8 #ifndef StPicoUtilities_h
9 #define StPicoUtilities_h
17 #include "StMuDSTMaker/COMMON/StMuTrack.h"
18 #include "StMuDSTMaker/COMMON/StMuDst.h"
21 namespace StPicoUtilities {
23 enum Charge_t { Neg=0, Pos=1 };
24 enum TpcHalf_t { East=0, West=2 };
25 enum Mult_t { refMult2=0, refMult3=4, refMult4=8, refMultHalf=12 };
28 RefMult2NegEast = refMult2|Neg|East,
29 RefMult2NegWest = refMult2|Neg|West,
30 RefMult2PosEast = refMult2|Pos|East,
31 RefMult2PosWest = refMult2|Pos|West,
32 RefMult3NegEast = refMult3|Neg|East,
33 RefMult3NegWest = refMult3|Neg|West,
34 RefMult3PosEast = refMult3|Pos|East,
35 RefMult3PosWest = refMult3|Pos|West,
36 RefMult4NegEast = refMult4|Neg|East,
37 RefMult4NegWest = refMult4|Neg|West,
38 RefMult4PosEast = refMult4|Pos|East,
39 RefMult4PosWest = refMult4|Pos|West,
40 RefMultHalfNegEast = refMultHalf|Neg|East,
41 RefMultHalfNegWest = refMultHalf|Neg|West,
42 RefMultHalfPosEast = refMultHalf|Pos|East,
43 RefMultHalfPosWest = refMultHalf|Pos|West
46 std::array<int, 16> calculateRefMult(
const StMuDst& muDst) {
48 std::array<int, 16> custom_refMult = {};
51 for (Int_t iTrk = 0; iTrk < muDst.
primaryTracks()->GetEntries(); ++iTrk) {
60 if( track->
flag() < 0 ||
61 fabs(track->
momentum().mag()) < 1.e-10 ||
62 track->
dca().mag() > 3. ||
63 fabs(track->
momentum().pseudoRapidity()) > 1. )
continue;
65 double const eta = track->
momentum().pseudoRapidity() ;
66 Charge_t chargeName = (track->
charge() > 0) ? Pos : Neg;
67 TpcHalf_t tpcHalfName = (eta > 0) ? West : East;
69 double const beta = track->btofPidTraits().beta();
70 double const massSqr = (beta <= 1.e-5) ? -999. : track->
momentum().mag2() * (std::pow(1. / beta, 2) - 1.);
76 custom_refMult[refMultHalf | chargeName | tpcHalfName] += 1;
79 if (fabs(eta) > 0.5) {
80 custom_refMult[refMult2 | chargeName | tpcHalfName] += 1;
85 custom_refMult[refMult3 | chargeName | tpcHalfName] += 1;
93 if( (massSqr <= -990. && fabs(track->
nSigmaKaon()) > 3) ||
94 (massSqr > -990. && (massSqr > 0.6 || massSqr < 0.1)) ) {
95 custom_refMult[refMult4 | chargeName | tpcHalfName] += 1;
100 return custom_refMult;
105 #endif // #define StPicoUtilities_h
UShort_t nHitsFit() const
Return total number of hits used in fit.
short flag() const
Returns flag, (see StEvent manual for type information)
Short_t charge() const
Returns charge.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
StThreeVectorF dca(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex.
Double_t nSigmaProton() const
Returns Craig's distance to the calculated dE/dx band for protons in units of sigma.
Double_t nSigmaKaon() const
Returns Craig's distance to the calculated dE/dx band for kaons in units of sigma.