From bf0fbd43dac58f3109a164152511e66928ddcc8f Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Mon, 20 Mar 2023 14:10:07 -0400 Subject: [PATCH] Update makers to pull DEP from TriggerData and store in StEpdHit --- StRoot/StEpdHitMaker/StEpdHitMaker.cxx | 40 +++++++++++++++++++++++- StRoot/StEpdHitMaker/StEpdHitMaker.h | 8 +++++ StRoot/StPicoDstMaker/StPicoDstMaker.cxx | 2 +- 3 files changed, 48 insertions(+), 2 deletions(-) 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/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++) }