Hello Omar,
The confusion seems to stem from undefined behavior in TTree->Draw(). Let me explain.
Your hps_event contains a TClonesArray *ecal_hits containing EcalHit object and a counter n_ecal_hits. It also contains a TClonesArray *ecal_clusters containing EcalCluster objects, and each EcalCluster object contain a TRefArray *ecal_hits and a counter n_ecal_hits. There should not be, but in the TTree->Draw() there is a naming confusion, so when I ask for the n_ecal_hits from the hps_event, I seem to get the n_ecal_hits for the EcalCluser objects instead, even though when I want the latter, I should have requested for “ecal_clusters.n_ecal_hits”.
I am a bit disappointed that the TTree->Draw() mechanism can’t keep this straight. It seems that this is due to one of those ROOT shortcut hacks, so you can specify tree->Draw(“x”) instead of tree->Draw(“ecal_clusters.x”). Indeed, that works, but you don’t know if you get the “ecal_clusters.x” or the “svt_hits.x” (you get the latter, in my test). Maybe I should fie a bug report with ROOT about this poorly defined behavior.
To plot the number of hits in the event I thus need to specify: t->Draw("Event.n_ecal_hits>>nhits","pair1_trigger==1 && n_ecal_clusters>1"). This produces the attached histogram, which no longer contains the one hit wonder events. Remarkably, there do exist 2 hit events, but those are few.
Note that there are also ~7519 events out of ~250,000 that have only one cluster. (From t->Draw("Event.n_ecal_hits>>nhits","pair1_trigger==1 && n_ecal_clusters==1”) ) Some of those one cluster events have only one hit. I would conclude that we are not writing all the hits to the DST but only those found in clusters (confirmed by looking at the code), and that the clustering algorithm does not find all the clusters that the GTP found.
Thanks for the help!
Best,
Maurik
This is the number of Ecal hits per cluster. The number of entries is showing the total number of Ecal clusters integrated over all events.