FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PndPmtPoormantracks Class Reference

#include <PndPmtPoormantracks.h>

Inheritance diagram for PndPmtPoormantracks:
PndPmtTask

Public Member Functions

 PndPmtPoormantracks ()
 
 ~PndPmtPoormantracks ()
 
void SetSigV (double a)
 
void SetSigP (double a)
 
void SetPtRange (double min, double max)
 
void SetDTheta (double a)
 
void SetPid (int a)
 
void SetNumTrk (int a)
 
void SetSeed (int a)
 
void SetVerbose (int a)
 
void EnergyCorrelations ()
 

Protected Member Functions

TVector3 RollVertexBox (double widx, double widy, double widz)
 
void SmearVertex (TVector3 &vertex)
 
TVector3 RollMomentumBox (const TVector3 &vtx, double dtheta, double ptmin, double ptmax)
 
void SmearMomentum (TVector3 &momentum)
 
void PoorManTracks ()
 
void EnergyCorrelations (RhoError &covP4, TLorentzVector p4)
 

Protected Attributes

TClonesArray * fMcCands
 
TClonesArray * fCands
 
double fSigVx
 
double fSigVy
 
double fSigVz
 
double fSigPx
 
double fSigPy
 
double fSigPz
 
double fCharge
 
double fDtheta
 
int fPID
 
TParticlePDG * fPDG
 
int fNumTrk
 
int niter
 
int fNDF
 
int fSeed
 
TVector3 fVertex
 
double fWidx
 
double fWidy
 
double fWidz
 
double fPtMin
 
double fPtMax
 
int fVerbose
 

Detailed Description

Definition at line 12 of file PndPmtPoormantracks.h.

Constructor & Destructor Documentation

PndPmtPoormantracks::PndPmtPoormantracks ( )

Definition at line 23 of file PndPmtPoormantracks.cxx.

References fCands, fCharge, fDtheta, fMcCands, fNumTrk, fPDG, fPID, fPtMax, fPtMin, fSeed, fSigPx, fSigPy, fSigPz, fSigVx, fSigVy, fSigVz, and fVerbose.

24 {
25  fSigVx=0.005; //[cm]
26  fSigVy=0.005; //[cm]
27  fSigVz=0.005; //[cm]
28  fSigPx=0.01; //[GeV/c]
29  fSigPy=0.01; //[GeV/c]
30  fSigPz=0.01; //[GeV/c]
31  fPtMin=0.9;//[GeV/c]
32  fPtMax=1.1;//[GeV/c]
33  fCharge=1.;
34  fDtheta = 1.; //0.3 [pi]
35  fPID=211;// 211 pion, 22 muon, 2212 proton, 321 kaon
36  fPDG = 0;
37  fNumTrk=2;
38  fSeed=936650;//
39  fVerbose=0;
40  fMcCands = new TClonesArray("RhoCandidate");
41  fCands = new TClonesArray("RhoCandidate");
42 }
PndPmtPoormantracks::~PndPmtPoormantracks ( )

Definition at line 44 of file PndPmtPoormantracks.cxx.

45 {
46 }

Member Function Documentation

void PndPmtPoormantracks::EnergyCorrelations ( )

Referenced by PoorManTracks().

void PndPmtPoormantracks::EnergyCorrelations ( RhoError covP4,
TLorentzVector  p4 
)
protected

Definition at line 147 of file PndPmtPoormantracks.cxx.

148 {
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;
154 // covP4[0][3] = covP4[3][0] = (p4.X()*covP4[0][0]+p4.Y()*covP4[0][1]+p4.Z()*covP4[0][2])*invE;
155 // covP4[1][3] = covP4[3][1] = (p4.X()*covP4[1][0]+p4.Y()*covP4[1][1]+p4.Z()*covP4[1][2])*invE;
156 // covP4[2][3] = covP4[3][2] = (p4.X()*covP4[2][0]+p4.Y()*covP4[2][1]+p4.Z()*covP4[2][2])*invE;
157 
158 }
void PndPmtPoormantracks::PoorManTracks ( )
protected

Definition at line 95 of file PndPmtPoormantracks.cxx.

References EnergyCorrelations(), fCands, fCharge, fDtheta, fMcCands, fNumTrk, fPDG, fPID, fPtMax, fPtMin, fSigPx, fSigPy, fSigPz, fSigVx, fSigVy, fSigVz, fVerbose, fVertex, RhoCandidate::GetPosition(), p, RhoCandidate::P3Cov(), RhoCandidate::P4(), Pi, RollMomentumBox(), RhoCandidate::SetCov7(), RhoCandidate::SetMcTruth(), RhoCandidate::SetPos(), SmearMomentum(), and SmearVertex().

Referenced by PndPmtTask::Exec().

