I have a question, a bit related to this post: Filtering the events using a std::map in a TTree and create a histogram with the results
I have a TTree that contains a standard branch
Double_t signal (data from my detector), and a
std::map veto (containing data from my veto detectors, with the panel ID as keys).
Now I want to draw a histogram of
signal, while using a selection based on the
My problem: using the
std::map::operator, which should let me select a specific key (i.e. using only one veto panel), doesn’t work:
myTree->Draw("signal>>histo", "veto[key] > 100 && veto[key]<200" );
This results in an empty histogram, because the condition is apparently never fulfilled (even though when looking at the data, it is).
Another thing which doesn’t work as I want is when applying this cut on all keys:
myTree->Draw("signal>>histo", "veto.second > 100 && veto.second<200" );
because here the signals are drawn as duplicates for each veto that fulfills the condition.
To use a function like
"Min$(veto.second)<100" as in the solution of the previously mentioned post (here) is not applicable, as I am looking for values within a range, and I didn’t find any suitable other function in the documentation.
Is it somehow possible to achieve what I want to do with
So far I am using a work around, which is very inefficient (I have to reprocess the data when changing a cut condition…).
I would be happy for any suggestion!