diff --git a/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py b/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py index f0fa35b4aaa071c3a0e699e74f8a949a8f7765c9..9810f9606947468dad688f10d3547340dc687765 100755 --- a/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py +++ b/Control/CalypsoExample/Reconstruction/scripts/faser_reco.py @@ -46,10 +46,12 @@ if len(args.run_type) > 0: # i.e.: TestBeamData/Run-004150/Faser-Physics-004150-00000.raw" else: if len(filepath.parts) < 3: - print("Can't determine run type from path - specify on command line instead") - sys.exit(-1) + print("Can't determine run type from path - guessing TI12Data!") + 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) # Probably better to do this from configuration in upstream production scripts, diff --git a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.cxx b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.cxx index 5a63749a53243fc196ac93ccab92c040359e7d4b..b1402a22ab345a28ac4c9559062a26fd16cded88 100644 --- a/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.cxx +++ b/Tracker/TrackerEventCnv/TrackerEventAthenaPool/src/FaserSCT_SpacePointContainerCnv.cxx @@ -48,7 +48,7 @@ StatusCode FaserSCT_SpacePointContainerCnv::initialize() { FaserSCT_SpacePointContainer_PERS* FaserSCT_SpacePointContainerCnv::createPersistent (FaserSCT_SpacePointContainer* transObj) { - ATH_MSG_INFO("FaserSCT_SpacePointContainerCnv::createPersistent()"); + ATH_MSG_DEBUG("FaserSCT_SpacePointContainerCnv::createPersistent()"); FaserSCT_SpacePointContainerCnv_PERS converter; @@ -60,7 +60,7 @@ FaserSCT_SpacePointContainerCnv::createPersistent (FaserSCT_SpacePointContainer* FaserSCT_SpacePointContainer* 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"); FaserSCT_SpacePointContainer* transObj(nullptr); diff --git a/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py b/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py index 64764cd1c30ca7f039a28799dd16cc22bb50720c..d38eb4fd0a7ce0c26ffa1a78fd52a91f0261ac94 100644 --- a/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py +++ b/Waveform/WaveRecAlgs/python/WaveRecAlgsConfig.py @@ -20,14 +20,13 @@ def WaveformReconstructionCfg(flags, naive = False): if flags.Input.isMC and naive: 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, "PseudoPresehowerHitWaveformRecAlg", "Preshower")) acc.merge(PseudoCaloHitToWaveformRecCfg(flags, "PseudoCaloHitWaveformRecAlg")) return acc - if "TB" not in flags.GeoModel.FaserVersion: - acc.merge(WaveformHitRecCfg(flags, "TimingWaveformRecAlg", "Trigger")) + acc.merge(WaveformHitRecCfg(flags, "TriggerWaveformRecAlg", "Trigger")) acc.merge(WaveformHitRecCfg(flags, "VetoWaveformRecAlg", "Veto")) acc.merge(WaveformHitRecCfg(flags, "PreshowerWaveformRecAlg", "Preshower")) acc.merge(WaveformHitRecCfg(flags, "CaloWaveformRecAlg", "Calo")) diff --git a/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.cxx b/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.cxx index f1320c41e7dc75f5c9c8cd701dc06a92c3bab1c3..97f122e50f51c17f2ac3f0e0ff3174cf2f337347 100644 --- a/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.cxx +++ b/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.cxx @@ -29,6 +29,13 @@ StatusCode RawWaveformRecAlg::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; } @@ -74,6 +81,19 @@ RawWaveformRecAlg::execute(const EventContext& ctx) const { 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; } diff --git a/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.h b/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.h index a7120b83598b7b32476f86f1b890014452bf70f4..e57501a730dd5f67c38435cb9594b0a7def2ec75 100644 --- a/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.h +++ b/Waveform/WaveRecAlgs/src/RawWaveformRecAlg.h @@ -81,6 +81,19 @@ class RawWaveformRecAlg : public AthReentrantAlgorithm { {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 diff --git a/Waveform/WaveRecAlgs/src/WaveClockRecAlg.cxx b/Waveform/WaveRecAlgs/src/WaveClockRecAlg.cxx index 36891e70dd09cf8180753711209c526da90e04e4..4dc4014234e61ffcc24a5396397518ae102ac0e3 100644 --- a/Waveform/WaveRecAlgs/src/WaveClockRecAlg.cxx +++ b/Waveform/WaveRecAlgs/src/WaveClockRecAlg.cxx @@ -24,7 +24,7 @@ WaveClockRecAlg::initialize() { StatusCode WaveClockRecAlg::finalize() { ATH_MSG_INFO(name() << "::finalize()"); - + ATH_MSG_INFO( m_numberOfEvents << " events processed" ); return StatusCode::SUCCESS; } @@ -83,6 +83,9 @@ WaveClockRecAlg::execute(const EventContext& ctx) const { // Reconstruct the hits CHECK( m_recoTool->reconstruct(*wave, clock) ); + // Keep track of how many we reconstructed + m_numberOfEvents++; + // Only do one if there happen to be more break; } diff --git a/Waveform/WaveRecAlgs/src/WaveClockRecAlg.h b/Waveform/WaveRecAlgs/src/WaveClockRecAlg.h index e6e61cfd29e219200c64bfcdb1752be0055e983a..771b0e86873b73890e110075a36d1ec4f34c2750 100644 --- a/Waveform/WaveRecAlgs/src/WaveClockRecAlg.h +++ b/Waveform/WaveRecAlgs/src/WaveClockRecAlg.h @@ -67,6 +67,16 @@ class WaveClockRecAlg : public AthReentrantAlgorithm { {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