Commit fb205702 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'master-FilterHitUpdate' into 'master'

Split off BCM Filtering for Upgrade cases, and configure it using DetFlags

See merge request !35410
parents 4477a8d6 1a7317b7
......@@ -253,6 +253,14 @@ if hasattr(runArgs,'TruthReductionScheme'):
McEventCollectionFilter.UseTRTHits = False
except:
filterHitLog.error('Trying to run on upgrade samples (no TRT) with an old tag of McEventCollectionFilter - job will fail.')
## For upgrade geometries the BCM has been removed, so should be switched off
if not DetFlags.detdescr.BCM_on():
try:
McEventCollectionFilter.UseBCMHits = False
except:
filterHitLog.error('Trying to run on upgrade samples (no BCM) with an old version of McEventCollectionFilter - job will fail.')
if not DetFlags.detdescr.CSC_on():
try:
McEventCollectionFilter.UseCSCHits = False
......
......@@ -53,6 +53,7 @@ McEventCollectionFilter::McEventCollectionFilter(const std::string& name, ISvcLo
, m_UseCSCHits(true) // On unless RUN3 symmetric layout
, m_UseSTGCHits(false) // Off unless RUN3 layout
, m_UseMMHits(false) // Off unless RUN3 layout
, m_UseBCMHits(true) //On unless RUN4 layout
, m_RefBarcode(0)
{
declareProperty("TruthInput" , m_inputTruthCollection);
......@@ -83,6 +84,7 @@ McEventCollectionFilter::McEventCollectionFilter(const std::string& name, ISvcLo
declareProperty("UseCSCHits" , m_UseCSCHits);
declareProperty("UseSTGCHits" , m_UseSTGCHits);
declareProperty("UseMMHits" , m_UseMMHits);
declareProperty("UseBCMHits" , m_UseBCMHits);
}
......@@ -114,7 +116,7 @@ StatusCode McEventCollectionFilter::execute(){
//.......Reduce McEventCollection
ATH_CHECK( ReduceMCEventCollection() );
//.......to relink all Si hits to the new particle
//.......to relink all Pixel/SCT hits to the new particle
ATH_CHECK( SiliconHitsTruthRelink() );
//.......to relink all TRT hits to the new particle
......@@ -145,6 +147,11 @@ StatusCode McEventCollectionFilter::execute(){
if(m_UseMMHits) {
ATH_CHECK( MM_HitsTruthRelink() );
}
//.......to relink all BCM hits to the new particle
if(m_UseBCMHits) {
ATH_CHECK( BCMHitsTruthRelink() );
}
ATH_MSG_DEBUG( "succeded McEventCollectionFilter ..... " );
......@@ -251,7 +258,7 @@ StatusCode McEventCollectionFilter::ReduceMCEventCollection(){
//--------------------------------------------------------
StatusCode McEventCollectionFilter::SiliconHitsTruthRelink(){
//--------------------------------------------------------
//.......to relink all Si hits to the new particle
//.......to relink all Pixel/SCT hits to the new particle
//--------------------------------------------------------
//
if(!m_inputPixelHits.isValid())
......@@ -276,6 +283,16 @@ StatusCode McEventCollectionFilter::SiliconHitsTruthRelink(){
ATH_CHECK(this->SiHitsTruthRelink(m_inputSCTHits,m_outputSCTHits));
return StatusCode::SUCCESS;
}
//--------------------------------------------------------
StatusCode McEventCollectionFilter::BCMHitsTruthRelink(){
//--------------------------------------------------------
//.......to relink BCM hits to the new particle
//--------------------------------------------------------
//
if(!m_inputBCMHits.isValid())
{
ATH_MSG_ERROR( "Could not find BCM SiHitCollection");
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MCEVENTCOLLECTIONFILTER_H
......@@ -48,6 +48,7 @@ private:
StatusCode TGCHitsTruthRelink();
StatusCode STGC_HitsTruthRelink();
StatusCode MM_HitsTruthRelink();
StatusCode BCMHitsTruthRelink();
SG::ReadHandle<McEventCollection> m_inputTruthCollection;
SG::ReadHandle<SiHitCollection> m_inputBCMHits;
......@@ -79,6 +80,7 @@ private:
bool m_UseCSCHits;
bool m_UseSTGCHits;
bool m_UseMMHits;
bool m_UseBCMHits;
//---------------------
//std::string m_HitName;
int m_RefBarcode;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment