GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » Different results for same information extracted in different ways
Re: Different results for same information extracted in different ways [message #17465 is a reply to message #17464] Fri, 07 November 2014 13:55 Go to previous messageGo to previous message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *gsi.de
Hi Mamen,


concerning the discrepancy between the first two approaches (GetEntries() and summing the bin contents), I think a TH1 histogram in reality has n+2 bins, the n bins plotted and an overflow and underflow bin. Therefore you should actually try to loop like

int TotalEntries=0;
for (int i=0; i <Nbins+2;i++ )
{
  TotalEntries=TotalEntries+Reco->GetBinContent(i);// histograms start on bin=1 not bin=0
}
cout << "Total Reco Entries: "<< TotalEntries<< endl;


In the last case with the loop over the tree itself, I'm not sure. What I could imagine is, that e.g. the variable you set the branch address to has wrong type and then behaves unpredictable. I.e. check whether eppid really is a int branch and not a float branch. Of course you again don't count over- and underflow with this method.


Best,
Klaus
 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: vertex reconstruction without fitting?
Next Topic: Vertex fitter for two consecutive decays
Goto Forum:
  


Current Time: Tue Mar 19 11:58:42 CET 2024

Total time taken to generate the page: 0.01041 seconds