ATLAS Offline Software
ParticleSelectionAlg.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // ParticleSelectionAlg.h
8 // Header file for class ParticleSelectionAlg
9 // Author: Karsten Koeneke <karsten.koeneke@cern.ch>
11 #ifndef EVENTUTILS_PARTICLESELECTIONALG_H
12 #define EVENTUTILS_PARTICLESELECTIONALG_H 1
13 
14 // FrameWork includes
15 #include "GaudiKernel/ToolHandle.h"
16 // #include "GaudiKernel/ServiceHandle.h"
17 // #include "AthenaBaseComps/AthAlgorithm.h"
21 
22 // STL includes
23 #include <string>
24 #include <vector>
25 
27 
28 
30  : public ExpressionParserUser<::AthAnalysisAlgorithm>
31 {
32 
34  // Public methods:
36  public:
37 
38  // Copy constructor:
39 
41  ParticleSelectionAlg( const std::string& name, ISvcLocator* pSvcLocator );
42 
44  virtual ~ParticleSelectionAlg();
45 
46 
48  virtual StatusCode initialize() override;
49 
52  virtual StatusCode start() override;
53 
55  virtual StatusCode execute() override;
56 
58  virtual StatusCode finalize() override;
59 
60  private:
62  template<class CONT, class AUXCONT>
64  const std::vector<int>& resultVec) const;
65 
66 
68  // Private data:
70  private:
72  ToolHandleArray<IAsgSelectionTool> m_selTools;
73 
75  StringProperty m_evtInfoName;
76 
78  StringProperty m_inCollKey;
79 
81  StringProperty m_outCollKey;
82 
84  BooleanProperty m_writeSplitAux;
85 
90  StringProperty m_outOwnPolicyName;
91 
94  StringProperty m_selection;
95 
99 
102  StringProperty m_cutBKCName;
103 
104 
105 
108 
110  unsigned long m_nEventsProcessed;
111 
114 
116  enum contType_t {
130  };
131 
134 
136  std::size_t m_cutBKStartIdx;
137 
140  std::vector<std::size_t> m_selToolIdxOffset;
141 
144  std::size_t m_idxSelParster;
145 
147 
148 };
149 
150 // Include the templated code here. This must be done from this header file.
151 #include "ParticleSelectionAlg.icc"
152 
153 
154 #endif //> !EVENTUTILS_PARTICLESELECTIONALG_H
ParticleSelectionAlg::m_cutBKCName
StringProperty m_cutBKCName
The name of the resulting xAOD::CutBookkeeperContainer.
Definition: ParticleSelectionAlg.h:102
ParticleSelectionAlg::TAU
@ TAU
Definition: ParticleSelectionAlg.h:121
ParticleSelectionAlg::JET
@ JET
Definition: ParticleSelectionAlg.h:122
ParticleSelectionAlg::m_selToolIdxOffset
std::vector< std::size_t > m_selToolIdxOffset
The list of pairs of the tool index of the AsgSelectionTools and the starting index of the correspond...
Definition: ParticleSelectionAlg.h:140
ParticleSelectionAlg::ParticleSelectionAlg
ParticleSelectionAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: ParticleSelectionAlg.cxx:58
ParticleSelectionAlg::ELECTRON
@ ELECTRON
Definition: ParticleSelectionAlg.h:119
ParticleSelectionAlg::m_nEventsProcessed
unsigned long m_nEventsProcessed
Internal event counter.
Definition: ParticleSelectionAlg.h:110
ExpressionParserUser.h
ParticleSelectionAlg::m_contType
contType_t m_contType
The variable that holds the value that we find for the input container.
Definition: ParticleSelectionAlg.h:133
ParticleSelectionAlg::UNKNOWN
@ UNKNOWN
Definition: ParticleSelectionAlg.h:117
ParticleSelectionAlg::m_selTools
ToolHandleArray< IAsgSelectionTool > m_selTools
The list of IAsgSelectionTools.
Definition: ParticleSelectionAlg.h:72
ParticleSelectionAlg::selectParticles
StatusCode selectParticles(const xAOD::IParticleContainer *inContainer, const std::vector< int > &resultVec) const
Private function to perform the actualy work.
ParticleSelectionAlg::TRACKPARTICLE
@ TRACKPARTICLE
Definition: ParticleSelectionAlg.h:125
IAsgSelectionTool.h
ParticleSelectionAlg::m_inCollKey
StringProperty m_inCollKey
Input container name.
Definition: ParticleSelectionAlg.h:78
ParticleSelectionAlg::execute
virtual StatusCode execute() override
Athena algorithm's execute hook.
Definition: ParticleSelectionAlg.cxx:258
ParticleSelectionAlg::m_outOwnPolicyName
StringProperty m_outOwnPolicyName
Defines the ownership policy of the output container (default: 'VIEW_ELEMENTS'; also allowed: 'OWN_EL...
Definition: ParticleSelectionAlg.h:90
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
ParticleSelectionAlg::CALOCLUSTER
@ CALOCLUSTER
Definition: ParticleSelectionAlg.h:129
ParticleSelectionAlg::TRUTHPARTICLE
@ TRUTHPARTICLE
Definition: ParticleSelectionAlg.h:126
ParticleSelectionAlg.icc
ParticleSelectionAlg::PARITCLEFLOW
@ PARITCLEFLOW
Definition: ParticleSelectionAlg.h:123
ParticleSelectionAlg::m_outOwnPolicy
SG::OwnershipPolicy m_outOwnPolicy
The internally used translation for the ownership policy.
Definition: ParticleSelectionAlg.h:113
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IParticleContainer.h
ParticleSelectionAlg::COMPOSITEPARTICLE
@ COMPOSITEPARTICLE
Definition: ParticleSelectionAlg.h:127
ParticleSelectionAlg::m_outCollKey
StringProperty m_outCollKey
Output collection name (deep copies of the original ones)
Definition: ParticleSelectionAlg.h:81
AthAnalysisAlgorithm.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ParticleSelectionAlg::m_doCutFlow
bool m_doCutFlow
If true (deault: false), do the bookkeeping of how many particles passed which selection cuts.
Definition: ParticleSelectionAlg.h:98
ExpressionParserUser
Definition: ExpressionParserUser.h:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ParticleSelectionAlg::NEUTRALPARTICLE
@ NEUTRALPARTICLE
Definition: ParticleSelectionAlg.h:124
ParticleSelectionAlg::PHOTON
@ PHOTON
Definition: ParticleSelectionAlg.h:118
ParticleSelectionAlg::start
virtual StatusCode start() override
Athena algorithm's beginRun hook (called once before running over the events, after initialize)
Definition: ParticleSelectionAlg.cxx:167
ParticleSelectionAlg::~ParticleSelectionAlg
virtual ~ParticleSelectionAlg()
Destructor:
Definition: ParticleSelectionAlg.cxx:101
ParticleSelectionAlg::MUON
@ MUON
Definition: ParticleSelectionAlg.h:120
ParticleSelectionAlg::m_evtInfoName
StringProperty m_evtInfoName
Name of the EventInfo object.
Definition: ParticleSelectionAlg.h:75
ParticleSelectionAlg::initialize
virtual StatusCode initialize() override
Athena algorithm's initalize hook.
Definition: ParticleSelectionAlg.cxx:108
ParticleSelectionAlg::PARTICLE
@ PARTICLE
Definition: ParticleSelectionAlg.h:128
ParticleSelectionAlg::contType_t
contType_t
An enumaration for the actual container type.
Definition: ParticleSelectionAlg.h:116
ParticleSelectionAlg
Definition: ParticleSelectionAlg.h:31
ParticleSelectionAlg::m_idxSelParster
std::size_t m_idxSelParster
Store the index of the CutBookKeeper in the CutBookkeeperContainer for the selection using the Expres...
Definition: ParticleSelectionAlg.h:144
ParticleSelectionAlg::m_writeSplitAux
BooleanProperty m_writeSplitAux
Decide if we want to write a fully-split AuxContainer such that we can remove any variables.
Definition: ParticleSelectionAlg.h:84
ParticleSelectionAlg::finalize
virtual StatusCode finalize() override
Athena algorithm's finalize hook.
Definition: ParticleSelectionAlg.cxx:153
ParticleSelectionAlg::m_cutBKStartIdx
std::size_t m_cutBKStartIdx
The starting index of where in the CutBookkeeperContainer our new CutBookkeepers start.
Definition: ParticleSelectionAlg.h:136
ParticleSelectionAlg::m_selection
StringProperty m_selection
The selection string that will select which xAOD::IParticles to keep from an xAOD::IParticleContainer...
Definition: ParticleSelectionAlg.h:94