ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA > Class Template Reference
Inheritance diagram for jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >:
Collaboration diagram for jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >:

Public Types

enum  Kinematics {
  Pt, PtPUsub, SumPt, Par,
  Perp, P
}
 Define the available isolation variables. More...
 

Public Member Functions

 IsolationCalculatorT (double param=0.)
 
virtual IsolationResult jetIsolation (const xAOD::Jet *jet, std::vector< const xAOD::IParticle * > &nearbyConstit) const
 Compute the isolation 4-momentum from jet and jet inputs. More...
 
virtual string baseName () const
 
virtual IsolationCalculatorclone (const xAOD::Jet *j) const
 
virtual void copyFrom (const IsolationCalculator *o, const xAOD::Jet *)
 
bool scheduleKinematicCalculation (const std::string &kname)
 
virtual std::vector< float > calcIsolationVariables (const xAOD::Jet *jet, std::vector< const xAOD::IParticle * > &nearbyConstit) const
 Implement the calculation of isolation variables for this jet. More...
 
virtual std::vector< std::string > calculationNames () const
 
void dump () const
 
void setEventDensity (float rho)
 

Public Attributes

ISOCRITERIA m_iso
 

Static Public Attributes

static constexpr std::array< std::string_view, 6 > s_kname = {"Pt","PtPUsub" , "SumPt", "Par", "Perp", "P"}
 names for isolation variables. Must match EXACTLY the enum. More...
 

Protected Attributes

std::vector< Kinematicsm_kinematics
 kinematics isolation variables to be computed More...
 
float m_rho =-9999.
 Value of the event density in case it is needed. More...
 

Detailed Description

template<typename ISOCRITERIA>
class jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >

Definition at line 140 of file JetIsolationTool.cxx.

Member Enumeration Documentation

◆ Kinematics

Define the available isolation variables.

Enumerator
Pt 
PtPUsub 
SumPt 
Par 
Perp 

Definition at line 37 of file JetIsolationTool.cxx.

37  {
38  Pt, PtPUsub, SumPt, Par, Perp, P
39  };

Constructor & Destructor Documentation

◆ IsolationCalculatorT()

template<typename ISOCRITERIA >
jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >::IsolationCalculatorT ( double  param = 0.)
inline

Definition at line 143 of file JetIsolationTool.cxx.

143 : m_iso(param) { }

Member Function Documentation

◆ baseName()

template<typename ISOCRITERIA >
virtual string jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >::baseName ( ) const
inlinevirtual

Reimplemented from jet::JetIsolation::IsolationCalculator.

Definition at line 160 of file JetIsolationTool.cxx.

160 {return m_iso.name();}

◆ calcIsolationVariables()

virtual std::vector<float> jet::JetIsolation::IsolationCalculator::calcIsolationVariables ( const xAOD::Jet jet,
std::vector< const xAOD::IParticle * > &  nearbyConstit 
) const
inlinevirtualinherited

Implement the calculation of isolation variables for this jet.

The vector<IParticle*> nearbyConstit is expected to contain all the constituents which can fall in the isolation area AND which are not constituent of the jet.

Definition at line 80 of file JetIsolationTool.cxx.

80  {
81  IsolationResult result = jetIsolation(jet, nearbyConstit);
82  std::vector<float> calcVector;
83  float pt = jet->jetP4(xAOD::JetConstitScaleMomentum).pt();
84  static const SG::AuxElement::Accessor<float> areaAcc("ActiveArea");
85  float jetArea=0;
86  for(auto k : m_kinematics){
87  float v=-1;
88  switch( k ) {
89  case Pt:
90  v = result.isoP.Pt() / pt; break ;
91  case PtPUsub:
92  jetArea= areaAcc(*jet);
93  v = (result.isoP.Pt() - (result.isoArea-jetArea)*m_rho)/ (pt-jetArea*m_rho);
94  break;
95  case Perp:
96  v = result.isoP.Vect().Dot(unitVector(jet->p4())) /pt; break;
97  case SumPt:
98  v = result.isoSumPt; break;
99  case Par:
100  v = result.isoP.Vect().Perp(unitVector(jet->p4())) /pt ; break;
101  case P:
102  v = result.isoP.Vect().Mag()/pt; break ;
103  }
104  calcVector.push_back(v);
105  }
106  return calcVector;
107  }

◆ calculationNames()

virtual std::vector<std::string> jet::JetIsolation::IsolationCalculator::calculationNames ( ) const
inlinevirtualinherited

Definition at line 110 of file JetIsolationTool.cxx.

110  {
111  std::vector<std::string> v;
112  v.reserve(m_kinematics.size());
113  for(auto k : m_kinematics) {
114  v.emplace_back(baseName() + string(s_kname[k]));
115  }
116  return v;
117  }

◆ clone()

template<typename ISOCRITERIA >
virtual IsolationCalculator* jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >::clone ( const xAOD::Jet j) const
inlinevirtual

Reimplemented from jet::JetIsolation::IsolationCalculator.

Definition at line 162 of file JetIsolationTool.cxx.

162  {
164  isoT->m_iso = m_iso;
165  isoT->m_iso.setup(j);
166  isoT->copyFrom(this,j);
167  return isoT;
168  }

◆ copyFrom()

virtual void jet::JetIsolation::IsolationCalculator::copyFrom ( const IsolationCalculator o,
const xAOD::Jet  
)
inlinevirtualinherited

Definition at line 56 of file JetIsolationTool.cxx.

56  {
58  }

◆ dump()

void jet::JetIsolation::IsolationCalculator::dump ( ) const
inlineinherited

Definition at line 120 of file JetIsolationTool.cxx.

120  {
121  std::cout << "Isolation calculator "<< baseName() <<std::endl;
122  for(const auto& n : calculationNames()){
123  std::cout << " - "<< n << std::endl;
124  }
125  }

◆ jetIsolation()

template<typename ISOCRITERIA >
virtual IsolationResult jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >::jetIsolation ( const xAOD::Jet ,
std::vector< const xAOD::IParticle * > &   
) const
inlinevirtual

Compute the isolation 4-momentum from jet and jet inputs.

It is assumed the caller has already removed jet constituents from the input list.

Reimplemented from jet::JetIsolation::IsolationCalculator.

Definition at line 146 of file JetIsolationTool.cxx.

146  {
147  IsolationResult result;
148  double rap = jet->rapidity();
149  double phi = jet->phi();
150  for(const xAOD::IParticle* constit:nearbyConstit){
151  if ( m_iso.inIsolationArea(rap, phi, constit) ) {
152  result.isoP += constit->p4();
153  result.isoSumPt += constit->pt();
154  }
155  }
156  result.isoArea = m_iso.isoArea();
157  return result;
158  }

◆ scheduleKinematicCalculation()

bool jet::JetIsolation::IsolationCalculator::scheduleKinematicCalculation ( const std::string &  kname)
inlineinherited

Definition at line 67 of file JetIsolationTool.cxx.

67  {
68  auto it = std::ranges::find(s_kname, kname);
69  if( it != s_kname.end( )){
70  m_kinematics.push_back(static_cast<Kinematics>(it-s_kname.begin()) );
71  return true;
72  }
73  return false;
74  }

◆ setEventDensity()

void jet::JetIsolation::IsolationCalculator::setEventDensity ( float  rho)
inlineinherited

Definition at line 127 of file JetIsolationTool.cxx.

127  {
128  m_rho=rho;
129  }

Member Data Documentation

◆ m_iso

template<typename ISOCRITERIA >
ISOCRITERIA jet::JetIsolation::IsolationCalculatorT< ISOCRITERIA >::m_iso

Definition at line 170 of file JetIsolationTool.cxx.

◆ m_kinematics

std::vector<Kinematics> jet::JetIsolation::IsolationCalculator::m_kinematics
protectedinherited

kinematics isolation variables to be computed

Definition at line 133 of file JetIsolationTool.cxx.

◆ m_rho

float jet::JetIsolation::IsolationCalculator::m_rho =-9999.
protectedinherited

Value of the event density in case it is needed.

Definition at line 135 of file JetIsolationTool.cxx.

◆ s_kname

constexpr std::array<std::string_view, 6> jet::JetIsolation::IsolationCalculator::s_kname = {"Pt","PtPUsub" , "SumPt", "Par", "Perp", "P"}
staticconstexprinherited

names for isolation variables. Must match EXACTLY the enum.

Definition at line 42 of file JetIsolationTool.cxx.


The documentation for this class was generated from the following file:
jet::JetIsolation::IsolationCalculator::Perp
@ Perp
Definition: JetIsolationTool.cxx:38
jet::JetIsolation::IsolationCalculator::m_kinematics
std::vector< Kinematics > m_kinematics
kinematics isolation variables to be computed
Definition: JetIsolationTool.cxx:133
get_generator_info.result
result
Definition: get_generator_info.py:21
jet::JetIsolation::IsolationCalculatorT::IsolationCalculatorT
IsolationCalculatorT(double param=0.)
Definition: JetIsolationTool.cxx:143
jet::JetIsolation::IsolationCalculator::jetIsolation
virtual IsolationResult jetIsolation(const xAOD::Jet *, std::vector< const xAOD::IParticle * > &) const
Compute the isolation 4-momentum from jet and jet inputs.
Definition: JetIsolationTool.cxx:63
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
jet::JetIsolation::IsolationCalculator::calculationNames
virtual std::vector< std::string > calculationNames() const
Definition: JetIsolationTool.cxx:110
jet::JetIsolation::IsolationCalculator::P
@ P
Definition: JetIsolationTool.cxx:38
skel.it
it
Definition: skel.GENtoEVGEN.py:396
jet::JetIsolation::IsolationCalculator::m_rho
float m_rho
Value of the event density in case it is needed.
Definition: JetIsolationTool.cxx:135
test_pyathena.pt
pt
Definition: test_pyathena.py:11
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
jet::JetIsolation::IsolationCalculatorT
Definition: JetIsolationTool.cxx:140
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
xAOD::JetConstitScaleMomentum
@ JetConstitScaleMomentum
Definition: JetTypes.h:29
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
beamspotman.n
n
Definition: beamspotman.py:731
jet::JetIsolation::IsolationCalculator::Kinematics
Kinematics
Define the available isolation variables.
Definition: JetIsolationTool.cxx:37
jet::JetIsolation::IsolationCalculator::s_kname
static constexpr std::array< std::string_view, 6 > s_kname
names for isolation variables. Must match EXACTLY the enum.
Definition: JetIsolationTool.cxx:42
jet::JetIsolation::IsolationCalculator::Pt
@ Pt
Definition: JetIsolationTool.cxx:38
jet::JetIsolation::IsolationCalculatorT::m_iso
ISOCRITERIA m_iso
Definition: JetIsolationTool.cxx:170
jet::JetIsolation::IsolationCalculator::SumPt
@ SumPt
Definition: JetIsolationTool.cxx:38
jet::JetIsolation::unitVector
TVector3 unitVector(const FourMom_t &v)
Definition: JetIsolationTool.cxx:24
jet::JetIsolation::IsolationCalculator::PtPUsub
@ PtPUsub
Definition: JetIsolationTool.cxx:38
python.PyAthena.v
v
Definition: PyAthena.py:154
jet::JetIsolation::IsolationCalculator::baseName
virtual string baseName() const
Definition: JetIsolationTool.cxx:54
jet::JetIsolation::IsolationCalculator::Par
@ Par
Definition: JetIsolationTool.cxx:38
jet::JetIsolation::IsolationCalculator::copyFrom
virtual void copyFrom(const IsolationCalculator *o, const xAOD::Jet *)
Definition: JetIsolationTool.cxx:56
fitman.rho
rho
Definition: fitman.py:532
fitman.k
k
Definition: fitman.py:528