diff --git a/StRoot/StEpdHitMaker/StEpdHitMaker.cxx b/StRoot/StEpdHitMaker/StEpdHitMaker.cxx index c17a34d4d86..01dad6888c9 100644 --- a/StRoot/StEpdHitMaker/StEpdHitMaker.cxx +++ b/StRoot/StEpdHitMaker/StEpdHitMaker.cxx @@ -12,6 +12,10 @@ If it is not there, it creates one and fills it from the StTriggerData object and info from the StEpdDbMaker (database) + + Update March 2023 - Mike Lisa + Updated to pull DEP information from the TriggerData and store in the newly-updated StEpdHit object + */ #include "StEpdHitMaker.h" @@ -198,6 +202,10 @@ void StEpdHitMaker::FillStEpdData(){ int truthId=0; // this is for simulation + // March 2023 - now add DEP information + unsigned short rawDEP; + float calibratedDEP; + getEpdDepInfo(ew, PP, TT, rawDEP, calibratedDEP); // EpdOfs2 << ew << "\t" << PP << "\t" << TT << "\t" // << mEpdDbMaker->GetCrateAdc(ew,PP,TT) << "\t" @@ -208,9 +216,19 @@ void StEpdHitMaker::FillStEpdData(){ // << mEpdDbMaker->GetChannelTac(ew,PP,TT) << "\t" // << ADC << "\t" << nMIP << endl; - StEpdHit* hit = new StEpdHit(PP,TT,EWforHit,ADC,TAC,TDC,HasTac,nMIP,isGood,truthId); + StEpdHit* hit = new StEpdHit(PP, TT, EWforHit, ADC, TAC, TDC, HasTac, nMIP, isGood, truthId, rawDEP, calibratedDEP); mEpdCollection->addHit(hit); nHitsAdded++; + } // if ADC>0 + else { // even if there is no ADC from the QT, there might still be info from the DEP - March 2023 + unsigned short rawDEP; + float calibratedDEP; + getEpdDepInfo(ew, PP, TT, rawDEP, calibratedDEP); + if (rawDEP > 0) { + StEpdHit* hit = new StEpdHit((int)PP, (int)TT, EWforHit, 0, 0, 0, false, 0, true, 0, rawDEP, calibratedDEP); + mEpdCollection->addHit(hit); + nHitsAdded++; + } } } } @@ -223,3 +241,23 @@ void StEpdHitMaker::FillStEpdData(){ LOG_INFO << "StEpdHitMaker::FillStEpdData - added " << nHitsAdded << " to StEpdHitCollection" << endm; } + +// March 2023 - get DEP data +void StEpdHitMaker::getEpdDepInfo(short ew, short pp, short tt, unsigned short& rawDEP, float& calibratedDEP){ + if (ew == 0) { rawDEP = 0; calibratedDEP = 0.; return;} // only DEP on the west side + + // -------------------------- March 2023 --------------------------------- + // Here is where I must fill in the code to + // 1) Get the raw DEP waveform from the TriggerData + // 2) Sum up the appropriate time buckets (this is DEPdata) + // 3) Get the gain constant from the database (which needs to exist!!!) + // 4) mnMIP_DEP = DEPdata / gain + // 5) put mnMIP_DEP and rawDEPdata into the StEpdHit + // + // 6) might want to impose a "zero suppression threshold" here, too + + // right now I just return zero + rawDEP = 0; + calibratedDEP = 0.0; + return; +} diff --git a/StRoot/StEpdHitMaker/StEpdHitMaker.h b/StRoot/StEpdHitMaker/StEpdHitMaker.h index 5a0c6ceefc9..b6139b45a3f 100644 --- a/StRoot/StEpdHitMaker/StEpdHitMaker.h +++ b/StRoot/StEpdHitMaker/StEpdHitMaker.h @@ -13,6 +13,10 @@ If it is not there, it creates one and fills it from the StTriggerData object and info from the StEpdDbMaker (database) + + Update March 2023 - Mike Lisa + now must read in DEP data and store it in the newly-updated StEpdHit objects + */ @@ -51,6 +55,10 @@ class StEpdHitMaker : public StMaker { /// Returns a pointer to the StEvent object StEvent* GetStEvent(){return mStEvent;} + /// update March 2023 Mike Lisa - method to get and calibrate DEP information + /// This does not NEED to be public, but no harm and may be useful for debugging + void getEpdDepInfo(short ew, short pp, short tt, unsigned short& rawDEP, float& calibratedDEP); + virtual const char *GetCVS() const {static const char cvs[]="Tag " __DATE__ " " __TIME__ ; return cvs;} diff --git a/StRoot/StEvent/StEpdHit.cxx b/StRoot/StEvent/StEpdHit.cxx index c0e7726c62b..5572a0a11d3 100644 --- a/StRoot/StEvent/StEpdHit.cxx +++ b/StRoot/StEvent/StEpdHit.cxx @@ -29,16 +29,19 @@ StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0) /* no-op */ } +// March 2023: +// * add arguments for DEPdata and nMIP_DEP StEpdHit::StEpdHit(int position, int tile, short EW, int ADC, int TAC, - int TDC, bool hasTAC, float nMIP, - bool statusIsGood, int truthId) : + int TDC, bool hasTAC, float nMIP_QT, + bool statusIsGood, int truthId, + unsigned short DEPdata, float nMIP_DEP) : mId( (100*position + tile)*EW ), mQTdata( (ADC & 0x0FFF) | (TAC & 0x0FFF) << 12 | (TDC & 0x001F) << 24 | hasTAC << 29 | statusIsGood << 30 ), - mnMIP(nMIP), - mTruthId(truthId) + mnMIP(nMIP_QT), + mTruthId(truthId), + mDEPdata(DEPdata), + mnMIP_DEP(nMIP_DEP) { /* no-op */ } - - diff --git a/StRoot/StEvent/StEpdHit.h b/StRoot/StEvent/StEpdHit.h index 770a39a4fdc..e5e02267bcf 100644 --- a/StRoot/StEvent/StEpdHit.h +++ b/StRoot/StEvent/StEpdHit.h @@ -27,6 +27,13 @@ * * - Mike Lisa Jan 2018 * + * Update March 2023 - Mike Lisa + * - Add two data members (mDEPdata and mnMIP_DEP) to StEpdHit and StMuEpdHit and StPicoEpdHit + * in order to include the DEP information. Note that this will be the *only* information + * available for the West side, when STAR runs at high rate. The QTs will not be read out. + * + * - Okay so now the size of a StEpdHit is 16 bytes. + * *************************************************************************** * * $Log: StEpdHit.h,v $ @@ -55,10 +62,12 @@ class StEpdHit : public StObject /// \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/nMIP_QT gain-calibrated signal from QT; energy loss in terms of MPV of Landau for a MIP /// \param statusIsGood good status, according to database /// \param truthId particle id of particle most responsible for energy loss (simulation) - StEpdHit(int position, int tile, short EW, int ADC, int TAC, int TDC, bool hasTAC, float nMIP, bool statusIsGood, int truthId); + /// \param DEPdata raw DEP data, in summed ADCs - added May 2023 + /// \param nMIP_DEP gain-calibrated signal from DEP; energy loss in terms of MPV of Landau for a MIP - added May 2023 + StEpdHit(int position, int tile, short EW, int ADC, int TAC, int TDC, bool hasTAC, float nMIP_QT, bool statusIsGood, int truthId, unsigned short DEPdata = 0, float nMIP_DEP = 0); // virtual void Print(const char *option = "") const; @@ -94,6 +103,8 @@ class StEpdHit : public StObject int qtData() const; /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP + /// Now returns QT-based nMIP if QT data is available (this is like before 2023) + /// but if there is no QT data available, then returns DEP-based nMIP - March 2023 float nMIP() const; /// false if tile is bad or missing, according to (time-dependent) database @@ -106,8 +117,11 @@ class StEpdHit : public StObject /// bit 30=0/1 if tile is marked bad/good in database void setQTdata(int packedData); - /// \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 data + //@{ void setnMIP(float nMIP); + void setnMIP_QT(float nMIP_QT); + //@} /// set identifier of particle most responsible for energy loss (simulation) void setIdTruth(int id); @@ -115,6 +129,24 @@ class StEpdHit : public StObject /// identifier of particle most responsible for energy loss (simulation) int idTruth() const; + /// \param DEPdata: raw DEP data (sum of buckets), in ADC counts - added March 2023 + void setDEPdata(unsigned short DEPdata); + + /// \param nMIP_DEP: gain-calibrated energy loss in tile, in units of Landau MPV for one MIP, from DEP data - added March 2023 + void setnMIP_DEP(float nMIP_DEP); + + /// gain-calibrated energy loss in tile, in units of Landau MPV for one MIP, from DEP data - added March 2023 + Float_t nMIP_DEP() const; + + /// raw DEP data (sum of buckets), in ADC counts - added March 2023 + Int_t depData() const; + + /// gain-calibrated energy loss in tile, in units of Landau MPV for one MIP, from QT data - added March 2023 + Float_t nMIP_QT() const; + + /// returns true if there is QT data stored - added March 2023 + bool qtDataAvailable() const; + protected: /// Packed channel Id: @@ -122,27 +154,34 @@ class StEpdHit : public StObject /// sign(mID) = +/- = West/East Short_t mId; - /// Packed channel data: bits 0-11 are ADC; bits 12-23 are TAC; - /// bits 24-28 are TDC; bit 29 is noTAC flag - /// bit 30 is the good/bad (1/0) status flag + /// Packed QT channel data: bits 0-11 are ADC; bits 12-23 are TAC; + /// bits 24-28 are TDC; bit 29 is noTAC flag + /// 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 + /// important: prior to 2023, the ONLY information came from the QTs. Now we also have the DEP Float_t mnMIP; /// identifier of particle most responsible for energy loss (simulation) Int_t mTruthId; + + /// DEP readout data - added March 2023 + UShort_t mDEPdata; + + /// gain calibrated energy loss based on DEP data - added March 2023 + Float_t mnMIP_DEP; - ClassDef(StEpdHit, 1) + ClassDef(StEpdHit, 2) }; -inline int StEpdHit::qtData() const {return mQTdata;} -inline float StEpdHit::nMIP() const {return mnMIP;} -inline void StEpdHit::setQTdata(int packedData) {mQTdata=packedData;} -inline void StEpdHit::setnMIP(float nMIP) {mnMIP = nMIP;} -inline void StEpdHit::setIdTruth(int id) {mTruthId = id;} -inline int StEpdHit::idTruth() const {return mTruthId;} -inline short StEpdHit::side() const { return mId < 0 ? -1 : +1;} +inline int StEpdHit::qtData() const {return mQTdata; } +inline float StEpdHit::nMIP() const { return qtDataAvailable() ? mnMIP : mnMIP_DEP; } +inline void StEpdHit::setQTdata(int packedData) { mQTdata = packedData; } +inline void StEpdHit::setnMIP(float nMIP) { mnMIP = nMIP; } +inline void StEpdHit::setIdTruth(int id) { mTruthId = id; } +inline int StEpdHit::idTruth() const { return mTruthId; } +inline short StEpdHit::side() const { return mId < 0 ? -1 : +1; } inline short StEpdHit::id() const { return mId; } inline int StEpdHit::position() const { return std::abs(mId / 100); } inline int StEpdHit::tile() const { return std::abs(mId % 100); } @@ -151,4 +190,11 @@ inline int StEpdHit::tac() const { return (mQTdata >> 12) & 0x0FFF; } inline int StEpdHit::tdc() const { return (mQTdata >> 24) & 0x001F; } inline bool StEpdHit::hasTac() const { return (mQTdata >> 29) & 0x1; } inline bool StEpdHit::isGood() const { return (mQTdata >> 30) & 0x1; } +inline void StEpdHit::setDEPdata(unsigned short DEPdata) { mDEPdata = DEPdata; } +inline void StEpdHit::setnMIP_DEP(float nMIP_DEP) { mnMIP_DEP = nMIP_DEP; } +inline int StEpdHit::depData() const { return mDEPdata; } +inline float StEpdHit::nMIP_DEP() const { return mnMIP_DEP; } +inline bool StEpdHit::qtDataAvailable() const { return adc() != 0; } +inline float StEpdHit::nMIP_QT() const { return mnMIP; } +inline void StEpdHit::setnMIP_QT(float nMIP_QT) { mnMIP = nMIP_QT; } #endif diff --git a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx index 46479196d45..6335833ba9a 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx @@ -24,6 +24,9 @@ * the StEpdHit object in StEvent * * - Mike Lisa Jan 2018 + * + * - Updated March 2023 - Mike Lisa - see header for details. + * ************************************************/ #include "StEvent/StEpdHit.h" @@ -37,19 +40,21 @@ StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0){ StMuEpdHit::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) : + Int_t TDC, bool hasTAC, Float_t nMIP_QT, + bool statusIsGood, Int_t truthId, + UShort_t DEPdata, Float_t nMIP_DEP) : mId( (100*position + tile)*EW ), mQTdata( (ADC & 0x0FFF) | (TAC & 0x0FFF) << 12 | (TDC & 0x001F) << 24 | hasTAC << 29 | statusIsGood << 30 ), - mnMIP(nMIP), - mTruthId(truthId) + mnMIP(nMIP_QT), + mTruthId(truthId), + mDEPdata(DEPdata), + mnMIP_DEP(nMIP_DEP) { /* no-op */ } StMuEpdHit::StMuEpdHit(StEpdHit* epdHit) : - mId(epdHit->id()), mQTdata(epdHit->qtData()), mnMIP(epdHit->nMIP()), mTruthId(epdHit->idTruth()) + mId(epdHit->id()), mQTdata(epdHit->qtData()), mnMIP(epdHit->nMIP_QT()), mTruthId(epdHit->idTruth()), mDEPdata(epdHit->depData()), mnMIP_DEP(epdHit->nMIP_DEP()) { /* no-op */ } - diff --git a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h index 3431a3964a6..193f485028d 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h @@ -27,6 +27,17 @@ * the StEpdHit object in StEvent * * - Mike Lisa Jan 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 StEpdHit; @@ -44,10 +55,12 @@ class StMuEpdHit : public StObject /// \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/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 truthId id of particle most responsible for energy loss (simulation) - 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); + /// \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 + 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 = 0, Float_t nMIP_DEP = 0); /// constructor based on StEpdHit /// this is what will be used in constructing the StMuDst from the StEvent @@ -93,14 +106,32 @@ class StMuEpdHit : public StObject /// \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 - void SetnMIP(Float_t nMIP){mnMIP = nMIP;} + void SetnMIP(Float_t nMIP) { mnMIP = nMIP; } + /// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data - March 2023 + void setnMIP_QT(Float_t nMIP_QT) { mnMIP = nMIP_QT; } /// set the id of particle most responsible for energy loss in tile (monte carlo) - void setIdTruth(Int_t id){mTruthId = id;} + void setIdTruth(Int_t id) { mTruthId = id; } /// returns the particle number for the particle most responsible for energy loss (monte carlo) Int_t idTruth(){return mTruthId;} + // 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 mnMIP_DEP; } + /// true if there is QT information available for this (will be false for sure at high rates on west side) + bool qtDataAvailable() const; + /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data + Float_t nMIP_QT() const { return mnMIP; } + /// 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 { return qtDataAvailable() ? mnMIP : mnMIP_DEP; } + protected: /// Packed channel Id: @@ -113,13 +144,19 @@ class StMuEpdHit : public StObject /// 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 Float_t mnMIP; + /// 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; + /// greatest contributer to energy deposition (MC) Int_t mTruthId; - ClassDef(StMuEpdHit, 1) + ClassDef(StMuEpdHit, 2) }; inline Short_t StMuEpdHit::side() const { return mId < 0 ? -1 : +1;} @@ -133,4 +170,6 @@ inline Int_t StMuEpdHit::tac() const { return (mQTdata >> 12) & 0x0FFF; } inline Int_t StMuEpdHit::tdc() const { return (mQTdata >> 24) & 0x001F; } inline bool StMuEpdHit::hasTac() const { return (mQTdata >> 29) & 0x1; } inline bool StMuEpdHit::isGood() const { return (mQTdata >> 30) & 0x1; } +inline bool StMuEpdHit::qtDataAvailable() const { return adc() != 0; } + #endif diff --git a/StRoot/StPicoDstMaker/StPicoDstMaker.cxx b/StRoot/StPicoDstMaker/StPicoDstMaker.cxx index 8cbded354f4..0ce3129ce29 100644 --- a/StRoot/StPicoDstMaker/StPicoDstMaker.cxx +++ b/StRoot/StPicoDstMaker/StPicoDstMaker.cxx @@ -2361,7 +2361,7 @@ void StPicoDstMaker::fillEpdHits() { StMuEpdHit* aHit = mMuDst->epdHit(i); if (!aHit) continue; int counter = mPicoArrays[StPicoArrays::EpdHit]->GetEntries(); - new((*(mPicoArrays[StPicoArrays::EpdHit]))[counter]) StPicoEpdHit(aHit->id(), aHit->qtData(), aHit->nMIP()); + new((*(mPicoArrays[StPicoArrays::EpdHit]))[counter]) StPicoEpdHit(aHit->id(), aHit->qtData(), aHit->nMIP_QT(), aHit->depData(), aHit->nMIP_DEP()); // added DEP info - March 2023 - mike lisa } //for (unsigned int i=0; i < mMuDst->numberOfEpdHit(); i++) } diff --git a/StRoot/StPicoEvent/StPicoEpdHit.cxx b/StRoot/StPicoEvent/StPicoEpdHit.cxx index 0b4d11e4ec7..3124cc61e36 100644 --- a/StRoot/StPicoEvent/StPicoEpdHit.cxx +++ b/StRoot/StPicoEvent/StPicoEpdHit.cxx @@ -29,12 +29,14 @@ * 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 */ } @@ -42,17 +44,17 @@ StPicoEpdHit::StPicoEpdHit() : TObject(), mId(0), mQTdata(0), mnMIP(0) { 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 */ } @@ -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; } //_________________ @@ -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; } diff --git a/StRoot/StPicoEvent/StPicoEpdHit.h b/StRoot/StPicoEvent/StPicoEpdHit.h index 50ca177eb59..e323133e9b3 100644 --- a/StRoot/StPicoEvent/StPicoEpdHit.h +++ b/StRoot/StPicoEvent/StPicoEpdHit.h @@ -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 { @@ -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 @@ -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. @@ -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: @@ -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