GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Tracking » genfit in pandaroot - trunk rev 25180: test macros
Re: genfit in pandaroot - trunk rev 25180: test macros [message #16757 is a reply to message #16755] Fri, 30 May 2014 11:37 Go to previous messageGo to previous message
Elisabetta Prencipe (2) is currently offline  Elisabetta Prencipe (2)
Messages: 214
Registered: February 2013
first-grade participant
From: *unitymediagroup.de
Hi Stefano and Gianluigi,

the analysis macros available in /macro/run give no troubles. I have access to all information as for my analysis on DsJ( momentum, vertex position, angular distributions; and of course resolution of those). I have a question related to how to get access to the informations like GetZ0(), GetRadius(), GetTanL(), ..., which I see are accessible by mean of PndTrkTrack objects, or PndTrackCand.

The question is the following:

after I run sim-, digi-, reco-, pid-, I can write in a macro something like this:

TClonesArray* cand_array=new TClonesArray("PndPidCandidate");
tree->SetBranchAddress("PidChargeCandidate", &cand_array);

[..]

for (Int_t pp=0; pp<track_array->GetEntriesFast(); pp++)
{
PndPidCandidate * mytrack = (PndPidCandidate*)cand_array->At(pp);


rec_mom = mctrack->GetMomentum().Mag();
rec_theta = mctrack->GetMomentum().Theta()*TMath::RadToDeg();
rec_phi = mctrack->GetMomentum().Phi()*TMath::RadToDeg();


cand_mult++;

// end of candidate loop
}


*****
This works (thank you Susanna for this macro!). It is available in the macro/pid/track_check.C
However, a PndPidCandidate gives access to limited informations, compared to the most generic PndTrkTrack candidates.

But if I try:
TClonesArray* track_array=new TClonesArray("PndTrkTrack");
tree->SetBranchAddress("Track", &track_array);

for (Int_t pp=0; pp<track_array->GetEntriesFast(); pp++)
{
PndTrackCand * mytrack = (PndTrackCand*)track_array->At(pp);
cout<<"Could you eneter in the loop?"<<endl;

//rec_d0 = mytrack->GetDist();
rec_z0 = mytrack->GetZ0();
rec_tanL = mytrack->GetTanL();
rec_R = mytrack->GetRadius();
cout<<"test = "<<mytrack->GetZ0()<<endl;
rec_charge = -(Int_t) mytrack->GetCharge();
double rec_pt = mytrack->GetRadius()*0.006;
double rec_pl = mytrack->GetRadius()*rec_tanL*0.006;
rec_mom = TMath::Sqrt(rec_pt*rec_pt + rec_pl*rec_pl);
if(rec_mom!=0) rec_omega = rec_charge / rec_mom;

// }

cand_mult++;

} // end of candidate loop


*****

I cannot enter neither in the loop. What am I doing wrong here? How should I write this?
I attach my macro. Could anyone help, please?

Thank you in advance.

Elisabetta
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Secondary track finder ?
Next Topic: RhoError class in pandaroot
Goto Forum:
  


Current Time: Thu Mar 28 21:53:49 CET 2024

Total time taken to generate the page: 0.01041 seconds