12 #include "StPicoMessMgr.h"
13 #include "StPicoBEmcPidTraits.h"
20 mBemcId(-9999), mBemcAdc0(-9999), mBemcE0(-9999), mBemcE(-9999),
21 mBemcZDist(-9999), mBemcPhiDist(-9999),
22 mBemcSmdNEta(std::numeric_limits<
unsigned char>::max()), mBemcSmdNPhi(std::numeric_limits<
unsigned char>::max()),
23 mBtowId(-9999), mBtowId23(std::numeric_limits<
unsigned char>::max()),
24 mBtowE(-9999), mBtowE2(-9999), mBtowE3(-9999),
25 mBtowEtaDist(-9999), mBtowPhiDist(-9999) {
31 const Int_t* nhit,
const Int_t* ntow) : TObject() {
33 mTrackIndex = (index > std::numeric_limits<short>::max()) ? -1 : (Short_t)index;
35 auto getConstrainedShort = [](
float x) {
36 return ( ( TMath::Abs(x) >= std::numeric_limits<short>::max() ) ?
37 std::numeric_limits<short>::max() : (short)(TMath::Nint(x)) );
40 mBemcId = (
id > std::numeric_limits<short>::max()) ? -1 : (Short_t)id;
41 mBemcAdc0 = ( (adc0 > std::numeric_limits<unsigned short>::max()) ?
42 std::numeric_limits<unsigned short>::max() : (UShort_t)adc0 );
43 mBemcE0 = getConstrainedShort(e[0] * 1000.);
44 mBemcE = getConstrainedShort(e[1] * 1000.);
45 mBemcZDist = getConstrainedShort(dist[0] * 100.);
46 mBemcPhiDist = getConstrainedShort(dist[1] * 10000.);
47 mBemcSmdNEta = ( (nhit[0] > std::numeric_limits<unsigned char>::max()) ?
48 std::numeric_limits<unsigned char>::max() : (UChar_t)(nhit[0]) );
49 mBemcSmdNPhi = ( (nhit[1] > std::numeric_limits<unsigned char>::max()) ?
50 std::numeric_limits<unsigned char>::max() : (UChar_t)(nhit[1]) );
52 mBtowId = (ntow[0] <= 0 || ntow[0] > 4800) ? -1 : (Short_t)ntow[0];
58 if ( !(ntow[1] < 0 || ntow[1] >= 9) ) {
59 if ( !(ntow[2] < 0 || ntow[2] >= 9) ) {
60 mBtowId23 = (Char_t)(ntow[1] * 10 + ntow[2]);
63 mBtowId23 = (Char_t)(ntow[1] * 10 + 9);
70 mBtowE = getConstrainedShort(e[2] * 1000.);
71 mBtowE2 = getConstrainedShort(e[3] * 1000.);
72 mBtowE3 = getConstrainedShort(e[4] * 1000.);
73 mBtowEtaDist = getConstrainedShort(dist[2] * 10000.);
74 mBtowPhiDist = getConstrainedShort(dist[3] * 10000.);
79 mTrackIndex = traits.mTrackIndex;
80 mBemcId = traits.mBemcId;
81 mBemcAdc0 = traits.mBemcAdc0;
82 mBemcE0 = traits.mBemcE0;
83 mBemcE = traits.mBemcE;
84 mBemcZDist = traits.mBemcZDist;
85 mBemcPhiDist = traits.mBemcPhiDist;
86 mBemcSmdNEta = traits.mBemcSmdNEta;
87 mBemcSmdNPhi = traits.mBemcSmdNPhi;
89 mBtowId = traits.mBtowId;
90 mBtowId23 = traits.mBtowId23;
91 mBtowE = traits.mBtowE;
92 mBtowE2 = traits.mBtowE2;
93 mBtowE3 = traits.mBtowE3;
94 mBtowEtaDist = traits.mBtowEtaDist;
95 mBtowPhiDist = traits.mBtowPhiDist;
105 LOG_INFO <<
"Matched track index = " << mTrackIndex << endm;
106 LOG_INFO <<
" BEMC Id = " <<
bemcId() <<
" BTOW Adc0 = " <<
bemcAdc0()
107 <<
" bemc E0 = " <<
bemcE0() <<
" e = " <<
bemcE() << endm;
110 LOG_INFO <<
" BTOW Id = " <<
btowId() <<
" tower Id 2/3 = " <<
btowId2() <<
" " <<
btowId3() << endm;
111 LOG_INFO <<
" BTOW energy = " <<
btowE() <<
" " <<
btowE2() <<
" " <<
btowE3() << endm;
117 auto getConstrainedShort = [](
float x) {
118 return fabs(x) >= std::numeric_limits<short>::max() ?
119 std::numeric_limits<short>::max() : (short)(TMath::Nint(x));
121 mBemcE0 = getConstrainedShort(energy[0] * 1000.);
122 mBemcE = getConstrainedShort(energy[1] * 1000.);
123 mBtowE = getConstrainedShort(energy[2] * 1000.);
124 mBtowE2 = getConstrainedShort(energy[3] * 1000.);
125 mBtowE3 = getConstrainedShort(energy[4] * 1000.);
130 auto getConstrainedShort = [](
float x) {
131 return fabs(x) >= std::numeric_limits<short>::max() ?
132 std::numeric_limits<short>::max() : (short)(TMath::Nint(x));
134 mBemcZDist = getConstrainedShort(dist[0] * 100.);
135 mBemcPhiDist = getConstrainedShort(dist[1] * 10000.);
136 mBtowEtaDist = getConstrainedShort(dist[2] * 10000.);
137 mBtowPhiDist = getConstrainedShort(dist[3] * 10000.);
142 mBemcSmdNEta = ( (nhit[0] > std::numeric_limits<unsigned char>::max()) ?
143 std::numeric_limits<unsigned char>::max() : (UChar_t)(nhit[0]) );
144 mBemcSmdNPhi = ( (nhit[1] > std::numeric_limits<unsigned char>::max()) ?
145 std::numeric_limits<unsigned char>::max() : (UChar_t)(nhit[1]) );
150 mBtowId = (ntow[0] <= 0 || ntow[0] > 4800) ? -1 : (Short_t)ntow[0];
155 if ( !( ntow[1] < 0 || ntow[1] >= 9 ) ) {
156 if ( !(ntow[2] < 0 || ntow[2] >= 9) ) {
157 mBtowId23 = (Char_t)(ntow[1] * 10 + ntow[2]);
160 mBtowId23 = (Char_t)(ntow[1] * 10 + 9);
Float_t btowE2() const
Energy of second closest tower.
Float_t bemcE() const
Associated bemc cluster energy (STAR standard clustering algorithm)
Float_t bemcE0() const
Associated bemc cluster highest tower energy (STAR standard clustering algorithm) ...
void setEnergy(Float_t energy[5])
Set energy.
Float_t btowE3() const
Energy of third closest tower.
StPicoBEmcPidTraits()
Default constructor.
Float_t btowEtaDist() const
Eta distance to matched tower (cm)
Int_t bemcAdc0() const
Associated bemc cluster highest tower adc (STAR standard clustering algorithm)
Float_t btowE() const
Matched tower energy.
Int_t bemcSmdNPhi() const
Associated bemc cluster number of fired SMD-phi wires (STAR standard clustering algorithm) ...
Int_t btowId2() const
Track second closest tower local id.
Int_t bemcSmdNEta() const
Associated bemc cluster number of fired SMD-eta wires (STAR standard clustering algorithm) ...
Float_t bemcZDist() const
Associated bemc cluster Z-distance (cm) (STAR standard clustering algorithm)
Int_t btowId() const
Track matched tower id (using StEmcPosition::projTrack())
Keep information about Barrel ElectroMagnetic Calorimeter (BEMC) matched tracks.
Float_t bemcPhiDist() const
Associated bemc cluster phi-distance (cm) (STAR standard clustering algorithm)
Int_t btowId3() const
Track third closest tower local id.
Float_t btowPhiDist() const
Phi distance to matched tower (cm)
void setNHits(Int_t nhit[2])
Set number of hits.
Int_t bemcId() const
Associated BEMC cluster id (STAR standard clustering algorithm)
void setDistances(Float_t dist[4])
Set distances.
virtual void Print(const Char_t *option="") const
Print BEMC PID traits information.
void setNTOW(Int_t ntow[3])
Set IDs of the towers.
virtual ~StPicoBEmcPidTraits()
Destructor.