Skip to content

Commit 1186ce6

Browse files
committed
Update StMuEpdHit to include the DEP information
1 parent 4021e69 commit 1186ce6

File tree

2 files changed

+57
-17
lines changed

2 files changed

+57
-17
lines changed

StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,37 @@
2424
* the StEpdHit object in StEvent
2525
*
2626
* - Mike Lisa Jan 2018
27+
*
28+
* - Updated March 2023 - Mike Lisa - see header for details.
29+
*
2730
************************************************/
2831

2932
#include "StEvent/StEpdHit.h"
3033
#include "StMuEpdHit.h"
3134

3235
ClassImp(StMuEpdHit)
3336

34-
StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0){
37+
StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0){
3538
/* no-op */
3639
}
3740

3841
StMuEpdHit::StMuEpdHit(Int_t position, Int_t tile,
3942
Short_t EW, Int_t ADC, Int_t TAC,
40-
Int_t TDC, bool hasTAC, Float_t nMIP,
41-
bool statusIsGood, Int_t truthId) :
43+
Int_t TDC, bool hasTAC, Float_t nMIP_QT,
44+
bool statusIsGood, Int_t truthId,
45+
UShort_t DEPdata, Float_t nMIP_DEP) :
4246
mId( (100*position + tile)*EW ),
4347
mQTdata( (ADC & 0x0FFF) | (TAC & 0x0FFF) << 12 | (TDC & 0x001F) << 24 | hasTAC << 29 | statusIsGood << 30 ),
44-
mnMIP(nMIP),
45-
mTruthId(truthId)
48+
mnMIP_QT(nMIP_QT),
49+
mTruthId(truthId),
50+
mDEPdata(DEPdata),
51+
mnMIP_DEP(nMIP_DEP)
4652
{
4753
/* no-op */
4854
}
4955

5056
StMuEpdHit::StMuEpdHit(StEpdHit* epdHit) :
51-
mId(epdHit->id()), mQTdata(epdHit->qtData()), mnMIP(epdHit->nMIP()), mTruthId(epdHit->idTruth())
57+
mId(epdHit->id()), mQTdata(epdHit->qtData()), mnMIP_QT(epdHit->nMIP_QT()), mTruthId(epdHit->idTruth()), mDEPdata(epdHit->depData()), mnMIP_DEP(epdHit->nMIP_DEP())
5258
{
5359
/* no-op */
5460
}

StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@
2727
* the StEpdHit object in StEvent
2828
*
2929
* - Mike Lisa Jan 2018
30+
*
31+
*
32+
* Update March 2023 (More than 5 years later. Not bad.) Mike Lisa
33+
* - We now have the DAQ upgrade and DEP readout on the West side.
34+
* DEP information will *always* be there. QT only at low rate.
35+
* So, now have to store DEP information.
36+
*
37+
* It means several new methods, and two new data members:
38+
* 1) unsigned short DEPdata
39+
* 2) float nMIP_DEP
40+
* So, now the size of one StMuEpdHit is 16 bytes
3041
************************************************/
3142
class StEpdHit;
3243

@@ -44,10 +55,12 @@ class StMuEpdHit : public StObject
4455
/// \param TAC TAC reported by QT board (if there is one) [0,4095]
4556
/// \param TDC TDC reported by QT board [0,32]
4657
/// \param hasTAC true/fals if this channel has a TAC
47-
/// \param nMIP gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP
58+
/// \param nMIP_QT gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP - based on QT data
4859
/// \param statusIsGood good status, according to database
4960
/// \param truthId id of particle most responsible for energy loss (simulation)
50-
StMuEpdHit(Int_t position, Int_t tile, Short_t EW, Int_t ADC, Int_t TAC, Int_t TDC, bool hasTAC, Float_t nMIP, bool statusIsGood, Int_t truthId);
61+
/// \param DEPdata raw data from DEP - March 2023
62+
/// \param nMIP_DEP gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP - based on DEP data - March 2023
63+
StMuEpdHit(Int_t position, Int_t tile, Short_t EW, Int_t ADC, Int_t TAC, Int_t TDC, bool hasTAC, Float_t nMIP_QT, bool statusIsGood, Int_t truthId, UShort_t DEPdata, Float_t nMIP_DEP);
5164

