Skip to content
Snippets Groups Projects
Commit 50da8522 authored by Eric Torrence's avatar Eric Torrence
Browse files

add some debug monitoring

parent cf41fa45
No related branches found
No related tags found
16 merge requests!197Reco Script update for Segment Finder,!194Reco script update,!176Waveform Reco updates,!175Waveform reco update,!173Update production to latest master,!167Catch raw data format errors,!166Waveform raw integral bug,!165Reco scripts,!162Production Reco Scripts,!161Add waveform identifiers, configure digitizer channels,!159Move Waveform code to its own major area,!157Catch error on truncated events,!155Cluster Limit,!138Made NoisyStripFinder package,!134Added raw data reconstruction tests to pipeline,!123Waveform reconstruction bugfix
......@@ -64,7 +64,8 @@ ClockReconstructionTool::reconstruct(const ScintWaveform& raw_wave,
ATH_MSG_DEBUG("Created double array with length " << wave.size() );
ATH_MSG_DEBUG("First 10 elements:");
for (unsigned int i=0; i < std::min(10, N); i++)
for (int i=0; i < std::min(10, N); i++)
ATH_MSG_DEBUG(" " << i << " " << wave[i]);
// delta_nu = 1/T where T is the total waveform length
......@@ -138,5 +139,29 @@ ClockReconstructionTool::reconstruct(const ScintWaveform& raw_wave,
delete fftr2c;
if (m_checkResult) checkResult(raw_wave, clockdata);
return StatusCode::SUCCESS;
}
void
ClockReconstructionTool::checkResult(const ScintWaveform& raw_wave,
xAOD::WaveformClock* clockdata) const {
// Go through each element in raw_wave and make sure time in clockdata matches
float time;
for (unsigned int i=0; i<raw_wave.adc_counts().size(); i++) {
time = 2.*i; // Time in ns
float dt = clockdata->time_from_clock(time);
// Is raw_wave HI or LO?
bool hi = raw_wave.adc_counts()[i] > clockdata->dc_offset();
// Check for mismatch
if (((dt < 12.5) && !hi) || ((dt > 12.5) && hi) )
ATH_MSG_WARNING("Clock Time:" << time << " dt:" << dt << " found" << hi);
}
}
......@@ -45,6 +45,12 @@ class ClockReconstructionTool: public extends<AthAlgTool, IClockReconstructionTo
/// Minimum samples in the input waveform array to try FFT
IntegerProperty m_minimumSamples{this, "MinimumSamples", 40};
/// Check reconstructed clock against waveform
BooleanProperty m_checkResult{this, "CheckResult", false};
void checkResult(const ScintWaveform& raw_wave,
xAOD::WaveformClock* clockdata) const;
};
#endif // SCINTRECTOOLS_CLOCKRECONSTRUCTIONTOOL_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment