From f76f41de801731479312ceb2d8a7a7db97d4d3b4 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 10:41:32 -0400 Subject: [PATCH 1/7] Update StEpdHit to include the DEP information --- StRoot/StEvent/StEpdHit.cxx | 16 ++++++--- StRoot/StEvent/StEpdHit.h | 69 +++++++++++++++++++++++++++++++------ 2 files changed, 69 insertions(+), 16 deletions(-) diff --git a/StRoot/StEvent/StEpdHit.cxx b/StRoot/StEvent/StEpdHit.cxx index c0e7726c62b..477b9169e13 100644 --- a/StRoot/StEvent/StEpdHit.cxx +++ b/StRoot/StEvent/StEpdHit.cxx @@ -24,19 +24,25 @@ ClassImp(StEpdHit); -StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0) +StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0) { /* no-op */ } +// March 2023: +// * add arguments for DEPdata and nMIP_DEP +// * rename nMIP to nMIP_QT 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_QT(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..f05a56eccf5 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_QT gain-calibrated signal from QT; energy loss in terms of MPV of Landau for a MIP - renamed from nMIP March 2023 /// \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, float nMIP_DEP); // 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 - void setnMIP(float nMIP); + /// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data + /// I have RENAMED this method from "setnMIP" to "setnMIP_QT". I know such actions are to be minimized, + /// but I do not believe this will cause any + /// problems for the outside user. And it is simply safer. - March 2023 + void setnMIP_QT(float nMIP_QT); /// set identifier of particle most responsible for energy loss (simulation) void setIdTruth(int id); @@ -115,6 +129,25 @@ 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,24 +155,31 @@ 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 - Float_t mnMIP; + /// important: prior to 2023, the ONLY information came from the QTs. Now we also have the DEP + /// So, this variable has been RENAMED from mnMIP to mnMIP_QT. I believe it the safest way - March 2023 + Float_t mnMIP_QT; /// 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 float StEpdHit::nMIP() const {return (this->qtDataAvailable())?mnMIP_QT:mnMIP_DEP;} // March 2023 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;} @@ -151,4 +191,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 (this->adc()!=0);} +inline float StEpdHit::nMIP_QT() const {return mnMIP_QT;} +inline void StEpdHit::setnMIP_QT(float nMIP_QT){mnMIP_QT=nMIP_QT;} #endif From 8f881120cd7afb87e407e832f5b3b3d48e0c89a1 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 16:20:32 -0400 Subject: [PATCH 2/7] do not rename data member in IO class [skip ci] --- StRoot/StEvent/StEpdHit.cxx | 5 ++--- StRoot/StEvent/StEpdHit.h | 16 +++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/StRoot/StEvent/StEpdHit.cxx b/StRoot/StEvent/StEpdHit.cxx index 477b9169e13..fa52e79d450 100644 --- a/StRoot/StEvent/StEpdHit.cxx +++ b/StRoot/StEvent/StEpdHit.cxx @@ -31,15 +31,14 @@ StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0) // March 2023: // * add arguments for DEPdata and nMIP_DEP -// * rename nMIP to nMIP_QT StEpdHit::StEpdHit(int position, int tile, short EW, int ADC, int TAC, - int TDC, bool hasTAC, float nMIP_QT, + int TDC, bool hasTAC, float nMIP, 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_QT(nMIP_QT), + mnMIP(nMIP), mTruthId(truthId), mDEPdata(DEPdata), mnMIP_DEP(nMIP_DEP) diff --git a/StRoot/StEvent/StEpdHit.h b/StRoot/StEvent/StEpdHit.h index f05a56eccf5..10a811ea237 100644 --- a/StRoot/StEvent/StEpdHit.h +++ b/StRoot/StEvent/StEpdHit.h @@ -62,7 +62,7 @@ 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_QT gain-calibrated signal from QT; energy loss in terms of MPV of Landau for a MIP - renamed from nMIP March 2023 + /// \param nMIP 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) /// \param DEPdata raw DEP data, in summed ADCs - added May 2023 @@ -118,10 +118,8 @@ class StEpdHit : public StObject void setQTdata(int packedData); /// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data - /// I have RENAMED this method from "setnMIP" to "setnMIP_QT". I know such actions are to be minimized, - /// but I do not believe this will cause any - /// problems for the outside user. And it is simply safer. - March 2023 void setnMIP_QT(float nMIP_QT); + void setnMIP(float nMIP); /// set identifier of particle most responsible for energy loss (simulation) void setIdTruth(int id); @@ -162,8 +160,7 @@ class StEpdHit : public StObject /// 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 - /// So, this variable has been RENAMED from mnMIP to mnMIP_QT. I believe it the safest way - March 2023 - Float_t mnMIP_QT; + Float_t mnMIP; /// identifier of particle most responsible for energy loss (simulation) Int_t mTruthId; @@ -178,8 +175,9 @@ class StEpdHit : public StObject }; inline int StEpdHit::qtData() const {return mQTdata;} -inline float StEpdHit::nMIP() const {return (this->qtDataAvailable())?mnMIP_QT:mnMIP_DEP;} // March 2023 +inline float StEpdHit::nMIP() const {return (this->qtDataAvailable())?mnMIP:mnMIP_DEP;} // March 2023 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;} @@ -196,6 +194,6 @@ 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 (this->adc()!=0);} -inline float StEpdHit::nMIP_QT() const {return mnMIP_QT;} -inline void StEpdHit::setnMIP_QT(float nMIP_QT){mnMIP_QT=nMIP_QT;} +inline float StEpdHit::nMIP_QT() const {return mnMIP;} +inline void StEpdHit::setnMIP_QT(float nMIP_QT){mnMIP=nMIP_QT;} #endif From e7fca624f7d0cb35c13fc05844435d6214d06b3b Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 16:42:23 -0400 Subject: [PATCH 3/7] minor white space adjustments [skip ci] --- StRoot/StEvent/StEpdHit.cxx | 4 ++-- StRoot/StEvent/StEpdHit.h | 31 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/StRoot/StEvent/StEpdHit.cxx b/StRoot/StEvent/StEpdHit.cxx index fa52e79d450..a7cd687e966 100644 --- a/StRoot/StEvent/StEpdHit.cxx +++ b/StRoot/StEvent/StEpdHit.cxx @@ -33,12 +33,12 @@ StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0) // * 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, + 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), + mnMIP(nMIP_QT), mTruthId(truthId), mDEPdata(DEPdata), mnMIP_DEP(nMIP_DEP) diff --git a/StRoot/StEvent/StEpdHit.h b/StRoot/StEvent/StEpdHit.h index 10a811ea237..b15692304b5 100644 --- a/StRoot/StEvent/StEpdHit.h +++ b/StRoot/StEvent/StEpdHit.h @@ -118,8 +118,8 @@ class StEpdHit : public StObject void setQTdata(int packedData); /// \param gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data - void setnMIP_QT(float nMIP_QT); void setnMIP(float nMIP); + void setnMIP_QT(float nMIP_QT); /// set identifier of particle most responsible for energy loss (simulation) void setIdTruth(int id); @@ -145,7 +145,6 @@ class StEpdHit : public StObject /// returns true if there is QT data stored - added March 2023 bool qtDataAvailable() const; - protected: /// Packed channel Id: @@ -174,13 +173,13 @@ class StEpdHit : public StObject ClassDef(StEpdHit, 2) }; -inline int StEpdHit::qtData() const {return mQTdata;} -inline float StEpdHit::nMIP() const {return (this->qtDataAvailable())?mnMIP:mnMIP_DEP;} // March 2023 -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); } @@ -189,11 +188,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 (this->adc()!=0);} -inline float StEpdHit::nMIP_QT() const {return mnMIP;} -inline void StEpdHit::setnMIP_QT(float nMIP_QT){mnMIP=nMIP_QT;} +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 From 266814aeb729cda52f896a605ce35440c03df5f0 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 17:13:46 -0400 Subject: [PATCH 4/7] restore original constructor [skip ci] --- StRoot/StEvent/StEpdHit.cxx | 14 ++++++++++++-- StRoot/StEvent/StEpdHit.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/StRoot/StEvent/StEpdHit.cxx b/StRoot/StEvent/StEpdHit.cxx index a7cd687e966..e38cd2e2afc 100644 --- a/StRoot/StEvent/StEpdHit.cxx +++ b/StRoot/StEvent/StEpdHit.cxx @@ -29,6 +29,18 @@ StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0) /* no-op */ } +StEpdHit::StEpdHit(int position, int tile, + short EW, int ADC, int TAC, + int TDC, bool hasTAC, float nMIP, + bool statusIsGood, int truthId) : + mId( (100*position + tile)*EW ), + mQTdata( (ADC & 0x0FFF) | (TAC & 0x0FFF) << 12 | (TDC & 0x001F) << 24 | hasTAC << 29 | statusIsGood << 30 ), + mnMIP(nMIP), + mTruthId(truthId) +{ + /* no-op */ +} + // March 2023: // * add arguments for DEPdata and nMIP_DEP StEpdHit::StEpdHit(int position, int tile, @@ -45,5 +57,3 @@ StEpdHit::StEpdHit(int position, int tile, { /* no-op */ } - - diff --git a/StRoot/StEvent/StEpdHit.h b/StRoot/StEvent/StEpdHit.h index b15692304b5..e99a90d2cce 100644 --- a/StRoot/StEvent/StEpdHit.h +++ b/StRoot/StEvent/StEpdHit.h @@ -65,6 +65,7 @@ class StEpdHit : public StObject /// \param nMIP 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_QT, 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, float nMIP_DEP); From 4021e6983ead23f21bcab133eaf9b2c413db8a61 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 17:19:15 -0400 Subject: [PATCH 5/7] delegate constructor --- StRoot/StEvent/StEpdHit.cxx | 8 ++------ StRoot/StEvent/StEpdHit.h | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/StRoot/StEvent/StEpdHit.cxx b/StRoot/StEvent/StEpdHit.cxx index e38cd2e2afc..bfb8e409a99 100644 --- a/StRoot/StEvent/StEpdHit.cxx +++ b/StRoot/StEvent/StEpdHit.cxx @@ -24,7 +24,7 @@ ClassImp(StEpdHit); -StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0) +StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0) { /* no-op */ } @@ -32,11 +32,7 @@ StEpdHit::StEpdHit() : StEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0) StEpdHit::StEpdHit(int position, int tile, short EW, int ADC, int TAC, int TDC, bool hasTAC, float nMIP, - bool statusIsGood, int truthId) : - mId( (100*position + tile)*EW ), - mQTdata( (ADC & 0x0FFF) | (TAC & 0x0FFF) << 12 | (TDC & 0x001F) << 24 | hasTAC << 29 | statusIsGood << 30 ), - mnMIP(nMIP), - mTruthId(truthId) + bool statusIsGood, int truthId) : StEpdHit(position, tile, EW, ADC, TAC, TDC, hasTAC, nMIP, statusIsGood, truthId, 0, 0) { /* no-op */ } diff --git a/StRoot/StEvent/StEpdHit.h b/StRoot/StEvent/StEpdHit.h index e99a90d2cce..9956bf19e02 100644 --- a/StRoot/StEvent/StEpdHit.h +++ b/StRoot/StEvent/StEpdHit.h @@ -65,7 +65,7 @@ class StEpdHit : public StObject /// \param nMIP 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_QT, bool statusIsGood, int truthId); + 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, float nMIP_DEP); From 1186ce660dc9e4ecac1e82b9d0c17b970477a7c6 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 10:52:36 -0400 Subject: [PATCH 6/7] Update StMuEpdHit to include the DEP information --- StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx | 18 +++++--- StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h | 56 ++++++++++++++++++----- 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx index 46479196d45..ec0540f74b9 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" @@ -31,24 +34,27 @@ ClassImp(StMuEpdHit) -StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0){ +StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0){ /* no-op */ } 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_QT(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_QT(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..bce2bad03f7 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_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, Float_t nMIP_DEP); /// constructor based on StEpdHit /// this is what will be used in constructing the StMuDst from the StEvent @@ -77,8 +90,6 @@ class StMuEpdHit : public StObject /// bit 29=0/1 for has/does not have TAC; /// bit 30=0/1 if tile is marked bad/good in database Int_t qtData() {return mQTdata;} - /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - Float_t nMIP() {return mnMIP;} /// false if tile is bad or missing, according to (time-dependent) database bool isGood() const; @@ -92,15 +103,30 @@ class StMuEpdHit : public StObject /// 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 - 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_QT = nMIP_QT;} /// set the id of particle most responsible for energy loss in tile (monte carlo) 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_QT;} + /// 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 (this->qtDataAvailable())?mnMIP_QT:mnMIP_DEP;} + + protected: /// Packed channel Id: @@ -113,13 +139,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 - Float_t mnMIP; + /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT + Float_t mnMIP_QT; + + /// 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 +165,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 (this->adc()!=0);} + #endif From e9b00057f907c21ca799d44ea8170f060e92f4bb Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 24 Mar 2023 14:44:59 -0400 Subject: [PATCH 7/7] do not rename data member, delegate constructor --- StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx | 16 ++++++++++++---- StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h | 12 +++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx index ec0540f74b9..300179870dd 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx +++ b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.cxx @@ -34,18 +34,26 @@ ClassImp(StMuEpdHit) -StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0, 0, 0.0){ +StMuEpdHit::StMuEpdHit() : StMuEpdHit(0, 0, 0, 0, 0, 0, false, 0.0, false, 0){ /* no-op */ } 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_QT, + Int_t TDC, bool hasTAC, Float_t nMIP, + bool statusIsGood, Int_t truthId) : StMuEpdHit(position, tile, EW, ADC, TAC, TDC, hasTAC, nMIP, statusIsGood, truthId, 0, 0) +{ + /* no-op */ +} + +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, 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_QT(nMIP_QT), + mnMIP(nMIP), mTruthId(truthId), mDEPdata(DEPdata), mnMIP_DEP(nMIP_DEP) @@ -54,7 +62,7 @@ StMuEpdHit::StMuEpdHit(Int_t position, Int_t tile, } StMuEpdHit::StMuEpdHit(StEpdHit* epdHit) : - mId(epdHit->id()), mQTdata(epdHit->qtData()), mnMIP_QT(epdHit->nMIP_QT()), mTruthId(epdHit->idTruth()), mDEPdata(epdHit->depData()), mnMIP_DEP(epdHit->nMIP_DEP()) + 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 bce2bad03f7..af6741ddf05 100644 --- a/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h +++ b/StRoot/StMuDSTMaker/COMMON/StMuEpdHit.h @@ -55,9 +55,10 @@ 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_QT gain-calibrated signal; energy loss in terms of MPV of Landau for a MIP - based on QT data + /// \param nMIP 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, Float_t nMIP_DEP); @@ -90,6 +91,8 @@ class StMuEpdHit : public StObject /// bit 29=0/1 for has/does not have TAC; /// bit 30=0/1 if tile is marked bad/good in database Int_t qtData() {return mQTdata;} + /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP + Float_t nMIP() {return mnMIP;} /// false if tile is bad or missing, according to (time-dependent) database bool isGood() const; @@ -103,10 +106,14 @@ class StMuEpdHit : public StObject /// 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 + 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_QT = nMIP_QT;} /// set the id of particle most responsible for energy loss in tile (monte carlo) 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;} @@ -126,7 +133,6 @@ class StMuEpdHit : public StObject /// 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 (this->qtDataAvailable())?mnMIP_QT:mnMIP_DEP;} - protected: /// Packed channel Id: @@ -140,7 +146,7 @@ class StMuEpdHit : public StObject Int_t mQTdata; /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT - Float_t mnMIP_QT; + Float_t mnMIP; /// raw DEP data - March 2023 UShort_t mDEPdata;