20 #ifndef STV0TOFCORRECTION_H
21 #define STV0TOFCORRECTION_H
28 #include "StPhysicalHelixD.hh"
29 #include "StarClassLibrary/StLorentzVectorD.hh"
30 #include "StarClassLibrary/StThreeVectorD.hh"
32 #include "TVirtualStreamerInfo.h"
39 template <
class T,
class container = std::vector<T> >
53 pContainer->setNrArgs(NrArgs);
54 pContainer->push_back(vec);
65 typedef std::map< std::string, std::pair<float, float> > M2CutType;
75 inline Bool_t inputOk();
77 inline Bool_t cutOnMass2(
const Float_t&,
const std::string&);
80 Bool_t cleared, cleared2;
86 static M2CutType createM2CutMap() {
88 m[
"pi"] = std::make_pair(0.015, 0.025);
89 m[
"K"] = std::make_pair(0.2, 0.3);
90 m[
"p"] = std::make_pair(0.8085, 1.15);
104 const char* err_msg =
105 "Make sure to call clearContainers() function"
106 "every time a correction of a particle is done!"
107 "Otherwise you're using the same container over and over again!";
108 Error(
"StV0TofCorrection::setVectors3D", err_msg);
110 Vectors3D->setNrArgs(0);
111 Vectors3D->setPointer2Container(Vectors3D);
113 return (*Vectors3D)(vec);
120 tracks->setNrArgs(0);
121 tracks->setPointer2Container(tracks);
123 return (*tracks)(tr);
127 "StV0TofCorrection::setMotherTracks",
128 "Again: Don't forget clearContainers()!"
137 const Float_t& MomentumA = -999.,
138 const std::string& particle =
""
144 delete Vectors3D;
delete tracks;
145 Vectors3D = NULL; tracks = NULL;
146 cleared = kTRUE; cleared2 = kTRUE;
150 inline Float_t
calcM2(
const Float_t& mom,
const Float_t& beta) {
151 Float_t f2 = 1./(beta*beta) - 1.;
void setNrArgs(const Int_t &c)
setter for number of arguments
Float_t calcM2(const Float_t &mom, const Float_t &beta)
helper function to calculate m2 from momentum & beta
StInlineContainer< T > operator()(const T vec)
operater () overloaded for filling container
Int_t getNrArgs()
getter for number of arguments
StInlineContainer< StLorentzVectorD > setMotherTracks(const StLorentzVectorD tr)
function for initialization of mother tracks container
void clearContainers()
function for finalization by destroying containers
StInlineContainer(const T vec)
explicit constructor
virtual ~StV0TofCorrection()
destructor
void setPointer2Container(StInlineContainer< T > *p)
set pointer to container
template class defining an inline container
StInlineContainer< StThreeVectorD > setVectors3D(const StThreeVectorD vec)
function for initialization of 3d-vectors container
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
A class providing tools to correct the time of flight of V0 particles.