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

Fixes for MC reco with 24 configuration

parent 54a3d67a
No related branches found
No related tags found
1 merge request!407Fixes for MC reco with 24 configuration
Pipeline #7819930 passed
......@@ -98,11 +98,18 @@ CaloWaveformDigiAlg::execute(const EventContext& ctx) const {
// Loop over wavefrom vectors to make and store waveform
unsigned int digitizer_samples = m_digiTool->digitizer_samples();
for (const auto& w : waveforms) {
RawWaveform* wfm = new RawWaveform();
RawWaveform* wfm = new RawWaveform();
wfm->setWaveform(0, w.second);
wfm->setIdentifier(w.first);
wfm->setChannel(m_mappingTool->getChannelMapping(w.first));
wfm->setSamples(digitizer_samples);
// Don't write out waveforms with no channel defined
// Causes problems in downstream reco (not known in cable map
int channel = m_mappingTool->getChannelMapping(w.first);
if (channel < 0) {
ATH_MSG_DEBUG("Skipping waveform with unknown channel!");
continue;
}
wfm->setChannel(channel);
waveformContainerHandle->push_back(wfm);
}
......
......@@ -51,14 +51,7 @@ StatusCode CaloRecAlg::execute(const EventContext& ctx) const {
}
SG::ReadHandle<xAOD::WaveformHitContainer> calo2WaveHitHandle(m_calo2WaveHitContainerKey, ctx);
ATH_CHECK( calo2WaveHitHandle.isValid() );
ATH_MSG_DEBUG("Found ReadHandle for WaveformHitContainer " << m_calo2WaveHitContainerKey);
if (calo2WaveHitHandle->size() == 0) {
ATH_MSG_DEBUG("Calorimeter 2 Waveform Hit container found with zero length!");
}
SG::ReadHandle<xAOD::WaveformHitContainer> preshowerWaveHitHandle(m_preshowerWaveHitContainerKey, ctx);
ATH_CHECK( preshowerWaveHitHandle.isValid() );
......@@ -87,21 +80,6 @@ StatusCode CaloRecAlg::execute(const EventContext& ctx) const {
}
ATH_MSG_DEBUG("CaloHitContainer '" << caloHitContainerHandle.name() << "' filled with "<< caloHitContainerHandle->size() <<" items");
// Reconstruct high-gain calorimeter hits
SG::WriteHandle<xAOD::CalorimeterHitContainer> calo2HitContainerHandle(m_calo2HitContainerKey, ctx);
ATH_CHECK( calo2HitContainerHandle.record( std::make_unique<xAOD::CalorimeterHitContainer>(),
std::make_unique<xAOD::CalorimeterHitAuxContainer>() ) );
ATH_MSG_DEBUG("WaveformsHitContainer '" << calo2HitContainerHandle.name() << "' initialized");
for( const auto& hit : *calo2WaveHitHandle ) {
if (hit->status_bit(xAOD::WaveformStatus::SECONDARY)) continue;
xAOD::CalorimeterHit* calo_hit = new xAOD::CalorimeterHit();
calo2HitContainerHandle->push_back(calo_hit);
calo_hit->addHit(calo2WaveHitHandle.get(), hit);
m_recoCalibTool->reconstruct(ctx, calo_hit, correct_gain=false);
}
ATH_MSG_DEBUG("Calo2HitContainer '" << calo2HitContainerHandle.name() << "' filled with "<< calo2HitContainerHandle->size() <<" items");
// Reconstruct preshower hits
SG::WriteHandle<xAOD::CalorimeterHitContainer> preshowerHitContainerHandle(m_preshowerHitContainerKey, ctx);
ATH_CHECK( preshowerHitContainerHandle.record( std::make_unique<xAOD::CalorimeterHitContainer>(),
......@@ -117,6 +95,35 @@ StatusCode CaloRecAlg::execute(const EventContext& ctx) const {
}
ATH_MSG_DEBUG("PreshowerHitContainer '" << preshowerHitContainerHandle.name() << "' filled with "<< preshowerHitContainerHandle->size() <<" items");
// High-gain calo isn't guaranteed to exist
if ( calo2WaveHitHandle.isValid() ) {
ATH_MSG_DEBUG("Found ReadHandle for WaveformHitContainer " << m_calo2WaveHitContainerKey);
if (calo2WaveHitHandle->size() == 0) {
ATH_MSG_DEBUG("Calorimeter 2 Waveform Hit container found with zero length!");
}
// Reconstruct high-gain calorimeter hits
SG::WriteHandle<xAOD::CalorimeterHitContainer> calo2HitContainerHandle(m_calo2HitContainerKey, ctx);
ATH_CHECK( calo2HitContainerHandle.record( std::make_unique<xAOD::CalorimeterHitContainer>(),
std::make_unique<xAOD::CalorimeterHitAuxContainer>() ) );
ATH_MSG_DEBUG("WaveformsHitContainer '" << calo2HitContainerHandle.name() << "' initialized");
for( const auto& hit : *calo2WaveHitHandle ) {
if (hit->status_bit(xAOD::WaveformStatus::SECONDARY)) continue;
xAOD::CalorimeterHit* calo_hit = new xAOD::CalorimeterHit();
calo2HitContainerHandle->push_back(calo_hit);
calo_hit->addHit(calo2WaveHitHandle.get(), hit);
m_recoCalibTool->reconstruct(ctx, calo_hit, correct_gain=false);
}
ATH_MSG_DEBUG("Calo2HitContainer '" << calo2HitContainerHandle.name() << "' filled with "<< calo2HitContainerHandle->size() <<" items");
} else {
ATH_MSG_DEBUG("No ReadHandle for WaveformHitContainer " << m_calo2WaveHitContainerKey);
}
return StatusCode::SUCCESS;
}
......@@ -16,7 +16,9 @@ def WaveformReconstructionCfg(flags):
""" Return all algorithms and tools for Waveform reconstruction """
acc = ComponentAccumulator()
if not flags.Input.isMC:
if flags.Input.isMC:
print("ClockRecAlg diabled for MC in WaveformReconstructionCfg!")
else:
acc.merge(WaveformClockRecCfg(flags, "ClockRecAlg"))
if "TB" in flags.GeoModel.FaserVersion:
......@@ -28,7 +30,10 @@ def WaveformReconstructionCfg(flags):
else:
acc.merge(WaveformHitRecCfg(flags, "CaloWaveformRecAlg", "Calo"))
acc.merge(WaveformHitRecCfg(flags, "Calo2WaveformRecAlg", "Calo2"))
if flags.Input.isMC:
print("Calo2WaveformRecAlg diabled for MC in WaveformReconstructionCfg!")
else:
acc.merge(WaveformHitRecCfg(flags, "Calo2WaveformRecAlg", "Calo2"))
# Make preshower window 200 ns wide (value in digitizer clock ticks)
acc.merge(WaveformHitRecCfg(flags, "VetoWaveformRecAlg", "Veto", FitWindowWidth=100 ))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment