ATLAS Offline Software
ParticleRemoverAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef EVENTUTILS_PARTICLEREMOVERALG_H
6 #define EVENTUTILS_PARTICLEREMOVERALG_H 1
7 
9 
11 
12 
13 
15  public:
17  ParticleRemoverAlg( const std::string& name, ISvcLocator* pSvcLocator );
18 
20  virtual ~ParticleRemoverAlg();
21 
23  virtual StatusCode initialize();
24 
26  virtual StatusCode execute();
27 
29  virtual StatusCode finalize();
30 
31  private:
33  template<class CONT>
34  StatusCode removeParticles( const std::vector<bool>& keepParticleVec );
35 
36  private:
37 
40 
42  Gaudi::Property<std::string> m_inCont{this, "Input", "", "Input container name"};
43 
45  Gaudi::Property<std::string> m_separator{this, "Separator", "___", "The string separator between the output container name and the sytematic variation"};
46 
48  Gaudi::Property<std::string> m_outCont{this, "Output", "", "The name of the output container with the deep copy of input objects"};
49 
51  Gaudi::Property<std::vector<std::string>> m_suffixes{this, "Suffixes", {}, "The names of all suffixes for the input and output container names"};
52 
54  Gaudi::Property<std::vector<std::string>> m_viewContNames{this, "SelectedViewContainers", {}, "The names of all view containers that contain particles that we want to retain"};
55 
57  Gaudi::Property<bool> m_resetViewConts{this, "RemapViewContainers", true, "Boolean to decide if the existing view containers should be re-mapped"};
58 
60  Gaudi::Property<std::string> m_outPrefix{this, "OutputViewContainerPrefix", "", "Prefix to be used for all created output view containers"};
61 
63 
64 
67 
69  std::vector<std::string> m_inContNameList;
70 
72  std::vector<std::string> m_outContNameList;
73 
75  std::vector< const xAOD::IParticleContainer* > m_inContList;
76 
78  std::vector< xAOD::IParticleContainer* > m_outContList;
79 
81  std::vector< std::vector<std::string> > m_inViewContNameListList;
82 
84  std::vector< std::vector<std::string> > m_outViewContNameListList;
85 
86 
88  enum contType_t {
93  TAU,
94  JET,
102  };
103 
106 
108 
109 };
110 
111 // Include the templated code here. This must be done from this header file.
112 #include "ParticleRemoverAlg.icc"
113 
114 #endif //> !EVENTUTILS_PARTICLEREMOVERALG_H
ParticleRemoverAlg.icc
ParticleRemoverAlg::m_outContNameList
std::vector< std::string > m_outContNameList
Vector of all output container names.
Definition: ParticleRemoverAlg.h:72
ParticleRemoverAlg::PARITCLEFLOW
@ PARITCLEFLOW
Definition: ParticleRemoverAlg.h:95
ParticleRemoverAlg::m_outViewContNameListList
std::vector< std::vector< std::string > > m_outViewContNameListList
Vector of all output view container names.
Definition: ParticleRemoverAlg.h:84
ParticleRemoverAlg::m_contType
contType_t m_contType
The variable that holds the value that we find for the input container.
Definition: ParticleRemoverAlg.h:105
ParticleRemoverAlg::m_suffixes
Gaudi::Property< std::vector< std::string > > m_suffixes
The names of all suffixes for the input and output container names.
Definition: ParticleRemoverAlg.h:51
ParticleRemoverAlg::m_resetViewConts
Gaudi::Property< bool > m_resetViewConts
Boolean to decide if the existing view containers should be re-mapped (default: true)
Definition: ParticleRemoverAlg.h:57
ParticleRemoverAlg::UNKNOWN
@ UNKNOWN
Definition: ParticleRemoverAlg.h:89
ParticleRemoverAlg::removeParticles
StatusCode removeParticles(const std::vector< bool > &keepParticleVec)
Private function to perform the actualy work.
ParticleRemoverAlg::PHOTON
@ PHOTON
Definition: ParticleRemoverAlg.h:90
ParticleRemoverAlg::m_inCont
Gaudi::Property< std::string > m_inCont
The input container name.
Definition: ParticleRemoverAlg.h:42
ParticleRemoverAlg::NEUTRALPARTICLE
@ NEUTRALPARTICLE
Definition: ParticleRemoverAlg.h:96
ParticleRemoverAlg::COMPOSITEPARTICLE
@ COMPOSITEPARTICLE
Definition: ParticleRemoverAlg.h:99
AthAlgorithm.h
ParticleRemoverAlg::TAU
@ TAU
Definition: ParticleRemoverAlg.h:93
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IParticleContainer.h
ParticleRemoverAlg::m_separator
Gaudi::Property< std::string > m_separator
The string separator between the output container name and the sytematic variation (default="___")
Definition: ParticleRemoverAlg.h:45
ParticleRemoverAlg
Definition: ParticleRemoverAlg.h:14
ParticleRemoverAlg::m_inContNameList
std::vector< std::string > m_inContNameList
Vector of all input container names.
Definition: ParticleRemoverAlg.h:69
ParticleRemoverAlg::JET
@ JET
Definition: ParticleRemoverAlg.h:94
ParticleRemoverAlg::m_outPrefix
Gaudi::Property< std::string > m_outPrefix
Prefix to be used for all created output view containers.
Definition: ParticleRemoverAlg.h:60
ParticleRemoverAlg::ELECTRON
@ ELECTRON
Definition: ParticleRemoverAlg.h:91
ParticleRemoverAlg::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method called once before the event loop.
Definition: ParticleRemoverAlg.cxx:37
AthAlgorithm
Definition: AthAlgorithm.h:47
ParticleRemoverAlg::ParticleRemoverAlg
ParticleRemoverAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
Definition: ParticleRemoverAlg.cxx:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ParticleRemoverAlg::m_inViewContNameListList
std::vector< std::vector< std::string > > m_inViewContNameListList
Vector of all input view container names.
Definition: ParticleRemoverAlg.h:81
ParticleRemoverAlg::CALOCLUSTER
@ CALOCLUSTER
Definition: ParticleRemoverAlg.h:101
ParticleRemoverAlg::execute
virtual StatusCode execute()
Standard Gaudi execute method called once for every event.
Definition: ParticleRemoverAlg.cxx:175
ParticleRemoverAlg::m_inContList
std::vector< const xAOD::IParticleContainer * > m_inContList
Vector of all input containers.
Definition: ParticleRemoverAlg.h:75
ParticleRemoverAlg::PARTICLE
@ PARTICLE
Definition: ParticleRemoverAlg.h:100
ParticleRemoverAlg::m_outContList
std::vector< xAOD::IParticleContainer * > m_outContList
Vector of all output containers.
Definition: ParticleRemoverAlg.h:78
ParticleRemoverAlg::contType_t
contType_t
An enumaration for the actual container type.
Definition: ParticleRemoverAlg.h:88
ParticleRemoverAlg::TRACKPARTICLE
@ TRACKPARTICLE
Definition: ParticleRemoverAlg.h:97
ParticleRemoverAlg::MUON
@ MUON
Definition: ParticleRemoverAlg.h:92
ParticleRemoverAlg::~ParticleRemoverAlg
virtual ~ParticleRemoverAlg()
Standard destructor.
Definition: ParticleRemoverAlg.cxx:34
ParticleRemoverAlg::TRUTHPARTICLE
@ TRUTHPARTICLE
Definition: ParticleRemoverAlg.h:98
ParticleRemoverAlg::finalize
virtual StatusCode finalize()
Standard Gaudi finalize method called once after the event loop.
Definition: ParticleRemoverAlg.cxx:166
ParticleRemoverAlg::m_viewContNames
Gaudi::Property< std::vector< std::string > > m_viewContNames
The names of all view containers that contain particles that we want to retain.
Definition: ParticleRemoverAlg.h:54
ParticleRemoverAlg::m_outCont
Gaudi::Property< std::string > m_outCont
The output container name.
Definition: ParticleRemoverAlg.h:48