ATLAS Offline Software
Loading...
Searching...
No Matches
jet::PerJetFlavourUncertaintyComponent Class Reference

#include <PerJetFlavourUncertaintyComponent.h>

Inheritance diagram for jet::PerJetFlavourUncertaintyComponent:
Collaboration diagram for jet::PerJetFlavourUncertaintyComponent:

Public Member Functions

 PerJetFlavourUncertaintyComponent (const ComponentHelper &component)
 PerJetFlavourUncertaintyComponent (const PerJetFlavourUncertaintyComponent &toCopy)
virtual PerJetFlavourUncertaintyComponentclone () const
virtual ~PerJetFlavourUncertaintyComponent ()
virtual StatusCode initialize (TFile *histFile)
virtual std::vector< int > getRelevantLabels () const
virtual TString getName () const
virtual TString getValidName () const
virtual CompScaleVar::TypeEnum getScaleVar () const
virtual JetTopology::TypeEnum getTopology () const
virtual bool isAlwaysZero () const
virtual bool getValidity (const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual double getUncertainty (const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual bool getValidUncertainty (double &unc, const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
void setLevel (MSG::Level lvl)
 Change the current logging level.
Functions providing the same interface as AthMessaging
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.

Protected Member Functions

virtual bool getValidityImpl (const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual double getUncertaintyImpl (const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual bool getValidBool (const double validity) const
virtual double getSplitFactor (const xAOD::Jet &jet) const
virtual double getAbsMass (const xAOD::Jet &jet, const CompMassDef::TypeEnum massDef) const
virtual double getMassOverPt (const xAOD::Jet &jet, const CompMassDef::TypeEnum massDef) const
virtual double getMassOverE (const xAOD::Jet &jet, const CompMassDef::TypeEnum massDef) const

Protected Attributes

bool m_isInit {}
const TString m_uncHistName
const TString m_validHistName
const CompScaleVar::TypeEnum m_scaleVar
const JetTopology::TypeEnum m_topology
const float m_energyScale {}
const Interpolate::TypeEnum m_interpolate
const int m_splitNumber {}
int m_numExpectedHist {}
UncertaintyHistogramm_uncHist {}
UncertaintyHistogramm_validHist {}

Private Member Functions

 PerJetFlavourUncertaintyComponent (const std::string &name="")
double getFlavourResponseUncertainty (const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
bool isSupportedLabel (const int label) const
bool checkTruthLabel (const xAOD::Jet &jet) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

const bool m_absEta {}
const std::vector< int > m_labels
const FlavourComp::TypeEnum m_flavourType {}
const bool m_constrainZresponse {}
const TString m_constrainZresponseFunc {}
const TF1 * m_ZjetQuarkFrac {}
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 15 of file PerJetFlavourUncertaintyComponent.h.

Constructor & Destructor Documentation

◆ PerJetFlavourUncertaintyComponent() [1/3]

jet::PerJetFlavourUncertaintyComponent::PerJetFlavourUncertaintyComponent ( const ComponentHelper & component)

Definition at line 29 of file PerJetFlavourUncertaintyComponent.cxx.

30 : UncertaintyComponent(component,1)
31 , m_absEta(CompParametrization::isAbsEta(component.parametrization))
32 , m_labels(component.truthLabels)
33 , m_flavourType(component.flavourType)
34 , m_constrainZresponse(component.constrainZresponse)
35 , m_constrainZresponseFunc(component.constrainZresponseFunc)
36{
37 ATH_MSG_DEBUG("Created PerJetFlavourUncertaintyComponent named " << m_uncHistName.Data());
38}
#define ATH_MSG_DEBUG(x)
UncertaintyComponent(const ComponentHelper &component, const size_t numHist=1)
bool isAbsEta(const TypeEnum type)

◆ PerJetFlavourUncertaintyComponent() [2/3]

jet::PerJetFlavourUncertaintyComponent::PerJetFlavourUncertaintyComponent ( const PerJetFlavourUncertaintyComponent & toCopy)

Definition at line 40 of file PerJetFlavourUncertaintyComponent.cxx.

41 : UncertaintyComponent(toCopy)
42 , m_absEta(toCopy.m_absEta)
43 , m_labels(toCopy.m_labels)
44 , m_flavourType(toCopy.m_flavourType)
45 , m_constrainZresponse(toCopy.m_constrainZresponse)
46 , m_constrainZresponseFunc(toCopy.m_constrainZresponseFunc)
47{
48 ATH_MSG_DEBUG("Creating copy of PerJetFlavourUncertaintyComponent named " << m_uncHistName.Data());
49}

◆ ~PerJetFlavourUncertaintyComponent()

virtual jet::PerJetFlavourUncertaintyComponent::~PerJetFlavourUncertaintyComponent ( )
inlinevirtual

Definition at line 22 of file PerJetFlavourUncertaintyComponent.h.

22{}

◆ PerJetFlavourUncertaintyComponent() [3/3]

jet::PerJetFlavourUncertaintyComponent::PerJetFlavourUncertaintyComponent ( const std::string & name = "")
private

Member Function Documentation

◆ checkTruthLabel()

bool jet::PerJetFlavourUncertaintyComponent::checkTruthLabel ( const xAOD::Jet & jet) const
private

Definition at line 173 of file PerJetFlavourUncertaintyComponent.cxx.

174{
175 static const SG::AuxElement::ConstAccessor<int> truthLabelAccessor ("PartonTruthLabelID");
176 if (!truthLabelAccessor.isAvailable(jet))
177 {
178 ATH_MSG_ERROR("Unable to find PartonTruthLabelID on the jet");
179 return JESUNC_ERROR_CODE;
180 }
181 const int truthHighestEparton = abs(truthLabelAccessor(jet));
182
183 for (const int label : m_labels)
184 if (label == truthHighestEparton)
185 return true;
186 return false;
187}
#define ATH_MSG_ERROR(x)
std::string label(const std::string &format, int i)
Definition label.h:19

◆ clone()

PerJetFlavourUncertaintyComponent * jet::PerJetFlavourUncertaintyComponent::clone ( ) const
virtual

Implements jet::UncertaintyComponent.

Definition at line 51 of file PerJetFlavourUncertaintyComponent.cxx.

52{
53 return new PerJetFlavourUncertaintyComponent(*this);
54}
PerJetFlavourUncertaintyComponent(const ComponentHelper &component)

◆ getAbsMass()

double jet::UncertaintyComponent::getAbsMass ( const xAOD::Jet & jet,
const CompMassDef::TypeEnum massDef ) const
protectedvirtualinherited

Definition at line 309 of file UncertaintyComponent.cxx.

310{
311 // Check for the simple case (where we want the default four-vector itself)
312 if (massDef == CompMassDef::UNKNOWN || massDef == CompMassDef::FourVecMass)
313 return jet.m();
314
315 // Not the simple case, check for the specified four-vector instead and return it if it is available
316 JetFourMomAccessor scale(CompMassDef::getJetScaleString(massDef).Data());
317 if (scale.isAvailable(jet))
318 return scale(jet).M();
319
320 // Fall-back on the TA moment as a float if applicable (legacy support)
321 SG::AuxElement::ConstAccessor<float> scaleTAMoment("JetTrackAssistedMassCalibrated");
322 if (massDef == CompMassDef::TAMass && scaleTAMoment.isAvailable(jet))
323 return scaleTAMoment(jet);
324
325 // Fall-back on the calo mass as the 4-vec if applicable (legacy support)
326 if (massDef == CompMassDef::CaloMass)
327 return jet.m();
328
329 // Specified scale is not available, error
330 ATH_MSG_ERROR("Failed to retrieve the " << CompMassDef::enumToString(massDef).Data() << " mass from the jet");
331 return JESUNC_ERROR_CODE;
332}
@ Data
Definition BaseObject.h:11
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
TString getJetScaleString(const TypeEnum type)
TString enumToString(const TypeEnum type)

◆ getFlavourResponseUncertainty()

double jet::PerJetFlavourUncertaintyComponent::getFlavourResponseUncertainty ( const xAOD::Jet & jet,
const xAOD::EventInfo & eInfo ) const
private

Definition at line 117 of file PerJetFlavourUncertaintyComponent.cxx.

118{
119 // sigma_x = l_x * dR_x(x response modelling uncertainty)
120 // sigma_x is the flavour response uncertainty for jet type x
121 // l_x is the jet flavour label, and is 0 or 1
122 // dR_x is the response modelling uncertainty for jets of type x
123 // dR_x is typically taken as the difference in x response between Pythia and Herwig
124
125 // Check the jet label (is this uncertainty relevant?)
126 if (!checkTruthLabel(jet))
127 return 0;
128
129 // This is a jet of the relevant type
130 // Now calculate and return the uncertainty
131 const double pT = jet.pt()*m_energyScale;
132 const double eta = m_absEta ? fabs(jet.eta()) : jet.eta();
133
134 FlavourComp::TypeEnum ThisJetFlavourType = FlavourComp::UNKNOWN;
135 if(m_labels.at(0)==21 || m_labels.at(0)==0) ThisJetFlavourType = FlavourComp::PerJetResponse_Gluon;
136 else if(m_labels.at(0)==1 || m_labels.at(0)==2 || m_labels.at(0)==3) ThisJetFlavourType = FlavourComp::PerJetResponse_LQ;
137 else if(m_labels.at(0)==5) ThisJetFlavourType = FlavourComp::PerJetResponse_B;
138 else if(m_labels.at(0)==4 ) ThisJetFlavourType = FlavourComp::PerJetResponse_C;
139
140 // bool DoesItPass = false;
141 if(m_flavourType == ThisJetFlavourType){
142 double unc = m_uncHist->getValue(pT,eta);
143 if (m_constrainZresponse){
144 if (m_flavourType==FlavourComp::PerJetResponse_Gluon) unc *= m_ZjetQuarkFrac->Eval(pT);
145 if (m_flavourType==FlavourComp::PerJetResponse_LQ) unc *= (m_ZjetQuarkFrac->Eval(pT)-1.0);
146 }
147 // Return the uncertainty
148 return unc;
149
150 }else{ return 0;}
151
152}
Scalar eta() const
pseudorapidity method
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49

◆ getMassOverE()

double jet::UncertaintyComponent::getMassOverE ( const xAOD::Jet & jet,
const CompMassDef::TypeEnum massDef ) const
protectedvirtualinherited

Definition at line 360 of file UncertaintyComponent.cxx.

361{
362 // Check for the simple case (where we want the default four-vector itself)
363 if (massDef == CompMassDef::UNKNOWN || massDef == CompMassDef::FourVecMass)
364 return jet.m()/jet.e();
365
366 // Not the simple case, check for the specified four-vector instead and return it if it is available
367 JetFourMomAccessor scale(CompMassDef::getJetScaleString(massDef).Data());
368 if (scale.isAvailable(jet))
369 return scale(jet).M()/scale(jet).E();
370
371 // Fall-back on the TA moment as a float if applicable (legacy support)
372 SG::AuxElement::ConstAccessor<float> scaleTAMoment("JetTrackAssistedMassCalibrated");
373 if (massDef == CompMassDef::TAMass && scaleTAMoment.isAvailable(jet))
374 return scaleTAMoment(jet)/jet.e();
375
376 // Fall-back on the calo mass as the 4-vec if applicable (legacy support)
377 if (massDef == CompMassDef::CaloMass)
378 return jet.m()/jet.e();
379
380 // Specified scale is not available, error
381 ATH_MSG_ERROR("Failed to retrieve the " << CompMassDef::enumToString(massDef).Data() << " mass from the jet");
382 return JESUNC_ERROR_CODE;
383
384}
virtual double e() const
The total energy of the particle.
Definition Jet_v1.cxx:63

◆ getMassOverPt()

double jet::UncertaintyComponent::getMassOverPt ( const xAOD::Jet & jet,
const CompMassDef::TypeEnum massDef ) const
protectedvirtualinherited

Definition at line 334 of file UncertaintyComponent.cxx.

335{
336 // Check for the simple case (where we want the default four-vector itself)
337 if (massDef == CompMassDef::UNKNOWN || massDef == CompMassDef::FourVecMass)
338 return jet.m()/jet.pt();
339
340 // Not the simple case, check for the specified four-vector instead and return it if it is available
341 JetFourMomAccessor scale(CompMassDef::getJetScaleString(massDef).Data());
342 if (scale.isAvailable(jet))
343 return scale(jet).M()/scale(jet).Pt();
344
345 // Fall-back on the TA moment as a float if applicable (legacy support)
346 SG::AuxElement::ConstAccessor<float> scaleTAMoment("JetTrackAssistedMassCalibrated");
347 if (massDef == CompMassDef::TAMass && scaleTAMoment.isAvailable(jet))
348 return scaleTAMoment(jet)/jet.pt();
349
350 // Fall-back on the calo mass as the 4-vec if applicable (legacy support)
351 if (massDef == CompMassDef::CaloMass)
352 return jet.m()/jet.pt();
353
354 // Specified scale is not available, error
355 ATH_MSG_ERROR("Failed to retrieve the " << CompMassDef::enumToString(massDef).Data() << " mass from the jet");
356 return JESUNC_ERROR_CODE;
357
358}

◆ getName()

virtual TString jet::UncertaintyComponent::getName ( ) const
inlinevirtualinherited

Definition at line 35 of file UncertaintyComponent.h.

35{ return m_uncHistName; }

◆ getRelevantLabels()

virtual std::vector< int > jet::PerJetFlavourUncertaintyComponent::getRelevantLabels ( ) const
inlinevirtual

Definition at line 26 of file PerJetFlavourUncertaintyComponent.h.

26{ return m_labels; }

◆ getScaleVar()

virtual CompScaleVar::TypeEnum jet::UncertaintyComponent::getScaleVar ( ) const
inlinevirtualinherited

Definition at line 37 of file UncertaintyComponent.h.

37{ return m_scaleVar; }
const CompScaleVar::TypeEnum m_scaleVar

◆ getSplitFactor()

double jet::UncertaintyComponent::getSplitFactor ( const xAOD::Jet & jet) const
protectedvirtualinherited

Definition at line 196 of file UncertaintyComponent.cxx.

197{
198 // Immediate return for the most common case
199 if (!m_splitNumber)
200 return 1;
201
202 // SplitNumber was specified, we have to calculate the factor
203 double splitFactor = 1;
204 const TH1* histo = m_uncHist->getHisto();
205
206 if (m_splitNumber == 1 || m_splitNumber == -1)
207 {
208 // Straight line in log(pT) from 0 to 1
209 // y = mx+b
210 // m = 1/[log(max)-log(min)]
211 // x = log(min) --> b = -m*log(min)
212
213 const double minPt = histo->GetXaxis()->GetBinLowEdge(1);
214 const double maxPt = histo->GetXaxis()->GetBinLowEdge(histo->GetNbinsX()+1);
215 const double valPt = jet.pt()*m_energyScale;
216
217 const double slope = 1./(log(maxPt)-log(minPt));
218 const double intercept = -slope*log(minPt);
219
220 splitFactor = slope*log(valPt <= minPt ? minPt+1.e-3 : valPt >= maxPt ? maxPt-1.e-3 : valPt)+intercept;
221 }
222 else if (m_splitNumber == 2 || m_splitNumber == -2)
223 {
224 // Straight line in |eta| from 0 to 1
225 // y = mx + b
226 // m = 1/(max - min)
227 // x = min --> b = -m*min
228 const double minEta = 0;
229 const double maxEta = 4.5;
230 const double absEta = fabs(jet.eta());
231
232 const double slope = 1./(maxEta - minEta);
233 const double intercept = -slope*minEta;
234
235 splitFactor = slope*(absEta <= minEta ? minEta+1.e-3 : absEta >= maxEta ? maxEta-1.e-3 : absEta)+intercept;
236 }
237 else if (m_splitNumber == 3 || m_splitNumber == -3)
238 {
239 // Increasing with log(pT) and increasing with |eta|
240 // z = mx + ny + c
241 // z(min,min) = 0
242 // z(max,max) = 1
243 // Linear in both dimensions means need factor of 1/2 in a single dimension
244 // m = 0.5/[log(maxPt)-log(minPt)]
245 // n = 0.5/(maxEta - minEta)
246 // c = -minPt*m - minEta*n
247 // 2*z = (logx-logxmin)/(logxmax-logxmin) + (y-ymin)/(ymax-ymin)
248 const double minPt = histo->GetXaxis()->GetBinLowEdge(1);
249 const double maxPt = histo->GetXaxis()->GetBinLowEdge(histo->GetNbinsX()+1);
250 const double valPt = jet.pt()*m_energyScale;
251
252 const double minEta = 0;
253 const double maxEta = 4.5;
254 const double absEta = fabs(jet.eta());
255
256 const double slopePt = 1./(log(maxPt)-log(minPt));
257 const double slopeEta = 1./(maxEta-minEta);
258
259 const double fixedPt = valPt <= minPt ? minPt+1.e-3 : valPt >= maxPt ? maxPt - 1.e-3 : valPt;
260 const double fixedEta = absEta <= minEta ? minEta+1.e-3 : absEta >= maxEta ? maxEta-1.e-3 : absEta;
261
262 splitFactor = (slopePt*(log(fixedPt)-log(minPt)) + slopeEta*(fixedEta-minEta))/2.;
263 }
264 else if (m_splitNumber == 4 || m_splitNumber == -4)
265 {
266 // Increasing with log(pT) and decreasing with |eta|
267 // See description above, follows similarly
268 // 2*z = (logx-logxmin)/(logxmax-logxmin) + (ymax-y)/(ymax-ymin)
269 const double minPt = histo->GetXaxis()->GetBinLowEdge(1);
270 const double maxPt = histo->GetXaxis()->GetBinLowEdge(histo->GetNbinsX()+1);
271 const double valPt = jet.pt()*m_energyScale;
272
273 const double minEta = 0;
274 const double maxEta = 4.5;
275 const double absEta = fabs(jet.eta());
276
277 const double slopePt = 1./(log(maxPt)-log(minPt));
278 const double slopeEta = 1./(maxEta-minEta);
279
280 const double fixedPt = valPt <= minPt ? minPt+1.e-3 : valPt >= maxPt ? maxPt - 1.e-3 : valPt;
281 const double fixedEta = absEta <= minEta ? minEta+1.e-3 : absEta >= maxEta ? maxEta-1.e-3 : absEta;
282
283 splitFactor = (slopePt*(log(fixedPt)-log(minPt)) + slopeEta*(maxEta-fixedEta))/2.;
284 }
285
286
287 // Now check if this is the functional part or the complementary part
288 if (m_splitNumber < 0)
289 splitFactor = sqrt(1-splitFactor*splitFactor);
290
291 return splitFactor;
292}
UncertaintyHistogram * m_uncHist
constexpr float maxEta
bool absEta(const xAOD::TauJet &tau, float &out)

◆ getTopology()

virtual JetTopology::TypeEnum jet::UncertaintyComponent::getTopology ( ) const
inlinevirtualinherited

Definition at line 38 of file UncertaintyComponent.h.

38{ return m_topology; }
const JetTopology::TypeEnum m_topology

◆ getUncertainty()

double jet::UncertaintyComponent::getUncertainty ( const xAOD::Jet & jet,
const xAOD::EventInfo & eInfo ) const
virtualinherited

Definition at line 169 of file UncertaintyComponent.cxx.

170{
171 if (!m_isInit)
172 {
173 ATH_MSG_ERROR("Component hasn't been initialized: " << getName().Data());
174 return JESUNC_ERROR_CODE;
175 }
176 return getUncertaintyImpl(jet,eInfo)*getSplitFactor(jet);
177}
virtual TString getName() const
virtual double getUncertaintyImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const =0
virtual double getSplitFactor(const xAOD::Jet &jet) const

◆ getUncertaintyImpl()

double jet::PerJetFlavourUncertaintyComponent::getUncertaintyImpl ( const xAOD::Jet & jet,
const xAOD::EventInfo & eInfo ) const
protectedvirtual

Implements jet::UncertaintyComponent.

Definition at line 112 of file PerJetFlavourUncertaintyComponent.cxx.

113{
114 return getFlavourResponseUncertainty(jet,eInfo);
115}
double getFlavourResponseUncertainty(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const

◆ getValidBool()

bool jet::UncertaintyComponent::getValidBool ( const double validity) const
protectedvirtualinherited

Definition at line 301 of file UncertaintyComponent.cxx.

302{
303 if (validity < 1.e-5 && validity > -1.e-5) return false;
304 if (validity < 1+1.e-5 && validity > 1-1.e-5) return true;
305 ATH_MSG_ERROR(Form("Validity value not in expected range: %lf for histogram %s",validity,getValidName().Data()));
306 return false;
307}
virtual TString getValidName() const

◆ getValidity()

bool jet::UncertaintyComponent::getValidity ( const xAOD::Jet & jet,
const xAOD::EventInfo & eInfo ) const
virtualinherited

Definition at line 159 of file UncertaintyComponent.cxx.

160{
161 if (!m_isInit)
162 {
163 ATH_MSG_ERROR("Component hasn't been initialized: " << getName().Data());
164 return false;
165 }
166 return getValidityImpl(jet,eInfo);
167}
virtual bool getValidityImpl(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const =0

◆ getValidityImpl()

bool jet::PerJetFlavourUncertaintyComponent::getValidityImpl ( const xAOD::Jet & jet,
const xAOD::EventInfo & eInfo ) const
protectedvirtual

Implements jet::UncertaintyComponent.

Definition at line 107 of file PerJetFlavourUncertaintyComponent.cxx.

108{
109 return !m_validHist ? true : getValidBool(m_validHist->getValue(jet.pt()*m_energyScale,m_absEta ? fabs(jet.eta()) : jet.eta()));
110}
virtual bool getValidBool(const double validity) const
UncertaintyHistogram * m_validHist

◆ getValidName()

virtual TString jet::UncertaintyComponent::getValidName ( ) const
inlinevirtualinherited

Definition at line 36 of file UncertaintyComponent.h.

36{ return m_validHistName; }

◆ getValidUncertainty()

bool jet::UncertaintyComponent::getValidUncertainty ( double & unc,
const xAOD::Jet & jet,
const xAOD::EventInfo & eInfo ) const
virtualinherited

Definition at line 179 of file UncertaintyComponent.cxx.

180{
181 if (getValidity(jet,eInfo))
182 {
183 unc = getUncertainty(jet,eInfo);
184 return true;
185 }
186 return false;
187}
virtual double getUncertainty(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const
virtual bool getValidity(const xAOD::Jet &jet, const xAOD::EventInfo &eInfo) const

◆ initialize()

StatusCode jet::PerJetFlavourUncertaintyComponent::initialize ( TFile * histFile)
virtual

Reimplemented from jet::UncertaintyComponent.

Definition at line 56 of file PerJetFlavourUncertaintyComponent.cxx.

57{
58 // Call the base class first
59 if (UncertaintyComponent::initialize(histFile).isFailure())
60 return StatusCode::FAILURE;
61
62 // Ensure that the labels are sane
63 if (m_labels.empty())
64 {
65 ATH_MSG_ERROR("Specified a PerJetFlavourUncertaintyComponent without the associated labels to use: " << getName().Data());
66 return StatusCode::FAILURE;
67 }
68 for (int aLabel : m_labels)
69 {
70 if (!isSupportedLabel(aLabel))
71 {
72 ATH_MSG_ERROR("Unsupported label ID of " << aLabel << " in " << getName().Data());
73 return StatusCode::FAILURE;
74 }
75 }
76
77 // Load TF1 for Z-jet gluon fraction
79 {
80 // Find the histogram by name
81 TObject* tmp_tf1 = histFile->Get(m_constrainZresponseFunc);
82 if (!tmp_tf1)
83 {
84 ATH_MSG_ERROR(Form("Histogram file does not contain a histogram named %s",m_constrainZresponseFunc.Data()));
85 return StatusCode::FAILURE;
86 }
87 // Ensure the object is a TF1
88 m_ZjetQuarkFrac = dynamic_cast<const TF1*>(tmp_tf1);
89 if (!m_ZjetQuarkFrac)
90 {
91 ATH_MSG_ERROR(Form("Histogram file contains the expected key, but it's not a TF1* (%s)",m_constrainZresponseFunc.Data()));
92 return StatusCode::FAILURE;
93 }
94 }
95
96 // Done checking the configuration
97 return StatusCode::SUCCESS;
98}
virtual StatusCode initialize(TFile *histFile)

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ isAlwaysZero()

bool jet::UncertaintyComponent::isAlwaysZero ( ) const
virtualinherited

Reimplemented in jet::CombinedMassUncertaintyComponent.

Definition at line 140 of file UncertaintyComponent.cxx.

141{
142 if (!m_isInit)
143 {
144 ATH_MSG_ERROR("Cannot call method before initialization, component: " << getName().Data());
145 return false;
146 }
147
148 const TH1* histo = m_uncHist->getHisto();
149 return !(fabs(histo->GetMinimum()) > 1.e-8 || fabs(histo->GetMaximum()) > 1.e-8);
150}

◆ isSupportedLabel()

bool jet::PerJetFlavourUncertaintyComponent::isSupportedLabel ( const int label) const
private

Definition at line 156 of file PerJetFlavourUncertaintyComponent.cxx.

157{
158 switch (abs(label))
159 {
160 case 1: // parton-label, up
161 case 2: // parton-label, down
162 case 3: // parton-label, strange
163 case 4: // parton-label, charm
164 case 5: // parton-label, bottom
165 case 21: // parton-label, gluon
166 case 0: // parton-label, PileUp/non-identified
167 return true;
168 default:
169 return false;
170 }
171}

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 49 of file AsgMessaging.cxx.

49 {
50#ifndef XAOD_STANDALONE
51 return ::AthMessaging::msg();
52#else // not XAOD_STANDALONE
53 return m_msg;
54#endif // not XAOD_STANDALONE
55 }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 57 of file AsgMessaging.cxx.

57 {
58#ifndef XAOD_STANDALONE
59 return ::AthMessaging::msg( lvl );
60#else // not XAOD_STANDALONE
61 m_msg << lvl;
62 return m_msg;
63#endif // not XAOD_STANDALONE
64 }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 41 of file AsgMessaging.cxx.

41 {
42#ifndef XAOD_STANDALONE
43 return ::AthMessaging::msgLvl( lvl );
44#else // not XAOD_STANDALONE
45 return m_msg.msgLevel( lvl );
46#endif // not XAOD_STANDALONE
47 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_absEta

const bool jet::PerJetFlavourUncertaintyComponent::m_absEta {}
private

Definition at line 39 of file PerJetFlavourUncertaintyComponent.h.

39{};

◆ m_constrainZresponse

const bool jet::PerJetFlavourUncertaintyComponent::m_constrainZresponse {}
private

Definition at line 42 of file PerJetFlavourUncertaintyComponent.h.

42{};

◆ m_constrainZresponseFunc

const TString jet::PerJetFlavourUncertaintyComponent::m_constrainZresponseFunc {}
private

Definition at line 43 of file PerJetFlavourUncertaintyComponent.h.

43{};

◆ m_energyScale

const float jet::UncertaintyComponent::m_energyScale {}
protectedinherited

Definition at line 55 of file UncertaintyComponent.h.

55{};

◆ m_flavourType

const FlavourComp::TypeEnum jet::PerJetFlavourUncertaintyComponent::m_flavourType {}
private

Definition at line 41 of file PerJetFlavourUncertaintyComponent.h.

41{};

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_interpolate

const Interpolate::TypeEnum jet::UncertaintyComponent::m_interpolate
protectedinherited

Definition at line 56 of file UncertaintyComponent.h.

◆ m_isInit

bool jet::UncertaintyComponent::m_isInit {}
protectedinherited

Definition at line 50 of file UncertaintyComponent.h.

50{};

◆ m_labels

const std::vector<int> jet::PerJetFlavourUncertaintyComponent::m_labels
private

Definition at line 40 of file PerJetFlavourUncertaintyComponent.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_numExpectedHist

int jet::UncertaintyComponent::m_numExpectedHist {}
protectedinherited

Definition at line 59 of file UncertaintyComponent.h.

59{};

◆ m_scaleVar

const CompScaleVar::TypeEnum jet::UncertaintyComponent::m_scaleVar
protectedinherited

Definition at line 53 of file UncertaintyComponent.h.

◆ m_splitNumber

const int jet::UncertaintyComponent::m_splitNumber {}
protectedinherited

Definition at line 57 of file UncertaintyComponent.h.

57{};

◆ m_topology

const JetTopology::TypeEnum jet::UncertaintyComponent::m_topology
protectedinherited

Definition at line 54 of file UncertaintyComponent.h.

◆ m_uncHist

UncertaintyHistogram* jet::UncertaintyComponent::m_uncHist {}
protectedinherited

Definition at line 60 of file UncertaintyComponent.h.

60{};

◆ m_uncHistName

const TString jet::UncertaintyComponent::m_uncHistName
protectedinherited

Definition at line 51 of file UncertaintyComponent.h.

◆ m_validHist

UncertaintyHistogram* jet::UncertaintyComponent::m_validHist {}
protectedinherited

Definition at line 61 of file UncertaintyComponent.h.

61{};

◆ m_validHistName

const TString jet::UncertaintyComponent::m_validHistName
protectedinherited

Definition at line 52 of file UncertaintyComponent.h.

◆ m_ZjetQuarkFrac

const TF1* jet::PerJetFlavourUncertaintyComponent::m_ZjetQuarkFrac {}
private

Definition at line 44 of file PerJetFlavourUncertaintyComponent.h.

44{};

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