53 #include "StMessMgr.h"
57 #include "StMuDSTMaker/COMMON/StMuTrack.h"
58 #include "StParticleDefinition.hh"
60 #include "StEmbeddingQATrack.h"
61 #include "StEmbeddingQAUtilities.h"
69 : mNCommonHit(-10), mParentParentGeantId(-10), mParentGeantId(-10), mGeantId(-10), mGeantProcess(-10),
70 mNHit(-10), mNHitPoss(-10), mCharge(-10),
71 mVectorMc(-9999., -9999., -9999., -9999.),
72 mVectorRc(-9999., -9999., -9999., -9999.),
73 mPhi(-9999.), mdEdx(-9999.), mDcaGl(-9999.),
74 mNSigmaElectron(-9999.), mNSigmaPion(-9999.), mNSigmaKaon(-9999.), mNSigmaProton(-9999.),
83 mParentParentGeantId(-10), mParentGeantId(track.parentGeantId()), mGeantId(track.geantId()), mGeantProcess(-10),
84 mNHit(track.nHitMc()), mNHitPoss(-10), mCharge(track.chargeMc()),
85 mVectorMc(track.pxMc(), track.pyMc(), track.pzMc(),
86 TMath::Sqrt(track.pMc()*track.pMc() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track.geantId())->mass(),2.0))),
87 mVectorRc(-9999., -9999., -9999., -9999.),
88 mPhi(track.phiMc()), mdEdx(-9999.), mDcaGl(-9999.),
89 mNSigmaElectron(-9999.), mNSigmaPion(-9999.), mNSigmaKaon(-9999.), mNSigmaProton(-9999.),
98 : mNCommonHit(track->commonHits()),
99 mParentParentGeantId(-10), mParentGeantId(track->parentGeantId()), mGeantId(track->geantId()), mGeantProcess(-10),
100 mNHit(track->fitPts()), mNHitPoss(track->nPossiblePts()), mCharge(track->charge()),
101 mVectorMc(track->pxMc(), track->pyMc(), track->pzMc(),
102 TMath::Sqrt(track->pMc()*track->pMc() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track->geantId())->mass(),2.0))),
103 mVectorRc(track->pxPr(), track->pyPr(), track->pzPr(),
104 TMath::Sqrt(track->pPr()*track->pPr() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track->geantId())->mass(),2.0))),
105 mVectorGl(track->pxGl(), track->pyGl(), track->pzGl(),
106 TMath::Sqrt(track->pGl()*track->pGl() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track->geantId())->mass(),2.0))),
107 mPhi(track->phiMc()), mdEdx(track->dedx()), mDcaGl(track->dcaGl()),
108 mNSigmaElectron(-9999.), mNSigmaPion(-9999.), mNSigmaKaon(-9999.), mNSigmaProton(-9999.),
117 : mNCommonHit(track->commonHits()),
118 mParentParentGeantId(track->mParentParentGeantId), mParentGeantId(track->parentGeantId()), mGeantId(track->geantId()),
119 mGeantProcess(track->mGeantProcess),
120 mNHit(track->fitPts()), mNHitPoss(track->nPossiblePts()), mCharge(track->charge()),
121 mVectorMc(track->pxMc(), track->pyMc(), track->pzMc(),
122 TMath::Sqrt(track->pMc()*track->pMc() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track->geantId())->mass(),2.0))),
123 mVectorRc(track->pxPr(), track->pyPr(), track->pzPr(),
124 TMath::Sqrt(track->pPr()*track->pPr() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track->geantId())->mass(),2.0))),
125 mVectorGl(track->pxGl(), track->pyGl(), track->pzGl(),
126 TMath::Sqrt(track->pGl()*track->pGl() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(track->geantId())->mass(),2.0))),
127 mPhi(track->phiMc()), mdEdx(track->dedx()), mDcaGl(track->dcaGl()),
128 mNSigmaElectron(-9999.), mNSigmaPion(-9999.), mNSigmaKaon(-9999.), mNSigmaProton(-9999.),
138 : mNCommonHit(0), mParentParentGeantId(0), mParentGeantId(0), mGeantId(geantid), mGeantProcess(0),
139 mNHit(track.nHitsFit(kTpcId)), mNHitPoss(track.nHitsPoss(kTpcId)), mCharge(track.charge()),
140 mVectorMc(-9999., -9999., -9999., -9999.),
141 mVectorRc(track.p().x(), track.p().y(), track.p().z(),
142 TMath::Sqrt(track.p().mag2() + TMath::Power(
StEmbeddingQAUtilities::instance()->getParticleDefinition(geantid)->mass(),2.0))),
143 mVectorGl(-9999., -9999., -9999., -9999.),
144 mPhi(track.phi()), mdEdx(track.dEdx()), mDcaGl(track.dcaGlobal().mag()),
145 mNSigmaElectron(btof?track.btofPidTraits().sigmaElectron():track.nSigmaElectron()), mNSigmaPion(btof?track.btofPidTraits().sigmaPion():track.nSigmaPion()), mNSigmaKaon(btof?track.btofPidTraits().sigmaKaon():track.nSigmaKaon()), mNSigmaProton(btof?track.btofPidTraits().sigmaProton():track.nSigmaProton()),
172 const Bool_t isPtOk = utility->
isPtOk(pt) ;
173 const Bool_t isEtaOk = utility->isEtaOk(eta) ;
204 const Float_t ratio = (mNHitPoss>0) ? (Float_t)mNHit/(Float_t)mNHitPoss : -1.0 ;
238 if ( !utility->
isReal(mName) )
return kTRUE ;
241 if ( !utility->
isEPiKP(geantid) )
return kTRUE ;
245 if(!isChargeOk)
return kFALSE ;
251 if ( utility->
isElectron(geantid) )
return utility->isNSigmaOk(mNSigmaElectron) ;
252 else if ( utility->
isPiMinus(geantid) )
return utility->isNSigmaOk(mNSigmaPion) ;
253 else if ( utility->
isKMinus(geantid) )
return utility->isNSigmaOk(mNSigmaKaon) ;
254 else if ( utility->
isPBar(geantid) )
return utility->isNSigmaOk(mNSigmaProton) ;
257 LOG_ERROR <<
"StEmbeddingQATrack::isNSigmaOk Geant id is not e, pi, K or p, geantid= " << geantid << endm;
258 LOG_ERROR <<
"StEmbeddingQATrack::isNSigmaOk Please check geantid, real data QA should only contain e, pi, K and p" << endm;
262 else if ( mCharge > 0 ) {
264 if ( utility->
isPositron(geantid) )
return utility->isNSigmaOk(mNSigmaElectron) ;
265 else if ( utility->
isPiPlus(geantid) )
return utility->isNSigmaOk(mNSigmaPion) ;
266 else if ( utility->
isKPlus(geantid) )
return utility->isNSigmaOk(mNSigmaKaon) ;
267 else if ( utility->
isProton(geantid) )
return utility->isNSigmaOk(mNSigmaProton) ;
270 LOG_ERROR <<
"StEmbeddingQATrack::isNSigmaOk Geant id is not e, pi, K or p, geantid= " << geantid << endm;
271 LOG_ERROR <<
"StEmbeddingQATrack::isNSigmaOk Please check geantid, real data QA should only contain e, pi, K and p" << endm;
277 LOG_ERROR <<
"StEmbeddingQATrack::isNSigmaOk Charge == 0, charge=" << mCharge <<
", geantid= " << geantid << endm;
278 LOG_ERROR <<
"StEmbeddingQATrack::isNSigmaOk Please check geantid, real data QA should only contain e, pi, K and p" << endm;
320 LOG_INFO <<
"#----------------------------------------------------------------------------------------------------" << endm;
321 LOG_INFO << Form(
"StEmbeddingQATrack::print() : Track informations (%s)", mName.Data()) << endm;
325 LOG_INFO <<
" getGeantId() " <<
getGeantId() << endm;
327 LOG_INFO <<
" getNHit() " <<
getNHit() << endm;
328 LOG_INFO <<
" getMass() (MC, RC) (" <<
getMassMc() <<
", " <<
getMassRc() <<
")" << endm;
329 LOG_INFO <<
" getPt() (MC, RC) (" <<
getPtMc() <<
", " <<
getPtRc() <<
")" << endm;
330 LOG_INFO <<
" getPx() (MC, RC) (" <<
getPxMc() <<
", " <<
getPxRc() <<
")" << endm;
331 LOG_INFO <<
" getPy() (MC, RC) (" <<
getPyMc() <<
", " <<
getPyRc() <<
")" << endm;
332 LOG_INFO <<
" getPz() (MC, RC) (" <<
getPzMc() <<
", " <<
getPzRc() <<
")" << endm;
333 LOG_INFO <<
" getP() (MC, RC) (" <<
getPMc() <<
", " <<
getPRc() <<
")" << endm;
334 LOG_INFO <<
" getEta() (MC, RC) (" <<
getEtaMc() <<
", " <<
getEtaRc() <<
")" << endm;
335 LOG_INFO <<
" getPhi() " <<
getPhi() << endm;
336 LOG_INFO <<
" getdEdx() " <<
getdEdx() << endm;
337 LOG_INFO <<
" getDcaGl() " <<
getDcaGl() << endm;
338 LOG_INFO <<
"#----------------------------------------------------------------------------------------------------" << endm;
void print() const
Get nsigma for protons/anti-protons.
Float_t getPtMc() const
Get MC particle mass.
Float_t getPxRc() const
Get reconstructed transverse momentum (primary)
Bool_t isKPlus(const Int_t geantid) const
Check the input geantid is pi-.
Short_t getNCommonHit() const
Get reconstructed 4-momentum (global)
Float_t getRapidityRc() const
Get reconstructed pseudorapidity (primary)
Bool_t isEPiKP(const Int_t geantid) const
Check the input geantid is protons.
Float_t getPtRc() const
Get reconstructed particle mass (primary)
Bool_t isReal(const TString name) const
Check whether the track is embedding pair or not.
Int_t getParentParentGeantId() const
Get number of common hits.
Float_t getPRc() const
Get reconstructed pz (primary)
Bool_t isElectron(const Int_t geantid) const
Check whether the track is real track or not.
Int_t getParentGeantId() const
Get parent geant id.
Float_t getPyMc() const
Get MC px.
Float_t getPzRc() const
Get reconstructed py (primary)
Bool_t isDcaOk() const
Nhits/NhitsPoss cut.
Bool_t isPBar(const Int_t geantid) const
Check the input geantid is p.
Float_t getPhi() const
Get reconstructed rapidity (primary)
Float_t getPxMc() const
Get MC transverse momentum.
Short_t getNHit() const
Get geant process.
StParticleDefinition * getParticleDefinition(const UInt_t geantid) const
runnumber = runid - (year - 2000 + 1) * 10^6
Bool_t isPiMinus(const Int_t geantid) const
Check the input geantid is pi+.
Bool_t isProton(const Int_t geantid) const
Check the input geantid is K-.
Float_t getdEdx() const
Get azimuthal angle.
Int_t getGeantId() const
Get parent geant id.
Double_t getMassRc() const
Get MC rapidity.
StEmbeddingQATrack()
Default constructor.
StLorentzVectorD getVectorMc() const
Float_t getPyRc() const
Get reconstructed px (primary)
Bool_t isPositron(const Int_t geantid) const
Check the input geantid is e-.
StLorentzVectorD getVectorRc() const
Get MC 4-momentum.
Bool_t isNHitOk() const
Rapidity cut.
Bool_t isNHitToNPossOk() const
Nhits cut.
static StEmbeddingQAUtilities * instance()
Get instance.
virtual ~StEmbeddingQATrack()
Destructor.
Float_t getEtaMc() const
Get MC momentum.
Float_t getPMc() const
Get MC pz.
Bool_t isCommonHitOk() const
Dca cut.
Bool_t isKMinus(const Int_t geantid) const
Check the input geantid is K+.
Bool_t isNSigmaOk(const Int_t geantid) const
Common hit cut.
StLorentzVectorD getVectorGl() const
Get reconstructed 4-momentum (primary <- return getVectorRc())
Int_t getGeantProcess() const
Get geant id.
Bool_t isRapidityOk(const Double_t ycut) const
Pt and eta cuts.
for simplicity, this contains both the rc and mc track information.
Float_t getEtaRc() const
Get reconstructed momentum (primary)
Definition of Pair for Contamination tracks (secondary tracks, weak decay tracks) ...
Float_t getDcaGl() const
Get dE/dx in keV unit.
Bool_t isPtAndEtaOk() const
Float_t getRapidityMc() const
Get MC pseudorapidity.
StLorentzVectorD getVectorPr() const
Get reconstructed 4-momentum (primary)
Bool_t isPtOk(const Float_t pt) const
Track and event cuts.
Bool_t isMc(const TString name) const
Category id from category name.
Float_t getPzMc() const
Get MC py.
Bool_t isPiPlus(const Int_t geantid) const
Check the input geantid is e+.
Persistent MC track class.
Double_t getMassMc() const
Get charge.