5265
/// constructor based on StEpdHit
5366
/// this is what will be used in constructing the StMuDst from the StEvent
@@ -77,8 +90,6 @@ class StMuEpdHit : public StObject
7790
/// bit 29=0/1 for has/does not have TAC;
7891
/// bit 30=0/1 if tile is marked bad/good in database
7992
Int_t qtData() {return mQTdata;}
80-
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP
81-
Float_t nMIP() {return mnMIP;}
8293
/// false if tile is bad or missing, according to (time-dependent) database
8394
bool isGood() const;
8495

@@ -92,15 +103,30 @@ class StMuEpdHit : public StObject
92103
/// It is expected that this will not be invoked, but rather the constructor used
93104
/// \param id = sign*(100*position+tile) where sign=+/- for West/East wheel
94105
void setId(Short_t id){mId = id;}
95-
/// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP
96-
void SetnMIP(Float_t nMIP){mnMIP = nMIP;}
97-
106+
/// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data - March 2023
107+
void setnMIP_QT(Float_t nMIP_QT){mnMIP_QT = nMIP_QT;}
98108
/// set the id of particle most responsible for energy loss in tile (monte carlo)
99109
void setIdTruth(Int_t id){mTruthId = id;}
100-
101110
/// returns the particle number for the particle most responsible for energy loss (monte carlo)
102111
Int_t idTruth(){return mTruthId;}
103112

113+
// Now a bunch of methods for DEP - March 2023
114+
/// store the raw DEP data
115+
void setDEPdata(unsigned short DEPdata){mDEPdata=DEPdata;}
116+
/// store the gain-calibrated energy loss based on DEP data
117+
void setnMIP_DEP(float nMipDep){mnMIP_DEP=nMipDep;}
118+
/// get the raw DEP data
119+
UShort_t depData() const {return mDEPdata;}
120+
/// get the gain-calibrated energy loss based on DEP data
121+
Float_t nMIP_DEP() const {return mnMIP_DEP;}
122+
/// true if there is QT information available for this (will be false for sure at high rates on west side)
123+
bool qtDataAvailable() const;
124+
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data
125+
Float_t nMIP_QT() const {return mnMIP_QT;}
126+
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data if there is QT data. Otherwise from DEP
127+
Float_t nMIP() const {return (this->qtDataAvailable())?mnMIP_QT:mnMIP_DEP;}
128+
129+
104130
protected:
105131

106132
/// Packed channel Id:
@@ -113,13 +139,19 @@ class StMuEpdHit : public StObject
113139
/// bit 30 is the good/bad (1/0) status flag
114140
Int_t mQTdata;
115141

116-
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP
117-
Float_t mnMIP;
142+
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT
143+
Float_t mnMIP_QT;
144+
145+
/// raw DEP data - March 2023
146+
UShort_t mDEPdata;
147+
148+
/// gain-calibrated energy loss in tile, in units of Landau MPV for one MIP - based on DEP - March 2023
149+
Float_t mnMIP_DEP;
118150

119151
/// greatest contributer to energy deposition (MC)
120152
Int_t mTruthId;
121153

122-
ClassDef(StMuEpdHit, 1)
154+
ClassDef(StMuEpdHit, 2)
123155
};
124156

125157
inline Short_t StMuEpdHit::side() const { return mId < 0 ? -1 : +1;}
@@ -133,4 +165,6 @@ inline Int_t StMuEpdHit::tac() const { return (mQTdata >> 12) & 0x0FFF; }
133165
inline Int_t StMuEpdHit::tdc() const { return (mQTdata >> 24) & 0x001F; }
134166
inline bool StMuEpdHit::hasTac() const { return (mQTdata >> 29) & 0x1; }
135167
inline bool StMuEpdHit::isGood() const { return (mQTdata >> 30) & 0x1; }
168+
inline bool StMuEpdHit::qtDataAvailable() const {return (this->adc()!=0);}
169+
136170
#endif

0 commit comments

Comments
 (0)