ATLAS Offline Software
IsolationCondition.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 
9 namespace CP {
10 
12  const std::vector<xAOD::Iso::IsolationType>& isoTypes,
13  const std::string& isoDecSuffix) :
14  asg::AsgMessaging{"IsolationCondition_"+name},
15  m_name(name), m_isolationType(isoTypes), m_isoDecSuffix(isoDecSuffix) {
16  for (const xAOD::Iso::IsolationType& iso_type : m_isolationType) {
17  std::string accName = std::string(toCString(iso_type)) + (isoDecSuffix.empty() ? "" : "_") + isoDecSuffix;
18  m_acc.emplace_back(accName);
19  }
20  }
21  IsolationCondition::IsolationCondition(const std::string& name, const std::vector<std::string>& isoTypes, const std::string& isoDecSuffix) :
22  asg::AsgMessaging{"IsolationCondition_"+name},
23  m_name(name), m_isoDecSuffix(isoDecSuffix) {
24  for (const std::string& iso_type : isoTypes) {
25  m_isolationType.push_back(xAOD::Iso::IsolationType(0));
26  std::string accName = iso_type + (isoDecSuffix.empty() ? "" : "_") + isoDecSuffix;
27  m_acc.emplace_back(accName);
28  }
29  }
30  IsolationCondition::IsolationCondition(const std::string& name, xAOD::Iso::IsolationType isoType, const std::string& isoDecSuffix) :
31  IsolationCondition(name, std::vector<xAOD::Iso::IsolationType>{isoType}, isoDecSuffix) {}
32  IsolationCondition::IsolationCondition(const std::string& name, const std::string& isoType, const std::string& isoDecSuffix) :
33  IsolationCondition(name, std::vector<std::string>{isoType}, isoDecSuffix) {}
34 
35  unsigned int IsolationCondition::num_types() const { return m_isolationType.size(); }
36  const std::string& IsolationCondition::name() const { return m_name; }
38  const SG::AuxElement::ConstAccessor<float>& IsolationCondition::accessor(unsigned int n) const { return m_acc.at(n); }
39 } // namespace CP
IsolationCorrection.h
asg
Definition: DataHandleTestTool.h:28
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
CP::IsolationCondition::type
xAOD::Iso::IsolationType type(unsigned int n=0) const
Definition: IsolationCondition.cxx:37
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::IsolationCondition::num_types
unsigned int num_types() const
Definition: IsolationCondition.cxx:35
CP::IsolationCondition
Definition: IsolationCondition.h:30
CP::Iso
@ Iso
Definition: MuonEfficiencyType.h:16
beamspotman.n
n
Definition: beamspotman.py:731
IsolationCondition.h
vector
Definition: MultiHisto.h:13
xAOD::Iso::IsolationType
IsolationType
Overall enumeration for isolation types in xAOD files.
Definition: IsolationType.h:26
CP::IsolationCondition::IsolationCondition
IsolationCondition(const std::string &name, xAOD::Iso::IsolationType isoType, const std::string &isoDecSuffix="")
Definition: IsolationCondition.cxx:30
CP::IsolationCondition::name
const std::string & name() const
Definition: IsolationCondition.cxx:36
CP::IsolationCondition::accessor
const FloatAccessor & accessor(unsigned int n=0) const
Definition: IsolationCondition.cxx:38
CP::IsolationCondition::m_acc
std::vector< FloatAccessor > m_acc
Definition: IsolationCondition.h:53
CP::IsolationCondition::m_name
std::string m_name
Definition: IsolationCondition.h:51
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CP::IsolationCondition::m_isolationType
std::vector< xAOD::Iso::IsolationType > m_isolationType
Definition: IsolationCondition.h:52
AuxElement.h
Base class for elements of a container that can have aux data.