13 #include "StPicoMessMgr.h"
14 #include "StPicoBTofPidTraits.h"
20 mTrackIndex(-1), mBTofCellId(-1), mBTofMatchFlag(-1),
21 mBTof(0), mBTofBeta(0),
22 mBTofYLocal( std::numeric_limits<
short>::min() ),
23 mBTofZLocal( std::numeric_limits<
short>::min() ),
24 mBTofHitPosX( std::numeric_limits<
short>::min() ),
25 mBTofHitPosY( std::numeric_limits<
short>::min() ),
26 mBTofHitPosZ( std::numeric_limits<
short>::min() ),
27 mNSigmaElectron( std::numeric_limits<
short>::min() ),
28 mNSigmaPion( std::numeric_limits<
short>::min() ),
29 mNSigmaKaon( std::numeric_limits<
short>::min() ),
30 mNSigmaProton( std::numeric_limits<
short>::min() ) {
36 mTrackIndex = traits.mTrackIndex;
37 mBTofCellId = traits.mBTofCellId;
38 mBTofMatchFlag = traits.mBTofMatchFlag;
40 mBTofBeta = traits.mBTofBeta;
41 mBTofYLocal = traits.mBTofYLocal;
42 mBTofZLocal = traits.mBTofZLocal;
43 mBTofHitPosX = traits.mBTofHitPosX;
44 mBTofHitPosY = traits.mBTofHitPosY;
45 mBTofHitPosZ = traits.mBTofHitPosZ;
46 mNSigmaElectron = traits.mNSigmaElectron;
47 mNSigmaPion = traits.mNSigmaPion;
48 mNSigmaKaon = traits.mNSigmaKaon;
49 mNSigmaProton = traits.mNSigmaProton;
63 mBTofBeta = ( (beta * 20000.) > std::numeric_limits<unsigned short>::max() ?
64 std::numeric_limits<unsigned short>::max() :
65 (UShort_t)( TMath::Nint( beta * 20000. ) ) );
71 mBTofYLocal = ( fabs(yLocal * 1000.) > std::numeric_limits<short>::max() ?
72 ( (yLocal>0) ? std::numeric_limits<short>::max() :
73 std::numeric_limits<short>::min() ):
74 (Short_t)( TMath::Nint( yLocal * 1000. ) ) );
79 mBTofZLocal = ( fabs(zLocal * 1000.) > std::numeric_limits<short>::max() ?
80 ( (zLocal>0) ? std::numeric_limits<short>::max() :
81 std::numeric_limits<short>::min() ):
82 (Short_t)( TMath::Nint( zLocal * 1000. ) ) );
87 mBTofHitPosX = ( fabs(x * 100.) > std::numeric_limits<short>::max() ?
88 ( (x>0) ? std::numeric_limits<short>::max() :
89 std::numeric_limits<short>::min() ):
90 (Short_t)( TMath::Nint( x * 100. ) ) );
95 mBTofHitPosY = ( fabs(y * 100.) > std::numeric_limits<short>::max() ?
96 ( (y>0) ? std::numeric_limits<short>::max() :
97 std::numeric_limits<short>::min() ):
98 (Short_t)( TMath::Nint( y * 100. ) ) );
103 mBTofHitPosZ = ( fabs(z * 100.) > std::numeric_limits<short>::max() ?
104 ( (z>0) ? std::numeric_limits<short>::max() :
105 std::numeric_limits<short>::min() ):
106 (Short_t)( TMath::Nint( z * 100. ) ) );
116 mNSigmaElectron = ( fabs(sigma * 1000.) > std::numeric_limits<short>::max() ?
117 ( (sigma > 0) ? std::numeric_limits<short>::max() :
118 std::numeric_limits<short>::min() ) :
119 (Short_t)( TMath::Nint( sigma * 1000. ) ) );
124 mNSigmaPion = ( fabs(sigma * 1000.) > std::numeric_limits<short>::max() ?
125 ( (sigma > 0) ? std::numeric_limits<short>::max() :
126 std::numeric_limits<short>::min() ) :
127 (Short_t)( TMath::Nint( sigma * 1000. ) ) );
132 mNSigmaKaon = ( fabs(sigma * 1000.) > std::numeric_limits<short>::max() ?
133 ( (sigma > 0) ? std::numeric_limits<short>::max() :
134 std::numeric_limits<short>::min() ) :
135 (Short_t)( TMath::Nint( sigma * 1000. ) ) );
140 mNSigmaProton = ( fabs(sigma * 1000.) > std::numeric_limits<short>::max() ?
141 ( (sigma > 0) ? std::numeric_limits<short>::max() :
142 std::numeric_limits<short>::min() ) :
143 (Short_t)( TMath::Nint( sigma * 1000. ) ) );
148 LOG_INFO <<
" Matched track index = " << mTrackIndex << endm;
149 LOG_INFO <<
" BTOF cellId = " <<
btofCellId() <<
" tof = " <<
btof()
150 <<
" beta = " <<
btofBeta() << endm;
151 LOG_INFO <<
" BTOF match = " <<
btofMatchFlag() <<
" yLocal/zLocal "
Float_t btofZLocal() const
Return zLocal (compression = zLocal * 1000)
Int_t btofCellId() const
Return BTOF cell ID (encoding = (tray-1)*192+(module-1)*6+(cell-1): -1 - no match ) ...
void setZLocal(Float_t zLocal)
Set zLocal.
void setNSigmaProton(Float_t sigma)
Set nsigma(proton)
virtual ~StPicoBTofPidTraits()
Destructor.
Float_t btofYLocal() const
Return yLocal (compression = yLocal * 1000)
virtual void Print(const Char_t *option="") const
Print TOF PID traits information.
void setHitPositionZ(Float_t z)
Set hit position z (cm)
Float_t btofBeta() const
Return beta (compression = beta * 20000)
void setHitPositionXYZ(Float_t x, Float_t y, Float_t z)
Set hit position (x,y,z)
Float_t btof() const
Return time of flight.
void setNSigmaElectron(Float_t sigma)
Set nsigma(electron)
void setNSigmaKaon(Float_t sigma)
Set nsigma(kaon)
void setHitPositionY(Float_t y)
Set hit position y (cm)
void setNSigmaPion(Float_t sigma)
Set nsigma(pion)
void setHitPositionX(Float_t x)
Set hit position x (cm)
void setBeta(Float_t beta)
Set beta.
StPicoBTofPidTraits()
Default constructor.
Int_t btofMatchFlag() const
Return matching flag (0 - no match, 1 - one-to-one, 2 - one-to-multiple)
void setYLocal(Float_t yLocal)
Set yLocal.