Base class for event generator filtering modules.
More...
#include <GenFilter.h>
Inherits GenBase.
Inherited by BSignalFilter, BoostedHadTopAndTopPair, ChargedTracksFilter, ChargedTracksWeightFilter, DecayTimeFilter, DecayVolumeFilter, DecaysFinalStateFilter, DiBjetFilter, DiLeptonMassFilter, DiPhotonFilter, DirectPhotonFilter, ElectronFilter, ForwardProtonFilter, FourLeptonInvMassFilter, FourLeptonMassFilter, HTFilter, HeavyFlavorHadronFilter, HiggsFilter, JetFilter, LeptonFilter, LeptonPairFilter, M4MuIntervalFilter, MassRangeFilter, MissingEtFilter, MuDstarFilter, MultiBjetFilter, MultiCjetFilter, MultiElecMuTauFilter, MultiElectronFilter, MultiLeptonFilter, MultiMuonFilter, MultiParticleFilter, MuonFilter, ParentChildFilter, ParentChildwStatusFilter, ParentTwoChildrenFilter, ParticleDecayFilter, ParticleFilter, PhotonFilter, QCDTruthJetFilter, QCDTruthMultiJetFilter, SameParticleHardScatteringFilter, SoftLeptonInJetFilter, SplitPhotonFilter, TTbarMassFilter, TTbarPlusHeavyFlavorFilter, TTbarWToLeptonFilter, TTbarWithJpsimumuFilter, TauFilter, TrimuMassRangeFilter, TruthJetFilter, VBFForwardJetsFilter, VBFHbbEtaSortingFilter, VBFMjjIntervalFilter, XtoVVDecayFilterExtended, ZtoLeptonFilter, xAODBSignalFilter, xAODChargedTracksFilter, xAODChargedTracksWeightFilter, xAODDecayTimeFilter, xAODDecaysFinalStateFilter, xAODDiLeptonMassFilter, xAODDiPhotonFilter, xAODDirectPhotonFilter, xAODElectronFilter, xAODForwardProtonFilter, xAODFourLeptonInvMassFilter, xAODFourLeptonMassFilter, xAODHTFilter, xAODHeavyFlavorHadronFilter, xAODJetFilter, xAODLeptonFilter, xAODLeptonPairFilter, xAODM4MuIntervalFilter, xAODMETFilter, xAODMuDstarFilter, xAODMultiBjetFilter, xAODMultiCjetFilter, xAODMultiElecMuTauFilter, xAODMultiElectronFilter, xAODMultiLeptonFilter, xAODMultiMuonFilter, xAODMuonFilter, xAODParentChildFilter, xAODParentTwoChildrenFilter, xAODParticleDecayFilter, xAODParticleFilter, xAODPhotonFilter, xAODSameParticleHardScatteringFilter, xAODSplitPhotonFilter, xAODTTbarWToLeptonFilter, xAODTTbarWithJpsimumuFilter, xAODTauFilter, xAODVBFForwardJetsFilter, xAODVBFMjjIntervalFilter, and xAODXtoVVDecayFilterExtended.
|
| std::string | m_mcEventKey {} |
| | StoreGate key for the MC event collection (defaults to GEN_EVENT).
|
| BooleanProperty | m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"} |
| | Flag to determine if a new MC event collection should be made if it doesn't exist.
|
| SG::ReadHandleKey< McEventCollection > | m_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" } |
| | Const handle to the MC event collection.
|
Base class for event generator filtering modules.
- Author
- Ian Hinchliffe (initial code, December 2001)
-
Andy Buckley (updates to AthAlgorithm, etc., Dec 2011)
-
Andy Buckley (conversion to GenBase and tidying, Nov 2013)
This class is the base class used to specify the behavior of all event generator filtering modules and is meant to capture the common behavior of these modules. GenFilter inherits the GenBase interface and is principally used in Generators/GeneratorFilters.
The following virtual methods should be overloaded in the child class: StatusCode filterInitialize() (optional) StatusCode filterEvent(const EventContext& ctx) StatusCode filterFinalize() (optional)
LeptonFilter or ElectronFilter are good templates for learning to implement new filters.
Definition at line 30 of file GenFilter.h.
◆ StoreGateSvc_t
◆ GenFilter()
| GenFilter::GenFilter |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
Definition at line 8 of file GenFilter.cxx.
10{
15}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
◆ ~GenFilter()
| virtual GenFilter::~GenFilter |
( |
| ) |
|
|
inlinevirtual |
◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]
◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]
Access the current signal event (first in the McEventCollection).
- Note
- This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.
Definition at line 74 of file GenBase.h.
74 {
76 ATH_MSG_ERROR(
"McEventCollection is empty during first event access");
77 return *(
events()->begin());
78 }
static const Attributes_t empty
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ event_const()
Access the current signal event (const).
Definition at line 81 of file GenBase.h.
81 {
84 ATH_MSG_ERROR(
"Const McEventCollection is empty during first event access");
85 return *(coll->
begin());
86 }
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool empty() const noexcept
Returns true if the collection is empty.
const McEventCollection * events_const(const EventContext &ctx) const
Access the current event's McEventCollection (const).
◆ events_const()
Access the current event's McEventCollection (const).
Definition at line 95 of file GenBase.h.
95 {
100 }
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
◆ evtStore()
◆ execute()
| StatusCode GenFilter::execute |
( |
const EventContext & | ctx | ) |
|
|
virtual |
Execute method.
- Todo
- Probably the filter should only look at the first event... right?
Reimplemented from GenBase.
Definition at line 27 of file GenFilter.cxx.
27 {
30 return StatusCode::FAILURE;
33 ATH_MSG_WARNING(
"More than one event in current McEventCollection -- which is valid?");
34 }
39 } else {
42 }
43
45 sc = StatusCode::FAILURE;
47}
#define ATH_MSG_WARNING(x)
size_t size() const
Number of registered mappings.
virtual bool filterPassed(const EventContext &ctx) const
virtual StatusCode filterEvent(const EventContext &ctx)=0
::StatusCode StatusCode
StatusCode definition for legacy code.
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 89 of file AthCommonAlgorithm.cxx.
54{
55
56
59 }
61}
Common base class for algorithms.
DataObjIDColl m_extendedExtraObjects
◆ filterEvent()
| virtual StatusCode GenFilter::filterEvent |
( |
const EventContext & | ctx | ) |
|
|
pure virtual |
Implemented in BoostedHadTopAndTopPair, BSignalFilter, ChargedTracksFilter, ChargedTracksWeightFilter, DecaysFinalStateFilter, DecayTimeFilter, DecayVolumeFilter, DiBjetFilter, DiLeptonMassFilter, DiPhotonFilter, DirectPhotonFilter, ElectronFilter, ForwardProtonFilter, FourLeptonInvMassFilter, FourLeptonMassFilter, HeavyFlavorHadronFilter, HiggsFilter, HTFilter, JetFilter, LeptonFilter, LeptonPairFilter, M4MuIntervalFilter, MassRangeFilter, MissingEtFilter, MuDstarFilter, MultiBjetFilter, MultiCjetFilter, MultiElecMuTauFilter, MultiElectronFilter, MultiLeptonFilter, MultiMuonFilter, MultiParticleFilter, MuonFilter, ParentChildFilter, ParentChildwStatusFilter, ParentTwoChildrenFilter, ParticleDecayFilter, ParticleFilter, PhotonFilter, QCDTruthJetFilter, QCDTruthMultiJetFilter, SameParticleHardScatteringFilter, SoftLeptonInJetFilter, SplitPhotonFilter, TauFilter, TrimuMassRangeFilter, TruthJetFilter, TTbarMassFilter, TTbarPlusHeavyFlavorFilter, TTbarWithJpsimumuFilter, TTbarWToLeptonFilter, VBFForwardJetsFilter, VBFHbbEtaSortingFilter, VBFMjjIntervalFilter, xAODBSignalFilter, xAODChargedTracksFilter, xAODChargedTracksWeightFilter, xAODDecaysFinalStateFilter, xAODDecayTimeFilter, xAODDiLeptonMassFilter, xAODDiPhotonFilter, xAODDirectPhotonFilter, xAODElectronFilter, xAODForwardProtonFilter, xAODFourLeptonInvMassFilter, xAODFourLeptonMassFilter, xAODHeavyFlavorHadronFilter, xAODHTFilter, xAODJetFilter, xAODLeptonFilter, xAODLeptonPairFilter, xAODM4MuIntervalFilter, xAODMETFilter, xAODMuDstarFilter, xAODMultiBjetFilter, xAODMultiCjetFilter, xAODMultiElecMuTauFilter, xAODMultiElectronFilter, xAODMultiLeptonFilter, xAODMultiMuonFilter, xAODMuonFilter, xAODParentChildFilter, xAODParentTwoChildrenFilter, xAODParticleDecayFilter, xAODParticleFilter, xAODPhotonFilter, xAODSameParticleHardScatteringFilter, xAODSplitPhotonFilter, xAODTauFilter, xAODTTbarWithJpsimumuFilter, xAODTTbarWToLeptonFilter, xAODVBFForwardJetsFilter, xAODVBFMjjIntervalFilter, xAODXtoVVDecayFilterExtended, XtoVVDecayFilterExtended, and ZtoLeptonFilter.
◆ filterFinalize()
| virtual StatusCode GenFilter::filterFinalize |
( |
| ) |
|
|
inlinevirtual |
Reimplemented in BoostedHadTopAndTopPair, BSignalFilter, ChargedTracksWeightFilter, DecaysFinalStateFilter, DecayVolumeFilter, DiBjetFilter, DiLeptonMassFilter, FourLeptonInvMassFilter, HeavyFlavorHadronFilter, HTFilter, LeptonFilter, LeptonPairFilter, M4MuIntervalFilter, MuDstarFilter, MultiBjetFilter, MultiCjetFilter, MultiParticleFilter, ParentChildwStatusFilter, ParticleDecayFilter, QCDTruthJetFilter, QCDTruthMultiJetFilter, TauFilter, TrimuMassRangeFilter, TTbarPlusHeavyFlavorFilter, TTbarWithJpsimumuFilter, VBFHbbEtaSortingFilter, xAODBSignalFilter, xAODChargedTracksWeightFilter, xAODDiLeptonMassFilter, xAODHeavyFlavorHadronFilter, xAODHTFilter, xAODMultiBjetFilter, xAODMultiCjetFilter, xAODTauFilter, xAODTTbarWithJpsimumuFilter, xAODXtoVVDecayFilterExtended, and XtoVVDecayFilterExtended.
Definition at line 47 of file GenFilter.h.
47{ return StatusCode::SUCCESS; }
◆ filterInitialize()
| virtual StatusCode GenFilter::filterInitialize |
( |
| ) |
|
|
inlinevirtual |
Reimplemented in BoostedHadTopAndTopPair, ChargedTracksWeightFilter, DecaysFinalStateFilter, DecayTimeFilter, DecayVolumeFilter, DiBjetFilter, DiLeptonMassFilter, DiPhotonFilter, DirectPhotonFilter, FourLeptonInvMassFilter, FourLeptonMassFilter, HeavyFlavorHadronFilter, HTFilter, JetFilter, LeptonFilter, LeptonPairFilter, M4MuIntervalFilter, MassRangeFilter, MuDstarFilter, MultiBjetFilter, MultiCjetFilter, MultiParticleFilter, ParentChildFilter, ParentChildwStatusFilter, ParentTwoChildrenFilter, ParticleDecayFilter, ParticleFilter, QCDTruthJetFilter, QCDTruthMultiJetFilter, SameParticleHardScatteringFilter, TauFilter, TrimuMassRangeFilter, TruthJetFilter, TTbarPlusHeavyFlavorFilter, TTbarWithJpsimumuFilter, VBFForwardJetsFilter, VBFHbbEtaSortingFilter, VBFMjjIntervalFilter, xAODBSignalFilter, xAODChargedTracksFilter, xAODChargedTracksWeightFilter, xAODDecaysFinalStateFilter, xAODDecayTimeFilter, xAODDiLeptonMassFilter, xAODDiPhotonFilter, xAODDirectPhotonFilter, xAODElectronFilter, xAODForwardProtonFilter, xAODFourLeptonInvMassFilter, xAODFourLeptonMassFilter, xAODHeavyFlavorHadronFilter, xAODHTFilter, xAODJetFilter, xAODLeptonFilter, xAODLeptonPairFilter, xAODM4MuIntervalFilter, xAODMETFilter, xAODMuDstarFilter, xAODMultiBjetFilter, xAODMultiCjetFilter, xAODMultiElecMuTauFilter, xAODMultiElectronFilter, xAODMultiLeptonFilter, xAODMultiMuonFilter, xAODMuonFilter, xAODParentChildFilter, xAODParentTwoChildrenFilter, xAODParticleDecayFilter, xAODParticleFilter, xAODPhotonFilter, xAODSameParticleHardScatteringFilter, xAODSplitPhotonFilter, xAODTauFilter, xAODTTbarWithJpsimumuFilter, xAODTTbarWToLeptonFilter, xAODVBFForwardJetsFilter, xAODVBFMjjIntervalFilter, xAODXtoVVDecayFilterExtended, and XtoVVDecayFilterExtended.
Definition at line 45 of file GenFilter.h.
45{ return StatusCode::SUCCESS; }
◆ filterPassed()
◆ finalize()
| StatusCode GenFilter::finalize |
( |
| ) |
|
Definition at line 50 of file GenFilter.cxx.
50 {
53 return StatusCode::SUCCESS;
54}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode filterFinalize()
◆ initialize()
| StatusCode GenFilter::initialize |
( |
| ) |
|
|
virtual |
Reimplemented from GenBase.
Definition at line 18 of file GenFilter.cxx.
18 {
23 return StatusCode::SUCCESS;
24}
virtual StatusCode initialize() override
virtual StatusCode filterInitialize()
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ isClonable()
|
|
inlineoverridevirtualinherited |
Specify if the algorithm is clonable.
Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.
Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.
Definition at line 68 of file AthCommonAlgorithm.h.
68 {
69 return true;
70 }
◆ isReEntrant()
| virtual bool AthAlgorithm::isReEntrant |
( |
| ) |
const |
|
inlinefinaloverrideprotectedvirtualinherited |
Legacy algorithms are not thread-safe.
Definition at line 47 of file AthAlgorithm.h.
◆ keepAll()
| bool GenFilter::keepAll |
( |
| ) |
const |
|
inline |
◆ msg()
◆ msgLvl()
◆ nFailed()
| int GenFilter::nFailed |
( |
| ) |
const |
|
inline |
◆ nNeeded()
| int GenFilter::nNeeded |
( |
| ) |
const |
|
inline |
◆ nPassed()
| int GenFilter::nPassed |
( |
| ) |
const |
|
inline |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
◆ renounceArray()
◆ setFilterPassed()
| virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed |
( |
bool | state, |
|
|
const EventContext & | ctx ) const |
|
inlinevirtualinherited |
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Reimplemented in AthAnalysisAlgorithm.
Definition at line 80 of file AthCommonAlgorithm.cxx.
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.
Definition at line 60 of file AthCommonAlgorithm.cxx.
71 {
73
76 }
77
81
82 if (
cs.retrieve().isFailure() ) {
85 }
86 if (
cs->regHandle(
this,*
h).isFailure()) {
88 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 108 of file AthCommonAlgorithm.h.
◆ m_keepAll
| bool GenFilter::m_keepAll |
|
protected |
◆ m_mcEventKey
| std::string GenBase::m_mcEventKey {} |
|
protectedinherited |
StoreGate key for the MC event collection (defaults to GEN_EVENT).
Definition at line 110 of file GenBase.h.
◆ m_mcevents_const
Const handle to the MC event collection.
Definition at line 119 of file GenBase.h.
119{ this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" };
◆ m_mkMcEvent
| BooleanProperty GenBase::m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"} |
|
protectedinherited |
Flag to determine if a new MC event collection should be made if it doesn't exist.
Definition at line 112 of file GenBase.h.
112{this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"};
◆ m_nFail
◆ m_nNeeded
◆ m_nPass
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files: