 |
ATLAS Offline Software
|
#include <ParticleRemoverAlg.h>
|
| ParticleRemoverAlg (const std::string &name, ISvcLocator *pSvcLocator) |
| Standard constructor. More...
|
|
virtual | ~ParticleRemoverAlg () |
| Standard destructor. More...
|
|
virtual StatusCode | initialize () |
| Standard Gaudi initialize method called once before the event loop. More...
|
|
virtual StatusCode | execute () |
| Standard Gaudi execute method called once for every event. More...
|
|
virtual StatusCode | finalize () |
| Standard Gaudi finalize method called once after the event loop. More...
|
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
template<class CONT > |
StatusCode | removeParticles (const std::vector< bool > &keepParticleVec) |
| Private function to perform the actualy work. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
DataObjIDColl | m_extendedExtraObjects |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
|
Gaudi::Property< std::string > | m_inCont {this, "Input", "", "Input container name"} |
| The input container name. More...
|
|
Gaudi::Property< std::string > | m_separator {this, "Separator", "___", "The string separator between the output container name and the sytematic variation"} |
| The string separator between the output container name and the sytematic variation (default="___") More...
|
|
Gaudi::Property< std::string > | m_outCont {this, "Output", "", "The name of the output container with the deep copy of input objects"} |
| The output container name. More...
|
|
Gaudi::Property< std::vector< std::string > > | m_suffixes {this, "Suffixes", {}, "The names of all suffixes for the input and output container names"} |
| The names of all suffixes for the input and output container names. More...
|
|
Gaudi::Property< std::vector< std::string > > | m_viewContNames {this, "SelectedViewContainers", {}, "The names of all view containers that contain particles that we want to retain"} |
| The names of all view containers that contain particles that we want to retain. More...
|
|
Gaudi::Property< bool > | m_resetViewConts {this, "RemapViewContainers", true, "Boolean to decide if the existing view containers should be re-mapped"} |
| Boolean to decide if the existing view containers should be re-mapped (default: true) More...
|
|
Gaudi::Property< std::string > | m_outPrefix {this, "OutputViewContainerPrefix", "", "Prefix to be used for all created output view containers"} |
| Prefix to be used for all created output view containers. More...
|
|
|
enum | contType_t {
UNKNOWN,
PHOTON,
ELECTRON,
MUON,
TAU,
JET,
PARITCLEFLOW,
NEUTRALPARTICLE,
TRACKPARTICLE,
TRUTHPARTICLE,
COMPOSITEPARTICLE,
PARTICLE,
CALOCLUSTER
} |
| An enumaration for the actual container type. More...
|
|
std::vector< std::string > | m_inContNameList |
| Vector of all input container names. More...
|
|
std::vector< std::string > | m_outContNameList |
| Vector of all output container names. More...
|
|
std::vector< const xAOD::IParticleContainer * > | m_inContList |
| Vector of all input containers. More...
|
|
std::vector< xAOD::IParticleContainer * > | m_outContList |
| Vector of all output containers. More...
|
|
std::vector< std::vector< std::string > > | m_inViewContNameListList |
| Vector of all input view container names. More...
|
|
std::vector< std::vector< std::string > > | m_outViewContNameListList |
| Vector of all output view container names. More...
|
|
contType_t | m_contType {UNKNOWN} |
| The variable that holds the value that we find for the input container. More...
|
|
Definition at line 14 of file ParticleRemoverAlg.h.
◆ StoreGateSvc_t
◆ contType_t
An enumaration for the actual container type.
Enumerator |
---|
UNKNOWN | |
PHOTON | |
ELECTRON | |
MUON | |
TAU | |
JET | |
PARITCLEFLOW | |
NEUTRALPARTICLE | |
TRACKPARTICLE | |
TRUTHPARTICLE | |
COMPOSITEPARTICLE | |
PARTICLE | |
CALOCLUSTER | |
Definition at line 88 of file ParticleRemoverAlg.h.
◆ ParticleRemoverAlg()
ParticleRemoverAlg::ParticleRemoverAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~ParticleRemoverAlg()
ParticleRemoverAlg::~ParticleRemoverAlg |
( |
| ) |
|
|
virtual |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode ParticleRemoverAlg::execute |
( |
| ) |
|
|
virtual |
Standard Gaudi execute method called once for every event.
Definition at line 175 of file ParticleRemoverAlg.cxx.
199 ATH_MSG_FATAL(
"We couldn't determine the type of the container... abort!");
200 return StatusCode::FAILURE;
211 if ( inContSize != inCont->size() ){
212 ATH_MSG_FATAL(
"The input container and its shallow copies don't have the same size! Aborting...");
213 return StatusCode::FAILURE;
220 std::vector<bool> keepParticleVec (inContSize,
false);
227 if ( inViewCont->
size() > inContSize ){
228 ATH_MSG_FATAL(
"One of the input view containers is larger than the input container... aborting.");
229 return StatusCode::FAILURE;
232 const std::size_t
idx =
part->index();
233 keepParticleVec[
idx] =
true;
239 ATH_CHECK( this->removeParticles<xAOD::PhotonContainer>(keepParticleVec) );
242 ATH_CHECK( this->removeParticles<xAOD::ElectronContainer>(keepParticleVec) );
245 ATH_CHECK( this->removeParticles<xAOD::MuonContainer>(keepParticleVec) );
248 ATH_CHECK( this->removeParticles<xAOD::TauJetContainer>(keepParticleVec) );
251 ATH_CHECK( this->removeParticles<xAOD::JetContainer>(keepParticleVec) );
254 ATH_CHECK( this->removeParticles<xAOD::TruthParticleContainer>(keepParticleVec) );
257 ATH_CHECK( this->removeParticles<xAOD::CompositeParticleContainer>(keepParticleVec) );
260 ATH_CHECK( this->removeParticles<xAOD::PFOContainer>(keepParticleVec) );
263 ATH_CHECK( this->removeParticles<xAOD::NeutralParticleContainer>(keepParticleVec) );
266 ATH_CHECK( this->removeParticles<xAOD::TrackParticleContainer>(keepParticleVec) );
269 ATH_CHECK( this->removeParticles<xAOD::ParticleContainer>(keepParticleVec) );
272 ATH_CHECK( this->removeParticles<xAOD::CaloClusterContainer>(keepParticleVec) );
275 return StatusCode::SUCCESS;
◆ 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()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode ParticleRemoverAlg::finalize |
( |
| ) |
|
|
virtual |
Standard Gaudi finalize method called once after the event loop.
Definition at line 166 of file ParticleRemoverAlg.cxx.
170 return StatusCode::SUCCESS;
◆ initialize()
StatusCode ParticleRemoverAlg::initialize |
( |
| ) |
|
|
virtual |
Standard Gaudi initialize method called once before the event loop.
Definition at line 37 of file ParticleRemoverAlg.cxx.
52 ATH_MSG_ERROR(
"Wrong user setup! You need to give a valid name for both the Input, Output, and SelectedViewContainers!");
53 return StatusCode::FAILURE;
60 const std::size_t totSize = 1 +
m_suffixes.value().size();
66 for ( std::size_t
i=1;
i<totSize; ++
i ) {
67 const std::string& currentSuffix =
m_suffixes.value()[
i-1];
68 ATH_MSG_VERBOSE(
"Using current suffix " << currentSuffix <<
" to search for matching containers");
69 if ( currentSuffix.rfind(
m_separator.value(),0 ) == 0 ) {
96 for ( std::size_t
i=0;
i<totSize; ++
i ) {
100 std::vector<std::string> inViewNames;
101 std::vector<std::string> outViewNames;
103 ATH_MSG_VERBOSE(
"Looking at input view container name: " << inViewName);
105 if (
pos == std::string::npos ){
107 inViewNames.push_back(inViewName);
108 outViewNames.push_back(
m_outPrefix.value() + inViewName );
109 ATH_MSG_VERBOSE(
"Added input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
113 const std::string foundSuffix = inViewName.substr(
pos, std::string::npos);
117 inViewNames.push_back(inViewName);
118 outViewNames.push_back(
m_outPrefix.value() + inViewName );
119 ATH_MSG_VERBOSE(
"Added2 input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
127 const std::string& currentSuffix =
m_suffixes.value()[
i-1];
129 std::vector<std::string> inViewNames;
130 std::vector<std::string> outViewNames;
132 ATH_MSG_VERBOSE(
"Looking at current input view container name: " << inViewName);
133 if ( inViewName.find(
m_separator.value()+currentSuffix) != std::string::npos ){
134 inViewNames.push_back(inViewName);
135 outViewNames.push_back(
m_outPrefix.value() + inViewName );
136 ATH_MSG_VERBOSE(
"Added3 input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
151 ATH_MSG_VERBOSE(
" Have " << inViewNameList.size() <<
" in view elements and " << outViewNameList.size() <<
" out view elements");
152 for ( std::size_t j=0; j<inViewNameList.size(); ++j ){
154 const std::string& inName = inViewNameList[j];
155 const std::string&
outName = outViewNameList[j];
161 return StatusCode::SUCCESS;
◆ 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.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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.
◆ removeParticles()
template<class CONT >
StatusCode ParticleRemoverAlg::removeParticles |
( |
const std::vector< bool > & |
keepParticleVec | ) |
|
|
private |
Private function to perform the actualy work.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ 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()
◆ m_contType
The variable that holds the value that we find for the input container.
Definition at line 105 of file ParticleRemoverAlg.h.
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_inCont
Gaudi::Property<std::string> ParticleRemoverAlg::m_inCont {this, "Input", "", "Input container name"} |
|
private |
◆ m_inContList
◆ m_inContNameList
std::vector<std::string> ParticleRemoverAlg::m_inContNameList |
|
private |
◆ m_inViewContNameListList
std::vector< std::vector<std::string> > ParticleRemoverAlg::m_inViewContNameListList |
|
private |
◆ m_outCont
Gaudi::Property<std::string> ParticleRemoverAlg::m_outCont {this, "Output", "", "The name of the output container with the deep copy of input objects"} |
|
private |
◆ m_outContList
◆ m_outContNameList
std::vector<std::string> ParticleRemoverAlg::m_outContNameList |
|
private |
◆ m_outPrefix
Gaudi::Property<std::string> ParticleRemoverAlg::m_outPrefix {this, "OutputViewContainerPrefix", "", "Prefix to be used for all created output view containers"} |
|
private |
◆ m_outViewContNameListList
std::vector< std::vector<std::string> > ParticleRemoverAlg::m_outViewContNameListList |
|
private |
◆ m_resetViewConts
Gaudi::Property<bool> ParticleRemoverAlg::m_resetViewConts {this, "RemapViewContainers", true, "Boolean to decide if the existing view containers should be re-mapped"} |
|
private |
Boolean to decide if the existing view containers should be re-mapped (default: true)
Definition at line 57 of file ParticleRemoverAlg.h.
◆ m_separator
Gaudi::Property<std::string> ParticleRemoverAlg::m_separator {this, "Separator", "___", "The string separator between the output container name and the sytematic variation"} |
|
private |
The string separator between the output container name and the sytematic variation (default="___")
Definition at line 45 of file ParticleRemoverAlg.h.
◆ m_suffixes
Gaudi::Property<std::vector<std::string> > ParticleRemoverAlg::m_suffixes {this, "Suffixes", {}, "The names of all suffixes for the input and output container names"} |
|
private |
The names of all suffixes for the input and output container names.
Definition at line 51 of file ParticleRemoverAlg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_viewContNames
Gaudi::Property<std::vector<std::string> > ParticleRemoverAlg::m_viewContNames {this, "SelectedViewContainers", {}, "The names of all view containers that contain particles that we want to retain"} |
|
private |
The names of all view containers that contain particles that we want to retain.
Definition at line 54 of file ParticleRemoverAlg.h.
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
std::vector< std::string > m_outContNameList
Vector of all output container names.
std::vector< std::vector< std::string > > m_outViewContNameListList
Vector of all output view container names.
std::string find(const std::string &s)
return a remapped string
contType_t m_contType
The variable that holds the value that we find for the input container.
Gaudi::Property< std::vector< std::string > > m_suffixes
The names of all suffixes for the input and output container names.
Gaudi::Property< bool > m_resetViewConts
Boolean to decide if the existing view containers should be re-mapped (default: true)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
Class providing the definition of the 4-vector interface.
Gaudi::Property< std::string > m_inCont
The input container name.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Gaudi::Property< std::string > m_separator
The string separator between the output container name and the sytematic variation (default="___")
std::vector< std::string > m_inContNameList
Vector of all input container names.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Gaudi::Property< std::string > m_outPrefix
Prefix to be used for all created output view containers.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::vector< std::vector< std::string > > m_inViewContNameListList
Vector of all input view container names.
std::vector< const xAOD::IParticleContainer * > m_inContList
Vector of all input containers.
DataObjIDColl m_extendedExtraObjects
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::vector< xAOD::IParticleContainer * > m_outContList
Vector of all output containers.
AthAlgorithm()
Default constructor:
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< std::vector< std::string > > m_viewContNames
The names of all view containers that contain particles that we want to retain.
Gaudi::Property< std::string > m_outCont
The output container name.