Filtering on Charge

Hello,

I am attempting to use the .Filter as included in the analysis.stage1.py file of FCCAnalyses to select for only the elements of zed_leptonic_charge where the array value is zero. I have changed the filter to:

.Filter(“zed_leptonic_recoil_m.size()>0”,“zed_leptonic_charge.size()==0”)

so it will filter as it originally does with the recoil mass but also so it will filter only zero charge array elements. Is this the correct way to do this or is there a different way to go about this? If more information is needed to clarify let me know.

Thanks,
Hayden Shaddix

Hi Hayden,

The “Filter” should select events, not elements of an array.
So if you run:

Filter(“zed_leptonic_charge.size()==0”)

only events for which zero “zed_leptonic_charge” objects were found will be processed further and be written to the output file (with the definition of “zed_leptonic_charge” that is in examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py, it means selecting events where no Z(mumu) candidate was found). You would get the very same selection with e.g.:

Filter(“zed_leptonic_m.size()==0”)

Also, while the syntax of .Filter seems to allow indeed a list of arguments, it does not do what you think:
.Filter(“cut_a”, “cut_b”) does not select events that pass cut_a and cut_b, as you can easily check by running with

Filter(“zed_leptonic_charge.size() > 0” , “zed_leptonic_charge.size() == 0” )

To select events that pass cut_a and cut_b, I would do .Filter(" cut_a && cut_b").

Cheers,
E.

@eperez ,

Thanks! I see that I was getting confused with the array elements but I have managed to select for what I was looking for using your help.

Cheers,
Hayden Shaddix