GSI Forum - RDF feed
type: channel
description: GSI Helmholtzzentrum für Schwerionenforschung
items: [FIXED] Regarding Match of Track Id
items: Re: Regarding Match of Track Id

[FIXED] Regarding Match of Track Id
type: item
description: Hi, I want to access the entries for fToF only in simulation but I am not able to access the entries. I am using code: //--------------------------------------------- TFile* f = new TFile("sim_complete.root"); TTree *t=(TTree *) f->Get("cbmsim") ; TClonesArray *ftof_array=new TClonesArray("PndFtofPoint"); t->SetBranchAddress("FtofPoint",&ftof_array);//Branch names for (Int_t k=0; k<ftof_array->GetEntriesFast(); k++) { PndFtofPoint* tofpoint = (PndFtofPoint*)ftof_array->At(k); cout<<"The entries in Ftof are="<< k<<endl; } //----------------------------------------------- Thank You
creator: Shyam Kumar
date: 2013-10-29T16:16:39-00:00

Re: Regarding Match of Track Id
type: item
description: If you take a look into this macro, you can see you forgot the event loop on the tree: Int_t nEntries = t->GetEntriesFast(); for (Int_t j=0; j< nEntries; j++) { t->GetEntry(j); for (Int_t k=0; k<ftof_array->GetEntriesFast(); k++) { PndFtofPoint* tofpoint = (PndFtofPoint*)ftof_array->At(k); cout<<"This is Ftof entry number "<< k<<endl; } }
creator: StefanoSpataro
date: 2013-10-29T16:23:32-00:00

Re: Regarding Match of Track Id
type: item
description: Hi Stefano, Thank you for reply I have a question that when I run the above code I have the output below. Now for total entries I have to sum these all numbers or I have to consider every entry number as 1 entry. This is Ftof entry number 3 This is Ftof entry number 1 This is Ftof entry number 2 This is Ftof entry number 3 This is Ftof entry number 4 This is Ftof entry number 5 This is Ftof entry number 6 This is Ftof entry number 7 This is Ftof entry number 8 This is Ftof entry number 9
creator: Shyam Kumar
date: 2013-10-29T17:23:23-00:00

Re: Regarding Match of Track Id
type: item
description: That is the loop over the ftof hits. If you want to have the sum per event, then it is enough: Int_t counts = ftof_array->GetEntriesFast();
creator: StefanoSpataro
date: 2013-10-29T19:21:17-00:00

Re: Regarding Match of Track Id
type: item
description: Hi Stefano, I am matching the track Id for start detector and Ftof, I have a doubt that for every entry of tree I get around 4 or 5 track id for start and around 2 or 3 for Ftof. My question is I have to match the track id for both detectors for every entry of tree one by one or I have to store all the track id corresponding to both detector in two different array for all the entry in tree then in the last I have to match them.
creator: Shyam Kumar
date: 2013-11-01T14:22:40-00:00

Re: Regarding Match of Track Id
type: item
description: The best way would be to loop over the MCTrack array, you select only the primary particles (GetMotherID()==-1), and for each MCTrack ID you associate the point in the start and the point in the ftof. In the case you have more than one point for each track IF, mabe you could store also the multiplicity. Or maybe you define a new TObjArray (or maybe a vector) storing all the Points (or maybe the indices) correlated to the same track id.
creator: StefanoSpataro
date: 2013-11-01T14:33:14-00:00

Re: Regarding Match of Track Id
type: item
description: Thank You for reply I have tried to use mc_array but the entries in MC Track are 5742300 that will take longer time to match but in start and ftof i have entries 19185 and 10340 respectively That is the reason I have choose array to store track id.
creator: Shyam Kumar
date: 2013-11-01T14:56:24-00:00

Re: Regarding Match of Track Id
type: item
description: Which kind of events do you have, with a so high number of points in the ftof and start? I beliebe there should be something wrong Could you please put your package and amcros somehwre in the development branch, so that I can take a look? (but next week)
creator: StefanoSpataro
date: 2013-11-01T15:03:24-00:00

Re: Regarding Match of Track Id
type: item
description: I am using the macro/run/sim_complete.C for 1 GeV 20000 pion with multiplicity 5 by box generator.I am using the lambda disk Geometry as start detector. I am attaching the plot and picture. I have not changed any thing in sim_complete.C just use box generator and mom=1GeV.
creator: Shyam Kumar
date: 2013-11-01T15:22:50-00:00

Re: Regarding Match of Track Id
type: item
description: Again, MCTrack is fine, but if you select ONLY the primary particles, where GetMotherID()==-1, you should see many less particles in all the systems. I believe you don't want to reconstruct secondary particles.
creator: StefanoSpataro
date: 2013-11-01T15:28:39-00:00

Re: Regarding Match of Track Id
type: item
description: Thank you for reply, I will try the way you have suggested.
creator: Shyam Kumar
date: 2013-11-01T15:35:47-00:00