ATLAS Offline Software
SimEventFilter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_ALGORITHMS_SIMEVENTFILTER_H
6 #define ISF_ALGORITHMS_SIMEVENTFILTER_H 1
7 
8 #ifndef SIMULATIONBASE
9 
10 // STL includes
11 #include <string>
12 
13 // FrameWork includes
14 #include "StoreGate/ReadHandle.h"
15 #include "GaudiKernel/ToolHandle.h"
18 
19 // ISF_Interfaces includes
21 
22 // McEventCollection
24 
25 namespace ISF {
26 
28 
29  public:
31  SimEventFilter( const std::string& name, ISvcLocator* pSvcLocator );
32 
34  virtual ~SimEventFilter() = default;
35 
37  virtual StatusCode initialize() override final;
38  virtual StatusCode execute(const EventContext& ctx) const override final;
39 
41  virtual StatusCode finalize() override final;
42 
43  private:
44 #ifdef HEPMC3
45  bool passesFilters(HepMC::ConstGenParticlePtr& part, const ToolHandleArray<IGenParticleFilter>& filters) const;
46 #else
47  bool passesFilters(HepMC::ConstGenParticlePtr part, const ToolHandleArray<IGenParticleFilter>& filters) const;
48 #endif
49 
51  SG::ReadHandleKey<McEventCollection> m_inputHardScatterEvgenKey{this, "InputHardScatterCollection", "", "Input Hard Scatter EVGEN collection."};
52 
57  ToolHandleArray<IGenParticleFilter> m_genParticleCommonFilters{this, "GenParticleCommonFilters", {}, "Tools for filtering out GenParticles for both selections."};
58  ToolHandleArray<IGenParticleFilter> m_genParticleOldFilters{this, "GenParticleOldFilters", {}, "Tools for filtering out GenParticles with the old selection."};
59  ToolHandleArray<IGenParticleFilter> m_genParticleNewFilters{this, "GenParticleNewFilters", {}, "Tools for filtering out GenParticles with the new selection."};
60 
61  FilterReporterParams m_filterParams {this, "ISF_SimEventFilter", "Decides whether particles should be resimulated or simply copied."};
62  Gaudi::Property<bool> m_invertfilter{this, "InvertFilter", false, "Invert filter decision."};
63  };
64 }
65 
66 #endif // SimEventFilter currently will not compile in the AthSimulation Project
67 #endif //> !ISF_ALGORITHMS_SIMEVENTFILTER_H
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
ISF::SimEventFilter::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Athena algorithm's interface method execute()
Definition: SimEventFilter.cxx:80
ISF::SimEventFilter::passesFilters
bool passesFilters(HepMC::ConstGenParticlePtr part, const ToolHandleArray< IGenParticleFilter > &filters) const
check if the given particle passes all filters
Definition: SimEventFilter.cxx:59
ISF::SimEventFilter::m_genParticleNewFilters
ToolHandleArray< IGenParticleFilter > m_genParticleNewFilters
HepMC::GenParticle filters for new selection.
Definition: SimEventFilter.h:59
ISF::SimEventFilter::SimEventFilter
SimEventFilter(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
Definition: SimEventFilter.cxx:22
ISF::SimEventFilter::m_invertfilter
Gaudi::Property< bool > m_invertfilter
invert filter decision at the end
Definition: SimEventFilter.h:62
ISF::SimEventFilter
Definition: SimEventFilter.h:27
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
SG::ReadHandleKey< McEventCollection >
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ISF::SimEventFilter::m_genParticleCommonFilters
ToolHandleArray< IGenParticleFilter > m_genParticleCommonFilters
Filter passes if a difference between the decision of m_genParticleOldFilters and m_genParticleNewFil...
Definition: SimEventFilter.h:57
FilterReporterParams
a handle for applying algorithm filter decisions
Definition: FilterReporterParams.h:58
ISF::SimEventFilter::finalize
virtual StatusCode finalize() override final
Athena algorithm's interface method finalize()
Definition: SimEventFilter.cxx:45
McEventCollection.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ISF::SimEventFilter::m_filterParams
FilterReporterParams m_filterParams
Definition: SimEventFilter.h:61
ISF::SimEventFilter::m_inputHardScatterEvgenKey
SG::ReadHandleKey< McEventCollection > m_inputHardScatterEvgenKey
Input truth collections.
Definition: SimEventFilter.h:51
AthReentrantAlgorithm.h
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ISF::SimEventFilter::m_genParticleOldFilters
ToolHandleArray< IGenParticleFilter > m_genParticleOldFilters
HepMC::GenParticle filters for old selection.
Definition: SimEventFilter.h:58
ISF::SimEventFilter::initialize
virtual StatusCode initialize() override final
Athena algorithm's interface method initialize()
Definition: SimEventFilter.cxx:29
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
IGenParticleFilter.h
ISF::SimEventFilter::~SimEventFilter
virtual ~SimEventFilter()=default
Destructor.
ReadHandle.h
Handle class for reading from StoreGate.
FilterReporterParams.h