c++ - CERN root - error when filtering events for subtree based on time -
I had asked this question before the official route (CERN) forum, but the problem is still unresolved. Maybe someone can help me, point my fault or suggest alternate method?
I have a TTR with incidents; In TTRE, each program has a branch with unix time and some other branches. I want to choose a subset of events based on a time interval so that I can analyze them separately. To make the selection, I make another tree and copy all entries within the correct time interval.
The following code works perfectly well and copies the copy of all the events from the tree:
void tree_time_filter (TTree * tree, TTree ** subtree, Int_t time_i, int_t time_f) {* subtree = tree-> clonitory (0); Int_t t; Tree-> Setbank Academy ("Unix Time", & amp; t); (Long 64_t i = 0; i & lt; tree- & gt; GetEntries (); i ++) {tree-> gateenti (i); If (true) {(* subtitles) - & gt; fill (); }} Cout & lt; & Lt; "Tree-filtered." & Lt; & Lt; (* Subtree) - & gt; GetEntries () & lt; & Lt; "Selected entries. \ N"; Return; } The problem occurs when I replace the real condition (true):
zero tree_time_filter (TTree * tree, TTree ** subtree , Int_t Time_i, Int_t time_f) {* subtree = tree-> Clonetary (0); Int_t t; Tree-> Setbank Academy ("Unix Time", & amp; t); (Long 64_t i = 0; i & lt; tree- & gt; GetEntries (); i ++) {tree-> gateenti (i); If (T> Time_i & amp; t & lt; time_f) // - & gt; Condition {(* Subtree) - & gt; fill (); // -> This line now returns an error}} cout & lt; & Lt; "Tree filtered". & Lt; & Lt; (* Subtree) - & gt; GetEntries () & lt; & Lt; "Selected entries. \ N"; Return; } I get an error: "Error: Invalid pointers for Class Object Subtree 0x0 3084c: / .... * Recover Interpreter Error * " < / P> Referred from the error line (* subtitles) - & gt; Fill (), the same code that worked perfectly fine in the first instance. The code works if there is no mention of sub-section of the body for any condition, or if any. Can anyone explain what is wrong here?
Thank you!
(For reference, a link to the original question)
I think That's a problem of interpreter, a bug in my opinion.
The macro passes through the macro (* subtitle) for the first time - & gt; fill (); It does not fill anything, it's strange, because it does not go there, but ... I was able to solve it with two ends: the first loop loop until this cut The first event is to be found and then closes. Second, where (* subtitles) - & gt; fill (); begins with this incident, with the effect of ensuring that the first process is processed and it is filled up.
Comments
Post a Comment