GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Number of entries in TTree
Number of entries in TTree [message #12198] Tue, 05 July 2011 13:19 Go to next message
Dima Melnychuk is currently offline  Dima Melnychuk
Messages: 213
Registered: April 2004
Location: National Centre for Nucle...
first-grade participant
From: *fuw.edu.pl
Dear colleagues,

I have observed a strangeness with number of entries in TTree for simulation, digitization, reconstruction and pid, i.e. these number are different and I expect them to be equal.

I do simulation with eta_c macros from /macro/run/tdrct/eta_c.
With 2000 events simulation with trunk rev.12565

Running simple macro on produced data

void test_data()
{
	TString inSimFileName = "evt_points_stt.root";
	TString inDigiFileName = "evt_digi_stt.root";
	TString inRecoFileName = "evt_reco_stt.root";
	TString inPidFileName  = "evt_pid_stt.root";
	
	TFile *inSimFile = TFile::Open(inSimFileName,"READ");
	TTree *treeSim=(TTree *) inSimFile->Get("cbmsim");

	TFile *inDigiFile = TFile::Open(inDigiFileName,"READ");
	TTree *treeDigi=(TTree *) inDigiFile->Get("cbmsim");

	TFile *inRecoFile = TFile::Open(inRecoFileName,"READ");
	TTree *treeReco=(TTree *) inRecoFile->Get("cbmsim");

	TFile *inPidFile = TFile::Open(inPidFileName,"READ");
	TTree *treePid=(TTree *) inPidFile->Get("cbmsim");

	std::cout<<"treeSim->GetEntriesFast()="<<treeSim->GetEntriesFast()<<std::endl;
	std::cout<<"treeDigi->GetEntriesFast()="<<treeDigi->GetEntriesFast()<<std::endl;
	std::cout<<"treeReco->GetEntriesFast()="<<treeReco->GetEntriesFast()<<std::endl;
	std::cout<<"treePid->GetEntriesFast()="<<treePid->GetEntriesFast()<<std::endl;
}


I have the following output
treeSim->GetEntriesFast()=2000
treeDigi->GetEntriesFast()=2001
treeReco->GetEntriesFast()=2002
treePid->GetEntriesFast()=2001


And those number are the same for stt and tpc simulation.

Should those numbers be equal?

Dima

Re: Number of entries in TTree [message #12199 is a reply to message #12198] Tue, 05 July 2011 13:32 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Hi,
you are correct, they must be equal.
I sent a mail to Mohammad and Florian last week because of this bug. Meanwhile, if you use the latest may11, this problem is not present, we moved to an older version of base w/o such feature.
Re: Number of entries in TTree [message #12202 is a reply to message #12198] Tue, 05 July 2011 13:44 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Hi,

the difference in the number of entries is due to modifications for the time based simulation.

They should not cause any problems for standard simulations (the additional entries are just empty) but are necessary to store the content of some buffers after the time based simulation.

Cheers,

Tobias
Re: Number of entries in TTree [message #12203 is a reply to message #12202] Tue, 05 July 2011 13:53 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
But the AddFriend returns a warning message, saying that the numbers of entries are different.
Is there no other place where to put that information? Maybe the parameter file?
Re: Number of entries in TTree [message #12204 is a reply to message #12203] Tue, 05 July 2011 14:27 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Hi Stefano,

I do not see a different place where to put it. This is ordinary data which has to be processed by the subdetector tasks. Maybe we can introduce another variable which switches of this feature for ordinary simulation or we swith off the warning if the difference between two trees is just one entry.

Cheers,

Tobias
Re: Number of entries in TTree [message #12206 is a reply to message #12204] Tue, 05 July 2011 14:56 Go to previous messageGo to next message
Bernhard Ketzer is currently offline  Bernhard Ketzer
Messages: 3
Registered: March 2006
occasional visitor
From: *dfn.mwn.de
Dear Tobias,

I think we should find a different way to store this data. The time-based simulation will (or should) become the standard for MC simulations in PANDA. If we continue to carry on this error, we will constantly run into troubles or questions associating the events.

Best regards,

Bernhard
Re: Number of entries in TTree [message #12208 is a reply to message #12206] Tue, 05 July 2011 15:19 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *ikp.kfa-juelich.de
Dear Bernhard and Stefano,

I do not think this is an error.

In terms of time based simulation it does not make sense to think about number of events despite in the MC simulation at the beginning. In the digitization stage the digis will be randomized and you access them not any longer by taking the same event but asking for time windows. The FairRootManager cares about providing you with the correct data.
The additional entry at the end of the tree is necessary to store all those data which is still sitting in the data buffers in the digitization tasks. This data does not differ in any kind from the rest of the data and is processed later on in the same way. To store this data at a different place does not make sense in my point of view.

We sure can discuss this on one of the next EVO meetings or during the collaboration meeting in September.

Cheers,

Tobias
Re: Number of entries in TTree [message #12296 is a reply to message #12208] Tue, 19 July 2011 13:19 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
Hi,
another problem of the additional events appears when merging more than one file.

Let us assume that we have 2 mc files of 1000 events; after recosntrution we will have 2 pid files of 1001 events, the last is the dummy one.

When I want to add these 2 files, I will have 2000 mc files and 2002 pid files, but in this case the mc event #1001 will correspond to pid event #1002, breaking the friend mechanism.
This is quite nasty.
Previous Topic: Crash in PndTpcRiemannTrackingTask
Next Topic: D+ and D- vertex resolution from Psi analysis
Goto Forum:
  


Current Time: Tue May 24 02:44:37 CEST 2022

Total time taken to generate the page: 0.00918 seconds