ATLAS Offline Software
JetCaloEnergies.h
Go to the documentation of this file.
1 // this file is -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2023 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"
14 #include "xAODJet/JetContainer.h"
15 #include <vector>
16 
18  virtual public IJetDecorator {
20 public:
21 
22  JetCaloEnergies(const std::string & t);
23 
24  virtual StatusCode initialize() override;
25  virtual StatusCode decorate(const xAOD::JetContainer& jets) const override;
26 
27 protected:
28  void fillEperSamplingCluster(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
29  void fillEperSamplingPFO(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
30  void fillEperSamplingFE(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
31  void fillEperSamplingFEClusterBased(const xAOD::Jet &jet, std::vector<float> & ePerSampling ) const ;
32  bool isInVector(const std::string& key, const std::vector<std::string>& calculations);
33  bool m_doFracSamplingMax = false;
34 
35 private:
36  Gaudi::Property<std::vector<std::string> > m_calculationNames{this, "Calculations", {}, "Name of calo quantities to compute and add as decorations"};
37  Gaudi::Property<std::string> m_jetContainerName{this, "JetContainer", "", "SG key for the input jet container"};
38  Gaudi::Property<bool> m_calcClusterBasedVars{this, "calcClusterBasedVars", false, "SG key to decide if cluster-based variables will be calculated for FE-based jets"};
39 
40  SG::WriteDecorHandleKey<xAOD::JetContainer> m_ePerSamplingKey{this, "EPerSamplingName", "EnergyPerSampling", "SG key for the EnergyPerSampling attribute"};
41  SG::WriteDecorHandleKey<xAOD::JetContainer> m_emFracKey{this, "EMFracName", "EMFrac", "SG key for the EMFrac attribute"};
42  SG::WriteDecorHandleKey<xAOD::JetContainer> m_hecFracKey{this, "HECFracName", "HECFrac", "SG key for the HECFrac attribute"};
43  SG::WriteDecorHandleKey<xAOD::JetContainer> m_psFracKey{this, "PSFracName", "PSFrac", "SG key for the PSFrac attribute"};
44  SG::WriteDecorHandleKey<xAOD::JetContainer> m_em3FracKey{this, "EM3FracName", "EM3Frac", "SG key for the EM3Frac attribute"};
45  SG::WriteDecorHandleKey<xAOD::JetContainer> m_tile0FracKey{this, "Tile0FracName", "Tile0Frac", "SG key for the Tile0Frac attribute"};
46  SG::WriteDecorHandleKey<xAOD::JetContainer> m_effNClustsFracKey{this, "EffNClustsName", "EffNClusts", "SG key for the EffNClusts attribute"};
47  SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxKey{this, "FracSamplingMaxName", "FracSamplingMax", "SG key for the FracSamplingMax attribute"};
48  SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxIndexKey{this, "FracSamplingMaxIndexName", "FracSamplingMaxIndex", "SG key for the FracSamplingMaxIndex attribute"};
49 
50  // Variables for FE-based jet collection using the underlying cluster rather than energy-subtracted FE for calculations
51  SG::WriteDecorHandleKey<xAOD::JetContainer> m_ePerSamplingClusterKey{this, "EPerSamplingClusterName", "EnergyPerSamplingCaloBased", "SG key for the EnergyPerSampling attribute"};
52  SG::WriteDecorHandleKey<xAOD::JetContainer> m_emFracClusterKey{this, "EMFracClusterName", "EMFracCaloBased", "SG key for the EMFrac attribute"};
53  SG::WriteDecorHandleKey<xAOD::JetContainer> m_hecFracClusterKey{this, "HECFracClusterName", "HECFracCaloBased", "SG key for the HECFrac attribute"};
54  SG::WriteDecorHandleKey<xAOD::JetContainer> m_psFracClusterKey{this, "PSFracClusterName", "PSFracCaloBased", "SG key for the PSFrac attribute"};
55  SG::WriteDecorHandleKey<xAOD::JetContainer> m_em3FracClusterKey{this, "EM3FracClusterName", "EM3FracCaloBased", "SG key for the EM3Frac attribute"};
56  SG::WriteDecorHandleKey<xAOD::JetContainer> m_tile0FracClusterKey{this, "Tile0FracClusterName", "Tile0FracCaloBased", "SG key for the Tile0Frac attribute"};
57  SG::WriteDecorHandleKey<xAOD::JetContainer> m_effNClustsFracClusterKey{this, "EffNClustsClusterName", "EffNClustsCaloBased", "SG key for the EffNClusts attribute"};
58  SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxClusterKey{this, "FracSamplingMaxClusterName", "FracSamplingMaxCaloBased", "SG key for the FracSamplingMax (clus) attribute"};
59  SG::WriteDecorHandleKey<xAOD::JetContainer> m_fracSamplingMaxIndexClusterKey{this, "FracSamplingMaxIndexClusterName", "FracSamplingMaxIndexCaloBased", "SG key for FracSamplingMaxIndex (clus) attribute"};
60 
61 };
62 
63 
64 #undef ASG_DERIVED_TOOL_CLASS
65 #endif
66 
JetCaloEnergies::m_fracSamplingMaxClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxClusterKey
Definition: JetCaloEnergies.h:58
JetCaloEnergies::isInVector
bool isInVector(const std::string &key, const std::vector< std::string > &calculations)
Definition: JetCaloEnergies.cxx:27
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
JetCaloEnergies::m_effNClustsFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_effNClustsFracKey
Definition: JetCaloEnergies.h:46
JetCaloEnergies::m_jetContainerName
Gaudi::Property< std::string > m_jetContainerName
Definition: JetCaloEnergies.h:37
JetCaloEnergies::fillEperSamplingPFO
void fillEperSamplingPFO(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
Definition: JetCaloEnergies.cxx:202
JetCaloEnergies::m_em3FracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_em3FracClusterKey
Definition: JetCaloEnergies.h:55
JetCaloEnergies::JetCaloEnergies
JetCaloEnergies(const std::string &t)
Definition: JetCaloEnergies.cxx:22
JetCaloEnergies::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: JetCaloEnergies.cxx:42
JetCaloEnergies::m_doFracSamplingMax
bool m_doFracSamplingMax
Definition: JetCaloEnergies.h:33
IJetDecorator
Interface for adding a decoration to a jet container.
Definition: IJetDecorator.h:21
JetCaloEnergies::m_fracSamplingMaxIndexKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxIndexKey
Definition: JetCaloEnergies.h:48
JetCaloEnergies::fillEperSamplingFE
void fillEperSamplingFE(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
Definition: JetCaloEnergies.cxx:287
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
IJetDecorator.h
JetCaloEnergies::decorate
virtual StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
Definition: JetCaloEnergies.cxx:102
JetCaloEnergies::m_tile0FracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_tile0FracKey
Definition: JetCaloEnergies.h:45
JetCaloEnergies::m_ePerSamplingKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ePerSamplingKey
Definition: JetCaloEnergies.h:40
JetCaloEnergies::m_psFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_psFracClusterKey
Definition: JetCaloEnergies.h:54
JetCaloEnergies::m_ePerSamplingClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ePerSamplingClusterKey
Definition: JetCaloEnergies.h:51
JetCaloEnergies::m_hecFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hecFracClusterKey
Definition: JetCaloEnergies.h:53
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
JetCaloEnergies::m_fracSamplingMaxKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxKey
Definition: JetCaloEnergies.h:47
ASG_TOOL_CLASS0
#define ASG_TOOL_CLASS0(CLASSNAME)
Definition: AsgToolMacros.h:62
JetCaloEnergies::m_fracSamplingMaxIndexClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_fracSamplingMaxIndexClusterKey
Definition: JetCaloEnergies.h:59
JetCaloEnergies::m_tile0FracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_tile0FracClusterKey
Definition: JetCaloEnergies.h:56
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
JetCaloEnergies::m_effNClustsFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_effNClustsFracClusterKey
Definition: JetCaloEnergies.h:57
JetCaloEnergies::m_calculationNames
Gaudi::Property< std::vector< std::string > > m_calculationNames
Definition: JetCaloEnergies.h:36
JetCaloEnergies::m_emFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_emFracKey
Definition: JetCaloEnergies.h:41
WriteDecorHandleKey.h
JetCaloEnergies::m_emFracClusterKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_emFracClusterKey
Definition: JetCaloEnergies.h:52
JetCaloEnergies::m_calcClusterBasedVars
Gaudi::Property< bool > m_calcClusterBasedVars
Definition: JetCaloEnergies.h:38
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
JetCaloEnergies::m_em3FracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_em3FracKey
Definition: JetCaloEnergies.h:44
JetCaloEnergies::m_psFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_psFracKey
Definition: JetCaloEnergies.h:43
JetCaloEnergies::fillEperSamplingFEClusterBased
void fillEperSamplingFEClusterBased(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
Definition: JetCaloEnergies.cxx:479
JetCaloEnergies
Definition: JetCaloEnergies.h:18
JetCaloEnergies::m_hecFracKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_hecFracKey
Definition: JetCaloEnergies.h:42
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
JetCaloEnergies::fillEperSamplingCluster
void fillEperSamplingCluster(const xAOD::Jet &jet, std::vector< float > &ePerSampling) const
Definition: JetCaloEnergies.cxx:151
AsgTool.h
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37