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

#include <IsolationBuilder.h>

Inheritance diagram for IsolationBuilder:
Collaboration diagram for IsolationBuilder:

Classes

struct  CaloIsoHelpKey
struct  TrackIsoHelpKey
struct  CaloIsoHelpHandles
struct  TrackIsoHelpHandles

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 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
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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_fwdelisoInts
Gaudi::Property< std::vector< std::vector< int > > > m_fwdelcorInts
Gaudi::Property< std::vector< std::vector< int > > > m_fwdelcorIntsExtra
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_fwdelCaloIso
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_fwdelTrackIso
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 405 of file IsolationBuilder.cxx.

413{
414 if (!corrsAreExtra) {
415 std::string bitsetName =
416 prefix + xAOD::Iso::toString(isoFlav) + "CorrBitset";
417 if (!customConfig.empty()) {
418 bitsetName += "_" + customConfig;
419 }
420
421 cisoH.corrBitsetDeco = bitsetName;
422 ATH_MSG_DEBUG("Initializing non extra corr : " << cisoH.corrBitsetDeco.key());
423 ATH_CHECK(cisoH.corrBitsetDeco.initialize());
424 }
425
426 for (size_t corrType = 0; corrType < corInts[flavor].size(); corrType++) {
427 // iterate over the calo isolation corrections
428 const auto cor = static_cast<unsigned int>(corInts[flavor][corrType]);
429 if (!corrsAreExtra)
430 cisoH.CorrList.calobitset.set(cor);
432 static_cast<xAOD::Iso::IsolationCaloCorrection>(cor);
433
434 if (isCoreCor(isoCor)) {
435 std::string isoCorName = prefix;
436 if (isoCor != xAOD::Iso::core57cells) {
437 isoCorName += xAOD::Iso::toString(isoFlav); // since this doesn't depend on the flavor, just have one
438 }
439
440 // a core correction; only store core energy, not the core area
441 isoCorName += xAOD::Iso::toString(isoCor) +
443 if (!customConfig.empty()) {
444 isoCorName += "_" + customConfig;
445 }
446 cisoH.coreCorDeco.emplace(isoCor, isoCorName);
447 cisoH.coreCorDeco[isoCor].setOwner(this);
448 ATH_MSG_DEBUG("initializing " << cisoH.coreCorDeco[isoCor].key());
449 ATH_CHECK(cisoH.coreCorDeco[isoCor].initialize());
450 } else {
451 // noncore correction
453 continue;
454 cisoH.noncoreCorDeco.emplace(
456 auto& vec = cisoH.noncoreCorDeco[isoCor];
457 vec.setOwner(this);
458 for (auto type : cisoH.isoTypes) {
459 std::string corName = prefix + xAOD::Iso::toString(type) +
460 xAOD::Iso::toString(isoCor) + "Correction";
461 if (!customConfig.empty()) {
462 corName += "_" + customConfig;
463 }
464 vec.emplace_back(corName);
465 }
466 ATH_MSG_DEBUG("Initializing " << xAOD::Iso::toString(isoCor)
467 << " Corrections");
468 ATH_CHECK(vec.initialize());
469 }
470 }
471 return StatusCode::SUCCESS;
472}
#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 475 of file IsolationBuilder.cxx.

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

◆ 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 759 of file IsolationBuilder.cxx.

761{
762 for (auto& iso : caloIso) {
763 iso.second.declare(this);
764 }
765}

◆ declareIso() [2/2]

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

Definition at line 768 of file IsolationBuilder.cxx.

771{
772 for (auto& iso : trackIso) {
773 iso.second.declare(this);
774 }
775}

◆ 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 133 of file IsolationBuilder.cxx.

134{
135 ATH_MSG_DEBUG("Executing " << name() << "...");
136
137 // For etcone, needs the cells
138
139 const CaloCellContainer* cellColl = nullptr;
140 if (!m_cellIsolationTool.empty()) {
141 SG::ReadHandle<CaloCellContainer> cellcoll(m_cellsKey, ctx);
142 // check is only used for serial running; remove when MT scheduler used
143 if (!cellcoll.isValid()) {
144 ATH_MSG_FATAL("Failed to retrieve cell container: " << m_cellsKey.key());
145 return StatusCode::FAILURE;
146 }
147 cellColl = cellcoll.cptr();
148 }
149 // Compute isolations
150
151 if (m_elCaloIso.size()) {
152 ATH_MSG_DEBUG("About to execute Electron calo iso");
154 }
155 if (m_phCaloIso.size()) {
156 ATH_MSG_DEBUG("About to execute Photon calo iso");
158 }
159 if (m_fwdelCaloIso.size()) {
160 ATH_MSG_DEBUG("About to execute Forward Electron calo iso");
162 }
163 if (m_muCaloIso.size()) {
164 ATH_MSG_DEBUG("About to execute muon calo iso");
166 }
167
168 if (m_elTrackIso.size()) {
169 ATH_MSG_DEBUG("About to execute Electron track iso");
171 }
172 if (m_phTrackIso.size()) {
173 ATH_MSG_DEBUG("About to execute Photon track iso");
175 }
176 if (m_fwdelTrackIso.size()) {
177 ATH_MSG_DEBUG("About to execute forward electron track iso");
179 }
180 if (m_muTrackIso.size()) {
181 ATH_MSG_DEBUG("About to execute Muon track iso");
183 }
184
185 return StatusCode::SUCCESS;
186}
#define ATH_MSG_FATAL(x,...)
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_elTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, CaloIsoHelpKey > > m_fwdelCaloIso
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_elCaloIso
StatusCode executeTrackIso(const std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > &trackIsoMap) const
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_muTrackIso
std::vector< std::pair< xAOD::Iso::IsolationFlavour, TrackIsoHelpKey > > m_fwdelTrackIso
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 520 of file IsolationBuilder.cxx.

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

639{
640 for (const auto& pr : trackIsoMap) {
641 const xAOD::Iso::IsolationFlavour flav = pr.first;
642 const auto& keys = pr.second;
643 TrackIsoHelpHandles handles(keys);
644
645 ATH_MSG_DEBUG("Executing track iso flavor: " << xAOD::Iso::toString(flav));
646
647 if (handles.isoDeco.empty()) {
648 ATH_MSG_FATAL("Have a TrackIsoHelpHandles with no actual isolations; "
649 "something wrong happened");
650 return StatusCode::FAILURE;
651 }
652 auto& readHandle =
653 handles.isoDeco[0]; // can treat the writeDecorHandle as a read handle;
654
655 if (readHandle.isAvailable()){ // This must be before readHandle.isValid() or else the isValid call
656 // will crash if the deocration already exists
657 ATH_MSG_DEBUG("Decoration for for " << keys.isoDeco[0].key() << " already exists. "
658 << "Will not recompute." );
659 return StatusCode::SUCCESS;
660 }
661
662 if (!readHandle.isValid()) {
663 ATH_MSG_FATAL("Could not retrieve read handle for "
664 << keys.isoDeco[0].key());
665 return StatusCode::FAILURE;
666 }
667
668 for (const auto *part : *readHandle) {
669 xAOD::TrackIsolation TrackIsoResult;
670 bool successfulCalc = false;
671 // check to see if we are dealing with an electron
672 const auto * eg = dynamic_cast<const xAOD::Egamma*>(part);
673 if (eg) {
674 ATH_MSG_DEBUG("Doing track isolation on an egamma particle");
675 std::unique_ptr<xAOD::Vertex> trigVtx = nullptr;
676 std::set<const xAOD::TrackParticle*> tracksToExclude;
678 tracksToExclude =
680 if (m_isTrigger) {
681 const xAOD::Electron* el = static_cast<const xAOD::Electron*>(part);
682 trigVtx = std::make_unique<xAOD::Vertex>();
683 trigVtx->makePrivateStore();
684 trigVtx->setZ(el->trackParticle()->z0() + el->trackParticle()->vz());
685 ATH_MSG_DEBUG("will use a vertex at z = " << trigVtx->z() << " to compute electron track isolation");
686 }
687 } else {
688 if (m_allTrackRemoval) { // New (from ??/??/16) : now this gives all
689 // tracks
690 tracksToExclude =
692 } else { // this is just to be able to have the 2015+2016 default case
693 // (only tracks from first vertex)
694 const auto * gam = dynamic_cast<const xAOD::Photon*>(eg);
695 if (gam && gam->nVertices() > 0) {
696 const xAOD::Vertex* phvtx = gam->vertex(0);
697 for (unsigned int itk = 0; itk < phvtx->nTrackParticles(); itk++)
698 tracksToExclude.insert(
701 phvtx->trackParticle(itk))
702 : phvtx->trackParticle(itk));
703 }
704 }
705 }
706 successfulCalc = m_trackIsolationTool->trackIsolation(TrackIsoResult,
707 *part,
708 keys.isoTypes,
709 keys.CorrList,
710 trigVtx.get(),
711 &tracksToExclude);
712 } else {
713 ATH_MSG_DEBUG("Not doing track isolation on an egamma particle");
714 successfulCalc = m_trackIsolationTool->trackIsolation(
715 TrackIsoResult, *part, keys.isoTypes, keys.CorrList);
716 }
717
718 if (successfulCalc) {
719 for (unsigned int i = 0; i < keys.isoTypes.size(); i++) {
720 float iso = TrackIsoResult.ptcones[i];
721 float isoV = TrackIsoResult.ptvarcones_10GeVDivPt[i];
722 ATH_MSG_DEBUG("custom Iso " << xAOD::Iso::toCString(keys.isoTypes[i])
723 << " = " << iso / 1e3
724 << ", var cone = " << isoV / 1e3);
725 (handles.isoDeco[i])(*part) = iso;
726 (handles.isoDecoV[i])(*part) = isoV;
727 }
728
729 // corrections
730 (handles.corrBitsetDeco)(*part) = keys.CorrList.trackbitset.to_ulong();
731 // let's do the core corrections
732 // iterate over the values we want to store
733 for (auto& coreCorDecoPr : handles.coreCorDeco) {
734 // find the matching result
735 auto corIter =
736 TrackIsoResult.coreCorrections.find(coreCorDecoPr.first);
737 if (corIter == TrackIsoResult.coreCorrections.end()) {
738 ATH_MSG_FATAL("Could not find core correction of required type: "
739 << xAOD::Iso::toCString(coreCorDecoPr.first));
740 ATH_MSG_FATAL("Check configuration");
741 return StatusCode::FAILURE;
742 }
743 ATH_MSG_DEBUG("About to write tracking core correction: "
744 << xAOD::Iso::toCString(coreCorDecoPr.first));
745 (coreCorDecoPr.second)(*part) = corIter->second;
746 }
747
748 } else {
749 ATH_MSG_FATAL("Call to TrackIsolationTool failed for flavor "
750 << xAOD::Iso::toCString(flav));
751 return StatusCode::FAILURE;
752 }
753 }
754 }
755 return StatusCode::SUCCESS;
756}
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.
bool isFwdElectron(const xAOD::Egamma *eg)
is the object a Fwd electron
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 & AthCommonAlgorithm< 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 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode IsolationBuilder::finalize ( )
finaloverridevirtual

Definition at line 125 of file IsolationBuilder.cxx.

126{
127 ATH_MSG_INFO("Finalizing " << name() << "...");
128
129 return StatusCode::SUCCESS;
130}
#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_fwdelisoInts.size()) {
61 ATH_MSG_DEBUG("Initializing forward electrons");
62 ATH_CHECK(initializeIso(runIsoType,
72 }
73
74 if (m_muisoInts.size()) {
75 ATH_MSG_DEBUG("Initializing muons");
76 ATH_CHECK(initializeIso(runIsoType,
86 }
87
88 // Retrieve the tools (there three Calo ones are the same in fact)
89 if (!m_cellIsolationTool.empty() &&
90 runIsoType.find(xAOD::Iso::etcone) != runIsoType.end()) {
92 } else {
93 m_cellIsolationTool.disable();
94 }
95
96 if (!m_topoIsolationTool.empty() &&
97 runIsoType.find(xAOD::Iso::topoetcone) != runIsoType.end()) {
99 } else {
100 m_topoIsolationTool.disable();
101 }
102
103 if (!m_pflowIsolationTool.empty() &&
104 runIsoType.find(xAOD::Iso::neflowisol) != runIsoType.end()) {
106 } else {
107 m_pflowIsolationTool.disable();
108 }
109
110 if (!m_trackIsolationTool.empty() &&
111 runIsoType.find(xAOD::Iso::IsolationFlavour::ptcone) !=
112 runIsoType.end()) {
114 } else {
115 m_trackIsolationTool.disable();
116 }
117
118 // initialise data handles
119 ATH_CHECK(m_cellsKey.initialize(!m_cellIsolationTool.empty()));
120
121 return StatusCode::SUCCESS;
122}
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::vector< std::vector< int > > > m_fwdelisoInts
Gaudi::Property< std::string > m_customConfigFwd
Gaudi::Property< std::vector< std::vector< int > > > m_fwdelcorIntsExtra
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_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_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_fwdelcorInts
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 274 of file IsolationBuilder.cxx.

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

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< 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.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< 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 AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x,...)
virtual StatusCode sysInitialize() override
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 351 of file IsolationBuilder.h.

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

◆ m_customConfigFwd

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

Definition at line 365 of file IsolationBuilder.h.

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

◆ m_customConfigMu

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

Definition at line 372 of file IsolationBuilder.h.

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

◆ m_customConfigPh

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

Definition at line 358 of file IsolationBuilder.h.

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

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fwdelCaloIso

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

Definition at line 281 of file IsolationBuilder.h.

◆ m_fwdelcorInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_fwdelcorInts
private
Initial value:
{
this,
"FwdElCorTypes",
{},
"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 "FwdElCorTypes",
232 {},
233 "The correction types to do for forward electron iso: vector of vector of "
234 "enum type Iso::IsolationCalo/TrackCorrection"
235 };

◆ m_fwdelcorIntsExtra

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

Definition at line 237 of file IsolationBuilder.h.

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

◆ 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_fwdelisoInts

Gaudi::Property<std::vector<std::vector<int> > > IsolationBuilder::m_fwdelisoInts
private
Initial value:
{
this,
"FwdElIsoTypes",
{},
"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 "FwdElIsoTypes",
224 {},
225 "The isolation types to do for forward electron: vector of vector of enum "
226 "type Iso::IsolationType"
227 };

◆ m_fwdelTrackIso

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

Definition at line 318 of file IsolationBuilder.h.

◆ 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 320 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: