ATLAS Offline Software
Loading...
Searching...
No Matches
IsolationBuilder Class Reference

#include <IsolationBuilder.h>

Inheritance diagram for IsolationBuilder:
Collaboration diagram for IsolationBuilder:

Classes

struct  CaloIsoHelpHandles
struct  CaloIsoHelpKey
struct  TrackIsoHelpHandles
struct  TrackIsoHelpKey

Public Member Functions

 IsolationBuilder (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters:
virtual ~IsolationBuilder ()
 Destructor:
virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode finalize () override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

 IsolationBuilder ()
 Default constructor:
StatusCode initializeIso (std::set< xAOD::Iso::IsolationFlavour > &runIsoType, std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > *caloIsoMap, std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > *trackIsoMap, const std::string &containerName, const std::vector< std::vector< int > > &isoInts, const std::vector< std::vector< int > > &corInts, const std::vector< std::vector< int > > &corIntsExtra, const std::string &customConfig)
 called by algorithm initialize per object (electron, photon, forward electron, muon)
StatusCode addCaloIsoCorrections (size_t flavor, xAOD::Iso::IsolationFlavour isoFlav, CaloIsoHelpKey &cisoH, const std::vector< std::vector< int > > &corInts, bool corrsAreExtra, const std::string &prefix, const std::string &customConfig)
 called by initializeIso
StatusCode addTrackIsoCorrections (size_t flavor, xAOD::Iso::IsolationFlavour isoFlav, TrackIsoHelpKey &tisoH, const std::vector< std::vector< int > > &corInts, bool corrsAreExtra, const std::string &prefix, const std::string &customConfig)
 called by initializeIso
StatusCode executeCaloIso (const std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > &caloIsoMap, const CaloCellContainer *cellColl) const
StatusCode executeTrackIso (const std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > &trackIsoMap) const
void declareIso (std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > &caloIso)
void declareIso (std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > &trackIso)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static bool isCoreCor (xAOD::Iso::IsolationCaloCorrection corr)

Private Attributes

Gaudi::Property< std::string > m_ElectronContainerName
 Containers (Is it best to make them as strings? Used by multiple handles)
Gaudi::Property< std::string > m_FwdElectronContainerName
Gaudi::Property< std::string > m_PhotonContainerName
Gaudi::Property< std::string > m_MuonContainerName
ToolHandle< xAOD::ICaloCellIsolationToolm_cellIsolationTool
 Tool for cell isolation calculation.
SG::ReadHandleKey< CaloCellContainerm_cellsKey
 Cell container.
ToolHandle< xAOD::ICaloTopoClusterIsolationToolm_topoIsolationTool
 Tool for topo isolation calculation.
ToolHandle< xAOD::INeutralEFlowIsolationToolm_pflowIsolationTool
 Tool for neutral pflow isolation calculation.
ToolHandle< xAOD::ITrackIsolationToolm_trackIsolationTool
 Tool for neutral pflow isolation calculation.
Gaudi::Property< bool > m_isTrigger { this, "IsTrigger", false }
 is the alg run at trigger level
Gaudi::Property< bool > m_useBremAssoc
Gaudi::Property< bool > m_allTrackRemoval { this, "AllTrackRemoval", true }
Gaudi::Property< bool > m_storepileupCorrection { this, "storepileupCorrection", false }
Gaudi::Property< std::vector< std::vector< int > > > m_elisoInts
 Isolation types.
Gaudi::Property< std::vector< std::vector< int > > > m_elcorInts
Gaudi::Property< std::vector< std::vector< int > > > m_elcorIntsExtra
Gaudi::Property< std::vector< std::vector< int > > > m_phisoInts
 Isolation types (for the alg.
Gaudi::Property< std::vector< std::vector< int > > > m_phcorInts
Gaudi::Property< std::vector< std::vector< int > > > m_phcorIntsExtra
Gaudi::Property< std::vector< std::vector< int > > > m_muisoInts
Gaudi::Property< std::vector< std::vector< int > > > m_mucorInts
Gaudi::Property< std::vector< std::vector< int > > > m_mucorIntsExtra
Gaudi::Property< std::vector< std::vector< int > > > m_feisoInts
Gaudi::Property< std::vector< std::vector< int > > > m_fecorInts
Gaudi::Property< std::vector< std::vector< int > > > m_fecorIntsExtra
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_elCaloIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_phCaloIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_feCaloIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_muCaloIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_elTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_phTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_muTrackIso
Gaudi::Property< std::string > m_customConfigEl
Gaudi::Property< std::string > m_customConfigPh
Gaudi::Property< std::string > m_customConfigFwd
Gaudi::Property< std::string > m_customConfigMu
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 44 of file IsolationBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ IsolationBuilder() [1/2]

IsolationBuilder::IsolationBuilder ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor with parameters:

Definition at line 18 of file IsolationBuilder.cxx.

20 : ::AthReentrantAlgorithm(name, pSvcLocator)
21{}

◆ ~IsolationBuilder()

IsolationBuilder::~IsolationBuilder ( )
virtualdefault

Destructor:

◆ IsolationBuilder() [2/2]

IsolationBuilder::IsolationBuilder ( )
private

Default constructor:

Member Function Documentation

◆ addCaloIsoCorrections()

StatusCode IsolationBuilder::addCaloIsoCorrections ( size_t flavor,
xAOD::Iso::IsolationFlavour isoFlav,
CaloIsoHelpKey & cisoH,
const std::vector< std::vector< int > > & corInts,
bool corrsAreExtra,
const std::string & prefix,
const std::string & customConfig )
private

called by initializeIso

Definition at line 401 of file IsolationBuilder.cxx.

409{
410
411 if (!corrsAreExtra) {
412 std::string bitsetName =
413 prefix + xAOD::Iso::toString(isoFlav) + "CorrBitset";
414 if (!customConfig.empty()) {
415 bitsetName += "_" + customConfig;
416 }
417
418 cisoH.corrBitsetDeco = bitsetName;
419 ATH_MSG_DEBUG("Initializing non extra corr : " << cisoH.corrBitsetDeco.key());
420 ATH_CHECK(cisoH.corrBitsetDeco.initialize());
421 }
422
423 for (size_t corrType = 0; corrType < corInts[flavor].size(); corrType++) {
424 // iterate over the calo isolation corrections
425 const auto cor = static_cast<unsigned int>(corInts[flavor][corrType]);
426 if (!corrsAreExtra)
427 cisoH.CorrList.calobitset.set(cor);
429 static_cast<xAOD::Iso::IsolationCaloCorrection>(cor);
430
431 if (isCoreCor(isoCor)) {
432 std::string isoCorName = prefix;
433 if (isoCor != xAOD::Iso::core57cells) {
434 isoCorName += xAOD::Iso::toString(isoFlav); // since this doesn't depend on the flavor, just have one
435 }
436
437 // a core correction; only store core energy, not the core area
438 isoCorName += xAOD::Iso::toString(isoCor) +
440 if (!customConfig.empty()) {
441 isoCorName += "_" + customConfig;
442 }
443 cisoH.coreCorDeco.emplace(isoCor, isoCorName);
444 cisoH.coreCorDeco[isoCor].setOwner(this);
445 ATH_MSG_DEBUG("initializing " << cisoH.coreCorDeco[isoCor].key());
446 ATH_CHECK(cisoH.coreCorDeco[isoCor].initialize());
447 } else {
448 // noncore correction
450 continue;
451 cisoH.noncoreCorDeco.emplace(
453 auto& vec = cisoH.noncoreCorDeco[isoCor];
454 vec.setOwner(this);
455 for (auto type : cisoH.isoTypes) {
456 std::string corName = prefix + xAOD::Iso::toString(type) +
457 xAOD::Iso::toString(isoCor) + "Correction";
458 if (!customConfig.empty()) {
459 corName += "_" + customConfig;
460 }
461 vec.emplace_back(corName);
462 }
463 ATH_MSG_DEBUG("Initializing " << xAOD::Iso::toString(isoCor)
464 << " Corrections");
465 ATH_CHECK(vec.initialize());
466 }
467 }
468 return StatusCode::SUCCESS;
469}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
std::vector< size_t > vec
Gaudi::Property< bool > m_storepileupCorrection
static bool isCoreCor(xAOD::Iso::IsolationCaloCorrection corr)
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
IsolationCaloCorrection
Enumeration for different ways of correcting isolation in xAOD files.
std::string toString(const IsoType &iso)

◆ addTrackIsoCorrections()

StatusCode IsolationBuilder::addTrackIsoCorrections ( size_t flavor,
xAOD::Iso::IsolationFlavour isoFlav,
TrackIsoHelpKey & tisoH,
const std::vector< std::vector< int > > & corInts,
bool corrsAreExtra,
const std::string & prefix,
const std::string & customConfig )
private

called by initializeIso

Definition at line 472 of file IsolationBuilder.cxx.

480{
481
482 if (!corrsAreExtra) {
483 std::string bitsetName =
484 prefix + xAOD::Iso::toString(isoFlav) + "CorrBitset";
485 if (!customConfig.empty()) {
486 bitsetName += "_" + customConfig;
487 }
488
489 tisoH.corrBitsetDeco = bitsetName;
490 ATH_MSG_DEBUG("Initializing " << tisoH.corrBitsetDeco.key());
491 ATH_CHECK(tisoH.corrBitsetDeco.initialize());
492 }
493
494 for (size_t corrType = 0; corrType < corInts[flavor].size(); corrType++) {
495 const auto cor = static_cast<unsigned int>(corInts[flavor][corrType]);
496 if (!corrsAreExtra)
497 tisoH.CorrList.trackbitset.set(cor);
499 static_cast<xAOD::Iso::IsolationTrackCorrection>(cor);
500
501 // all pt corrections are core type
502 std::string isoCorName = prefix + xAOD::Iso::toString(isoFlav) +
503 xAOD::Iso::toString(isoCor) + "Correction";
504
505 if (!customConfig.empty()) {
506 isoCorName += "_" + customConfig;
507 }
508 tisoH.coreCorDeco.emplace(isoCor, isoCorName);
509 tisoH.coreCorDeco[isoCor].setOwner(this);
510 ATH_MSG_DEBUG("initializing " << tisoH.coreCorDeco[isoCor].key());
511 ATH_CHECK(tisoH.coreCorDeco[isoCor].initialize());
512 }
513 return StatusCode::SUCCESS;
514}

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareIso() [1/2]

void IsolationBuilder::declareIso ( std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > & caloIso)
private

Definition at line 756 of file IsolationBuilder.cxx.

758{
759 for (auto& iso : caloIso) {
760 iso.second.declare(this);
761 }
762}

◆ declareIso() [2/2]

void IsolationBuilder::declareIso ( std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > & trackIso)
private

Definition at line 765 of file IsolationBuilder.cxx.

768{
769 for (auto& iso : trackIso) {
770 iso.second.declare(this);
771 }
772}

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode IsolationBuilder::execute ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 132 of file IsolationBuilder.cxx.

133{
134 ATH_MSG_DEBUG("Executing " << name() << "...");
135
136 // For etcone, needs the cells
137
138 const CaloCellContainer* cellColl = nullptr;
139 if (!m_cellIsolationTool.empty()) {
140 SG::ReadHandle<CaloCellContainer> cellcoll(m_cellsKey, ctx);
141 // check is only used for serial running; remove when MT scheduler used
142 if (!cellcoll.isValid()) {
143 ATH_MSG_FATAL("Failed to retrieve cell container: " << m_cellsKey.key());
144 return StatusCode::FAILURE;
145 }
146 cellColl = cellcoll.cptr();
147 }
148 // Compute isolations
149
150 if (m_elCaloIso.size()) {
151 ATH_MSG_DEBUG("About to execute Electron calo iso");
153 }
154 if (m_phCaloIso.size()) {
155 ATH_MSG_DEBUG("About to execute Photon calo iso");
157 }
158 if (m_feCaloIso.size()) {
159 ATH_MSG_DEBUG("About to execute Forward Electron calo iso");
161 }
162 if (m_muCaloIso.size()) {
163 ATH_MSG_DEBUG("About to execute muon calo iso");
165 }
166
167 if (m_elTrackIso.size()) {
168 ATH_MSG_DEBUG("About to execute Electron track iso");
170 }
171 if (m_phTrackIso.size()) {
172 ATH_MSG_DEBUG("About to execute Photon track iso");
174 }
175 if (m_muTrackIso.size()) {
176 ATH_MSG_DEBUG("About to execute Muon track iso");
178 }
179
180 return StatusCode::SUCCESS;
181}
#define ATH_MSG_FATAL(x)
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_elTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_muCaloIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_phTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_feCaloIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_elCaloIso
StatusCode executeTrackIso(const std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > &trackIsoMap) const
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_muTrackIso
ToolHandle< xAOD::ICaloCellIsolationTool > m_cellIsolationTool
Tool for cell isolation calculation.
StatusCode executeCaloIso(const std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > &caloIsoMap, const CaloCellContainer *cellColl) const
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_phCaloIso
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
Cell container.

◆ executeCaloIso()

StatusCode IsolationBuilder::executeCaloIso ( const std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > & caloIsoMap,
const CaloCellContainer * cellColl ) const
private

Definition at line 517 of file IsolationBuilder.cxx.

521{
522 for (const auto& pr : caloIsoMap) {
523
524 const xAOD::Iso::IsolationFlavour flav = pr.first;
525 const auto& keys = pr.second;
526 CaloIsoHelpHandles handles(keys);
527
528 ATH_MSG_DEBUG("Executing calo iso flavor: " << xAOD::Iso::toString(flav));
529
530 if (handles.isoDeco.empty()) {
531 ATH_MSG_FATAL("Have a CaloIsoHelpHandles with no actual isolations; "
532 "something wrong happened");
533 return StatusCode::FAILURE;
534 }
535 auto& readHandle =
536 handles.isoDeco[0]; // can treat the writeDecorHandle as a read handle;
537
538 if (readHandle.isAvailable()){ // This must be before readHandle.isValid() or else the isValid call
539 // will crash if the deocration already exists
540 ATH_MSG_DEBUG("read (actually a write) handle for " << keys.isoDeco[0].key() << " already exists. "
541 << "Will not recompute." );
542 return StatusCode::SUCCESS;
543 }
544
545 if (!readHandle.isValid()) {
546 ATH_MSG_FATAL("Could not retrieve read handle for "
547 << keys.isoDeco[0].key());
548 return StatusCode::FAILURE;
549 }
550
551 for (const auto *part : *readHandle) {
552 xAOD::CaloIsolation CaloIsoResult;
553 bool successfulCalc = false;
554 if (flav == xAOD::Iso::IsolationFlavour::etcone && cellColl) {
555 successfulCalc = m_cellIsolationTool->caloCellIsolation(
556 CaloIsoResult, *part, keys.isoTypes, keys.CorrList, cellColl);
557 } else if (flav == xAOD::Iso::IsolationFlavour::topoetcone) {
558 successfulCalc = m_topoIsolationTool->caloTopoClusterIsolation(
559 CaloIsoResult, *part, keys.isoTypes, keys.CorrList);
560 } else if (flav == xAOD::Iso::IsolationFlavour::neflowisol) {
561 successfulCalc = m_pflowIsolationTool->neutralEflowIsolation(
562 CaloIsoResult, *part, keys.isoTypes, keys.CorrList);
563 }
564
565 if (successfulCalc) {
566 for (unsigned int i = 0; i < keys.isoTypes.size(); i++) {
567 float iso = CaloIsoResult.etcones[i];
568 ATH_MSG_DEBUG("custom Iso " << xAOD::Iso::toCString(keys.isoTypes[i])
569 << " = " << iso / 1e3);
570 (handles.isoDeco[i])(*part) = iso;
571 }
572 // corrections
573 (handles.corrBitsetDeco)(*part) = keys.CorrList.calobitset.to_ulong();
574
575 // let's do the core corrections
576
577 // iterate over the values we want to store
578 for (auto& coreCorDecoPr : handles.coreCorDeco) {
579 // find the matching result
580 auto corIter =
581 CaloIsoResult.coreCorrections.find(coreCorDecoPr.first);
582 if (corIter == CaloIsoResult.coreCorrections.end()) {
583 ATH_MSG_FATAL("Could not find core correction of required type: "
584 << xAOD::Iso::toCString(coreCorDecoPr.first));
585 ATH_MSG_FATAL("Check configuration");
586 return StatusCode::FAILURE;
587 }
588 // now that we have the match, let's find the energy
590 float>::const_iterator it =
591 corIter->second.find(xAOD::Iso::coreEnergy);
592 if (it == corIter->second.end()) {
593 ATH_MSG_FATAL("Could not find coreEnergy correction for: "
594 << xAOD::Iso::toCString(coreCorDecoPr.first));
595 ATH_MSG_FATAL("Check configuration");
596 return StatusCode::FAILURE;
597 }
598 ATH_MSG_DEBUG("About to write core correction: "
599 << xAOD::Iso::toCString(coreCorDecoPr.first));
600 (coreCorDecoPr.second)(*part) = it->second;
601 }
602
603 // let's do the noncore corrections
604 for (auto& noncoreCorDecoPr : handles.noncoreCorDeco) {
605 // find the matching result
606 auto corIter =
607 CaloIsoResult.noncoreCorrections.find(noncoreCorDecoPr.first);
608 if (corIter == CaloIsoResult.noncoreCorrections.end()) {
609 ATH_MSG_FATAL("Could not find noncore correction of required type: "
610 << xAOD::Iso::toCString(noncoreCorDecoPr.first));
611 ATH_MSG_FATAL("Check configuration");
612 return StatusCode::FAILURE;
613 }
614
615 ATH_MSG_DEBUG("About to write noncore correction: "
616 << xAOD::Iso::toCString(noncoreCorDecoPr.first));
617 auto& vecHandles = noncoreCorDecoPr.second;
618 for (size_t i = 0; i < vecHandles.size(); i++) {
619 (vecHandles[i])(*part) = corIter->second[i];
620 }
621 }
622 } else {
623 ATH_MSG_FATAL("Call to CaloIsolationTool failed for flavor "
624 << xAOD::Iso::toCString(flav));
625 return StatusCode::FAILURE;
626 }
627 }
628 }
629 return StatusCode::SUCCESS;
630}
ToolHandle< xAOD::INeutralEFlowIsolationTool > m_pflowIsolationTool
Tool for neutral pflow isolation calculation.
ToolHandle< xAOD::ICaloTopoClusterIsolationTool > m_topoIsolationTool
Tool for topo isolation calculation.
IsolationFlavour
Enumeration for different ways of calculating isolation in xAOD files.
@ topoetcone
Topo-cluster ET-sum.
@ neflowisol
neutral eflow
@ etcone
Calorimeter isolation.
static const char * toCString(IsolationConeSize conesize)
std::vector< float > etcones
std::map< Iso::IsolationCaloCorrection, std::vector< float > > noncoreCorrections
std::map< Iso::IsolationCaloCorrection, std::map< Iso::IsolationCorrectionParameter, float > > coreCorrections

◆ executeTrackIso()

StatusCode IsolationBuilder::executeTrackIso ( const std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > & trackIsoMap) const
private

Definition at line 633 of file IsolationBuilder.cxx.

636{
637 for (const auto& pr : trackIsoMap) {
638 const xAOD::Iso::IsolationFlavour flav = pr.first;
639 const auto& keys = pr.second;
640 TrackIsoHelpHandles handles(keys);
641
642 ATH_MSG_DEBUG("Executing track iso flavor: " << xAOD::Iso::toString(flav));
643
644 if (handles.isoDeco.empty()) {
645 ATH_MSG_FATAL("Have a TrackIsoHelpHandles with no actual isolations; "
646 "something wrong happened");
647 return StatusCode::FAILURE;
648 }
649 auto& readHandle =
650 handles.isoDeco[0]; // can treat the writeDecorHandle as a read handle;
651
652 if (readHandle.isAvailable()){ // This must be before readHandle.isValid() or else the isValid call
653 // will crash if the deocration already exists
654 ATH_MSG_DEBUG("Decoration for for " << keys.isoDeco[0].key() << " already exists. "
655 << "Will not recompute." );
656 return StatusCode::SUCCESS;
657 }
658
659 if (!readHandle.isValid()) {
660 ATH_MSG_FATAL("Could not retrieve read handle for "
661 << keys.isoDeco[0].key());
662 return StatusCode::FAILURE;
663 }
664
665 for (const auto *part : *readHandle) {
666 xAOD::TrackIsolation TrackIsoResult;
667 bool successfulCalc = false;
668 // check to see if we are dealing with an electron
669 const auto * eg = dynamic_cast<const xAOD::Egamma*>(part);
670 if (eg) {
671 ATH_MSG_DEBUG("Doing track isolation on an egamma particle");
672 std::unique_ptr<xAOD::Vertex> trigVtx = nullptr;
673 std::set<const xAOD::TrackParticle*> tracksToExclude;
675 tracksToExclude =
677 if (m_isTrigger) {
678 const xAOD::Electron* el = static_cast<const xAOD::Electron*>(part);
679 trigVtx = std::make_unique<xAOD::Vertex>();
680 trigVtx->makePrivateStore();
681 trigVtx->setZ(el->trackParticle()->z0() + el->trackParticle()->vz());
682 ATH_MSG_DEBUG("will use a vertex at z = " << trigVtx->z() << " to compute electron track isolation");
683 }
684 } else {
685 if (m_allTrackRemoval) { // New (from ??/??/16) : now this gives all
686 // tracks
687 tracksToExclude =
689 } else { // this is just to be able to have the 2015+2016 default case
690 // (only tracks from first vertex)
691 const auto * gam = dynamic_cast<const xAOD::Photon*>(eg);
692 if (gam && gam->nVertices() > 0) {
693 const xAOD::Vertex* phvtx = gam->vertex(0);
694 for (unsigned int itk = 0; itk < phvtx->nTrackParticles(); itk++)
695 tracksToExclude.insert(
698 phvtx->trackParticle(itk))
699 : phvtx->trackParticle(itk));
700 }
701 }
702 }
703 successfulCalc = m_trackIsolationTool->trackIsolation(TrackIsoResult,
704 *part,
705 keys.isoTypes,
706 keys.CorrList,
707 trigVtx.get(),
708 &tracksToExclude);
709 } else {
710 ATH_MSG_DEBUG("Not doing track isolation on an egamma particle");
711 successfulCalc = m_trackIsolationTool->trackIsolation(
712 TrackIsoResult, *part, keys.isoTypes, keys.CorrList);
713 }
714
715 if (successfulCalc) {
716 for (unsigned int i = 0; i < keys.isoTypes.size(); i++) {
717 float iso = TrackIsoResult.ptcones[i];
718 float isoV = TrackIsoResult.ptvarcones_10GeVDivPt[i];
719 ATH_MSG_DEBUG("custom Iso " << xAOD::Iso::toCString(keys.isoTypes[i])
720 << " = " << iso / 1e3
721 << ", var cone = " << isoV / 1e3);
722 (handles.isoDeco[i])(*part) = iso;
723 (handles.isoDecoV[i])(*part) = isoV;
724 }
725
726 // corrections
727 (handles.corrBitsetDeco)(*part) = keys.CorrList.trackbitset.to_ulong();
728 // let's do the core corrections
729 // iterate over the values we want to store
730 for (auto& coreCorDecoPr : handles.coreCorDeco) {
731 // find the matching result
732 auto corIter =
733 TrackIsoResult.coreCorrections.find(coreCorDecoPr.first);
734 if (corIter == TrackIsoResult.coreCorrections.end()) {
735 ATH_MSG_FATAL("Could not find core correction of required type: "
736 << xAOD::Iso::toCString(coreCorDecoPr.first));
737 ATH_MSG_FATAL("Check configuration");
738 return StatusCode::FAILURE;
739 }
740 ATH_MSG_DEBUG("About to write tracking core correction: "
741 << xAOD::Iso::toCString(coreCorDecoPr.first));
742 (coreCorDecoPr.second)(*part) = corIter->second;
743 }
744
745 } else {
746 ATH_MSG_FATAL("Call to TrackIsolationTool failed for flavor "
747 << xAOD::Iso::toCString(flav));
748 return StatusCode::FAILURE;
749 }
750 }
751 }
752 return StatusCode::SUCCESS;
753}
Gaudi::Property< bool > m_useBremAssoc
Gaudi::Property< bool > m_isTrigger
is the alg run at trigger level
ToolHandle< xAOD::ITrackIsolationTool > m_trackIsolationTool
Tool for neutral pflow isolation calculation.
Gaudi::Property< bool > m_allTrackRemoval
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
std::set< const xAOD::TrackParticle * > getTrackParticles(const xAOD::Egamma *eg, bool useBremAssoc=true, bool allParticles=true)
Return a list of all or only the best TrackParticle associated to the object.
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Vertex_v1 Vertex
Define the latest version of the vertex class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
Photon_v1 Photon
Definition of the current "egamma version".
Electron_v1 Electron
Definition of the current "egamma version".
std::vector< float > ptcones
std::vector< float > ptvarcones_10GeVDivPt
std::map< Iso::IsolationTrackCorrection, float > coreCorrections

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

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.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode IsolationBuilder::finalize ( )
finaloverridevirtual

Definition at line 124 of file IsolationBuilder.cxx.

125{
126 ATH_MSG_INFO("Finalizing " << name() << "...");
127
128 return StatusCode::SUCCESS;
129}
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode IsolationBuilder::initialize ( )
finaloverridevirtual

Definition at line 26 of file IsolationBuilder.cxx.

27{
28 ATH_MSG_INFO("Initializing " << name() << "...");
29
30 std::set<xAOD::Iso::IsolationFlavour> runIsoType;
31
32 if (m_elisoInts.size()) {
33 ATH_MSG_DEBUG("Initializing central electrons");
34 ATH_CHECK(initializeIso(runIsoType,
44 }
45
46 if (m_phisoInts.size()) {
47 ATH_MSG_DEBUG("Initializing central photons");
48 ATH_CHECK(initializeIso(runIsoType,
58 }
59
60 if (m_feisoInts.size()) {
61 ATH_MSG_DEBUG("Initializing forward electrons");
62 ATH_CHECK(initializeIso(runIsoType,
64 nullptr,
71 }
72
73 if (m_muisoInts.size()) {
74 ATH_MSG_DEBUG("Initializing muons");
75 ATH_CHECK(initializeIso(runIsoType,
85 }
86
87 // Retrieve the tools (there three Calo ones are the same in fact)
88 if (!m_cellIsolationTool.empty() &&
89 runIsoType.find(xAOD::Iso::etcone) != runIsoType.end()) {
91 } else {
92 m_cellIsolationTool.disable();
93 }
94
95 if (!m_topoIsolationTool.empty() &&
96 runIsoType.find(xAOD::Iso::topoetcone) != runIsoType.end()) {
98 } else {
99 m_topoIsolationTool.disable();
100 }
101
102 if (!m_pflowIsolationTool.empty() &&
103 runIsoType.find(xAOD::Iso::neflowisol) != runIsoType.end()) {
105 } else {
106 m_pflowIsolationTool.disable();
107 }
108
109 if (!m_trackIsolationTool.empty() &&
110 runIsoType.find(xAOD::Iso::IsolationFlavour::ptcone) !=
111 runIsoType.end()) {
113 } else {
114 m_trackIsolationTool.disable();
115 }
116
117 // initialise data handles
118 ATH_CHECK(m_cellsKey.initialize(!m_cellIsolationTool.empty()));
119
120 return StatusCode::SUCCESS;
121}
void declareIso(std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > &caloIso)
Gaudi::Property< std::string > m_ElectronContainerName
Containers (Is it best to make them as strings? Used by multiple handles)
Gaudi::Property< std::string > m_customConfigFwd
Gaudi::Property< std::vector< std::vector< int > > > m_elcorIntsExtra
Gaudi::Property< std::string > m_customConfigPh
Gaudi::Property< std::vector< std::vector< int > > > m_phisoInts
Isolation types (for the alg.
Gaudi::Property< std::string > m_customConfigMu
Gaudi::Property< std::vector< std::vector< int > > > m_fecorIntsExtra
Gaudi::Property< std::vector< std::vector< int > > > m_mucorIntsExtra
Gaudi::Property< std::vector< std::vector< int > > > m_muisoInts
Gaudi::Property< std::vector< std::vector< int > > > m_elisoInts
Isolation types.
Gaudi::Property< std::vector< std::vector< int > > > m_fecorInts
Gaudi::Property< std::vector< std::vector< int > > > m_mucorInts
Gaudi::Property< std::vector< std::vector< int > > > m_phcorIntsExtra
Gaudi::Property< std::string > m_FwdElectronContainerName
StatusCode initializeIso(std::set< xAOD::Iso::IsolationFlavour > &runIsoType, std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > *caloIsoMap, std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > *trackIsoMap, const std::string &containerName, const std::vector< std::vector< int > > &isoInts, const std::vector< std::vector< int > > &corInts, const std::vector< std::vector< int > > &corIntsExtra, const std::string &customConfig)
called by algorithm initialize per object (electron, photon, forward electron, muon)
Gaudi::Property< std::string > m_MuonContainerName
Gaudi::Property< std::vector< std::vector< int > > > m_feisoInts
Gaudi::Property< std::string > m_customConfigEl
Gaudi::Property< std::vector< std::vector< int > > > m_elcorInts
Gaudi::Property< std::vector< std::vector< int > > > m_phcorInts
Gaudi::Property< std::string > m_PhotonContainerName
@ ptcone
Track isolation.

◆ initializeIso()

StatusCode IsolationBuilder::initializeIso ( std::set< xAOD::Iso::IsolationFlavour > & runIsoType,
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > * caloIsoMap,
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > * trackIsoMap,
const std::string & containerName,
const std::vector< std::vector< int > > & isoInts,
const std::vector< std::vector< int > > & corInts,
const std::vector< std::vector< int > > & corIntsExtra,
const std::string & customConfig )
private

called by algorithm initialize per object (electron, photon, forward electron, muon)

Definition at line 269 of file IsolationBuilder.cxx.

280{
281
282 std::string prefix = containerName + ".";
283
284 for (size_t flavor = 0; flavor < isoInts.size(); flavor++) {
285 // iterate over the flavor (cell, topo, eflow, track
286 // Note: it is a configuration error if different types
287 // are included in one inner vector
288
289 CaloIsoHelpKey cisoH(this);
290 TrackIsoHelpKey tisoH(this);
291
292 // std::vector<SG::AuxElement::Decorator<float>*> Deco;
295
296 for (size_t type = 0; type < isoInts[flavor].size(); type++) {
297 // iterate over the cone sizes for a given flavor.
298 // (also check that the cone sizes really are of the same flavor;
299 // otherwise an error)
300
302 static_cast<xAOD::Iso::IsolationType>(isoInts[flavor][type]);
303 isoFlav = xAOD::Iso::isolationFlavour(isoType);
304 ATH_MSG_DEBUG("Saw isoType " << xAOD::Iso::toString(isoType) << " and isoFlav " << xAOD::Iso::toString(isoFlav));
305 if (oldIsoFlav != xAOD::Iso::numIsolationFlavours &&
306 oldIsoFlav != isoFlav) {
307 ATH_MSG_FATAL("Configuration error: can only have one type of "
308 "isolation in inner vector");
309 return StatusCode::FAILURE;
310 }
311 oldIsoFlav = isoFlav;
312 std::string isoName = prefix + xAOD::Iso::toString(isoType);
313 if (!customConfig.empty()) {
314 isoName += "_" + customConfig;
315 }
316 if (isoFlav == xAOD::Iso::etcone || isoFlav == xAOD::Iso::topoetcone ||
317 isoFlav == xAOD::Iso::neflowisol) {
318 cisoH.isoTypes.push_back(isoType);
319 cisoH.isoDeco.emplace_back(isoName);
320 } else if (isoFlav == xAOD::Iso::ptcone) {
321 tisoH.isoTypes.push_back(isoType);
322 tisoH.isoDeco.emplace_back(isoName);
323 auto coneSize =
324 static_cast<int>(round(100 * xAOD::Iso::coneSize(isoType)));
325 std::string isoNameV = prefix + "ptvarcone" + std::to_string(coneSize);
326 if (!customConfig.empty()) {
327 isoNameV += "_" + customConfig;
328 }
329 tisoH.isoDecoV.emplace_back(isoNameV);
330 } else {
331 ATH_MSG_FATAL("Configuration error: Isolation flavor "
332 << isoFlav << " not supported.");
333 return StatusCode::FAILURE;
334 }
335 }
336
337 // check that there were isolations configured
338 if (isoFlav == xAOD::Iso::numIsolationFlavours) {
339 ATH_MSG_WARNING("The configuration was malformed: an empty inner vector "
340 "was added; ignoring");
341 continue;
342 }
343
345 // Now that the isolations to calculate are determined,
346 // initialize the isolation decorations
347 // and then determine the corrections to apply,
348 // and finally add it to the IsoMap.
350
351 if (isoFlav == xAOD::Iso::etcone || isoFlav == xAOD::Iso::topoetcone ||
352 isoFlav == xAOD::Iso::neflowisol) {
353
354 // let's initialize the decos
355 ATH_MSG_DEBUG("Initializing cisoH.isoDeco");
356 ATH_CHECK(cisoH.isoDeco.initialize());
357
359 flavor, isoFlav, cisoH, corInts, false, prefix, customConfig));
361 flavor, isoFlav, cisoH, corIntsExtra, true, prefix, customConfig));
362
363 if (caloIsoMap) {
364 caloIsoMap->push_back(std::make_pair(isoFlav, cisoH));
365 } else {
367 "caloIsoMap was nullptr but the configuration attempted to use it");
368 return StatusCode::FAILURE;
369 }
370 } else if (isoFlav == xAOD::Iso::ptcone) {
371
372 // let's initialize the decos
373 ATH_MSG_DEBUG("Initializing tisoH.isoDeco");
374 ATH_CHECK(tisoH.isoDeco.initialize());
375 ATH_MSG_DEBUG("Initializing tisoH.isoDecoV");
376 ATH_CHECK(tisoH.isoDecoV.initialize());
377
379 flavor, isoFlav, tisoH, corInts, false, prefix, customConfig));
381 flavor, isoFlav, tisoH, corIntsExtra, true, prefix, customConfig));
382
383 if (trackIsoMap) {
384 trackIsoMap->push_back(std::make_pair(isoFlav, tisoH));
385 } else {
387 "trackIsoMap was nullptr but the configuration attempted to use it");
388 return StatusCode::FAILURE;
389 }
390 } else {
391 ATH_MSG_WARNING("Isolation flavour "
392 << xAOD::Iso::toCString(isoFlav)
393 << " does not exist ! Check your inputs");
394 }
395 runIsoType.insert(isoFlav);
396 }
397 return StatusCode::SUCCESS;
398}
#define ATH_MSG_WARNING(x)
StatusCode addTrackIsoCorrections(size_t flavor, xAOD::Iso::IsolationFlavour isoFlav, TrackIsoHelpKey &tisoH, const std::vector< std::vector< int > > &corInts, bool corrsAreExtra, const std::string &prefix, const std::string &customConfig)
called by initializeIso
StatusCode addCaloIsoCorrections(size_t flavor, xAOD::Iso::IsolationFlavour isoFlav, CaloIsoHelpKey &cisoH, const std::vector< std::vector< int > > &corInts, bool corrsAreExtra, const std::string &prefix, const std::string &customConfig)
called by initializeIso
float round(const float toRound, const unsigned int decimals)
Definition Mdt.cxx:27
IsolationFlavour isolationFlavour(IsolationType type)
convert Isolation Type into Isolation Flavour
IsolationType
Overall enumeration for isolation types in xAOD files.
float coneSize(IsolationConeSize type)
convert Isolation Size into cone size

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

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()

◆ isCoreCor()

bool IsolationBuilder::isCoreCor ( xAOD::Iso::IsolationCaloCorrection corr)
staticprivate

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

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()

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 > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

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.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_allTrackRemoval

Gaudi::Property<bool> IsolationBuilder::m_allTrackRemoval { this, "AllTrackRemoval", true }
private

Definition at line 145 of file IsolationBuilder.h.

145{ this, "AllTrackRemoval", true };

◆ m_cellIsolationTool

ToolHandle<xAOD::ICaloCellIsolationTool> IsolationBuilder::m_cellIsolationTool
private
Initial value:
{
this,
"CaloCellIsolationTool",
"",
"Handle of the calo cell IsolationTool"
}

Tool for cell isolation calculation.

Definition at line 97 of file IsolationBuilder.h.

97 {
98 this,
99 "CaloCellIsolationTool",
100 "",
101 "Handle of the calo cell IsolationTool"
102 };

◆ m_cellsKey

SG::ReadHandleKey<CaloCellContainer> IsolationBuilder::m_cellsKey
private
Initial value:
{
this,
"CellCollectionName",
"AllCalo",
"Name of container which contain calo cells"
}

Cell container.

Definition at line 105 of file IsolationBuilder.h.

105 {
106 this,
107 "CellCollectionName",
108 "AllCalo",
109 "Name of container which contain calo cells"
110 };

◆ m_customConfigEl

Gaudi::Property<std::string> IsolationBuilder::m_customConfigEl
private
Initial value:
{
this,
"CustomConfigurationNameEl",
"",
"use a custom configuration for electron"
}

Definition at line 349 of file IsolationBuilder.h.

349 {
350 this,
351 "CustomConfigurationNameEl",
352 "",
353 "use a custom configuration for electron"
354 };

◆ m_customConfigFwd

Gaudi::Property<std::string> IsolationBuilder::m_customConfigFwd
private
Initial value:
{
this,
"CustomConfigurationNameFwd",
"",
"use a custom configuration for forward electron"
}

Definition at line 363 of file IsolationBuilder.h.

363 {
364 this,
365 "CustomConfigurationNameFwd",
366 "",
367 "use a custom configuration for forward electron"
368 };

◆ m_customConfigMu

Gaudi::Property<std::string> IsolationBuilder::m_customConfigMu
private
Initial value:
{
this,
"CustomConfigurationNameMu",
"",
"use a custom configuration for muon"
}

Definition at line 370 of file IsolationBuilder.h.

370 {
371 this,
372 "CustomConfigurationNameMu",
373 "",
374 "use a custom configuration for muon"
375 };

◆ m_customConfigPh

Gaudi::Property<std::string> IsolationBuilder::m_customConfigPh
private
Initial value:
{
this,
"CustomConfigurationNamePh",
"",
"use a custom configuration for photon"
}

