|
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 > &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 |
|
|
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 |
| 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 |
|
) |
| |
Standard constructor.
Definition at line 28 of file ParticleRemoverAlg.cxx.
50 "The name of the output container with the deep copy of input objects" );
53 "The string seperator between the output container name and the sytematic variation (default='___')" );
56 "The names of all suffixes for the input and output container names" );
59 "The names of all view containers that contain particles that we want to retain" );
62 "Boolean to decide if the existing view containers should be re-mapped (default: true)" );
65 "Prefix to be used for all created output view containers" );
◆ ~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 210 of file ParticleRemoverAlg.cxx.
234 ATH_MSG_FATAL(
"We couldn't determine the type of the container... abort!");
235 return StatusCode::FAILURE;
246 if ( inContSize != inCont->size() ){
247 ATH_MSG_FATAL(
"The input container and its shallow copies don't have the same size! Aborting...");
248 return StatusCode::FAILURE;
255 std::vector<bool> keepParticleVec (inContSize,
false);
262 if ( inViewCont->
size() > inContSize ){
263 ATH_MSG_FATAL(
"One of the input view containers is larger than the input container... aborting.");
264 return StatusCode::FAILURE;
267 const std::size_t
idx =
part->index();
268 keepParticleVec[
idx] =
true;
274 ATH_CHECK( this->removeParticles<xAOD::PhotonContainer>(keepParticleVec) );
277 ATH_CHECK( this->removeParticles<xAOD::ElectronContainer>(keepParticleVec) );
280 ATH_CHECK( this->removeParticles<xAOD::MuonContainer>(keepParticleVec) );
283 ATH_CHECK( this->removeParticles<xAOD::TauJetContainer>(keepParticleVec) );
286 ATH_CHECK( this->removeParticles<xAOD::JetContainer>(keepParticleVec) );
289 ATH_CHECK( this->removeParticles<xAOD::TruthParticleContainer>(keepParticleVec) );
292 ATH_CHECK( this->removeParticles<xAOD::CompositeParticleContainer>(keepParticleVec) );
295 ATH_CHECK( this->removeParticles<xAOD::PFOContainer>(keepParticleVec) );
298 ATH_CHECK( this->removeParticles<xAOD::NeutralParticleContainer>(keepParticleVec) );
301 ATH_CHECK( this->removeParticles<xAOD::TrackParticleContainer>(keepParticleVec) );
304 ATH_CHECK( this->removeParticles<xAOD::ParticleContainer>(keepParticleVec) );
307 ATH_CHECK( this->removeParticles<xAOD::CaloClusterContainer>(keepParticleVec) );
310 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 201 of file ParticleRemoverAlg.cxx.
205 return StatusCode::SUCCESS;
◆ initialize()
StatusCode ParticleRemoverAlg::initialize |
( |
| ) |
|
|
virtual |
Standard Gaudi initialize method called once before the event loop.
Definition at line 72 of file ParticleRemoverAlg.cxx.
87 ATH_MSG_ERROR(
"Wrong user setup! You need to give a valid name for both the Input, Output, and SelectedViewContainers!");
88 return StatusCode::FAILURE;
95 const std::size_t totSize = 1 +
m_suffixes.value().size();
101 for ( std::size_t
i=1;
i<totSize; ++
i ) {
102 const std::string& currentSuffix =
m_suffixes.value()[
i-1];
103 ATH_MSG_VERBOSE(
"Using current suffix " << currentSuffix <<
" to search for matching containers");
104 if ( currentSuffix.rfind(
m_separator.value(),0 ) == 0 ) {
131 for ( std::size_t
i=0;
i<totSize; ++
i ) {
135 std::vector<std::string> inViewNames;
136 std::vector<std::string> outViewNames;
138 ATH_MSG_VERBOSE(
"Looking at input view container name: " << inViewName);
140 if (
pos == std::string::npos ){
142 inViewNames.push_back(inViewName);
143 outViewNames.push_back(
m_outPrefix.value() + inViewName );
144 ATH_MSG_VERBOSE(
"Added input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
148 const std::string foundSuffix = inViewName.substr(
pos, std::string::npos);
152 inViewNames.push_back(inViewName);
153 outViewNames.push_back(
m_outPrefix.value() + inViewName );
154 ATH_MSG_VERBOSE(
"Added2 input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
162 const std::string& currentSuffix =
m_suffixes.value()[
i-1];
164 std::vector<std::string> inViewNames;
165 std::vector<std::string> outViewNames;
167 ATH_MSG_VERBOSE(
"Looking at current input view container name: " << inViewName);
168 if ( inViewName.find(
m_separator.value()+currentSuffix) != std::string::npos ){
169 inViewNames.push_back(inViewName);
170 outViewNames.push_back(
m_outPrefix.value() + inViewName );
171 ATH_MSG_VERBOSE(
"Added3 input name " << inViewNames.back() <<
" and output name " << outViewNames.back());
186 ATH_MSG_VERBOSE(
" Have " << inViewNameList.size() <<
" in view elements and " << outViewNameList.size() <<
" out view elements");
187 for ( std::size_t j=0; j<inViewNameList.size(); ++j ){
189 const std::string& inName = inViewNameList[j];
190 const std::string&
outName = outViewNameList[j];
196 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
StringProperty ParticleRemoverAlg::m_inCont |
|
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
StringProperty ParticleRemoverAlg::m_outCont |
|
private |
◆ m_outContList
◆ m_outContNameList
std::vector<std::string> ParticleRemoverAlg::m_outContNameList |
|
private |
◆ m_outPrefix
StringProperty ParticleRemoverAlg::m_outPrefix |
|
private |
◆ m_outViewContNameListList
std::vector< std::vector<std::string> > ParticleRemoverAlg::m_outViewContNameListList |
|
private |
◆ m_resetViewConts
BooleanProperty ParticleRemoverAlg::m_resetViewConts |
|
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
StringProperty ParticleRemoverAlg::m_separator |
|
private |
The string separator between the output container name and the sytematic variation (default="___")
Definition at line 45 of file ParticleRemoverAlg.h.
◆ m_suffixes
StringArrayProperty ParticleRemoverAlg::m_suffixes |
|
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
StringArrayProperty ParticleRemoverAlg::m_viewContNames |
|
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::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StringArrayProperty m_suffixes
The names of all suffixes for the input and output container names.
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.
virtual void setOwner(IDataHandleHolder *o)=0
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.
BooleanProperty m_resetViewConts
Boolean to decide if the existing view containers should be re-mapped (default: true)
StringArrayProperty m_viewContNames
The names of all view containers that contain particles that we want to retain.
std::vector< std::string > m_inContNameList
Vector of all input container names.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
StringProperty m_outCont
The output container name.
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:
StringProperty m_separator
The string separator between the output container name and the sytematic variation (default="___")
StringProperty m_outPrefix
Prefix to be used for all created output view containers.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
StringProperty m_inCont
The input container name.