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

Merge branch 'torrence_recodev' into 'master'

Fix missing trigger scintillators in reco

See merge request faser/calypso!206
parents 5fb20c64 1a7d657a
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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);
......
......@@ -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"))
......
......@@ -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;
}
......@@ -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
......@@ -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;
}
......
......@@ -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
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