Skip to content

Commit 0b08e55

Browse files
authored
Merge pull request #47824 from bsunanda/Phase2-hgx363E
Phase2-hgx363E Modify the debug statements to enable the testing of the crash in the Digi step for 34034.0
2 parents 54bdb76 + f5d2639 commit 0b08e55

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

SimCalorimetry/HGCalSimProducers/src/HGCFEElectronics.cc

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "vdt/vdtMath.h"
77

88
using namespace hgc_digi;
9-
#define EDM_ML_DEBUG
9+
//#define EDM_ML_DEBUG
1010

1111
//
1212
template <class DFr>
@@ -29,7 +29,9 @@ HGCFEElectronics<DFr>::HGCFEElectronics(const edm::ParameterSet& ps)
2929
eventTimeOffset_ns_{{0.02, 0.02, 0.02}},
3030
noise_fC_{},
3131
toaMode_(WEIGHTEDBYE) {
32-
edm::LogVerbatim("HGCFE") << "[HGCFEElectronics] running with version " << fwVersion_ << std::endl;
32+
#ifdef EDM_ML_DEBUG
33+
edm::LogVerbatim("HGCFE") << "[HGCFEElectronics] running with version " << fwVersion_;
34+
#endif
3335
if (ps.exists("adcPulse")) {
3436
auto temp = ps.getParameter<std::vector<double> >("adcPulse");
3537
for (unsigned i = 0; i < temp.size(); ++i) {
@@ -48,17 +50,20 @@ HGCFEElectronics<DFr>::HGCFEElectronics(const edm::ParameterSet& ps)
4850
uint32_t adcNbits = ps.getParameter<uint32_t>("adcNbits");
4951
adcSaturation_fC_ = ps.getParameter<double>("adcSaturation_fC");
5052
adcLSB_fC_ = adcSaturation_fC_ / pow(2., adcNbits);
53+
#ifdef EDM_ML_DEBUG
5154
edm::LogVerbatim("HGCFE") << "[HGCFEElectronics] " << adcNbits << " bit ADC defined"
52-
<< " with LSB=" << adcLSB_fC_ << " saturation to occur @ " << adcSaturation_fC_
53-
<< std::endl;
55+
<< " with LSB=" << adcLSB_fC_ << " saturation to occur @ " << adcSaturation_fC_;
56+
#endif
5457
}
5558

5659
if (ps.exists("tdcNbits")) {
5760
tdcNbits_ = ps.getParameter<uint32_t>("tdcNbits");
5861
setTDCfsc(ps.getParameter<double>("tdcSaturation_fC"));
62+
#ifdef EDM_ML_DEBUG
5963
edm::LogVerbatim("HGCFE") << "[HGCFEElectronics] " << tdcNbits_ << " bit TDC defined with LSB=" << tdcLSB_fC_
6064
<< " saturation to occur @ " << tdcSaturation_fC_
61-
<< " (NB lowered by 1 part in a million)" << std::endl;
65+
<< " (NB lowered by 1 part in a million)";
66+
#endif
6267
}
6368
if (ps.exists("targetMIPvalue_ADC"))
6469
targetMIPvalue_ADC_ = ps.getParameter<uint32_t>("targetMIPvalue_ADC");
@@ -116,7 +121,7 @@ void HGCFEElectronics<DFr>::runTrivialShaper(
116121
#endif
117122

118123
if (debug)
119-
edm::LogVerbatim("HGCFE") << "[runTrivialShaper]" << std::endl;
124+
edm::LogVerbatim("HGCFE") << "[runTrivialShaper]";
120125

121126
if (lsbADC < 0)
122127
lsbADC = adcLSB_fC_;
@@ -139,7 +144,7 @@ void HGCFEElectronics<DFr>::runTrivialShaper(
139144
if (debug) {
140145
std::ostringstream msg;
141146
dataFrame.print(msg);
142-
edm::LogVerbatim("HGCFE") << msg.str() << std::endl;
147+
edm::LogVerbatim("HGCFE") << msg.str();
143148
}
144149
}
145150

@@ -197,7 +202,7 @@ void HGCFEElectronics<DFr>::runSimpleShaper(DFr& dataFrame,
197202
if (debug) {
198203
std::ostringstream msg;
199204
dataFrame.print(msg);
200-
edm::LogVerbatim("HGCFE") << msg.str() << std::endl;
205+
edm::LogVerbatim("HGCFE") << msg.str();
201206
}
202207
}
203208

@@ -264,7 +269,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
264269

265270
//now look at charge
266271
//first identify bunches which will trigger ToT
267-
//if(debug_state) edm::LogVerbatim("HGCFE") << "[runShaperWithToT]" << std::endl;
272+
//if(debug_state) edm::LogVerbatim("HGCFE") << "[runShaperWithToT]";
268273
for (int it = 0; it < (int)(chargeColl.size()); ++it) {
269274
debug = debug_state;
270275
//if already flagged as busy it can't be re-used to trigger the ToT
@@ -287,8 +292,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
287292
totFlags[it] = true;
288293

289294
if (debug)
290-
edm::LogVerbatim("HGCFE") << "\t q=" << charge << " fC with <toa>=" << toa << " ns, triggers ToT @ " << it
291-
<< std::endl;
295+
edm::LogVerbatim("HGCFE") << "\t q=" << charge << " fC with <toa>=" << toa << " ns, triggers ToT @ " << it;
292296

293297
//compute total charge to be integrated and integration time
294298
//needs a loop as ToT will last as long as there is charge to dissipate
@@ -328,11 +332,9 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
328332
//update charge integrated during ToT
329333
if (debug) {
330334
if (busyBxs == 0)
331-
edm::LogVerbatim("HGCFE") << "\t Intial busy estimate=" << integTime << " ns = " << newBusyBxs << " bxs"
332-
<< std::endl;
335+
edm::LogVerbatim("HGCFE") << "\t Intial busy estimate=" << integTime << " ns = " << newBusyBxs << " bxs";
333336
else
334-
edm::LogVerbatim("HGCFE") << "\t ...integrated charge overflows initial busy estimate, interating again"
335-
<< std::endl;
337+
edm::LogVerbatim("HGCFE") << "\t ...integrated charge overflows initial busy estimate, interating again";
336338
}
337339

338340
//update number of busy bunches
@@ -356,7 +358,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
356358

357359
if (debug)
358360
edm::LogVerbatim("HGCFE") << "\t\t leaking " << chargeColl[jt] << " fC @ deltaT=-" << deltaT << " -> +"
359-
<< leakCharge << " with avgT=" << pulseAvgT_[deltaT + 2] << std::endl;
361+
<< leakCharge << " with avgT=" << pulseAvgT_[deltaT + 2];
360362
}
361363

362364
//add contamination from posterior bunches
@@ -369,7 +371,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
369371
if (extraCharge == 0.f)
370372
continue;
371373
if (debug)
372-
edm::LogVerbatim("HGCFE") << "\t\t adding " << extraCharge << " fC @ deltaT=+" << (jt - it) << std::endl;
374+
edm::LogVerbatim("HGCFE") << "\t\t adding " << extraCharge << " fC @ deltaT=+" << (jt - it);
373375

374376
totalCharge += extraCharge;
375377
if (toaMode_ == WEIGHTEDBYE)
@@ -386,7 +388,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
386388
if (debug)
387389
edm::LogVerbatim("HGCFE") << "\t Final busy estimate=" << integTime << " ns = " << busyBxs << " bxs" << std::endl
388390
<< "\t Total integrated=" << totalCharge << " fC <toa>=" << toaFromToT[it]
389-
<< " (raw=" << finalToA << ") ns " << std::endl;
391+
<< " (raw=" << finalToA << ") ns ";
390392

391393
//last fC (tdcOnset) are dissipated trough pulse
392394
if (it + busyBxs < (int)(newCharge.size())) {
@@ -396,7 +398,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
396398
edm::LogVerbatim("HGCFE") << "\t Leaking remainder of TDC onset " << tdcOnset << " fC, to be dissipated in "
397399
<< deltaT2nextBx << " DeltaT/tau=" << deltaT2nextBx << " / "
398400
<< tdcChargeDrainParameterisation_[11] << " ns, adds " << tdcOnsetLeakage << " fC @ "
399-
<< it + busyBxs << " bx (first free bx)" << std::endl;
401+
<< it + busyBxs << " bx (first free bx)";
400402
newCharge[it + busyBxs] += tdcOnsetLeakage;
401403
}
402404
}
@@ -479,7 +481,7 @@ void HGCFEElectronics<DFr>::runShaperWithToT(DFr& dataFrame,
479481
if (debug) {
480482
std::ostringstream msg;
481483
dataFrame.print(msg);
482-
edm::LogVerbatim("HGCFE") << msg.str() << std::endl;
484+
edm::LogVerbatim("HGCFE") << msg.str();
483485
}
484486
}
485487

0 commit comments

Comments
 (0)