GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » [FIXED] Regarding Match of Track Id
[FIXED] Regarding Match of Track Id [message #15611] Tue, 29 October 2013 17:16 Go to next message
Shyam Kumar is currently offline  Shyam Kumar
Messages: 78
Registered: September 2012
Location: Mumbai, Maharashtra India
continuous participant
From: 89.204.139*
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

[Updated on: Fri, 07 February 2014 19:54] by Moderator

Report message to a moderator

Re: Regarding Match of Track Id [message #15612 is a reply to message #15611] Tue, 29 October 2013 17:23 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
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;
        }
    }
Re: Regarding Match of Track Id [message #15613 is a reply to message #15612] Tue, 29 October 2013 18:23 Go to previous messageGo to next message
Shyam Kumar is currently offline  Shyam Kumar
Messages: 78
Registered: September 2012
Location: Mumbai, Maharashtra India
continuous participant
From: 89.204.139*
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
Re: Regarding Match of Track Id [message #15614 is a reply to message #15613] Tue, 29 October 2013 20:21 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
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(); 

Re: Regarding Match of Track Id [message #15634 is a reply to message #15614] Fri, 01 November 2013 15:22 Go to previous messageGo to next message
Shyam Kumar is currently offline  Shyam Kumar
Messages: 78
Registered: September 2012
Location: Mumbai, Maharashtra India
continuous participant
From: 89.204.153*
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.
Re: Regarding Match of Track Id [message #15635 is a reply to message #15634] Fri, 01 November 2013 15:33 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
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.
Re: Regarding Match of Track Id [message #15636 is a reply to message #15635] Fri, 01 November 2013 15:56 Go to previous messageGo to next message
Shyam Kumar is currently offline  Shyam Kumar
Messages: 78
Registered: September 2012
Location: Mumbai, Maharashtra India
continuous participant
From: 89.204.153*
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.
Re: Regarding Match of Track Id [message #15637 is a reply to message #15636] Fri, 01 November 2013 16:03 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
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)
Re: Regarding Match of Track Id [message #15639 is a reply to message #15611] Fri, 01 November 2013 16:22 Go to previous messageGo to next message
Shyam Kumar is currently offline  Shyam Kumar
Messages: 78
Registered: September 2012
Location: Mumbai, Maharashtra India
continuous participant
From: 89.204.153*
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.
  • Attachment: MCTrack.ps
    (Size: 9.77KB, Downloaded 214 times)
  • Attachment: start6.png
    (Size: 19.90KB, Downloaded 268 times)
  • Attachment: startftof.png
    (Size: 39.91KB, Downloaded 256 times)

[Updated on: Fri, 01 November 2013 16:28]

Report message to a moderator

Re: Regarding Match of Track Id [message #15640 is a reply to message #15639] Fri, 01 November 2013 16:28 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
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.
Re: Regarding Match of Track Id [message #15641 is a reply to message #15611] Fri, 01 November 2013 16:35 Go to previous message
Shyam Kumar is currently offline  Shyam Kumar
Messages: 78
Registered: September 2012
Location: Mumbai, Maharashtra India
continuous participant
From: 89.204.153*
Thank you for reply, I will try the way you have suggested.
Previous Topic: [FIXED] Bug in DIRC correlation
Next Topic: [FIXED] problem with apr13 release
Goto Forum:
  


Current Time: Fri Nov 29 00:39:21 CET 2024

Total time taken to generate the page: 0.00616 seconds