28 #include "TClonesArray.h"
29 #include "TParticlePDG.h"
39 :
FairTask(name, iVerbose), fTrackInBranchName(
""), fTrackInIDBranchName(
""),
40 fTrackOutBranchName(
""), fMvdBranchName(
""), fCentralTrackerBranchName(
""),
41 fFitTrackArray(), fFitter(), fDafFitter(), fPDGHyp(-13),
42 fUseGeane(kTRUE), fIdealHyp(kFALSE), fDaf(kFALSE), fPersistence(kTRUE),
43 fPropagateToIP(kTRUE), fPerpPlane(kFALSE),
44 fNumIt(1), fBusyCut(20), fTrackRep(0), mStoreTrackParameterization(
false)
63 std::cout <<
" -I- PndRecoKalmanTask:Init :: Using GeaneTrackRep" << std::endl;
66 std::cout <<
" -I- PndRecoKalmanTask:Init :: Using RKTrackRep" << std::endl;
69 Error(
"PndRecoKalmanTask::Init",
"Not existing Track Representation!!");
102 Error(
"PndRecoKalmanTask::Init",
"RootManager not instantiated!");
110 Error(
"PndRecoKalmanTask::Init",
"track-array not found!");
115 pdg =
new TDatabasePDG();
119 Error(
"PndRecoKalmanTask::Init",
"track ID array not found! It is not possible to run ideal particle hypothesis");
126 Error(
"PndRecoKalmanTask::Init",
"MCTrack array not found! It is not possible to run ideal particle hypothesis");
146 if (
fVerbose>0) std::cout<<
"PndRecoKalmanTask::Exec"<<std::endl;
153 if (
fVerbose>1) std::cout <<
" -I- PndRecoKalmanTask: contains " << ntracks <<
" Tracks."<< std::endl;
158 std::cout<<
" -I- PndRecoKalmanTask::Exec: ntracks=" << ntracks <<
" Evil Event! skipping" << std::endl;
163 for(Int_t itr=0;itr<ntracks;++itr)
165 if (
fVerbose>1) std::cout<<
"starting track"<<itr<<std::endl;
168 Int_t size = trkRef.GetEntriesFast();
184 PDGCode = 211*fCharge;
185 std::cout <<
"-I- PndRecoKalmanTask::Exec: MCTrack #" << mcTrackId <<
" is not existing!! Trying with pion hyp" << std::endl;
191 if (PDGCode>=100000000)
193 PDGCode = 211*fCharge;
194 std::cout <<
"-I- PndRecoKalmanTask::Exec: Track is an ion (PDGCode>100000000)! Trying with pion hyp" << std::endl;
196 else if ((((TParticlePDG*)
pdg->GetParticle(PDGCode))->Charge())==0)
198 PDGCode = 211*fCharge;
199 std::cout <<
"-E- PndRecoKalmanTask::Exec: Track MC charge is 0!!!! Trying with pion hyp" << std::endl;
204 PDGCode = 211*fCharge;
205 std::cout <<
"-E- PndRecoKalmanTask::Exec: No MCTrack index in PndTrackID!! Trying with pion hyp" << std::endl;
210 PDGCode = 211*fCharge;
211 std::cout <<
"-E- PndRecoKalmanTask::Exec: No Correlated MCTrack id in PndTrackID!! Trying with pion hyp" << std::endl;
227 for(
unsigned iq=0; iq<fitTrack->mSmoothedValues.size(); iq++) {
228 TVector3 &
pos = fitTrack->mSmoothedValues[iq].first;
229 TVector3 &
mom = fitTrack->mSmoothedValues[iq].second;
231 printf(
"%10.4f %10.4f %10.4f -> %10.4f %10.4f %10.4f\n",
232 pos.X(), pos.Y(), pos.Z(), mom.X(), mom.Y(), mom.Z());
239 fitTrack = prefitTrack;
241 std::cout <<
"-I- PndRecoKalmanTask::Exec: Kalman cannot run on this track because of the bad MonteCarlo PDC code" << std::endl;
251 if (
fVerbose>0) std::cout<<
"Fitting done"<<std::endl;
259 if(h.BeginsWith(
"e") || h.BeginsWith(
"E")){
261 }
else if(h.BeginsWith(
"m") || h.BeginsWith(
"M")){
263 }
else if(h.BeginsWith(
"pi") || h.BeginsWith(
"Pi") || h.BeginsWith(
"PI")){
265 }
else if(h.BeginsWith(
"K") || h.BeginsWith(
"K")){
267 }
else if(h.BeginsWith(
"p") || h.BeginsWith(
"P") || h.BeginsWith(
"antip")){
270 std::cout <<
"-I- PndRecoKalmanTask::SetParticleHypo: Not recognised PID set -> Using default MUON hypothesis" << std::endl;
295 std::cout <<
"-I- PndRecoKalmanTask::SetParticleHypo: Not recognised PID set -> Using default MUON hypothesis" << std::endl;