96 {
97  if(fVerbose>1) cout<<" --------------------------------------------------- "<<endl;
98  if(fVerbose>0) cout<<"Poor man tracks."<<endl;
99  fMcCands->Clear("C");
100  fCands->Clear("C");
101 
102  RhoError covPos(3), covP4(4);
103  covPos[0][0]=fSigVx*fSigVx;
104  covPos[1][1]=fSigVy*fSigVy;
105  covPos[2][2]=fSigVz*fSigVz;
106  covP4[0][0]=fSigPx*fSigPx;
107  covP4[1][1]=fSigPy*fSigPy;
108  covP4[2][2]=fSigPz*fSigPz;
109 
110  for (int iTr=0; iTr<fNumTrk; iTr++)
111  {
112  fPDG = TDatabasePDG::Instance()->GetParticle(fPID);
113  TVector3 momentum = RollMomentumBox(fVertex,fDtheta*TMath::Pi(),fPtMin,fPtMax);
114 
115  int sizeMc = fMcCands->GetEntriesFast();
116  RhoCandidate *pmc=new ((*fMcCands)[sizeMc]) RhoCandidate(momentum,fPDG);
117  pmc->SetPos(fVertex);
118 
119  // Smeared "reco"
120  int size = fCands->GetEntriesFast();
121  TVector3 vertexMeasure = fVertex;
122  SmearVertex(vertexMeasure);
123  TVector3 momMeasure = momentum;
124  SmearMomentum(momMeasure);
125 
126 
127  RhoCandidate *p=new ((*fCands)[size]) RhoCandidate(momMeasure,fPDG);//TODO charge
128  p->SetMcTruth(pmc);
129  p->SetPos(vertexMeasure);
130  EnergyCorrelations(covP4,p->P4());
131  p->SetCov7(covPos,covP4);
132 
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;
136  if(fVerbose>1) p->P3Cov().Print();
137  if(fVerbose>1) pmc->GetPosition().Print();
138  if(fVerbose>1) p->GetPosition().Print();
139  if(fVerbose>1) fVertex.Print();
140  // print helix parameters and cov together with RhoCandidate V-P4 and cov7
141 
142  // alternate particle type
143  fCharge*=-1;
144  fPID*=-1;
145  }
146 }
TVector3 RollMomentumBox(const TVector3 &vtx, double dtheta, double ptmin, double ptmax)
RhoError P3Cov() const
void SetPos(const TVector3 &pos)
Definition: RhoCandidate.h:235
void SmearVertex(TVector3 &vertex)
Double_t p
Definition: anasim.C:58
TVector3 GetPosition() const
Definition: RhoCandidate.h:185
void SmearMomentum(TVector3 &momentum)
TLorentzVector P4() const
Definition: RhoCandidate.h:195
void SetMcTruth(RhoCandidate *mct)
Definition: RhoCandidate.h:436
Double_t Pi
void SetCov7(const TMatrixD &cov7)
TVector3 PndPmtPoormantracks::RollMomentumBox ( const TVector3 &  vtx,
double  dtheta,
double  ptmin,
double  ptmax 
)
protected

Definition at line 72 of file PndPmtPoormantracks.cxx.

References fVerbose, phi, pt(), theta, and CAMath::TwoPi().

Referenced by PoorManTracks().

73 {
74  // allow whole phi range
75  double phi=TMath::TwoPi()*gRandom->Rndm();
76  // allow theta at vertex pointing theta +- dtheta
77  double theta = vtx.Theta() + dtheta*2*(0.5-gRandom->Rndm());
78  // allow transverse momentum in [ptmin,ptmax]
79  double pt = ptmin + (ptmax-ptmin)*gRandom->Rndm();
80  TVector3 momentum;
81  momentum.SetPtThetaPhi(pt,theta,phi);
82  if(fVerbose>2) cout<<"RollMomentumBox: ("<<momentum.x()<<","<<momentum.y()<<","<<momentum.z()<<")"<<endl;
83  return momentum;
84 }
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
double dtheta
Definition: anaLmdCluster.C:54
static float TwoPi()
Definition: PndCAMath.h:61
TVector3 PndPmtPoormantracks::RollVertexBox ( double  widx,
double  widy,
double  widz 
)
protected

Definition at line 51 of file PndPmtPoormantracks.cxx.

References fVerbose.

Referenced by PndPmtTask::Exec().

52 {
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;
58  return vertex;
59 }
void PndPmtPoormantracks::SetDTheta ( double  a)
inline

Definition at line 20 of file PndPmtPoormantracks.h.

References a, and fDtheta.

20 {fDtheta=a;};
Int_t a
Definition: anaLmdDigi.C:126
void PndPmtPoormantracks::SetNumTrk ( int  a)
inline

Definition at line 22 of file PndPmtPoormantracks.h.

References a, and fNumTrk.

22 {fNumTrk=a;};
Int_t a
Definition: anaLmdDigi.C:126
void PndPmtPoormantracks::SetPid ( int  a)
inline

Definition at line 21 of file PndPmtPoormantracks.h.

References a, and fPID.

21 {fPID=a;};
Int_t a
Definition: anaLmdDigi.C:126
void PndPmtPoormantracks::SetPtRange ( double  min,
double  max 
)
inline

