11 #include "FairTrackParH.h"
12 #include "FairMCApplication.h"
13 #include "FairRunAna.h"
14 #include "FairRootManager.h"
15 #include "FairRuntimeDb.h"
21 std::cerr <<
"<Error> PndPidCorrelator::GetFtofInfo: FairTrackParH NULL pointer parameter."<<std::endl;
26 std::cerr <<
"<Error> PndPidCorrelator::GetFtofInfo: pidCand NULL pointer parameter."<<std::endl;
32 if (
fVerbose>0) std::cout <<
"-W- PndPidCorrelator::GetFtofInfo: Skipping tracks not reaching the last FTS layer" << std::endl;
36 if(helix->GetPz() <= 0.)
38 std::cout <<
"-W- PndPidCorrelator::GetFtofInfo: Skipping tracks going backward" << std::endl;
43 Int_t tofEntries =
fFtofHit->GetEntriesFast();
45 Float_t tofTof = 0., tofLength = -1000, tofGLength = -1000, tofTrackLength = -1000;;
46 Float_t tofQuality = 1000000;
49 TVector3 vertex(0., 0., -10000.);
50 TVector3 vertexrec(0., 0., -10000.);
51 TVector3 momrec(0., 0., -10000.);
52 TVector3 tofPos(0., 0., 0.);
53 TVector3 momentum(0., 0., 0.);
60 FairTrackParH *fRes=
new FairTrackParH();
65 vertexrec.SetXYZ(fRes->GetX(), fRes->GetY(), fRes->GetZ());
66 momrec.SetXYZ(fRes->GetPx(), fRes->GetPy(), fRes->GetPz());
70 for (Int_t tt = 0; tt<tofEntries; tt++)
74 tofHit->Position(tofPos);
76 Float_t propX = helix->GetX() + (
fCorrPar->
GetFtofZ() - helix->GetZ()) * helix->GetPx() / helix->GetPz();
77 Float_t propY = helix->GetY() + (
fCorrPar->
GetFtofZ() - helix->GetZ()) * helix->GetPy() / helix->GetPz();
79 vertex.SetXYZ(propX, propY, propZ);
80 tofGLength = (vertex-helix->GetPosition()).Mag();
86 FairTrackParH *fRes=
new FairTrackParH();
90 vertex.SetXYZ(fRes->GetX(), fRes->GetY(), fRes->GetZ());
93 Float_t dist = (tofPos-vertex).Mag2();
95 if ( tofQuality > dist)
100 tofLength = tofTrackLength+tofGLength;
105 Float_t ntuple[] = {
static_cast<Float_t
>(vertex.X()), static_cast<Float_t>(vertex.Y()), static_cast<Float_t>(vertex.Z()),
106 static_cast<Float_t>(vertexrec.X()), static_cast<Float_t>(vertexrec.Y()), static_cast<Float_t>(vertexrec.Z()),
107 static_cast<Float_t>(momrec.X()), static_cast<Float_t>(momrec.Y()), static_cast<Float_t>(momrec.Z()),
108 static_cast<Float_t>(helix->GetMomentum().Mag()), static_cast<Float_t>(helix->GetQ()), static_cast<Float_t>(helix->GetMomentum().Theta()), static_cast<Float_t>(helix->GetZ()),
109 static_cast<Float_t>(tofPos.X()), static_cast<Float_t>(tofPos.Y()), static_cast<Float_t>(tofPos.Z()),
110 dist, tofLength, tofGLength, tofTrackLength};
121 if ( (tofQuality<fCorrPar->GetFTofCut()) || (
fIdeal && tofIndex!=-1) )
130 Float_t mass2 = helix->GetMomentum().Mag()*helix->GetMomentum().Mag()*(30.*30.*tofTof*tofTof/tofLength/tofLength-1.);
void SetTofStopTime(Double_t val)
PndPidCorrPar * fCorrPar
PndRichHit TCA.
void SetTofM2(Double_t val)
void SetTofTrackLength(Double_t val)
Bool_t GetFtofInfo(FairTrackParH *helix, PndPidCandidate *pid)
FairGeanePro * fGeanePropagator
Refitter for MDT tracks.
TClonesArray * fFtofPoint
PndFtofHit TCA.
void SetTofQuality(Double_t val)
void SetTofIndex(Int_t val)
TClonesArray * fFtofHit
PndTofPoint TCA.