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

Fix missing trigger scintillators, add some counters to waveform reco, cleanup...

Fix missing trigger scintillators, add some counters to waveform reco, cleanup excessive INFO output
parent 5fb20c64
No related branches found
No related tags found
No related merge requests found
...@@ -46,10 +46,12 @@ if len(args.run_type) > 0: ...@@ -46,10 +46,12 @@ if len(args.run_type) > 0:
# i.e.: TestBeamData/Run-004150/Faser-Physics-004150-00000.raw" # i.e.: TestBeamData/Run-004150/Faser-Physics-004150-00000.raw"
else: else:
if len(filepath.parts) < 3: if len(filepath.parts) < 3:
print("Can't determine run type from path - specify on command line instead") print("Can't determine run type from path - guessing TI12Data!")
sys.exit(-1) print("If this is not correct, specify on command line")
runtype = "TI12Data"
runtype = filepath.parts[-3] else:
runtype = filepath.parts[-3]
# Fix TI12 geometry versions as well (needed in production) # Fix TI12 geometry versions as well (needed in production)
# Probably better to do this from configuration in upstream production scripts, # Probably better to do this from configuration in upstream production scripts,
......
...@@ -48,7 +48,7 @@ StatusCode FaserSCT_SpacePointContainerCnv::initialize() { ...@@ -48,7 +48,7 @@ StatusCode FaserSCT_SpacePointContainerCnv::initialize() {
FaserSCT_SpacePointContainer_PERS* FaserSCT_SpacePointContainer_PERS*
FaserSCT_SpacePointContainerCnv::createPersistent (FaserSCT_SpacePointContainer* transObj) { FaserSCT_SpacePointContainerCnv::createPersistent (FaserSCT_SpacePointContainer* transObj) {
ATH_MSG_INFO("FaserSCT_SpacePointContainerCnv::createPersistent()"); ATH_MSG_DEBUG("FaserSCT_SpacePointContainerCnv::createPersistent()");
FaserSCT_SpacePointContainerCnv_PERS converter; FaserSCT_SpacePointContainerCnv_PERS converter;
...@@ -60,7 +60,7 @@ FaserSCT_SpacePointContainerCnv::createPersistent (FaserSCT_SpacePointContainer* ...@@ -60,7 +60,7 @@ FaserSCT_SpacePointContainerCnv::createPersistent (FaserSCT_SpacePointContainer*
FaserSCT_SpacePointContainer* FaserSCT_SpacePointContainer*
FaserSCT_SpacePointContainerCnv::createTransient() { FaserSCT_SpacePointContainerCnv::createTransient() {
ATH_MSG_INFO("FaserSCT_SpacePointContainerCnv::createTransient()"); ATH_MSG_DEBUG("FaserSCT_SpacePointContainerCnv::createTransient()");
static const pool::Guid p0_guid("DB0397F9-A163-496F-BC17-C7E507A1FA50"); static const pool::Guid p0_guid("DB0397F9-A163-496F-BC17-C7E507A1FA50");
FaserSCT_SpacePointContainer* transObj(nullptr); FaserSCT_SpacePointContainer* transObj(nullptr);
......
...@@ -20,14 +20,13 @@ def WaveformReconstructionCfg(flags, naive = False): ...@@ -20,14 +20,13 @@ def WaveformReconstructionCfg(flags, naive = False):
if flags.Input.isMC and naive: if flags.Input.isMC and naive:
if "TB" not in flags.GeoModel.FaserVersion: if "TB" not in flags.GeoModel.FaserVersion:
acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoTimingHitWaveformRecAlg", "Trigger")) acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoTriggerHitWaveformRecAlg", "Trigger"))
acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoVetoHitToWaveformRecAlg", "Veto")) acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoVetoHitToWaveformRecAlg", "Veto"))
acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoPresehowerHitWaveformRecAlg", "Preshower")) acc.merge(PseudoScintHitToWaveformRecCfg(flags, "PseudoPresehowerHitWaveformRecAlg", "Preshower"))
acc.merge(PseudoCaloHitToWaveformRecCfg(flags, "PseudoCaloHitWaveformRecAlg")) acc.merge(PseudoCaloHitToWaveformRecCfg(flags, "PseudoCaloHitWaveformRecAlg"))
return acc return acc
if "TB" not in flags.GeoModel.FaserVersion: acc.merge(WaveformHitRecCfg(flags, "TriggerWaveformRecAlg", "Trigger"))
acc.merge(WaveformHitRecCfg(flags, "TimingWaveformRecAlg", "Trigger"))
acc.merge(WaveformHitRecCfg(flags, "VetoWaveformRecAlg", "Veto")) acc.merge(WaveformHitRecCfg(flags, "VetoWaveformRecAlg", "Veto"))
acc.merge(WaveformHitRecCfg(flags, "PreshowerWaveformRecAlg", "Preshower")) acc.merge(WaveformHitRecCfg(flags, "PreshowerWaveformRecAlg", "Preshower"))
acc.merge(WaveformHitRecCfg(flags, "CaloWaveformRecAlg", "Calo")) acc.merge(WaveformHitRecCfg(flags, "CaloWaveformRecAlg", "Calo"))
......
...@@ -29,6 +29,13 @@ StatusCode ...@@ -29,6 +29,13 @@ StatusCode
RawWaveformRecAlg::finalize() { RawWaveformRecAlg::finalize() {
ATH_MSG_INFO(name() << "::finalize()"); ATH_MSG_INFO(name() << "::finalize()");
ATH_MSG_INFO( m_numberOfEvents << " events processed" );
if ( m_numberOfEvents > 0) {
ATH_MSG_INFO( m_numberOfWaveforms << " waveforms found" );
ATH_MSG_INFO( m_numberOfOverflows << " overflows" );
ATH_MSG_INFO( m_numberOfFitErrors << " fit errors" );
}
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -74,6 +81,19 @@ RawWaveformRecAlg::execute(const EventContext& ctx) const { ...@@ -74,6 +81,19 @@ RawWaveformRecAlg::execute(const EventContext& ctx) const {
ATH_MSG_DEBUG("WaveformsHitContainer '" << hitContainerHandle.name() << "' filled with "<< hitContainerHandle->size() <<" items"); ATH_MSG_DEBUG("WaveformsHitContainer '" << hitContainerHandle.name() << "' filled with "<< hitContainerHandle->size() <<" items");
// Keep track of some statistics
m_numberOfEvents++;
for (const auto& hit : *(hitContainerHandle.ptr())) {
if (hit->status_bit(xAOD::WaveformStatus::THRESHOLD_FAILED)) continue;
m_numberOfWaveforms++;
if (hit->status_bit(xAOD::WaveformStatus::WAVE_OVERFLOW)) m_numberOfOverflows++;
if (hit->status_bit(xAOD::WaveformStatus::GFIT_FAILED)) {
m_numberOfFitErrors++;
} else if (hit->status_bit(xAOD::WaveformStatus::CBFIT_FAILED)) {
m_numberOfFitErrors++;
}
}
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -81,6 +81,19 @@ class RawWaveformRecAlg : public AthReentrantAlgorithm { ...@@ -81,6 +81,19 @@ class RawWaveformRecAlg : public AthReentrantAlgorithm {
{this, "WaveformHitContainerKey", ""}; {this, "WaveformHitContainerKey", ""};
//@} //@}
/**
* @name Counters
* Use mutable to be updated in const methods.
* AthReentrantAlgorithm is const during event processing.
* Use std::atomic to be multi-thread safe.
*/
//@{
mutable std::atomic<int> m_numberOfEvents{0};
mutable std::atomic<int> m_numberOfWaveforms{0};
mutable std::atomic<int> m_numberOfOverflows{0};
mutable std::atomic<int> m_numberOfFitErrors{0};
//@}
}; };
#endif // WAVERECALGS_RAWWAVEFORMRECALG_H #endif // WAVERECALGS_RAWWAVEFORMRECALG_H
...@@ -24,7 +24,7 @@ WaveClockRecAlg::initialize() { ...@@ -24,7 +24,7 @@ WaveClockRecAlg::initialize() {
StatusCode StatusCode
WaveClockRecAlg::finalize() { WaveClockRecAlg::finalize() {
ATH_MSG_INFO(name() << "::finalize()"); ATH_MSG_INFO(name() << "::finalize()");
ATH_MSG_INFO( m_numberOfEvents << " events processed" );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -83,6 +83,9 @@ WaveClockRecAlg::execute(const EventContext& ctx) const { ...@@ -83,6 +83,9 @@ WaveClockRecAlg::execute(const EventContext& ctx) const {
// Reconstruct the hits // Reconstruct the hits
CHECK( m_recoTool->reconstruct(*wave, clock) ); CHECK( m_recoTool->reconstruct(*wave, clock) );
// Keep track of how many we reconstructed
m_numberOfEvents++;
// Only do one if there happen to be more // Only do one if there happen to be more
break; break;
} }
......
...@@ -67,6 +67,16 @@ class WaveClockRecAlg : public AthReentrantAlgorithm { ...@@ -67,6 +67,16 @@ class WaveClockRecAlg : public AthReentrantAlgorithm {
{this, "WaveformClockKey", "WaveformClock"}; {this, "WaveformClockKey", "WaveformClock"};
//@} //@}
/**
* @name Counters
* Use mutable to be updated in const methods.
* AthReentrantAlgorithm is const during event processing.
* Use std::atomic to be multi-thread safe.
*/
//@{
mutable std::atomic<int> m_numberOfEvents{0};
//@}
}; };
#endif // WAVERECALGS_WAVECLOCKRECALG_H #endif // WAVERECALGS_WAVECLOCKRECALG_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