Definition at line 19 of file PndPmtPoormantracks.h.

References fPtMax, fPtMin, max(), and min().

19 {fPtMin=min;fPtMax=max;};
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void PndPmtPoormantracks::SetSeed ( int  a)
inline

Definition at line 23 of file PndPmtPoormantracks.h.

References a, and fSeed.

23 {fSeed=a;};
Int_t a
Definition: anaLmdDigi.C:126
void PndPmtPoormantracks::SetSigP ( double  a)
inline

Definition at line 18 of file PndPmtPoormantracks.h.

References a, fSigPx, fSigPy, and fSigPz.

void PndPmtPoormantracks::SetSigV ( double  a)
inline

Definition at line 17 of file PndPmtPoormantracks.h.

References a, fSigVx, fSigVy, and fSigVz.

void PndPmtPoormantracks::SetVerbose ( int  a)
inline

Definition at line 24 of file PndPmtPoormantracks.h.

References a, and fVerbose.

24 {fVerbose=a;};
Int_t a
Definition: anaLmdDigi.C:126
void PndPmtPoormantracks::SmearMomentum ( TVector3 &  momentum)
protected

Definition at line 86 of file PndPmtPoormantracks.cxx.

References fSigPx, fSigPy, and fSigPz.

Referenced by PoorManTracks().

87 {
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);
92  return;
93 }
void PndPmtPoormantracks::SmearVertex ( TVector3 &  vertex)
protected

Definition at line 61 of file PndPmtPoormantracks.cxx.

References fSigVx, fSigVy, fSigVz, and fVerbose.

Referenced by PoorManTracks().

62 {
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;
69  return;
70 }

Member Data Documentation

TClonesArray* PndPmtPoormantracks::fCands
protected

Definition at line 36 of file PndPmtPoormantracks.h.

Referenced by PndPmtTask::Exec(), PndPmtPoormantracks(), and PoorManTracks().

double PndPmtPoormantracks::fCharge
protected

Definition at line 46 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), and PoorManTracks().

double PndPmtPoormantracks::fDtheta
protected

Definition at line 47 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), and SetDTheta().

TClonesArray* PndPmtPoormantracks::fMcCands
protected

Definition at line 35 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), and PoorManTracks().

int PndPmtPoormantracks::fNDF
protected

Definition at line 52 of file PndPmtPoormantracks.h.

int PndPmtPoormantracks::fNumTrk
protected

Definition at line 50 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), and SetNumTrk().

TParticlePDG* PndPmtPoormantracks::fPDG
protected

Definition at line 49 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), and PoorManTracks().

int PndPmtPoormantracks::fPID
protected

Definition at line 48 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), and SetPid().

double PndPmtPoormantracks::fPtMax
protected

Definition at line 56 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), and SetPtRange().

double PndPmtPoormantracks::fPtMin
protected

Definition at line 56 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), and SetPtRange().

int PndPmtPoormantracks::fSeed
protected

Definition at line 53 of file PndPmtPoormantracks.h.

Referenced by PndPmtTask::Init(), PndPmtPoormantracks(), and SetSeed().

double PndPmtPoormantracks::fSigPx
protected

Definition at line 43 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), SetSigP(), and SmearMomentum().

double PndPmtPoormantracks::fSigPy
protected

Definition at line 44 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), SetSigP(), and SmearMomentum().

double PndPmtPoormantracks::fSigPz
protected

Definition at line 45 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), SetSigP(), and SmearMomentum().

double PndPmtPoormantracks::fSigVx
protected

Definition at line 40 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), SetSigV(), and SmearVertex().

double PndPmtPoormantracks::fSigVy
protected

Definition at line 41 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), SetSigV(), and SmearVertex().

double PndPmtPoormantracks::fSigVz
protected

Definition at line 42 of file PndPmtPoormantracks.h.

Referenced by PndPmtPoormantracks(), PoorManTracks(), SetSigV(), and SmearVertex().

int PndPmtPoormantracks::fVerbose
protected
TVector3 PndPmtPoormantracks::fVertex
protected

Definition at line 54 of file PndPmtPoormantracks.h.

Referenced by PndPmtTask::Exec(), and PoorManTracks().

double PndPmtPoormantracks::fWidx
protected

Definition at line 55 of file PndPmtPoormantracks.h.

Referenced by PndPmtTask::Exec(), and PndPmtTask::Init().

double PndPmtPoormantracks::fWidy
protected

Definition at line 55 of file PndPmtPoormantracks.h.

Referenced by PndPmtTask::Exec(), and PndPmtTask::Init().

double PndPmtPoormantracks::fWidz
protected

Definition at line 55 of file PndPmtPoormantracks.h.

Referenced by PndPmtTask::Exec(), and PndPmtTask::Init().

int PndPmtPoormantracks::niter
protected

Definition at line 51 of file PndPmtPoormantracks.h.


The documentation for this class was generated from the following files: