1212 If it is not there, it creates one and fills it from the
1313 StTriggerData object and info from the StEpdDbMaker (database)
1414
15+
16+ Update March 2023 - Mike Lisa
17+ Updated to pull DEP information from the TriggerData and store in the newly-updated StEpdHit object
18+
1519*/
1620
1721#include " StEpdHitMaker.h"
@@ -198,6 +202,10 @@ void StEpdHitMaker::FillStEpdData(){
198202
199203 int truthId=0 ; // this is for simulation
200204
205+ // March 2023 - now add DEP information
206+ unsigned short rawDEP;
207+ float calibratedDEP;
208+ getEpdDepInfo (ew, PP, TT, rawDEP, calibratedDEP);
201209
202210 // EpdOfs2 << ew << "\t" << PP << "\t" << TT << "\t"
203211 // << mEpdDbMaker->GetCrateAdc(ew,PP,TT) << "\t"
@@ -208,9 +216,19 @@ void StEpdHitMaker::FillStEpdData(){
208216 // << mEpdDbMaker->GetChannelTac(ew,PP,TT) << "\t"
209217 // << ADC << "\t" << nMIP << endl;
210218
211- StEpdHit* hit = new StEpdHit (PP,TT,EWforHit,ADC,TAC,TDC,HasTac,nMIP,isGood,truthId);
219+ StEpdHit* hit = new StEpdHit (PP, TT, EWforHit, ADC, TAC, TDC, HasTac, nMIP, isGood, truthId, rawDEP, calibratedDEP );
212220 mEpdCollection ->addHit (hit);
213221 nHitsAdded++;
222+ } // if ADC>0
223+ else { // even if there is no ADC from the QT, there might still be info from the DEP - March 2023
224+ unsigned short rawDEP;
225+ float calibratedDEP;
226+ getEpdDepInfo (ew, PP, TT, rawDEP, calibratedDEP);
227+ if (rawDEP > 0 ) {
228+ StEpdHit* hit = new StEpdHit ((int )PP, (int )TT, EWforHit, 0 , 0 , 0 , false , 0 , true , 0 , rawDEP, calibratedDEP);
229+ mEpdCollection ->addHit (hit);
230+ nHitsAdded++;
231+ }
214232 }
215233 }
216234 }
@@ -223,3 +241,23 @@ void StEpdHitMaker::FillStEpdData(){
223241 LOG_INFO << " StEpdHitMaker::FillStEpdData - added " << nHitsAdded << " to StEpdHitCollection" << endm;
224242}
225243
244+
245+ // March 2023 - get DEP data
246+ void StEpdHitMaker::getEpdDepInfo (short ew, short pp, short tt, unsigned short & rawDEP, float & calibratedDEP){
247+ if (ew == 0 ) { rawDEP = 0 ; calibratedDEP = 0 .; return ;} // only DEP on the west side
248+
249+ // -------------------------- March 2023 ---------------------------------
250+ // Here is where I must fill in the code to
251+ // 1) Get the raw DEP waveform from the TriggerData
252+ // 2) Sum up the appropriate time buckets (this is DEPdata)
253+ // 3) Get the gain constant from the database (which needs to exist!!!)
254+ // 4) mnMIP_DEP = DEPdata / gain
255+ // 5) put mnMIP_DEP and rawDEPdata into the StEpdHit
256+ //
257+ // 6) might want to impose a "zero suppression threshold" here, too
258+
259+ // right now I just return zero
260+ rawDEP = 0 ;
261+ calibratedDEP = 0.0 ;
262+ return ;
263+ }
0 commit comments