ATLAS Offline Software
PunchthroughUncertaintyComponent.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 namespace jet
9 {
10 
12 // //
13 // Constructor/destructor/initialization //
14 // //
16 
19  , m_absEta(false)
20 {
22 }
23 
25  : UncertaintyComponent(component)
26  , m_absEta(CompParametrization::isAbsEta(component.parametrization))
27 {
28  ATH_MSG_DEBUG(Form("Creating PunchthroughUncertaintyComponent named %s",m_uncHistName.Data()));
29 }
30 
32  : UncertaintyComponent(toCopy)
33  , m_absEta(toCopy.m_absEta)
34 {
35  ATH_MSG_DEBUG(Form("Creating copy of PunchthroughUncertaintyComponent named %s",m_uncHistName.Data()));
36 }
37 
39 {
40  return new PunchthroughUncertaintyComponent(*this);
41 }
42 
43 
45 // //
46 // Validity and uncertainty retrieval //
47 // //
49 
51 {
52  return !m_validHist ? true : getValidBool(m_validHist->getValue(jet.pt()*m_energyScale,getNumSegments(jet),m_absEta ? fabs(jet.eta()) : jet.eta()));
53 }
54 
56 {
57  return m_uncHist->getValue(jet.pt()*m_energyScale,getNumSegments(jet),m_absEta ? fabs(jet.eta()) : jet.eta());
58 }
59 
61 {
62 
63 // std::cout << "Calling getNumSegments for component " << getName() << std::endl;
64 
65  static const SG::AuxElement::Accessor<int> accNseg("GhostMuonSegmentCount");
66 
67  if (!accNseg.isAvailable(jet))
68  {
69  ATH_MSG_ERROR("Failed to retrieve number of segments from the jet");
70  return -1;
71  }
72  return accNseg(jet);
73 }
74 
75 } // end jet namespace
76 
jet::PunchthroughUncertaintyComponent::getValidityImpl
virtual bool getValidityImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition: PunchthroughUncertaintyComponent.cxx:50
jet::UncertaintyComponent::m_energyScale
const float m_energyScale
Definition: UncertaintyComponent.h:55
jet::PunchthroughUncertaintyComponent
Definition: PunchthroughUncertaintyComponent.h:14
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
jet::ComponentHelper
Definition: ConfigHelper.h:24
jet::UncertaintyComponent::m_uncHistName
const TString m_uncHistName
Definition: UncertaintyComponent.h:51
PunchthroughUncertaintyComponent.h
jet::CompParametrization::isAbsEta
bool isAbsEta(const TypeEnum type)
Definition: UncertaintyEnum.cxx:143
jet::UncertaintyComponent::getValidBool
virtual bool getValidBool(const double validity) const
Definition: UncertaintyComponent.cxx:301
jet::UncertaintyHistogram::getValue
double getValue(const double var1) const
Definition: UncertaintyHistogram.cxx:141
Helpers.h
jet::UncertaintyComponent
Definition: UncertaintyComponent.h:25
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
jet::UncertaintyComponent::m_validHist
UncertaintyHistogram * m_validHist
Definition: UncertaintyComponent.h:61
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
jet::PunchthroughUncertaintyComponent::getNumSegments
int getNumSegments(const xAOD::Jet &jet) const
Definition: PunchthroughUncertaintyComponent.cxx:60
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
JESUNC_NO_DEFAULT_CONSTRUCTOR
#define JESUNC_NO_DEFAULT_CONSTRUCTOR
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/Helpers.h:24
jet::PunchthroughUncertaintyComponent::getUncertaintyImpl
virtual double getUncertaintyImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
Definition: PunchthroughUncertaintyComponent.cxx:55
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
jet::PunchthroughUncertaintyComponent::PunchthroughUncertaintyComponent
PunchthroughUncertaintyComponent(const ComponentHelper &component)
Definition: PunchthroughUncertaintyComponent.cxx:24
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
jet::UncertaintyComponent::m_uncHist
UncertaintyHistogram * m_uncHist
Definition: UncertaintyComponent.h:60
jet::PunchthroughUncertaintyComponent::clone
virtual PunchthroughUncertaintyComponent * clone() const
Definition: PunchthroughUncertaintyComponent.cxx:38
jet::PunchthroughUncertaintyComponent::m_absEta
const bool m_absEta
Definition: PunchthroughUncertaintyComponent.h:30
LArG4GenerateShowerLib.parametrization
parametrization
Definition: LArG4GenerateShowerLib.py:19