38 : clight(29.9792458), cleared(kTRUE), cleared2(kTRUE),
39 NrDecays(0), Vectors3D(NULL), tracks(NULL) { }
43 inline Float_t StV0TofCorrection::calcTof(
47 Float_t BetaAB = mom.mag() / trackAB.e() * clight;
48 return PathAB / BetaAB;
52 inline Bool_t StV0TofCorrection::inputOk() {
53 if ( Vectors3D == NULL ) {
54 Error(
"StV0TofCorrection::correctBeta",
"setVectors3D() call missing!");
57 if ( tracks == NULL ) {
58 Error(
"StV0TofCorrection::correctBeta",
"setMotherTracks() call missing!");
61 if ( Vectors3D->getNrArgs()-2 != tracks->getNrArgs() ) {
63 "StV0TofCorrection::correctBeta",
64 "number of 3d-vectors not consistent to number of tracks!"
72 inline Bool_t StV0TofCorrection::cutOnMass2(
73 const Float_t& Mass2,
const std::string& particle
84 const Float_t& mom,
const std::string& particle
87 NrDecays = Vectors3D->getNrArgs()-2;
88 Float_t TofCorr = TofA;
89 for ( Int_t i = 0; i < NrDecays; i++ ) {
91 Float_t PathAB = ( (*Vectors3D)[i+1] - (*Vectors3D)[i] ).mag();
92 TofCorr -= calcTof((*tracks)[i], PathAB);
95 Float_t PathCorr = helixA.
pathLength( (*Vectors3D)[NrDecays+1] );
96 PathCorr -= helixA.
pathLength( (*Vectors3D)[NrDecays] );
97 BetaCorr = PathCorr / (TofCorr*clight);
98 if ( !particle.empty() ) {
99 Float_t m2corr =
calcM2(mom, BetaCorr);
100 return cutOnMass2(m2corr, particle);
104 Error(
"StV0TofCorrection::correctBeta",
"check Input! BetaCorr set to -998!");
Float_t calcM2(const Float_t &mom, const Float_t &beta)
helper function to calculate m2 from momentum & beta
header file of StV0TofCorrection class created by Patrick Huck (phuck@lbl.gov) [12/13/2010] ...
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
virtual ~StV0TofCorrection()
destructor
static M2CutType mM2CutMap
default m2 cuts
StV0TofCorrection()
constructor
Bool_t correctBeta(const StPhysicalHelixD &, const Float_t &, Float_t &, const Float_t &MomentumA=-999., const std::string &particle="")
main function for beta correction