ATLAS Offline Software
UncertaintyComponent.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETUNCERTAINTIES_UNCERTAINTYCOMPONENT_H
6 #define JETUNCERTAINTIES_UNCERTAINTYCOMPONENT_H
7 
11 
12 #include "xAODJet/Jet.h"
14 
16 
17 #include "TString.h"
18 
19 class TFile;
20 
21 namespace jet
22 {
23 
25 {
26  public:
27  // Constructor/destructor/initialization
28  UncertaintyComponent(const ComponentHelper& component, const size_t numHist = 1);
30  virtual UncertaintyComponent* clone() const = 0;
31  virtual ~UncertaintyComponent();
32  virtual StatusCode initialize(TFile* histFile);
33 
34  // Member retrieval methods
35  virtual TString getName() const { return m_uncHistName; }
36  virtual TString getValidName() const { return m_validHistName; }
37  virtual CompScaleVar::TypeEnum getScaleVar() const { return m_scaleVar; }
38  virtual JetTopology::TypeEnum getTopology() const { return m_topology; }
39 
40  // Helpers for special situations
41  virtual bool isAlwaysZero() const;
42 
43  // Uncertainty/validity retrieval methods
44  virtual bool getValidity(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
45  virtual double getUncertainty(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
46  virtual bool getValidUncertainty(double& unc, const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const;
47 
48  protected:
49  // Protected members
50  bool m_isInit{};
51  const TString m_uncHistName;
52  const TString m_validHistName;
55  const float m_energyScale{};
57  const int m_splitNumber{};
58 
62 
63  // Methods for derived classes to implement
64  virtual bool getValidityImpl(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const = 0;
65  virtual double getUncertaintyImpl(const xAOD::Jet& jet, const xAOD::EventInfo& eInfo) const = 0;
66 
67  // Helper methods
68  virtual bool getValidBool(const double validity) const;
69  virtual double getSplitFactor(const xAOD::Jet& jet) const;
70  virtual double getAbsMass(const xAOD::Jet& jet, const CompMassDef::TypeEnum massDef) const;
71  virtual double getMassOverPt(const xAOD::Jet& jet, const CompMassDef::TypeEnum massDef) const;
72  virtual double getMassOverE(const xAOD::Jet& jet, const CompMassDef::TypeEnum massDef) const;
73 
74  private:
75  UncertaintyComponent(const std::string& name = "");
76 };
77 
78 // Sorting operators
79 bool operator < (const UncertaintyComponent& componentA, const UncertaintyComponent& componentB);
80 bool operator == (const UncertaintyComponent& componentA, const UncertaintyComponent& componentB);
81 
82 } // end jet namespace
83 
84 
85 #endif
jet::UncertaintyComponent::getTopology
virtual JetTopology::TypeEnum getTopology() const
Definition: UncertaintyComponent.h:38
jet::CompMassDef::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:71
jet::UncertaintyComponent::getValidityImpl
virtual bool getValidityImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const =0
jet::UncertaintyComponent::getMassOverPt
virtual double getMassOverPt(const xAOD::Jet &jet, const CompMassDef::TypeEnum massDef) const
Definition: UncertaintyComponent.cxx:334
jet::UncertaintyComponent::getMassOverE
virtual double getMassOverE(const xAOD::Jet &jet, const CompMassDef::TypeEnum massDef) const
Definition: UncertaintyComponent.cxx:360
Jet.h
UncertaintyHistogram.h
jet::UncertaintyComponent::m_energyScale
const float m_energyScale
Definition: UncertaintyComponent.h:55
jet::Interpolate::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:241
jet::UncertaintyComponent::getSplitFactor
virtual double getSplitFactor(const xAOD::Jet &jet) const
Definition: UncertaintyComponent.cxx:196
jet::UncertaintyComponent::m_interpolate
const Interpolate::TypeEnum m_interpolate
Definition: UncertaintyComponent.h:56
jet::UncertaintyComponent::clone
virtual UncertaintyComponent * clone() const =0
jet::ComponentHelper
Definition: ConfigHelper.h:24
jet::UncertaintyComponent::~UncertaintyComponent
virtual ~UncertaintyComponent()
Definition: UncertaintyComponent.cxx:89
jet::UncertaintyComponent::m_uncHistName
const TString m_uncHistName
Definition: UncertaintyComponent.h:51
jet::operator==
bool operator==(const UncertaintyComponent &componentA, const UncertaintyComponent &componentB)
Definition: UncertaintyComponent.cxx:18
jet::UncertaintyComponent::initialize
virtual StatusCode initialize(TFile *histFile)
Definition: UncertaintyComponent.cxx:96
jet::UncertaintyComponent::m_isInit
bool m_isInit
Definition: UncertaintyComponent.h:50
jet::UncertaintyComponent::getValidBool
virtual bool getValidBool(const double validity) const
Definition: UncertaintyComponent.cxx:301
UncertaintyEnum.h
jet::UncertaintyComponent
Definition: UncertaintyComponent.h:25
jet::UncertaintyComponent::m_numExpectedHist
int m_numExpectedHist
Definition: UncertaintyComponent.h:59
AsgMessaging.h
jet::UncertaintyComponent::m_validHistName
const TString m_validHistName
Definition: UncertaintyComponent.h:52
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jet::operator<
bool operator<(const UncertaintyComponent &componentA, const UncertaintyComponent &componentB)
Definition: UncertaintyComponent.cxx:13
jet::UncertaintyComponent::m_validHist
UncertaintyHistogram * m_validHist
Definition: UncertaintyComponent.h:61
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
jet::UncertaintyComponent::getName
virtual TString getName() const
Definition: UncertaintyComponent.h:35
jet::UncertaintyComponent::isAlwaysZero
virtual bool isAlwaysZero() const
Definition: UncertaintyComponent.cxx:140
jet::UncertaintyComponent::getAbsMass
virtual double getAbsMass(const xAOD::Jet &jet, const CompMassDef::TypeEnum massDef) const
Definition: UncertaintyComponent.cxx:309
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
jet::UncertaintyComponent::m_splitNumber
const int m_splitNumber
Definition: UncertaintyComponent.h:57
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
jet::UncertaintyComponent::getUncertaintyImpl
virtual double getUncertaintyImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const =0
EventInfo.h
jet::UncertaintyHistogram
Definition: UncertaintyHistogram.h:25
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
jet::CompScaleVar::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:91
jet::UncertaintyComponent::getValidName
virtual TString getValidName() const
Definition: UncertaintyComponent.h:36
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
jet::UncertaintyComponent::m_scaleVar
const CompScaleVar::TypeEnum m_scaleVar
Definition: UncertaintyComponent.h:53
jet::UncertaintyComponent::getUncertainty
virtual double getUncertainty(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition: UncertaintyComponent.cxx:169
jet::UncertaintyComponent::UncertaintyComponent
UncertaintyComponent(const ComponentHelper &component, const size_t numHist=1)
Definition: UncertaintyComponent.cxx:47
jet::UncertaintyComponent::m_uncHist
UncertaintyHistogram * m_uncHist
Definition: UncertaintyComponent.h:60
jet::JetTopology::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:208
jet::UncertaintyComponent::getValidUncertainty
virtual bool getValidUncertainty(double &unc, const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition: UncertaintyComponent.cxx:179
jet::UncertaintyComponent::getValidity
virtual bool getValidity(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition: UncertaintyComponent.cxx:159
jet::UncertaintyComponent::getScaleVar
virtual CompScaleVar::TypeEnum getScaleVar() const
Definition: UncertaintyComponent.h:37
ConfigHelper.h
jet::UncertaintyComponent::m_topology
const JetTopology::TypeEnum m_topology
Definition: UncertaintyComponent.h:54