Skip to content
Snippets Groups Projects
Commit ea0fb9dd authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

DecodedDataFromMCRichHits: Add property to enable/disable spillover

parent 595710b3
No related branches found
No related tags found
1 merge request!4337Misc. improvements to support RICH 4D Reco
...@@ -98,33 +98,32 @@ namespace Rich::Future::MC { ...@@ -98,33 +98,32 @@ namespace Rich::Future::MC {
for ( const auto mchit : mchits ) { for ( const auto mchit : mchits ) {
const auto id = mchit->sensDetID(); const auto id = mchit->sensDetID();
if ( id.isValid() ) { if ( id.isValid() ) {
// Apply all sorts MC based filtering here, e.g. signal only, timing windows etc. // Apply all sorts MC based filtering here, e.g. signal only, timing windows etc.
// To be extended as needed // To be extended as needed
if ( m_rejectBackground && mchit->isBackground() ) { if ( m_rejectBackground && mchit->isBackground() ) {
_ri_verbo << id << " Rejected as background" << endmsg; _ri_verbo << id << " Rejected as background" << endmsg;
continue; continue;
} }
// finally save this id -> hit mapping // finally save this id -> hit mapping
hitsPerPix[id].push_back( mchit ); hitsPerPix[id].push_back( mchit );
} // hit is valid } // hit is valid
} // mc hit loop } // mc hit loop
}; };
// Spillover locations // add the main event hits
auto addSpilloverHits = [&]( auto const& mchits ) {
if ( mchits.exist() ) { addMCHits( *mchits.get() ); }
};
// add the hits
addMCHits( main_mchits ); addMCHits( main_mchits );
addSpilloverHits( m_prevHits );
addSpilloverHits( m_prevPrevHits ); // ... and if requested spillover hits
addSpilloverHits( m_nextHits ); if ( m_enableSpillover ) {
addSpilloverHits( m_nextNextHits ); auto addSpilloverHits = [&]( auto const& mchits ) {
addSpilloverHits( m_lhcBkgHits ); if ( mchits.exist() ) { addMCHits( *mchits.get() ); }
};
addSpilloverHits( m_prevHits );
addSpilloverHits( m_prevPrevHits );
addSpilloverHits( m_nextHits );
addSpilloverHits( m_nextNextHits );
addSpilloverHits( m_lhcBkgHits );
}
// Form list of unique IDs // Form list of unique IDs
LHCb::RichSmartID::Vector ids; LHCb::RichSmartID::Vector ids;
...@@ -216,6 +215,9 @@ namespace Rich::Future::MC { ...@@ -216,6 +215,9 @@ namespace Rich::Future::MC {
/// Reject background hits /// Reject background hits
Gaudi::Property<bool> m_rejectBackground{this, "RejectBackground", false}; Gaudi::Property<bool> m_rejectBackground{this, "RejectBackground", false};
/// Include spillover events
Gaudi::Property<bool> m_enableSpillover{this, "EnableSpillover", true};
}; };
// Declaration of the Algorithm Factory // Declaration of the Algorithm Factory
......
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