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

#include <JetCaloEnergies.h>

Inheritance diagram for JetCaloEnergies:
Collaboration diagram for JetCaloEnergies:

Public Member Functions

 JetCaloEnergies (const std::string &t)
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual StatusCode decorate (const xAOD::JetContainer &jets) const override
 Decorate a jet collection without otherwise modifying it.
virtual void print () const
 Print the state of the tool.
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 sysInitialize () override
 Perform system initialization for an algorithm.
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
virtual StatusCode modify (xAOD::JetContainer &jets) const override final
 Concrete implementation of the function inherited from IJetModifier.
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void fillEperSamplingCluster (const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
void fillEperSamplingPFO (const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
void fillEperSamplingFE (const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
void fillEperSamplingFEClusterBased (const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
bool isInVector (const std::string &key, const std::vector< std::string > &calculations)
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.

Protected Attributes

bool m_doFracSamplingMax = false

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

float getMoment (const xAOD::CaloCluster *cluster, const xAOD::CaloCluster::MomentType &momentType) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::vector< std::string > > m_calculationNames {this, "Calculations", {}, "Name of calo quantities to compute and add as decorations"}
Gaudi::Property< std::string > m_jetContainerName {this, "JetContainer", "", "SG key for the input jet container"}
Gaudi::Property< bool > m_calcClusterBasedVars {this, "calcClusterBasedVars", false, "SG key to decide if cluster-based variables will be calculated for FE-based jets"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_ePerSamplingKey {this, "EPerSamplingName", "EnergyPerSampling", "SG key for the EnergyPerSampling attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_emFracKey {this, "EMFracName", "EMFrac", "SG key for the EMFrac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_hecFracKey {this, "HECFracName", "HECFrac", "SG key for the HECFrac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_psFracKey {this, "PSFracName", "PSFrac", "SG key for the PSFrac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_em3FracKey {this, "EM3FracName", "EM3Frac", "SG key for the EM3Frac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_tile0FracKey {this, "Tile0FracName", "Tile0Frac", "SG key for the Tile0Frac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_effNClustsFracKey {this, "EffNClustsName", "EffNClusts", "SG key for the EffNClusts attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_fracSamplingMaxKey {this, "FracSamplingMaxName", "FracSamplingMax", "SG key for the FracSamplingMax attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_fracSamplingMaxIndexKey {this, "FracSamplingMaxIndexName", "FracSamplingMaxIndex", "SG key for the FracSamplingMaxIndex attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_ePerSamplingClusterKey {this, "EPerSamplingClusterName", "EnergyPerSamplingCaloBased", "SG key for the EnergyPerSampling attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_emFracClusterKey {this, "EMFracClusterName", "EMFracCaloBased", "SG key for the EMFrac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_hecFracClusterKey {this, "HECFracClusterName", "HECFracCaloBased", "SG key for the HECFrac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_psFracClusterKey {this, "PSFracClusterName", "PSFracCaloBased", "SG key for the PSFrac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_em3FracClusterKey {this, "EM3FracClusterName", "EM3FracCaloBased", "SG key for the EM3Frac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_tile0FracClusterKey {this, "Tile0FracClusterName", "Tile0FracCaloBased", "SG key for the Tile0Frac attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_effNClustsFracClusterKey {this, "EffNClustsClusterName", "EffNClustsCaloBased", "SG key for the EffNClusts attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_fracSamplingMaxClusterKey {this, "FracSamplingMaxClusterName", "FracSamplingMaxCaloBased", "SG key for the FracSamplingMax (clus) attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_fracSamplingMaxIndexClusterKey {this, "FracSamplingMaxIndexClusterName", "FracSamplingMaxIndexCaloBased", "SG key for FracSamplingMaxIndex (clus) attribute"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_lambdaLeadingClusterKey {this, "LambdaLeadingClusterName", "LambdaLeadingCluster", "SG key for the longitudinal distance between the leading (highest energy) cluster and the jet’s geometrical center"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_meanRadialDistanceSquaredKey {this, "MeanRadialDistanceSquaredName", "MeanRadialDistanceSquared", "SG key for the weighted mean of the squared radial distances of the clusters from jet’s geometrical center"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_meanLongitudinalDistanceSquaredKey {this, "MeanLongitudinalDistanceSquaredName", "MeanLongitudinalDistanceSquared", "SG key for the weighted mean of the squared Longitudinal distances of the clusters from jet’s geometrical center"}
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 18 of file JetCaloEnergies.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ JetCaloEnergies()

JetCaloEnergies::JetCaloEnergies ( const std::string & t)

Definition at line 22 of file JetCaloEnergies.cxx.

23: AsgTool(name) { }
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::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>

◆ decorate()

StatusCode JetCaloEnergies::decorate ( const xAOD::JetContainer & jets) const
overridevirtual

Decorate a jet collection without otherwise modifying it.

Implements IJetDecorator.

Definition at line 108 of file JetCaloEnergies.cxx.

108 {
109 ATH_MSG_VERBOSE("Begin decorating jets.");
110 for(const xAOD::Jet* jet : jets) {
111 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float> > ePerSamplingHandle(m_ePerSamplingKey);
112 size_t numConstit = jet->numConstituents();
113 ePerSamplingHandle(*jet) = std::vector<float>(CaloSampling::Unknown, 0.);
114 std::vector<float>& ePerSampling = ePerSamplingHandle(*jet);
115 for ( float& e : ePerSampling ) e = 0.0; // re-initialize
116
117 if ( numConstit == 0 ) {
118 ATH_MSG_VERBOSE("Jet has no constituents.");
119 continue;
120 }
121
122 // should find a more robust solution than using 1st constit type.
123 xAOD::Type::ObjectType ctype = jet->rawConstituent( 0 )->type();
124 if ( ctype == xAOD::Type::CaloCluster ) {
125 ATH_MSG_VERBOSE(" Constituents are calo clusters.");
126 fillEperSamplingCluster(*jet, ePerSampling);
127
128 } else if (ctype == xAOD::Type::ParticleFlow) {
129 ATH_MSG_VERBOSE(" Constituents are pflow objects.");
130 fillEperSamplingPFO(*jet, ePerSampling);
131
132 } else if (ctype == xAOD::Type::FlowElement) {
133 ATH_MSG_VERBOSE(" Constituents are FlowElements.");
134 fillEperSamplingFE(*jet, ePerSampling);
135
136 // In addition, calculate variables using the underlying cluster rather than
137 // the energy-subtracted FlowElements (improved implementation)
139 ATH_MSG_VERBOSE(" Constituents are FlowElements - Additional calculation");
140
141 SG::WriteDecorHandle<xAOD::JetContainer, std::vector<float> > ePerSamplingClusterHandle(m_ePerSamplingClusterKey);
142 ePerSamplingClusterHandle(*jet) = std::vector<float>(CaloSampling::Unknown, 0.);
143 std::vector<float>& ePerSamplingCluster = ePerSamplingClusterHandle(*jet);
144 for ( float& e : ePerSamplingCluster ) e = 0.0; // re-initialize
145
146 fillEperSamplingFEClusterBased(*jet, ePerSamplingCluster);
147 }
148
149 }else {
150 ATH_MSG_VERBOSE("Constituents are not CaloClusters, PFOs, or FlowElements.");
151 }
152
153 }
154 return StatusCode::SUCCESS;
155}
#define ATH_MSG_VERBOSE(x)
Gaudi::Property< bool > m_calcClusterBasedVars
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ePerSamplingKey
void fillEperSamplingCluster(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
void fillEperSamplingPFO(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ePerSamplingClusterKey
void fillEperSamplingFEClusterBased(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
void fillEperSamplingFE(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
@ ParticleFlow
The object is a particle-flow object.
Definition ObjectType.h:41
@ FlowElement
The object is a track-calo-cluster.
Definition ObjectType.h:52
@ CaloCluster
The object is a calorimeter cluster.
Definition ObjectType.h:39
Jet_v1 Jet
Definition of the current "jet version".

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ fillEperSamplingCluster()

void JetCaloEnergies::fillEperSamplingCluster ( const xAOD::Jet & jet,
std::vector< float > & ePerSampling ) const
protected

Definition at line 157 of file JetCaloEnergies.cxx.

157 {
158 // loop over raw constituents
159 size_t numConstit = jet.numConstituents();
160 for ( size_t i=0; i<numConstit; i++ ) {
162 ATH_MSG_WARNING("Tried to call fillEperSamplingCluster with a jet constituent that is not a cluster!");
163 continue;
164 }
165 const xAOD::CaloCluster* constit = static_cast<const xAOD::CaloCluster*>(jet.rawConstituent(i));
166 for ( size_t s= CaloSampling::PreSamplerB; s< CaloSampling::Unknown; s++ ) {
167 ePerSampling[s] += constit->eSample( (xAOD::CaloCluster::CaloSample) s );
168 }
169 }
170
171 double fracSamplingMax = -999999999.;
172 int fracSamplingMaxIndex = -1;
173 double sumE_samplings = 0.0;
174
176 for(unsigned int i = 0; i < ePerSampling.size(); ++i){
177 double e = ePerSampling[i];
178 sumE_samplings += e;
179 if (e>fracSamplingMax){
180 fracSamplingMax=e;
181 fracSamplingMaxIndex = i;
182 }
183 }
184 }
185
186 SG::WriteDecorHandle<xAOD::JetContainer, float> emFracHandle(m_emFracKey);
187 SG::WriteDecorHandle<xAOD::JetContainer, float> hecFracHandle(m_hecFracKey);
188 SG::WriteDecorHandle<xAOD::JetContainer, float> psFracHandle(m_psFracKey);
189
190 emFracHandle(jet) = jet::JetCaloQualityUtils::emFraction( ePerSampling );
191 hecFracHandle(jet) = jet::JetCaloQualityUtils::hecF( &jet );
192 psFracHandle(jet) = jet::JetCaloQualityUtils::presamplerFraction( &jet );
193
195 SG::WriteDecorHandle<xAOD::JetContainer, float> fracSamplingMaxHandle(m_fracSamplingMaxKey);
196 fracSamplingMaxHandle(jet) = sumE_samplings != 0. ? fracSamplingMax/sumE_samplings : 0.;
197 SG::WriteDecorHandle<xAOD::JetContainer, int> fracSamplingMaxIndexHandle(m_fracSamplingMaxIndexKey);
198 fracSamplingMaxIndexHandle(jet) = fracSamplingMaxIndex;
199 }
200}
#define ATH_MSG_WARNING(x)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hecFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxIndexKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_psFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_emFracKey
static double emFraction(const std::vector< float > &ePerSampling)
static double hecF(const Jet *jet)
static double presamplerFraction(const Jet *jet)
float eSample(const CaloSample sampling) const
CaloSampling::CaloSample CaloSample
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
Definition Jet_v1.cxx:153
const IParticle * rawConstituent(size_t i) const
Direct access to constituents. WARNING expert use only.
Definition Jet_v1.cxx:158
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ fillEperSamplingFE()

void JetCaloEnergies::fillEperSamplingFE ( const xAOD::Jet & jet,
std::vector< float > & ePerSampling ) const
protected

Definition at line 293 of file JetCaloEnergies.cxx.

293 {
294 float emTot = 0.;
295 float em3Tot = 0.;
296 float hecTot = 0.;
297 float psTot = 0.;
298 float tile0Tot = 0.;
299 float eTot = 0.;
300 float e2Tot = 0.;
301 size_t numConstit = jet.numConstituents();
302
303 std::vector<int> indicesNeutralFE;
304 std::vector<int> indicesChargedFE;
305
306 for ( size_t i=0; i<numConstit; i++ ) {
308 ATH_MSG_WARNING("Tried to call fillEperSamplingFE with a jet constituent that is not a FlowElement!");
309 continue;
310 }
311 const xAOD::FlowElement* constit = static_cast<const xAOD::FlowElement*>(jet.rawConstituent(i));
312
313 // Need to distinguish two cases:
314 // (1) Jet is a PFlow jet (constituents are charged or neutral FEs) or
315 // (2) Jet is a UFO jet (need to get the underlying charged and neutral FEs first)
316
317 //For PFlow jets, we can directly get the information from the constituent
318 if(constit->signalType() & xAOD::FlowElement::PFlow){
319
320 //Charged FlowElements:
321 if(constit->isCharged()){
322 eTot += constit->chargedObject(0)->e();
323 e2Tot += constit->chargedObject(0)->e()*constit->chargedObject(0)->e();
324 }
325 //Neutral FlowElements
326 else{
327 eTot += constit->e();
328 e2Tot += constit->e()*constit->e();
329 //Get the energy-per-layer information from the FE, not the underlying cluster (i.e. after subtraction)
330 std::vector<float> constitEPerSampling = FEHelpers::getEnergiesPerSampling(*constit);
331 for ( size_t s = CaloSampling::PreSamplerB; s < CaloSampling::Unknown; s++ ) {
332 ePerSampling[s] += constitEPerSampling[s];
333 }
334 emTot += (constitEPerSampling[CaloSampling::PreSamplerB] + constitEPerSampling[CaloSampling::EMB1]
335 + constitEPerSampling[CaloSampling::EMB2] + constitEPerSampling[CaloSampling::EMB3]
336 + constitEPerSampling[CaloSampling::PreSamplerE] + constitEPerSampling[CaloSampling::EME1]
337 + constitEPerSampling[CaloSampling::EME2] + constitEPerSampling[CaloSampling::EME3]
338 + constitEPerSampling[CaloSampling::FCAL0]);
339
340 hecTot += (constitEPerSampling[CaloSampling::HEC0] + constitEPerSampling[CaloSampling::HEC1]
341 + constitEPerSampling[CaloSampling::HEC2] + constitEPerSampling[CaloSampling::HEC3]);
342
343 psTot += (constitEPerSampling[CaloSampling::PreSamplerB] + constitEPerSampling[CaloSampling::PreSamplerE]);
344
345 em3Tot += (constitEPerSampling[CaloSampling::EMB3] + constitEPerSampling[CaloSampling::EME3]);
346
347 tile0Tot += (constitEPerSampling[CaloSampling::TileBar0] + constitEPerSampling[CaloSampling::TileExt0]);
348 }
349 }
350 else{
351 //For UFO jets, we first need to get the charged and neutral FE + corresponding energy from combined UFOs
352
353 // UFO is simply a charged FlowElement
354 if(constit->signalType() == xAOD::FlowElement::Charged){
355 eTot += constit->chargedObject(0)->e();
356 e2Tot += constit->chargedObject(0)->e()*constit->chargedObject(0)->e();
357 }
358 //UFO is simply a neutral Flowelement
359 else if(constit->signalType() == xAOD::FlowElement::Neutral){
360 // For neutral UFOs, there is only one "other object" stored which is the neutral FE
361 // Protection in case there is something wrong with this FE
362 if(constit->otherObjects().size() != 1 || !constit->otherObject(0)){
363 continue;
364 }
365
366 // Cast other object as FlowElement
367 const xAOD::FlowElement* nFE = static_cast<const xAOD::FlowElement*>(constit->otherObject(0));
368
369 eTot += nFE->e();
370 e2Tot += nFE->e()*nFE->e();
371
372 std::vector<float> neutralEPerSampling = FEHelpers::getEnergiesPerSampling(*nFE);
373 for ( size_t s = CaloSampling::PreSamplerB; s < CaloSampling::Unknown; s++ ) {
374 ePerSampling[s] += neutralEPerSampling[s];
375 }
376 emTot += (neutralEPerSampling[CaloSampling::PreSamplerB] + neutralEPerSampling[CaloSampling::EMB1]
377 + neutralEPerSampling[CaloSampling::EMB2] + neutralEPerSampling[CaloSampling::EMB3]
378 + neutralEPerSampling[CaloSampling::PreSamplerE] + neutralEPerSampling[CaloSampling::EME1]
379 + neutralEPerSampling[CaloSampling::EME2] + neutralEPerSampling[CaloSampling::EME3]
380 + neutralEPerSampling[CaloSampling::FCAL0]);
381
382 hecTot += (neutralEPerSampling[CaloSampling::HEC0] + neutralEPerSampling[CaloSampling::HEC1]
383 + neutralEPerSampling[CaloSampling::HEC2] + neutralEPerSampling[CaloSampling::HEC3]);
384
385 psTot += (neutralEPerSampling[CaloSampling::PreSamplerB] + neutralEPerSampling[CaloSampling::PreSamplerE]);
386
387 em3Tot += (neutralEPerSampling[CaloSampling::EMB3] + neutralEPerSampling[CaloSampling::EME3]);
388
389 tile0Tot += (neutralEPerSampling[CaloSampling::TileBar0] + neutralEPerSampling[CaloSampling::TileExt0]);
390 }
391 else if(constit->signalType() == xAOD::FlowElement::Combined){
392 // For the combined UFOs, otherObjects are neutral or charged FEs
393 // matched to this tracks (via track-to-cluster extrapolation)
394 for (size_t n = 0; n < constit->otherObjects().size(); ++n) {
395 if(! constit->otherObject(n)) continue;
396 const xAOD::FlowElement* FE_from_combined = static_cast<const xAOD::FlowElement*>(constit->otherObject(n));
397
398 //Charged FE (add energy to total energy only)
399 if(FE_from_combined->isCharged()){
400 if(std::find(indicesChargedFE.begin(), indicesChargedFE.end(), FE_from_combined->index()) == indicesChargedFE.end()){
401 eTot += FE_from_combined->e();
402 e2Tot += FE_from_combined->e()*FE_from_combined->e();
403 indicesChargedFE.push_back(FE_from_combined->index());
404 }
405 continue;
406 }
407 //Neutral FE:
408 //One neutral FE can be matched to various tracks and therefore be used for several UFOs
409 //We do not want to double count the energy and only add it once
410 if(std::find(indicesNeutralFE.begin(), indicesNeutralFE.end(), FE_from_combined->index()) == indicesNeutralFE.end()){
411 eTot += FE_from_combined->e();
412 e2Tot += FE_from_combined->e()*FE_from_combined->e();
413 std::vector<float> neutralFromCombEPerSampling = FEHelpers::getEnergiesPerSampling(*FE_from_combined);
414 for ( size_t s = CaloSampling::PreSamplerB; s < CaloSampling::Unknown; s++ ) {
415 ePerSampling[s] += neutralFromCombEPerSampling[s];
416 }
417 emTot += (neutralFromCombEPerSampling[CaloSampling::PreSamplerB] + neutralFromCombEPerSampling[CaloSampling::EMB1]
418 + neutralFromCombEPerSampling[CaloSampling::EMB2] + neutralFromCombEPerSampling[CaloSampling::EMB3]
419 + neutralFromCombEPerSampling[CaloSampling::PreSamplerE] + neutralFromCombEPerSampling[CaloSampling::EME1]
420 + neutralFromCombEPerSampling[CaloSampling::EME2] + neutralFromCombEPerSampling[CaloSampling::EME3]
421 + neutralFromCombEPerSampling[CaloSampling::FCAL0]);
422
423 hecTot += (neutralFromCombEPerSampling[CaloSampling::HEC0] + neutralFromCombEPerSampling[CaloSampling::HEC1]
424 + neutralFromCombEPerSampling[CaloSampling::HEC2] + neutralFromCombEPerSampling[CaloSampling::HEC3]);
425
426 psTot += (neutralFromCombEPerSampling[CaloSampling::PreSamplerB] + neutralFromCombEPerSampling[CaloSampling::PreSamplerE]);
427
428 em3Tot += (neutralFromCombEPerSampling[CaloSampling::EMB3] + neutralFromCombEPerSampling[CaloSampling::EME3]);
429
430 tile0Tot += (neutralFromCombEPerSampling[CaloSampling::TileBar0] + neutralFromCombEPerSampling[CaloSampling::TileExt0]);
431
432 indicesNeutralFE.push_back(FE_from_combined->index());
433 }
434 }
435 }
436 }
437 }
438
439 double fracSamplingMax = -999999999.;
440 int fracSamplingMaxIndex = -1;
441 double sumE_samplings = 0.0;
442
444 for(unsigned int i = 0; i < ePerSampling.size(); ++i){
445 double e = ePerSampling[i];
446 sumE_samplings += e;
447 if (e>fracSamplingMax){
448 fracSamplingMax=e;
449 fracSamplingMaxIndex = i;
450 }
451 }
452 }
453
454 for( const std::string & calcN : m_calculationNames){
455 if ( calcN == "EMFrac" ) {
456 SG::WriteDecorHandle<xAOD::JetContainer, float> emFracHandle(m_emFracKey);
457 emFracHandle(jet) = eTot != 0. ? emTot/eTot : 0.;
458 } else if ( calcN == "HECFrac" ) {
459 SG::WriteDecorHandle<xAOD::JetContainer, float> hecFracHandle(m_hecFracKey);
460 hecFracHandle(jet) = eTot != 0. ? hecTot/eTot : 0.;
461 } else if ( calcN == "PSFrac" ) {
462 SG::WriteDecorHandle<xAOD::JetContainer, float> psFracHandle(m_psFracKey);
463 psFracHandle(jet) = eTot != 0. ? psTot/eTot : 0.;
464 } else if ( calcN == "EM3Frac" ) {
465 SG::WriteDecorHandle<xAOD::JetContainer, float> em3FracHandle(m_em3FracKey);
466 em3FracHandle(jet) = eTot != 0. ? em3Tot/eTot : 0.;
467 } else if ( calcN == "Tile0Frac" ) {
468 SG::WriteDecorHandle<xAOD::JetContainer, float> tile0FracHandle(m_tile0FracKey);
469 tile0FracHandle(jet) = eTot != 0. ? tile0Tot/eTot : 0.;
470 } else if ( calcN == "EffNClusts" ) {
471 SG::WriteDecorHandle<xAOD::JetContainer, float> effNClustsFracHandle(m_effNClustsFracKey);
472 effNClustsFracHandle(jet) = eTot != 0. ? std::sqrt(eTot*eTot/e2Tot) : 0.;
473 } else if ( calcN == "FracSamplingMax" ){
474 SG::WriteDecorHandle<xAOD::JetContainer, float> fracSamplingMaxHandle(m_fracSamplingMaxKey);
475 fracSamplingMaxHandle(jet) = sumE_samplings != 0. ? fracSamplingMax/sumE_samplings : 0.;
476 SG::WriteDecorHandle<xAOD::JetContainer, int> fracSamplingMaxIndexHandle(m_fracSamplingMaxIndexKey);
477 fracSamplingMaxIndexHandle(jet) = fracSamplingMaxIndex;
478 }
479 }
480}
SG::WriteDecorHandleKey< xAOD::JetContainer > m_effNClustsFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_em3FracKey
Gaudi::Property< std::vector< std::string > > m_calculationNames
SG::WriteDecorHandleKey< xAOD::JetContainer > m_tile0FracKey
size_t index() const
Return the index of this element within its container.
std::vector< const xAOD::IParticle * > otherObjects() const
signal_t signalType() const
const xAOD::IParticle * chargedObject(std::size_t i) const
virtual double e() const override
The total energy of the particle.
const xAOD::IParticle * otherObject(std::size_t i) const
virtual double e() const =0
The total energy of the particle.
std::vector< float > getEnergiesPerSampling(const xAOD::FlowElement &fe)
Definition FEHelpers.cxx:78
float eTot(const U &p)
Accessor utility function for getting the value of Energy.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition FlowElement.h:16

◆ fillEperSamplingFEClusterBased()

void JetCaloEnergies::fillEperSamplingFEClusterBased ( const xAOD::Jet & jet,
std::vector< float > & ePerSampling ) const
protected

Definition at line 485 of file JetCaloEnergies.cxx.

485 {
486 float emTot = 0.;
487 float em3Tot = 0.;
488 float hecTot = 0.;
489 float psTot = 0.;
490 float tile0Tot = 0.;
491 float eTot = 0.;
492 float e2Tot = 0.;
493 float sumRadialDistanceSquared = 0;
494 float sumLongitudinalDistanceSquared = 0;
495 size_t numConstit = jet.numConstituents();
496 std::unique_ptr<std::vector<const xAOD::CaloCluster*> > constitV_tot = std::make_unique<std::vector<const xAOD::CaloCluster*>>();
497 const xAOD::CaloCluster* leadingCluster = nullptr;
498
499 for ( size_t i=0; i<numConstit; i++ ) {
501 ATH_MSG_WARNING("Tried to call fillEperSamplingFE with a jet constituent that is not a FlowElement!");
502 continue;
503 }
504 const xAOD::FlowElement* constit = static_cast<const xAOD::FlowElement*>(jet.rawConstituent(i));
505
506 for (size_t n = 0; n < constit->otherObjects().size(); ++n) {
507 if(! constit->otherObject(n)) continue;
508 int index_pfo = constit->otherObject(n)->index();
509 if(index_pfo<0) continue;
510
511 const auto* fe = (constit->otherObject(n));
512 const xAOD::CaloCluster* cluster = nullptr;
513
514 //If we have a cluster, we can directly access the calorimeter information
515 if(fe->type() == xAOD::Type::CaloCluster){
516 cluster = dynamic_cast<const xAOD::CaloCluster*> (fe);
517 }
518 //If we have a PFO, we should still get the associated cluster first
519 else {
520 const xAOD::FlowElement* pfo = dynamic_cast<const xAOD::FlowElement*>(fe);
521 if(!pfo->otherObjects().empty() && pfo->otherObject(0) && pfo->otherObject(0)->type() == xAOD::Type::CaloCluster){
522 cluster = dynamic_cast<const xAOD::CaloCluster*> (pfo->otherObject(0));
523 }
524 }
525 if(!cluster) continue;
526
527 if (!leadingCluster || (cluster->rawE() > leadingCluster->rawE())){
528 leadingCluster = cluster;
529 }
530
531
532 if(std::find(constitV_tot->begin(), constitV_tot->end(), cluster) == constitV_tot->end()){
533 for ( size_t s= CaloSampling::PreSamplerB; s< CaloSampling::Unknown; s++ ) {
534 ePerSampling[s] += cluster->eSample( (xAOD::CaloCluster::CaloSample) s );
535 }
536 eTot += cluster->rawE();
537 e2Tot += cluster->rawE()*cluster->rawE();
538
539 emTot += (cluster->eSample( CaloSampling::PreSamplerB) + cluster->eSample( CaloSampling::EMB1)
540 + cluster->eSample( CaloSampling::EMB2) + cluster->eSample( CaloSampling::EMB3)
541 + cluster->eSample( CaloSampling::PreSamplerE) + cluster->eSample( CaloSampling::EME1)
542 + cluster->eSample( CaloSampling::EME2) + cluster->eSample( CaloSampling::EME3)
543 + cluster->eSample( CaloSampling::FCAL0));
544
545 hecTot += (cluster->eSample( CaloSampling::HEC0) + cluster->eSample( CaloSampling::HEC1)
546 + cluster->eSample( CaloSampling::HEC2) + cluster->eSample( CaloSampling::HEC3));
547
548 psTot += (cluster->eSample( CaloSampling::PreSamplerB) + cluster->eSample( CaloSampling::PreSamplerE));
549
550 em3Tot += (cluster->eSample( CaloSampling::EMB3) + cluster->eSample( CaloSampling::EME3));
551
552 tile0Tot += (cluster->eSample( CaloSampling::TileBar0) + cluster->eSample( CaloSampling::TileExt0));
553
554 sumRadialDistanceSquared += cluster->rawE() * getMoment(cluster, xAOD::CaloCluster::SECOND_R);
555 sumLongitudinalDistanceSquared += cluster->rawE() * getMoment(cluster, xAOD::CaloCluster::SECOND_LAMBDA);
556
557 constitV_tot->push_back(cluster);
558 }
559 }
560 }
561
562 float fracSamplingMax = -999999999.;
563 int fracSamplingMaxIndex = -1;
564 float sumE_samplings = 0.0;
565
567 for(unsigned int i = 0; i < ePerSampling.size(); ++i){
568 float e = ePerSampling[i];
569 sumE_samplings += e;
570 if (e>fracSamplingMax){
571 fracSamplingMax=e;
572 fracSamplingMaxIndex = i;
573 }
574 }
575 }
576
577 for( const std::string & calcN : m_calculationNames){
578 if ( calcN == "EMFrac" ) {
579 SG::WriteDecorHandle<xAOD::JetContainer, float> emFracClusterHandle(m_emFracClusterKey);
580 emFracClusterHandle(jet) = eTot != 0. ? emTot/eTot : 0.;
581 } else if ( calcN == "HECFrac" ) {
582 SG::WriteDecorHandle<xAOD::JetContainer, float> hecFracClusterHandle(m_hecFracClusterKey);
583 hecFracClusterHandle(jet) = eTot != 0. ? hecTot/eTot : 0.;
584 } else if ( calcN == "PSFrac" ) {
585 SG::WriteDecorHandle<xAOD::JetContainer, float> psFracClusterHandle(m_psFracClusterKey);
586 psFracClusterHandle(jet) = eTot != 0. ? psTot/eTot : 0.;
587 } else if ( calcN == "EM3Frac" ) {
588 SG::WriteDecorHandle<xAOD::JetContainer, float> em3FracClusterHandle(m_em3FracClusterKey);
589 em3FracClusterHandle(jet) = eTot != 0. ? em3Tot/eTot : 0.;
590 } else if ( calcN == "Tile0Frac" ) {
591 SG::WriteDecorHandle<xAOD::JetContainer, float> tile0FracClusterHandle(m_tile0FracClusterKey);
592 tile0FracClusterHandle(jet) = eTot != 0. ? tile0Tot/eTot : 0.;
593 } else if ( calcN == "EffNClusts" ) {
594 SG::WriteDecorHandle<xAOD::JetContainer, float> effNClustsFracClusterHandle(m_effNClustsFracClusterKey);
595 effNClustsFracClusterHandle(jet) = eTot != 0. ? std::sqrt(eTot*eTot/e2Tot) : 0.;
596 } else if ( calcN == "FracSamplingMax" ){
597 SG::WriteDecorHandle<xAOD::JetContainer, float> fracSamplingMaxClusterHandle(m_fracSamplingMaxClusterKey);
598 fracSamplingMaxClusterHandle(jet) = sumE_samplings != 0. ? fracSamplingMax/sumE_samplings : 0.;
599 SG::WriteDecorHandle<xAOD::JetContainer, int> fracSamplingMaxIndexClusterHandle(m_fracSamplingMaxIndexClusterKey);
600 fracSamplingMaxIndexClusterHandle(jet) = fracSamplingMaxIndex;
601 }
602 }
603
604 SG::WriteDecorHandle<xAOD::JetContainer, float> lambdaLeadingClusterHandle(m_lambdaLeadingClusterKey);
605 lambdaLeadingClusterHandle(jet) = getMoment(leadingCluster, xAOD::CaloCluster::CENTER_LAMBDA);
606
607 SG::WriteDecorHandle<xAOD::JetContainer, float> meanRadialDistanceSquaredHandle(m_meanRadialDistanceSquaredKey);
608 meanRadialDistanceSquaredHandle(jet) = eTot != 0. ? sumRadialDistanceSquared/eTot : 0.;
609
610 SG::WriteDecorHandle<xAOD::JetContainer, float> meanLongitudinalDistanceSquaredHandle(m_meanLongitudinalDistanceSquaredKey);
611 meanLongitudinalDistanceSquaredHandle(jet) = eTot != 0. ? sumLongitudinalDistanceSquared/eTot : 0.;
612}
SG::WriteDecorHandleKey< xAOD::JetContainer > m_meanRadialDistanceSquaredKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_psFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_effNClustsFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_meanLongitudinalDistanceSquaredKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hecFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_tile0FracClusterKey
float getMoment(const xAOD::CaloCluster *cluster, const xAOD::CaloCluster::MomentType &momentType) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_em3FracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_emFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxIndexClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_lambdaLeadingClusterKey
flt_t rawE() const
@ SECOND_LAMBDA
Second Moment in .
@ SECOND_R
Second Moment in .
@ CENTER_LAMBDA
Shower depth at Cluster Centroid.

◆ fillEperSamplingPFO()

void JetCaloEnergies::fillEperSamplingPFO ( const xAOD::Jet & jet,
std::vector< float > & ePerSampling ) const
protected

Definition at line 208 of file JetCaloEnergies.cxx.

208 {
209
210 float emTot=0;
211 float hecTot=0;
212 float eTot =0;
213 size_t numConstit = jet.numConstituents();
214
215 for ( size_t i=0; i<numConstit; i++ ) {
217 const xAOD::PFO* constit = static_cast<const xAOD::PFO*>(jet.rawConstituent(i));
218 if ( fabs(constit->charge())>FLT_MIN ){
219 eTot += constit->track(0)->e();
220 } else {
221 eTot += constit->e();
222 FillESamplingPFO(PreSamplerB);
223 FillESamplingPFO(EMB1);
224 FillESamplingPFO(EMB2);
225 FillESamplingPFO(EMB3);
226
227 FillESamplingPFO(PreSamplerE);
228 FillESamplingPFO(EME1);
229 FillESamplingPFO(EME2);
230 FillESamplingPFO(EME3);
231
232 FillESamplingPFO(HEC0);
233 FillESamplingPFO(HEC1);
234 FillESamplingPFO(HEC2);
235 FillESamplingPFO(HEC3);
236
237 FillESamplingPFO(TileBar0);
238 FillESamplingPFO(TileBar1);
239 FillESamplingPFO(TileBar2);
240
241 FillESamplingPFO(TileGap1);
242 FillESamplingPFO(TileGap2);
243 FillESamplingPFO(TileGap3);
244
245 FillESamplingPFO(TileExt0);
246 FillESamplingPFO(TileExt1);
247 FillESamplingPFO(TileExt2);
248
249 FillESamplingPFO(FCAL0);
250 FillESamplingPFO(FCAL1);
251 FillESamplingPFO(FCAL2);
252
253 FillESamplingPFO(MINIFCAL0);
254 FillESamplingPFO(MINIFCAL1);
255 FillESamplingPFO(MINIFCAL2);
256 FillESamplingPFO(MINIFCAL3);
257
258 emTot += ( E_PreSamplerB+E_EMB1+E_EMB2+E_EMB3+
259 E_PreSamplerE+E_EME1+E_EME2+E_EME3+
260 E_FCAL0 );
261 hecTot += ( E_HEC0+E_HEC1+E_HEC2+E_HEC3 );
262
263 }//only consider neutral PFO
264 } else {
265 ATH_MSG_WARNING("Tried to call fillEperSamplingPFlow with a jet constituent that is not a PFO!");
266 }
267 }
268
269 SG::WriteDecorHandle<xAOD::JetContainer, float> emFracHandle(m_emFracKey);
270 if(eTot != 0.0){
271 emFracHandle(jet) = emTot/eTot;
272 /*
273 * Ratio of EM layer calorimeter energy of neutrals to sum of all constituents
274 * at EM scale (note charged PFO have an EM scale at track scale, and charged weights are ignored)
275 * */
276 }
277 else {
278 emFracHandle(jet) = 0.;
279 }
280
281 SG::WriteDecorHandle<xAOD::JetContainer, float> hecFracHandle(m_hecFracKey);
282 if (eTot != 0.0){
283 hecFracHandle(jet) = hecTot/eTot;
284 }
285 else{
286 hecFracHandle(jet) = 0.;
287 }
288
289}
#define FillESamplingPFO(LAYERNAME)
const TrackParticle * track(unsigned int index) const
Retrieve a const pointer to a Rec::TrackParticle.
Definition PFO_v1.cxx:691
virtual double e() const
The total energy of the particle.
Definition PFO_v1.cxx:81
float charge() const
get charge of PFO
virtual double e() const override final
The total energy of the particle.
PFO_v1 PFO
Definition of the current "pfo version".
Definition PFO.h:17

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getMoment()

float JetCaloEnergies::getMoment ( const xAOD::CaloCluster * cluster,
const xAOD::CaloCluster::MomentType & momentType ) const
private

Definition at line 614 of file JetCaloEnergies.cxx.

614 {
615 if (cluster){
616 double moment = 0.0;
617 bool isRetrieved = cluster->retrieveMoment(momentType, moment);
618 if (isRetrieved) return (float) moment;
619 }
620 ATH_MSG_DEBUG("Can not retrieve moment from cluster");
621 return 0.0;
622}
#define ATH_MSG_DEBUG(x)
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode JetCaloEnergies::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 42 of file JetCaloEnergies.cxx.

42 {
43 ATH_MSG_INFO("Initializing JetCaloEnergies " << name());
44
45 if(m_jetContainerName.empty()){
46 ATH_MSG_ERROR("JetCaloEnergies needs to have its input jet container configured!");
47 return StatusCode::FAILURE;
48 }
49
59
73 }
74
75 // Init calo based variables if necessary
83
85
88
89 // Init standard variables if necessary
90 ATH_CHECK(m_ePerSamplingKey.initialize());
91 ATH_CHECK(m_emFracKey.initialize());
92 ATH_CHECK(m_hecFracKey.initialize());
93 ATH_CHECK(m_psFracKey.initialize());
102
103 return StatusCode::SUCCESS;
104}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
Gaudi::Property< std::string > m_jetContainerName
bool isInVector(const std::string &key, const std::vector< std::string > &calculations)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ isInVector()

bool JetCaloEnergies::isInVector ( const std::string & key,
const std::vector< std::string > & calculations )
protected

Definition at line 27 of file JetCaloEnergies.cxx.

27 {
28 // Split key to get back the actual handle key
29 std::vector<std::string> split;
30 std::string sub_string;
31 std::istringstream tokenStream(key);
32
33 while (std::getline(tokenStream, sub_string, '.'))
34 {
35 split.push_back(sub_string);
36 }
37
38 // Return true if handle key in list of calculations
39 return std::find(calculations.begin(), calculations.end(), split[1]) != calculations.end();
40}
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ modify()

virtual StatusCode IJetDecorator::modify ( xAOD::JetContainer & jets) const
inlinefinaloverridevirtualinherited

Concrete implementation of the function inherited from IJetModifier.

Implements IJetModifier.

Definition at line 32 of file IJetDecorator.h.

32{return decorate(jets);};
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::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< AlgTool > >::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.

◆ print()

◆ 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< AlgTool > >::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< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_calcClusterBasedVars

Gaudi::Property<bool> JetCaloEnergies::m_calcClusterBasedVars {this, "calcClusterBasedVars", false, "SG key to decide if cluster-based variables will be calculated for FE-based jets"}
private

Definition at line 39 of file JetCaloEnergies.h.

39{this, "calcClusterBasedVars", false, "SG key to decide if cluster-based variables will be calculated for FE-based jets"};

◆ m_calculationNames

Gaudi::Property<std::vector<std::string> > JetCaloEnergies::m_calculationNames {this, "Calculations", {}, "Name of calo quantities to compute and add as decorations"}
private

Definition at line 37 of file JetCaloEnergies.h.

37{this, "Calculations", {}, "Name of calo quantities to compute and add as decorations"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doFracSamplingMax

bool JetCaloEnergies::m_doFracSamplingMax = false
protected

Definition at line 34 of file JetCaloEnergies.h.

◆ m_effNClustsFracClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_effNClustsFracClusterKey {this, "EffNClustsClusterName", "EffNClustsCaloBased", "SG key for the EffNClusts attribute"}
private

Definition at line 58 of file JetCaloEnergies.h.

58{this, "EffNClustsClusterName", "EffNClustsCaloBased", "SG key for the EffNClusts attribute"};

◆ m_effNClustsFracKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_effNClustsFracKey {this, "EffNClustsName", "EffNClusts", "SG key for the EffNClusts attribute"}
private

Definition at line 47 of file JetCaloEnergies.h.

47{this, "EffNClustsName", "EffNClusts", "SG key for the EffNClusts attribute"};

◆ m_em3FracClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_em3FracClusterKey {this, "EM3FracClusterName", "EM3FracCaloBased", "SG key for the EM3Frac attribute"}
private

Definition at line 56 of file JetCaloEnergies.h.

56{this, "EM3FracClusterName", "EM3FracCaloBased", "SG key for the EM3Frac attribute"};

◆ m_em3FracKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_em3FracKey {this, "EM3FracName", "EM3Frac", "SG key for the EM3Frac attribute"}
private

Definition at line 45 of file JetCaloEnergies.h.

45{this, "EM3FracName", "EM3Frac", "SG key for the EM3Frac attribute"};

◆ m_emFracClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_emFracClusterKey {this, "EMFracClusterName", "EMFracCaloBased", "SG key for the EMFrac attribute"}
private

Definition at line 53 of file JetCaloEnergies.h.

53{this, "EMFracClusterName", "EMFracCaloBased", "SG key for the EMFrac attribute"};

◆ m_emFracKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_emFracKey {this, "EMFracName", "EMFrac", "SG key for the EMFrac attribute"}
private

Definition at line 42 of file JetCaloEnergies.h.

42{this, "EMFracName", "EMFrac", "SG key for the EMFrac attribute"};

◆ m_ePerSamplingClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_ePerSamplingClusterKey {this, "EPerSamplingClusterName", "EnergyPerSamplingCaloBased", "SG key for the EnergyPerSampling attribute"}
private

Definition at line 52 of file JetCaloEnergies.h.

52{this, "EPerSamplingClusterName", "EnergyPerSamplingCaloBased", "SG key for the EnergyPerSampling attribute"};

◆ m_ePerSamplingKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_ePerSamplingKey {this, "EPerSamplingName", "EnergyPerSampling", "SG key for the EnergyPerSampling attribute"}
private

Definition at line 41 of file JetCaloEnergies.h.

41{this, "EPerSamplingName", "EnergyPerSampling", "SG key for the EnergyPerSampling attribute"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fracSamplingMaxClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_fracSamplingMaxClusterKey {this, "FracSamplingMaxClusterName", "FracSamplingMaxCaloBased", "SG key for the FracSamplingMax (clus) attribute"}
private

Definition at line 59 of file JetCaloEnergies.h.

59{this, "FracSamplingMaxClusterName", "FracSamplingMaxCaloBased", "SG key for the FracSamplingMax (clus) attribute"};

◆ m_fracSamplingMaxIndexClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_fracSamplingMaxIndexClusterKey {this, "FracSamplingMaxIndexClusterName", "FracSamplingMaxIndexCaloBased", "SG key for FracSamplingMaxIndex (clus) attribute"}
private

Definition at line 60 of file JetCaloEnergies.h.

60{this, "FracSamplingMaxIndexClusterName", "FracSamplingMaxIndexCaloBased", "SG key for FracSamplingMaxIndex (clus) attribute"};

◆ m_fracSamplingMaxIndexKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_fracSamplingMaxIndexKey {this, "FracSamplingMaxIndexName", "FracSamplingMaxIndex", "SG key for the FracSamplingMaxIndex attribute"}
private

Definition at line 49 of file JetCaloEnergies.h.

49{this, "FracSamplingMaxIndexName", "FracSamplingMaxIndex", "SG key for the FracSamplingMaxIndex attribute"};

◆ m_fracSamplingMaxKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_fracSamplingMaxKey {this, "FracSamplingMaxName", "FracSamplingMax", "SG key for the FracSamplingMax attribute"}
private

Definition at line 48 of file JetCaloEnergies.h.

48{this, "FracSamplingMaxName", "FracSamplingMax", "SG key for the FracSamplingMax attribute"};

◆ m_hecFracClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_hecFracClusterKey {this, "HECFracClusterName", "HECFracCaloBased", "SG key for the HECFrac attribute"}
private

Definition at line 54 of file JetCaloEnergies.h.

54{this, "HECFracClusterName", "HECFracCaloBased", "SG key for the HECFrac attribute"};

◆ m_hecFracKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_hecFracKey {this, "HECFracName", "HECFrac", "SG key for the HECFrac attribute"}
private

Definition at line 43 of file JetCaloEnergies.h.

43{this, "HECFracName", "HECFrac", "SG key for the HECFrac attribute"};

◆ m_jetContainerName

Gaudi::Property<std::string> JetCaloEnergies::m_jetContainerName {this, "JetContainer", "", "SG key for the input jet container"}
private

Definition at line 38 of file JetCaloEnergies.h.

38{this, "JetContainer", "", "SG key for the input jet container"};

◆ m_lambdaLeadingClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_lambdaLeadingClusterKey {this, "LambdaLeadingClusterName", "LambdaLeadingCluster", "SG key for the longitudinal distance between the leading (highest energy) cluster and the jet’s geometrical center"}
private

Definition at line 62 of file JetCaloEnergies.h.

62{this, "LambdaLeadingClusterName", "LambdaLeadingCluster", "SG key for the longitudinal distance between the leading (highest energy) cluster and the jet’s geometrical center"};

◆ m_meanLongitudinalDistanceSquaredKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_meanLongitudinalDistanceSquaredKey {this, "MeanLongitudinalDistanceSquaredName", "MeanLongitudinalDistanceSquared", "SG key for the weighted mean of the squared Longitudinal distances of the clusters from jet’s geometrical center"}
private

Definition at line 64 of file JetCaloEnergies.h.

64{this, "MeanLongitudinalDistanceSquaredName", "MeanLongitudinalDistanceSquared", "SG key for the weighted mean of the squared Longitudinal distances of the clusters from jet’s geometrical center"};

◆ m_meanRadialDistanceSquaredKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_meanRadialDistanceSquaredKey {this, "MeanRadialDistanceSquaredName", "MeanRadialDistanceSquared", "SG key for the weighted mean of the squared radial distances of the clusters from jet’s geometrical center"}
private

Definition at line 63 of file JetCaloEnergies.h.

63{this, "MeanRadialDistanceSquaredName", "MeanRadialDistanceSquared", "SG key for the weighted mean of the squared radial distances of the clusters from jet’s geometrical center"};

◆ m_psFracClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_psFracClusterKey {this, "PSFracClusterName", "PSFracCaloBased", "SG key for the PSFrac attribute"}
private

Definition at line 55 of file JetCaloEnergies.h.

55{this, "PSFracClusterName", "PSFracCaloBased", "SG key for the PSFrac attribute"};

◆ m_psFracKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_psFracKey {this, "PSFracName", "PSFrac", "SG key for the PSFrac attribute"}
private

Definition at line 44 of file JetCaloEnergies.h.

44{this, "PSFracName", "PSFrac", "SG key for the PSFrac attribute"};

◆ m_tile0FracClusterKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_tile0FracClusterKey {this, "Tile0FracClusterName", "Tile0FracCaloBased", "SG key for the Tile0Frac attribute"}
private

Definition at line 57 of file JetCaloEnergies.h.

57{this, "Tile0FracClusterName", "Tile0FracCaloBased", "SG key for the Tile0Frac attribute"};

◆ m_tile0FracKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JetCaloEnergies::m_tile0FracKey {this, "Tile0FracName", "Tile0Frac", "SG key for the Tile0Frac attribute"}
private

Definition at line 46 of file JetCaloEnergies.h.

46{this, "Tile0FracName", "Tile0Frac", "SG key for the Tile0Frac attribute"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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