ATLAS Offline Software
Loading...
Searching...
No Matches
JetCaloEnergies.h
Go to the documentation of this file.
1// this file is -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef JETMOMENTTOOLS_JETCALOENERGIES_H
8#define JETMOMENTTOOLS_JETCALOENERGIES_H
9
10#include "AsgTools/AsgTool.h"
16#include <vector>
17
19 virtual public IJetDecorator {
21public:
22
23 JetCaloEnergies(const std::string & t);
24
25 virtual StatusCode initialize() override;
26 virtual StatusCode decorate(const xAOD::JetContainer& jets) const override;
27
28protected:
29 void fillEperSamplingCluster(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
30 void fillEperSamplingPFO(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
31 void fillEperSamplingFE(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
32 void fillEperSamplingFEClusterBased(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
33 bool isInVector(const std::string& key, const std::vector<std::string>& calculations);
34 bool m_doFracSamplingMax = false;
35
36private:
37 Gaudi::Property<std::vector<std::string> > m_calculationNames{this, "Calculations", {}, "Name of calo quantities to compute and add as decorations"};
38 Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for the input jet container"};
39 Gaudi::Property<bool> m_calcClusterBasedVars{this, "calcClusterBasedVars", false, "SG key to decide if cluster-based variables will be calculated for FE-based jets"};
40
41 SG::WriteDecorHandleKey<xAOD::JetContainer> m_ePerSamplingKey{this, "EPerSamplingName", "EnergyPerSampling", "SG key for the EnergyPerSampling attribute"};
42 SG::WriteDecorHandleKey<xAOD::JetContainer> m_emFracKey{this, "EMFracName", "EMFrac", "SG key for the EMFrac attribute"};
43 SG::WriteDecorHandleKey<xAOD::JetContainer> m_hecFracKey{this, "HECFracName", "HECFrac", "SG key for the HECFrac attribute"};
44 SG::WriteDecorHandleKey<xAOD::JetContainer> m_psFracKey{this, "PSFracName", "PSFrac", "SG key for the PSFrac attribute"};
45 SG::WriteDecorHandleKey<xAOD::JetContainer> m_em3FracKey{this, "EM3FracName", "EM3Frac", "SG key for the EM3Frac attribute"};
46 SG::WriteDecorHandleKey<xAOD::JetContainer> m_tile0FracKey{this, "Tile0FracName", "Tile0Frac", "SG key for the Tile0Frac attribute"};
47 SG::WriteDecorHandleKey<xAOD::JetContainer> m_effNClustsFracKey{this, "EffNClustsName", "EffNClusts", "SG key for the EffNClusts attribute"};
48 SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxKey{this, "FracSamplingMaxName", "FracSamplingMax", "SG key for the FracSamplingMax attribute"};
49 SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxIndexKey{this, "FracSamplingMaxIndexName", "FracSamplingMaxIndex", "SG key for the FracSamplingMaxIndex attribute"};
50
51 // Variables for FE-based jet collection using the underlying cluster rather than energy-subtracted FE for calculations
52 SG::WriteDecorHandleKey<xAOD::JetContainer> m_ePerSamplingClusterKey{this, "EPerSamplingClusterName", "EnergyPerSamplingCaloBased", "SG key for the EnergyPerSampling attribute"};
53 SG::WriteDecorHandleKey<xAOD::JetContainer> m_emFracClusterKey{this, "EMFracClusterName", "EMFracCaloBased", "SG key for the EMFrac attribute"};
54 SG::WriteDecorHandleKey<xAOD::JetContainer> m_hecFracClusterKey{this, "HECFracClusterName", "HECFracCaloBased", "SG key for the HECFrac attribute"};
55 SG::WriteDecorHandleKey<xAOD::JetContainer> m_psFracClusterKey{this, "PSFracClusterName", "PSFracCaloBased", "SG key for the PSFrac attribute"};
56 SG::WriteDecorHandleKey<xAOD::JetContainer> m_em3FracClusterKey{this, "EM3FracClusterName", "EM3FracCaloBased", "SG key for the EM3Frac attribute"};
57 SG::WriteDecorHandleKey<xAOD::JetContainer> m_tile0FracClusterKey{this, "Tile0FracClusterName", "Tile0FracCaloBased", "SG key for the Tile0Frac attribute"};
58 SG::WriteDecorHandleKey<xAOD::JetContainer> m_effNClustsFracClusterKey{this, "EffNClustsClusterName", "EffNClustsCaloBased", "SG key for the EffNClusts attribute"};
59 SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxClusterKey{this, "FracSamplingMaxClusterName", "FracSamplingMaxCaloBased", "SG key for the FracSamplingMax (clus) attribute"};
60 SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxIndexClusterKey{this, "FracSamplingMaxIndexClusterName", "FracSamplingMaxIndexCaloBased", "SG key for FracSamplingMaxIndex (clus) attribute"};
61
62 SG::WriteDecorHandleKey<xAOD::JetContainer> m_lambdaLeadingClusterKey{this, "LambdaLeadingClusterName", "LambdaLeadingCluster", "SG key for the longitudinal distance between the leading (highest energy) cluster and the jet’s geometrical center"};
63 SG::WriteDecorHandleKey<xAOD::JetContainer> m_meanRadialDistanceSquaredKey{this, "MeanRadialDistanceSquaredName", "MeanRadialDistanceSquared", "SG key for the weighted mean of the squared radial distances of the clusters from jet’s geometrical center"};
64 SG::WriteDecorHandleKey<xAOD::JetContainer> m_meanLongitudinalDistanceSquaredKey{this, "MeanLongitudinalDistanceSquaredName", "MeanLongitudinalDistanceSquared", "SG key for the weighted mean of the squared Longitudinal distances of the clusters from jet’s geometrical center"};
65
66private:
67 float getMoment(const xAOD::CaloCluster* cluster, const xAOD::CaloCluster::MomentType& momentType) const;
68
69};
70
71
72#undef ASG_DERIVED_TOOL_CLASS
73#endif
74
#define ASG_TOOL_CLASS0(CLASSNAME)
Interface for adding a decoration to a jet container.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_effNClustsFracKey
Gaudi::Property< bool > m_calcClusterBasedVars
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ePerSamplingKey
void fillEperSamplingCluster(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_meanRadialDistanceSquaredKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hecFracKey
JetCaloEnergies(const std::string &t)
Gaudi::Property< std::string > m_jetContainerName
SG::WriteDecorHandleKey< xAOD::JetContainer > m_em3FracKey
Gaudi::Property< std::vector< std::string > > m_calculationNames
SG::WriteDecorHandleKey< xAOD::JetContainer > m_tile0FracKey
void fillEperSamplingPFO(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_psFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ePerSamplingClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxIndexKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_effNClustsFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_meanLongitudinalDistanceSquaredKey
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hecFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_tile0FracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_psFracKey
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
void fillEperSamplingFEClusterBased(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
float getMoment(const xAOD::CaloCluster *cluster, const xAOD::CaloCluster::MomentType &momentType) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_em3FracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_emFracClusterKey
bool isInVector(const std::string &key, const std::vector< std::string > &calculations)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_emFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxIndexClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_lambdaLeadingClusterKey
void fillEperSamplingFE(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
MomentType
Enums to identify different moments.
Jet_v1 Jet
Definition of the current "jet version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
JetContainer_v1 JetContainer
Definition of the current "jet container version".