Skip to content

Commit

Permalink
Update makers to pull DEP from TriggerData and store in StEpdHit
Browse files Browse the repository at this point in the history
  • Loading branch information
plexoos committed Mar 24, 2023
1 parent d464e1b commit bf0fbd4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
40 changes: 39 additions & 1 deletion StRoot/StEpdHitMaker/StEpdHitMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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++;
}
}
}
}
Expand All @@ -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;
}
8 changes: 8 additions & 0 deletions StRoot/StEpdHitMaker/StEpdHitMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/


Expand Down Expand Up @@ -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;}

Expand Down
2 changes: 1 addition & 1 deletion StRoot/StPicoDstMaker/StPicoDstMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
}

Expand Down

0 comments on commit bf0fbd4

Please sign in to comment.