4 #include "TDatabasePDG.h"
40 fMcCands =
new TClonesArray(
"RhoCandidate");
41 fCands =
new TClonesArray(
"RhoCandidate");
53 double rnd1=widx*2*(0.5-gRandom->Rndm());
54 double rnd2=widy*2*(0.5-gRandom->Rndm());
55 double rnd3=widz*2*(0.5-gRandom->Rndm());
56 TVector3 vertex(rnd1,rnd2,rnd3);
57 if(
fVerbose>2) cout<<
"RollVertexBox: ("<<vertex.x()<<
","<<vertex.y()<<
","<<vertex.z()<<
")"<<endl;
63 double rnd1=gRandom->Gaus(vertex.x(),
fSigVx);
64 double rnd2=gRandom->Gaus(vertex.y(),
fSigVy);
65 double rnd3=gRandom->Gaus(vertex.z(),
fSigVz);
66 if(
fVerbose>2) cout<<
"SmearVertex (B): ("<<vertex.x()<<
","<<vertex.y()<<
","<<vertex.z()<<
")"<<endl;
67 vertex.SetXYZ(rnd1,rnd2,rnd3);
68 if(
fVerbose>2) cout<<
"SmearVertex (A): ("<<vertex.x()<<
","<<vertex.y()<<
","<<vertex.z()<<
")"<<endl;
77 double theta = vtx.Theta() + dtheta*2*(0.5-gRandom->Rndm());
79 double pt = ptmin + (ptmax-ptmin)*gRandom->Rndm();
81 momentum.SetPtThetaPhi(pt,theta,phi);
82 if(
fVerbose>2) cout<<
"RollMomentumBox: ("<<momentum.x()<<
","<<momentum.y()<<
","<<momentum.z()<<
")"<<endl;
88 double rnd1=gRandom->Gaus(momentum.Px(),
fSigPx);
89 double rnd2=gRandom->Gaus(momentum.Py(),
fSigPy);
90 double rnd3=gRandom->Gaus(momentum.Pz(),
fSigPz);
91 momentum.SetXYZ(rnd1,rnd2,rnd3);
97 if(
fVerbose>1) cout<<
" --------------------------------------------------- "<<endl;
98 if(
fVerbose>0) cout<<
"Poor man tracks."<<endl;
110 for (
int iTr=0; iTr<
fNumTrk; iTr++)
112 fPDG = TDatabasePDG::Instance()->GetParticle(
fPID);
115 int sizeMc =
fMcCands->GetEntriesFast();
120 int size =
fCands->GetEntriesFast();
121 TVector3 vertexMeasure =
fVertex;
123 TVector3 momMeasure = momentum;
133 if(
fVerbose>1) cout<<
" ---------\n pmc, p, pmcpos, ppos, fVertex"<<endl;
134 if(
fVerbose>1) std::cout<<*pmc<<std::endl;
135 if(
fVerbose>1) std::cout<<*p<<std::endl;
149 double invE=1/p4.E();
150 covP4[3][3] = (p4.X()*p4.X()*covP4[0][0]+p4.Y()*p4.Y()*covP4[1][1]+p4.Z()*p4.Z()*covP4[2][2])*invE*invE;
151 covP4[0][3] = covP4[3][0] = p4.X()*covP4[0][0]*invE;
152 covP4[1][3] = covP4[3][1] = p4.Y()*covP4[1][1]*invE;
153 covP4[2][3] = covP4[3][2] = p4.Z()*covP4[2][2]*invE;
TVector3 RollMomentumBox(const TVector3 &vtx, double dtheta, double ptmin, double ptmax)
void SetPos(const TVector3 &pos)
void SmearVertex(TVector3 &vertex)
TString pt(TString pts, TString exts="px py pz")
void EnergyCorrelations()
TVector3 GetPosition() const
void SmearMomentum(TVector3 &momentum)
TLorentzVector P4() const
void SetMcTruth(RhoCandidate *mct)
void SetCov7(const TMatrixD &cov7)
TVector3 RollVertexBox(double widx, double widy, double widz)