Skip to content

Commit

Permalink
Update StPicoEpdHit to include the DEP information
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Mar 24, 2023
1 parent 6f1ac0a commit d464e1b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 14 deletions.
16 changes: 10 additions & 6 deletions StRoot/StPicoEvent/StPicoEpdHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,32 @@
* 2) there is no "Truth ID" which is used for simulations.
*
* - Mike Lisa March 2018
*
* Updated March 2023 Mike Lisa - see header for details.
************************************************/

ClassImp(StPicoEpdHit)

//_________________
StPicoEpdHit::StPicoEpdHit() : TObject(), mId(0), mQTdata(0), mnMIP(0) {
StPicoEpdHit::StPicoEpdHit() : StPicoEpdHit(0, 0, 0) {
/* no-op */
}

//_________________
StPicoEpdHit::StPicoEpdHit(Int_t position, Int_t tile,
Int_t EW, Int_t ADC, Int_t TAC,
Int_t TDC, Bool_t hasTAC, Float_t nMIP,
Bool_t statusIsGood) :
Bool_t statusIsGood, UShort_t DEPdata, Float_t nMIP_DEP) :
TObject(),
mId( (100*position + tile)*EW ),
mQTdata( (ADC & 0x0FFF) | (TAC & 0x0FFF) << 12 | (TDC & 0x001F) << 24 | hasTAC << 29 | statusIsGood << 30 ),
mnMIP(nMIP) {
mnMIP(nMIP), mDEPdata(DEPdata), mnMIP_DEP(nMIP_DEP) {
/* no-op */
}

//_________________
StPicoEpdHit::StPicoEpdHit(Short_t id, Int_t QTdata, Float_t nMIP) :
TObject(), mId(id), mQTdata(QTdata), mnMIP(nMIP) {
StPicoEpdHit::StPicoEpdHit(Short_t id, Int_t QTdata, Float_t nMIP_QT, UShort_t DEPdata, Float_t nMIP_DEP) :
TObject(), mId(id), mQTdata(QTdata), mnMIP(nMIP_QT), mDEPdata(DEPdata), mnMIP_DEP(nMIP_DEP) {
/* no-op */
}

Expand All @@ -61,6 +63,8 @@ StPicoEpdHit::StPicoEpdHit(const StPicoEpdHit &hit) : TObject() {
mId = hit.mId;
mQTdata = hit.mQTdata;
mnMIP = hit.mnMIP;
mDEPdata = hit.mDEPdata;
mnMIP_DEP = hit.mnMIP_DEP;
}

//_________________
Expand All @@ -70,5 +74,5 @@ StPicoEpdHit::~StPicoEpdHit() {

//_________________
void StPicoEpdHit::Print(const Char_t *option __attribute__((unused)) ) const {
LOG_INFO << "EPD hit id: " << mId << " QT data: " << mQTdata << " nMIP: " << mnMIP << endm;
LOG_INFO << "EPD hit id: " << mId << " QT data: " << mQTdata << " nMIP_QT: " << mnMIP << " DEPdata: " << mDEPdata << " nMIP_DEP: " << mnMIP_DEP << endm;
}
59 changes: 51 additions & 8 deletions StRoot/StPicoEvent/StPicoEpdHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
* (Also works for StEpdHit::id() and StMuEpdHit::id())
*
* - Mike Lisa March 2018
*
* ================================================
* Update March 2023 (More than 5 years later. Not bad.) Mike Lisa
* - We now have the DAQ upgrade and DEP readout on the West side.
* DEP information will *always* be there. QT only at low rate.
* So, now have to store DEP information.
*
* It means several new methods, and two new data members:
* 1) unsigned short DEPdata
* 2) float nMIP_DEP
* So, now the size of one StMuEpdHit is 16 bytes
************************************************/

class StPicoEpdHit : public TObject {
Expand All @@ -57,15 +68,21 @@ class StPicoEpdHit : public TObject {
/// \param TAC TAC reported by QT board (if there is one) [0,4095]
/// \param TDC TDC reported by QT board [0,32]
/// \param hasTAC true/fals if this channel has a TAC
/// \param nMIP gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP
/// \param nMIP_QT gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP - based on QT data
/// \param statusIsGood good status, according to database
/// \param DEPdata raw data from DEP - March 2023
/// \param nMIP_DEP gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP - based on DEP data - March 2023
StPicoEpdHit(Int_t position, Int_t tile, Int_t EW, Int_t ADC, Int_t TAC, Int_t TDC,
Bool_t hasTAC, Float_t nMIP, Bool_t statusIsGood);
Bool_t hasTAC, Float_t nMIP_QT, Bool_t statusIsGood, UShort_t DEPdata = 0, Float_t nMIP_DEP = 0);

/// constructor just taking id, QT, nMIP
/// \param id tile id, encoding size, position and tile
/// \param QTdata bit-compressed QT data
/// \nMIP calibrated ADC
StPicoEpdHit(Short_t id, Int_t QTdata, Float_t nMIP);
/// \param nMIP_QT calibrated ADC from QT
/// \param DEPdata raw DEP data - March 2023
/// \param nMIP_DEP calibrated DEP data - March 2023
StPicoEpdHit(Short_t id, Int_t QTdata, Float_t nMIP_QT, UShort_t DEPdata = 0, Float_t nMIP_DEP = 0);

/// Copy constructor
StPicoEpdHit(const StPicoEpdHit &hit);
/// Destructor
Expand Down Expand Up @@ -101,7 +118,8 @@ class StPicoEpdHit : public TObject {
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP
/// if the tile is identified as bad in the database, returns zero. Note you
/// can always access the raw ADC value, regardless of good/bad
Float_t nMIP() const { return this->isGood() ? mnMIP : 0.0; }
/// 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
Float_t nMIP() const { if (!isGood()) return 0; return qtDataAvailable() ? mnMIP : mnMIP_DEP; }
/// false if tile is bad or missing, according to (time-dependent) database
Bool_t isGood() const { return (mQTdata >> 30) & 0x1; }
/// truncated nMIP. This is usually the most useful thing to the physics analyzer.
Expand All @@ -119,8 +137,27 @@ class StPicoEpdHit : public TObject {
/// It is expected that this will not be invoked, but rather the constructor used
/// \param id = sign*(100*position+tile) where sign=+/- for West/East wheel
void setId(Short_t id) { mId = id; }
/// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP
/// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT
//@{
void setnMIP(Float_t nMIP) { mnMIP = nMIP; }
void setnMIP_QT(Float_t nMIP_QT) { mnMIP = nMIP_QT; }
//@}

// Now a bunch of methods for DEP - March 2023
/// store the raw DEP data
void setDEPdata(unsigned short DEPdata) { mDEPdata = DEPdata; }
/// store the gain-calibrated energy loss based on DEP data
void setnMIP_DEP(float nMipDep) { mnMIP_DEP = nMipDep; }
/// get the raw DEP data
UShort_t depData() const { return mDEPdata; }
/// get the gain-calibrated energy loss based on DEP data
Float_t nMIP_DEP() const { return isGood() ? mnMIP_DEP : 0; }
/// true if there is QT information available for this (will be false for sure at high rates on west side)
bool qtDataAvailable() const { return adc() > 0; }
/// gain calibrated energy loss in tile based on QT, in units of Landau MPV for one MIP
/// if the tile is identified as bad in the database, returns zero. Note you
/// can always access the raw ADC value, regardless of good/bad
Float_t nMIP_QT() const { return isGood() ? mnMIP : 0; }

protected:

Expand All @@ -134,10 +171,16 @@ class StPicoEpdHit : public TObject {
/// bit 30 is the good/bad (1/0) status flag
Int_t mQTdata;

/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP
/// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data
Float_t mnMIP;

ClassDef(StPicoEpdHit, 1)
/// raw DEP data - March 2023
UShort_t mDEPdata;

/// gain-calibrated energy loss in tile, in units of Landau MPV for one MIP - based on DEP - March 2023
Float_t mnMIP_DEP;

ClassDef(StPicoEpdHit, 2)
};

#endif

0 comments on commit d464e1b

Please sign in to comment.