Definition at line 356 of file IsolationBuilder.h.

356 {
357 this,
358 "CustomConfigurationNamePh",
359 "",
360 "use a custom configuration for photon"
361 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_elCaloIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey> > IsolationBuilder::m_elCaloIso
private

Definition at line 277 of file IsolationBuilder.h.

◆ m_elcorInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_elcorInts
private
Initial value:
{
this,
"ElCorTypes",
{},
"The correction types to do for electron iso: vector of vector of enum "
"type Iso::IsolationCalo/TrackCorrection"
}

Definition at line 158 of file IsolationBuilder.h.

158 {
159 this,
160 "ElCorTypes",
161 {},
162 "The correction types to do for electron iso: vector of vector of enum "
163 "type Iso::IsolationCalo/TrackCorrection"
164 };

◆ m_elcorIntsExtra

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_elcorIntsExtra
private
Initial value:
{
this,
"ElCorTypesExtra",
{},
"The extra correction types to store but not apply for electrons"
}

Definition at line 166 of file IsolationBuilder.h.

166 {
167 this,
168 "ElCorTypesExtra",
169 {},
170 "The extra correction types to store but not apply for electrons"
171 };

◆ m_ElectronContainerName

Gaudi::Property<std::string> IsolationBuilder::m_ElectronContainerName
private
Initial value:
{
this,
"ElectronCollectionContainerName",
"Electrons"
}

Containers (Is it best to make them as strings? Used by multiple handles)

Definition at line 72 of file IsolationBuilder.h.

72 {
73 this,
74 "ElectronCollectionContainerName",
75 "Electrons"
76 };

◆ m_elisoInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_elisoInts
private
Initial value:
{
this,
"ElIsoTypes",
{},
"The isolation types to do for electrons: vector of vector of enum type "
"Iso::IsolationType"
}

Isolation types.

Definition at line 150 of file IsolationBuilder.h.

150 {
151 this,
152 "ElIsoTypes",
153 {},
154 "The isolation types to do for electrons: vector of vector of enum type "
155 "Iso::IsolationType"
156 };

◆ m_elTrackIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey> > IsolationBuilder::m_elTrackIso
private

Definition at line 314 of file IsolationBuilder.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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_feCaloIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey> > IsolationBuilder::m_feCaloIso
private

Definition at line 281 of file IsolationBuilder.h.

◆ m_fecorInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_fecorInts
private
Initial value:
{
this,
"FeCorTypes",
{},
"The correction types to do for forward electron iso: vector of vector of "
"enum type Iso::IsolationCalo/TrackCorrection"
}

Definition at line 229 of file IsolationBuilder.h.

229 {
230 this,
231 "FeCorTypes",
232 {},
233 "The correction types to do for forward electron iso: vector of vector of "
234 "enum type Iso::IsolationCalo/TrackCorrection"
235 };

◆ m_fecorIntsExtra

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_fecorIntsExtra
private
Initial value:
{
this,
"FeCorTypesExtra",
{},
"The extra correction types to store but not apply for forward electrons"
}

Definition at line 237 of file IsolationBuilder.h.

237 {
238 this,
239 "FeCorTypesExtra",
240 {},
241 "The extra correction types to store but not apply for forward electrons"
242 };

◆ m_feisoInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_feisoInts
private
Initial value:
{
this,
"FeIsoTypes",
{},
"The isolation types to do for forward electron: vector of vector of enum "
"type Iso::IsolationType"
}

Definition at line 221 of file IsolationBuilder.h.

221 {
222 this,
223 "FeIsoTypes",
224 {},
225 "The isolation types to do for forward electron: vector of vector of enum "
226 "type Iso::IsolationType"
227 };

◆ m_FwdElectronContainerName

Gaudi::Property<std::string> IsolationBuilder::m_FwdElectronContainerName
private
Initial value:
{
this,
"FwdElectronCollectionContainerName",
"ForwardElectrons"
}

Definition at line 78 of file IsolationBuilder.h.

78 {
79 this,
80 "FwdElectronCollectionContainerName",
81 "ForwardElectrons"
82 };

◆ m_isTrigger

Gaudi::Property<bool> IsolationBuilder::m_isTrigger { this, "IsTrigger", false }
private

is the alg run at trigger level

Definition at line 137 of file IsolationBuilder.h.

137{ this, "IsTrigger", false };

◆ m_muCaloIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey> > IsolationBuilder::m_muCaloIso
private

Definition at line 283 of file IsolationBuilder.h.

◆ m_mucorInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_mucorInts
private
Initial value:
{
this,
"MuCorTypes",
{},
"The correction types to do for Muon iso: vector of vector of enum type "
"Iso::IsolationCalo/TrackCorrection"
}

Definition at line 206 of file IsolationBuilder.h.

206 {
207 this,
208 "MuCorTypes",
209 {},
210 "The correction types to do for Muon iso: vector of vector of enum type "
211 "Iso::IsolationCalo/TrackCorrection"
212 };

◆ m_mucorIntsExtra

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_mucorIntsExtra
private
Initial value:
{
this,
"MuCorTypesExtra",
{},
"The extra correction types to store but not apply for muons"
}

Definition at line 214 of file IsolationBuilder.h.

214 {
215 this,
216 "MuCorTypesExtra",
217 {},
218 "The extra correction types to store but not apply for muons"
219 };

◆ m_muisoInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_muisoInts
private
Initial value:
{
this,
"MuIsoTypes",
{},
"The isolation types to do for Muons : vector of vector of enum type "
"Iso::IsolationType"
}

Definition at line 198 of file IsolationBuilder.h.

198 {
199 this,
200 "MuIsoTypes",
201 {},
202 "The isolation types to do for Muons : vector of vector of enum type "
203 "Iso::IsolationType"
204 };

◆ m_MuonContainerName

Gaudi::Property<std::string> IsolationBuilder::m_MuonContainerName
private
Initial value:
{
this,
"MuonCollectionContainerName",
"Muons"
}

Definition at line 90 of file IsolationBuilder.h.

90 {
91 this,
92 "MuonCollectionContainerName",
93 "Muons"
94 };

◆ m_muTrackIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey> > IsolationBuilder::m_muTrackIso
private

Definition at line 318 of file IsolationBuilder.h.

◆ m_pflowIsolationTool

ToolHandle<xAOD::INeutralEFlowIsolationTool> IsolationBuilder::m_pflowIsolationTool
private
Initial value:
{
this,
"PFlowIsolationTool",
"",
"Handle of the pflow IsolationTool"
}

Tool for neutral pflow isolation calculation.

Definition at line 121 of file IsolationBuilder.h.

121 {
122 this,
123 "PFlowIsolationTool",
124 "",
125 "Handle of the pflow IsolationTool"
126 };

◆ m_phCaloIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, CaloIsoHelpKey> > IsolationBuilder::m_phCaloIso
private

Definition at line 279 of file IsolationBuilder.h.

◆ m_phcorInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_phcorInts
private
Initial value:
{
this,
"PhCorTypes",
{},
"The correction types to do for photons iso: vector of vector of enum type "
"Iso::IsolationCalo/TrackCorrection"
}

Definition at line 183 of file IsolationBuilder.h.

183 {
184 this,
185 "PhCorTypes",
186 {},
187 "The correction types to do for photons iso: vector of vector of enum type "
188 "Iso::IsolationCalo/TrackCorrection"
189 };

◆ m_phcorIntsExtra

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_phcorIntsExtra
private
Initial value:
{
this,
"PhCorTypesExtra",
{},
"The extra correction types to store but not apply for photons"
}

Definition at line 191 of file IsolationBuilder.h.

191 {
192 this,
193 "PhCorTypesExtra",
194 {},
195 "The extra correction types to store but not apply for photons"
196 };

◆ m_phisoInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_phisoInts
private
Initial value:
{
this,
"PhIsoTypes",
{},
"The isolation types to do for photons: vector of vector of enum type "
"Iso::IsolationType"
}

Isolation types (for the alg.

properties, only vector<vector<double>> available

Definition at line 175 of file IsolationBuilder.h.

175 {
176 this,
177 "PhIsoTypes",
178 {},
179 "The isolation types to do for photons: vector of vector of enum type "
180 "Iso::IsolationType"
181 };

◆ m_PhotonContainerName

Gaudi::Property<std::string> IsolationBuilder::m_PhotonContainerName
private
Initial value:
{
this,
"PhotonCollectionContainerName",
"Photons"
}

Definition at line 84 of file IsolationBuilder.h.

84 {
85 this,
86 "PhotonCollectionContainerName",
87 "Photons"
88 };

◆ m_phTrackIso

std::vector<std::pair<xAOD::Iso::IsolationFlavour, TrackIsoHelpKey> > IsolationBuilder::m_phTrackIso
private

Definition at line 316 of file IsolationBuilder.h.

◆ m_storepileupCorrection

Gaudi::Property<bool> IsolationBuilder::m_storepileupCorrection { this, "storepileupCorrection", false }
private

Definition at line 147 of file IsolationBuilder.h.

147{ this, "storepileupCorrection", false };

◆ m_topoIsolationTool

ToolHandle<xAOD::ICaloTopoClusterIsolationTool> IsolationBuilder::m_topoIsolationTool
private
Initial value:
{
this,
"CaloTopoIsolationTool",
"",
"Handle of the calo topo IsolationTool"
}

Tool for topo isolation calculation.

Definition at line 113 of file IsolationBuilder.h.

113 {
114 this,
115 "CaloTopoIsolationTool",
116 "",
117 "Handle of the calo topo IsolationTool"
118 };

◆ m_trackIsolationTool

ToolHandle<xAOD::ITrackIsolationTool> IsolationBuilder::m_trackIsolationTool
private
Initial value:
{
this,
"TrackIsolationTool",
"",
"Handle of the track IsolationTool"
}

Tool for neutral pflow isolation calculation.

Definition at line 129 of file IsolationBuilder.h.

129 {
130 this,
131 "TrackIsolationTool",
132 "",
133 "Handle of the track IsolationTool"
134 };

◆ m_useBremAssoc

Gaudi::Property<bool> IsolationBuilder::m_useBremAssoc
private
Initial value:
{ this,
"useBremAssoc",
true,
"use track to track assoc after brem" }

Definition at line 140 of file IsolationBuilder.h.

140 { this,
141 "useBremAssoc",
142 true,
143 "use track to track assoc after brem" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: