Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
this wraps the Electron LRT collection merger in a CP algorithm
More...
#include <ElectronLRTMergingAlg.h>
|
| ElectronLRTMergingAlg (const std::string &name, ISvcLocator *pSvcLocator) |
| the standard constructor More...
|
|
StatusCode | initialize () override |
|
StatusCode | execute (const EventContext &ctx) const override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
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 |
|
|
Gaudi::Property< bool > | m_createViewCollection {this, "CreateViewCollection", true, "Create a view to avoid deep copy"} |
| Protected data:
More...
|
|
Gaudi::Property< bool > | m_doRemoval {this, "doRemoval", true, "Remove overlapping electrons from output collection."} |
| Create a view to avoid deep copy. More...
|
|
Gaudi::Property< float > | m_ORThreshold {this, "ORThreshold", 0.001, "Delta R threshold for matching in overlap removal."} |
| Remove overlapping electrons from output collection. More...
|
|
Gaudi::Property< int > | m_ORstrategy {this, "overlapStrategy", CP::IElectronLRTOverlapRemovalTool::defaultStrategy, "Overlap removal strategy to use (0 = default)"} |
| Delta R threshold for matching in overlap removal. More...
|
|
Gaudi::Property< bool > | m_isDAOD {this, "isDAOD", true, "Switch for running on AOD (false) or DAOD (true)"} |
|
SG::ReadHandleKey< xAOD::ElectronContainer > | m_promptElectronLocation {this, "PromptElectronLocation", "Electrons", "Prompt electrons to merge"} |
| Switches method for retrieving electron ID. More...
|
|
SG::ReadHandleKey< xAOD::ElectronContainer > | m_lrtElectronLocation {this, "LRTElectronLocation", "LRTElectrons", "LRT electrons to merge"} |
| Standard electron collection to be merged. More...
|
|
SG::WriteHandleKey< xAOD::ElectronContainer > | m_outElectronLocation {this, "OutputCollectionName", "StdWithLRTElectrons", "Name for combined output collection"} |
| LRT electron collection to be merged. More...
|
|
ToolHandle< CP::IElectronLRTOverlapRemovalTool > | m_overlapRemovalTool {this, "overlapRemovalTool", "", "Tool used to check overlaps between standard and LRT electrons"} |
| Combined electron collection. More...
|
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_promptIsLRTKey { this, "PromptIsLRTKey", m_promptElectronLocation, "isLRT" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_lrtIsLRTKey { this, "LRTIsLRTKey", m_lrtElectronLocation, "isLRT" } |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
|
|
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 |
|
this wraps the Electron LRT collection merger in a CP algorithm
Definition at line 32 of file ElectronLRTMergingAlg.h.
◆ StoreGateSvc_t
◆ ElectronLRTMergingAlg()
CP::ElectronLRTMergingAlg::ElectronLRTMergingAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ 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);
◆ 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.
◆ 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.
◆ 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 CP::ElectronLRTMergingAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
override |
Definition at line 56 of file ElectronLRTMergingAlg.cxx.
60 std::unique_ptr<ConstDataVector<xAOD::ElectronContainer>> transientContainer = std::make_unique<ConstDataVector<xAOD::ElectronContainer>>(
SG::VIEW_ELEMENTS);
61 std::unique_ptr<xAOD::ElectronContainer> outputCol = std::make_unique<xAOD::ElectronContainer>();
64 std::unique_ptr<xAOD::ElectronAuxContainer> outputAuxCol;
69 outputAuxCol = std::make_unique<xAOD::ElectronAuxContainer>();
70 outputCol->setStore(outputAuxCol.get());
76 if (!promptCol.isValid())
79 return StatusCode::FAILURE;
81 if (!lrtCol.isValid())
84 return StatusCode::FAILURE;
88 std::set<const xAOD::Electron *> ElectronsToRemove;
91 ATH_MSG_DEBUG(
"Size of overlapping electrons to remove: " << ElectronsToRemove.size());
105 transientContainer->reserve(promptCol->size() + lrtCol->size());
107 mergeElectron(*promptCol, transientContainer.get(), ElectronsToRemove);
108 mergeElectron(*lrtCol, transientContainer.get(), ElectronsToRemove);
112 outputCol->reserve(promptCol->size() + lrtCol->size());
114 mergeElectron(*promptCol, outputCol.get(), ElectronsToRemove);
126 ATH_CHECK(h_write.record(std::move(outputCol), std::move(outputAuxCol)));
131 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()
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.
◆ filterPassed()
◆ finalize()
StatusCode EL::AnaReentrantAlgorithm::finalize |
( |
| ) |
|
|
protectedinherited |
finalize this algorithm
This gets called after event processing has finished. The last event may no longer be in memory, and the code should not try to access it.
Definition at line 102 of file AnaReentrantAlgorithm.cxx.
105 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CP::ElectronLRTMergingAlg::initialize |
( |
| ) |
|
|
override |
if the tool is not user-set, configure the automatic instance via our overlap flag
Definition at line 28 of file ElectronLRTMergingAlg.cxx.
52 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.
◆ isClonable()
◆ mergeElectron() [1/2]
A routine that merges the electron collections in the transient case.
Definition at line 176 of file ElectronLRTMergingAlg.cxx.
181 if (!electronCol.
empty())
185 for (
const auto *
const electron : electronCol)
188 if (
m_doRemoval && ElectronsToRemove.find(electron) != ElectronsToRemove.end())
195 ATH_MSG_DEBUG(
"Size of transient merged electron collection " << outputCol->size());
◆ mergeElectron() [2/2]
The lrt electron overlap removal tool.
Protected methods:
A routine that merges the electron collections in the copy case.
Definition at line 138 of file ElectronLRTMergingAlg.cxx.
143 if (!electronCol.
empty())
150 for (
const auto *
const electron : electronCol)
153 if (
m_doRemoval && ElectronsToRemove.find(electron) != ElectronsToRemove.end())
157 std::unique_ptr<xAOD::Electron> newElectron = std::make_unique<xAOD::Electron>(*electron);
160 originalElectronLink(*newElectron) = eLink;
164 outputCol->
push_back(std::move(newElectron));
169 ATH_MSG_DEBUG(
"Size of merged output electron collection " << outputCol->
size());
◆ 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.
◆ renounce()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.
◆ sysInitialize()
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ 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_createViewCollection
Gaudi::Property<bool> CP::ElectronLRTMergingAlg::m_createViewCollection {this, "CreateViewCollection", true, "Create a view to avoid deep copy"} |
|
private |
◆ m_detStore
◆ m_doRemoval
Gaudi::Property<bool> CP::ElectronLRTMergingAlg::m_doRemoval {this, "doRemoval", true, "Remove overlapping electrons from output collection."} |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 114 of file AthCommonReentrantAlgorithm.h.
◆ m_isDAOD
Gaudi::Property<bool> CP::ElectronLRTMergingAlg::m_isDAOD {this, "isDAOD", true, "Switch for running on AOD (false) or DAOD (true)"} |
|
private |
◆ m_lrtElectronLocation
◆ m_lrtIsLRTKey
◆ m_ORstrategy
Gaudi::Property<int> CP::ElectronLRTMergingAlg::m_ORstrategy {this, "overlapStrategy", CP::IElectronLRTOverlapRemovalTool::defaultStrategy, "Overlap removal strategy to use (0 = default)"} |
|
private |
Delta R threshold for matching in overlap removal.
allows to pass an overlap removal strategy to the underlying removal tool, without manually configuring said tool. Advantageous in certain analysis frameworks.
Definition at line 58 of file ElectronLRTMergingAlg.h.
◆ m_ORThreshold
Gaudi::Property<float> CP::ElectronLRTMergingAlg::m_ORThreshold {this, "ORThreshold", 0.001, "Delta R threshold for matching in overlap removal."} |
|
private |
◆ m_outElectronLocation
◆ m_overlapRemovalTool
◆ m_promptElectronLocation
◆ m_promptIsLRTKey
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Gaudi::Property< bool > m_isDAOD
SG::ReadHandleKey< xAOD::ElectronContainer > m_lrtElectronLocation
Standard electron collection to be merged.
Gaudi::Property< bool > m_createViewCollection
Protected data:
Helper class to provide type-safe access to aux data.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_promptIsLRTKey
Gaudi::Property< bool > m_doRemoval
Create a view to avoid deep copy.
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Gaudi::Property< int > m_ORstrategy
Delta R threshold for matching in overlap removal.
Helper class to provide type-safe access to aux data.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
SG::WriteHandleKey< xAOD::ElectronContainer > m_outElectronLocation
LRT electron collection to be merged.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ElementLink implementation for ROOT usage.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
the base class for EventLoop reentrant algorithms
ToolHandle< CP::IElectronLRTOverlapRemovalTool > m_overlapRemovalTool
Combined electron collection.
SG::WriteDecorHandleKey< xAOD::ElectronContainer > m_lrtIsLRTKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void mergeElectron(const xAOD::ElectronContainer &electronCol, xAOD::ElectronContainer *outputCol, const std::set< const xAOD::Electron * > &LRTElectronsToRemove) const
The lrt electron overlap removal tool.
#define ATH_MSG_WARNING(x)
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
SG::ReadHandleKey< xAOD::ElectronContainer > m_promptElectronLocation
Switches method for retrieving electron ID.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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>
bool empty() const noexcept
Returns true if the collection is empty.