I’m using TCuts for my analysis - my intention is to plot the MissingEt for like-sign same-flavour lepton pairs.
The histogram with cut e3 has less entries than the same with cut c3.
Is there a mistake in the code ?
Could you post a short (but running) script and a small data file reproducing the problem?
I am suspecting a problem with your cuts of style “a==b”.
If a and b are floating point variables, you should make the test including some numerical precision.
What you see is the (unfortunate) expected behavior. With the current code, if one of the element of the expression can not be evaluated (For example if El_N[0] does not exist because El_n.size()==0), the whole expression is invalidated. We have not yet found a good way (aka performant and clear enough) to prevent this.
However you have a simple work-around:
where you use the TTree::Draw special function Alt$ to express what should be the value of the expression in the case the values are missing).
Independently, I noticed that with your file the value of El_N and the size of the corresponding vectors (like El_charge) are not consistent. For example, see the result of:mychain->Scan("El_N:El_charge@.size()");
Is this intentional?