From ca428485f4a86e2c078f856a0545ecc6e8125da7 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 17 Mar 2023 11:01:48 -0400 Subject: [PATCH] Update StPicoEpdHit to include the DEP information --- StRoot/StPicoDstMaker/StPicoDstMaker.cxx | 2 +- StRoot/StPicoEvent/StPicoEpdHit.cxx | 25 ++++---- StRoot/StPicoEvent/StPicoEpdHit.h | 63 ++++++++++++++++----- StRoot/StPicoEvent/macros/PicoDstAnalyzer.C | 10 ++++ 4 files changed, 76 insertions(+), 24 deletions(-) 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..4db6764e2c9 100644 --- a/StRoot/StPicoEvent/StPicoEpdHit.cxx +++ b/StRoot/StPicoEvent/StPicoEpdHit.cxx @@ -29,38 +29,43 @@ * 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() : TObject(), mId(0), mQTdata(0), mnMIP_QT(0), mDEPdata(0), mnMIP_DEP(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) : + Int_t TDC, Bool_t hasTAC, Float_t nMIP_QT, + 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_QT(nMIP_QT), 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_QT(nMIP_QT), mDEPdata(DEPdata), mnMIP_DEP(nMIP_DEP) { /* no-op */ } //_________________ StPicoEpdHit::StPicoEpdHit(const StPicoEpdHit &hit) : TObject() { - mId = hit.mId; - mQTdata = hit.mQTdata; - mnMIP = hit.mnMIP; + mId = hit.mId; + mQTdata = hit.mQTdata; + mnMIP_QT = hit.mnMIP_QT; + mDEPdata = hit.mDEPdata; + mnMIP_DEP = hit.mnMIP_DEP; } //_________________ @@ -70,5 +75,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_QT << " DEPdata: " << mDEPdata << " nMIP_DEP: " << mnMIP_DEP << endm; } diff --git a/StRoot/StPicoEvent/StPicoEpdHit.h b/StRoot/StPicoEvent/StPicoEpdHit.h index 50ca177eb59..63e8ce55f8c 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,20 @@ 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, Float_t nMIP_DEP); /// 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, Float_t nMIP_DEP); /// Copy constructor StPicoEpdHit(const StPicoEpdHit &hit); /// Destructor @@ -98,10 +114,6 @@ class StPicoEpdHit : public TObject { /// 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() const { return mQTdata; } - /// 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; } /// 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 +131,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 - 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 + void setnMIP_QT(Float_t nMIP_QT) { mnMIP_QT = 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 this->isGood() ? mnMIP_DEP : 0.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 this->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 this->isGood() ? mnMIP_QT : 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 (!this->isGood()) return 0.0; return (this->qtDataAvailable())?mnMIP_QT:mnMIP_DEP;} protected: @@ -134,10 +165,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 - Float_t mnMIP; + /// gain calibrated energy loss in tile, in units of Landau MPV for one MIP - based on QT data + 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; - ClassDef(StPicoEpdHit, 1) + ClassDef(StPicoEpdHit, 2) }; #endif diff --git a/StRoot/StPicoEvent/macros/PicoDstAnalyzer.C b/StRoot/StPicoEvent/macros/PicoDstAnalyzer.C index 222fe0aaba9..7995bc78b8e 100644 --- a/StRoot/StPicoEvent/macros/PicoDstAnalyzer.C +++ b/StRoot/StPicoEvent/macros/PicoDstAnalyzer.C @@ -39,6 +39,7 @@ #include "../StPicoEmcTrigger.h" #include "../StPicoBTofPidTraits.h" #include "../StPicoTrackCovMatrix.h" +#include "../StPicoEpdHit.h" // Load libraries (for ROOT_VERSTION_CODE >= 393215) #if ROOT_VERSION_CODE >= ROOT_VERSION(6,0,0) @@ -139,6 +140,9 @@ void PicoDstAnalyzer(const Char_t *inFile = "../files/st_physics_12126101_raw_30 TH1F *hBTofTrayHit = new TH1F("hBTofTrayHit","BTof tray number with the hit", 120, -0.5, 119.5); + // Epd - mal 13mar2023 + TH1F* hEpdHitsByPP = new TH1F("hEpdHitsByPP","Number of EPD hits by PP",25,-12.5,12.5); + TH1F* hEpdMult = new TH1F("hEpdMult","EPD hit multiplicity",800,0,800); // Loop over events for(Long64_t iEvent=0; iEvent