ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
jet::ResolutionHelper Class Reference

#include <ResolutionHelper.h>

Inheritance diagram for jet::ResolutionHelper:
Collaboration diagram for jet::ResolutionHelper:

Public Member Functions

 ResolutionHelper (const std::string &name, const std::string &jetDef)
 
 ResolutionHelper (const ResolutionHelper &toCopy)
 
virtual StatusCode initialize (TEnv &settings, TFile *histFile, const TString &MCtype)
 
virtual ~ResolutionHelper ()
 
std::tuple< const UncertaintyHistogram *, CompParametrization::TypeEnum, CompMassDef::TypeEnumgetNominalResolution (const CompScaleVar::TypeEnum smearType, const JetTopology::TypeEnum topology, const bool readMC) const
 
bool smearOnlyMC () const
 
bool smearDataAndMC () const
 
bool hasRelevantInfo (const CompScaleVar::TypeEnum type, const JetTopology::TypeEnum topology) const
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

StatusCode parseInput (TEnv &settings, TFile *histFile, const TString &key, const TString &defaultValue, UncertaintyHistogram *&hist, CompParametrization::TypeEnum &param, CompMassDef::TypeEnum &massDef, const TString &MCtype)
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_name
 
std::string m_jetDef
 
bool m_isInit
 
bool m_smearOnlyMC
 
UncertaintyHistogramm_ptNomHistData
 
CompParametrization::TypeEnum m_ptNomParamData
 
CompMassDef::TypeEnum m_ptNomMassDefData
 
UncertaintyHistogramm_ptNomHistMC
 
CompParametrization::TypeEnum m_ptNomParamMC
 
CompMassDef::TypeEnum m_ptNomMassDefMC
 
UncertaintyHistogramm_fvNomHistData
 
CompParametrization::TypeEnum m_fvNomParamData
 
CompMassDef::TypeEnum m_fvNomMassDefData
 
UncertaintyHistogramm_fvNomHistMC
 
CompParametrization::TypeEnum m_fvNomParamMC
 
CompMassDef::TypeEnum m_fvNomMassDefMC
 
UncertaintyHistogramm_mQCDNomHistData
 
CompParametrization::TypeEnum m_mQCDNomParamData
 
CompMassDef::TypeEnum m_mQCDNomMassDefData
 
UncertaintyHistogramm_mQCDNomHistMC
 
CompParametrization::TypeEnum m_mQCDNomParamMC
 
CompMassDef::TypeEnum m_mQCDNomMassDefMC
 
UncertaintyHistogramm_mWZNomHistData
 
CompParametrization::TypeEnum m_mWZNomParamData
 
CompMassDef::TypeEnum m_mWZNomMassDefData
 
UncertaintyHistogramm_mWZNomHistMC
 
CompParametrization::TypeEnum m_mWZNomParamMC
 
CompMassDef::TypeEnum m_mWZNomMassDefMC
 
UncertaintyHistogramm_mHbbNomHistData
 
CompParametrization::TypeEnum m_mHbbNomParamData
 
CompMassDef::TypeEnum m_mHbbNomMassDefData
 
UncertaintyHistogramm_mHbbNomHistMC
 
CompParametrization::TypeEnum m_mHbbNomParamMC
 
CompMassDef::TypeEnum m_mHbbNomMassDefMC
 
UncertaintyHistogramm_mTopNomHistData
 
CompParametrization::TypeEnum m_mTopNomParamData
 
CompMassDef::TypeEnum m_mTopNomMassDefData
 
UncertaintyHistogramm_mTopNomHistMC
 
CompParametrization::TypeEnum m_mTopNomParamMC
 
CompMassDef::TypeEnum m_mTopNomMassDefMC
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 21 of file Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h.

Constructor & Destructor Documentation

◆ ResolutionHelper() [1/2]

jet::ResolutionHelper::ResolutionHelper ( const std::string &  name,
const std::string &  jetDef 
)

Definition at line 17 of file Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx.

19  , m_name(name)
20  , m_jetDef(jetDef)
21  , m_isInit(false)
22  , m_smearOnlyMC(false)
23  , m_ptNomHistData(nullptr)
26  , m_ptNomHistMC(nullptr)
29  , m_fvNomHistData(nullptr)
32  , m_fvNomHistMC(nullptr)
35  , m_mQCDNomHistData(nullptr)
38  , m_mQCDNomHistMC(nullptr)
41  , m_mWZNomHistData(nullptr)
44  , m_mWZNomHistMC(nullptr)
47  , m_mHbbNomHistData(nullptr)
50  , m_mHbbNomHistMC(nullptr)
53  , m_mTopNomHistData(nullptr)
56  , m_mTopNomHistMC(nullptr)
59 { }

◆ ResolutionHelper() [2/2]

jet::ResolutionHelper::ResolutionHelper ( const ResolutionHelper toCopy)

Definition at line 61 of file Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx.

62  : asg::AsgMessaging(toCopy.m_name)
63  , m_name(toCopy.m_name)
64  , m_jetDef(toCopy.m_jetDef)
65  , m_isInit(toCopy.m_isInit)
66  , m_smearOnlyMC(toCopy.m_smearOnlyMC)
67  , m_ptNomHistData(!toCopy.m_ptNomHistData ? nullptr : new UncertaintyHistogram(*toCopy.m_ptNomHistData))
68  , m_ptNomParamData(toCopy.m_ptNomParamData)
69  , m_ptNomMassDefData(toCopy.m_ptNomMassDefData)
70  , m_ptNomHistMC(!toCopy.m_ptNomHistMC ? nullptr : new UncertaintyHistogram(*toCopy.m_ptNomHistMC))
71  , m_ptNomParamMC(toCopy.m_ptNomParamMC)
72  , m_ptNomMassDefMC(toCopy.m_ptNomMassDefMC)
73  , m_fvNomHistData(!toCopy.m_fvNomHistData ? nullptr : new UncertaintyHistogram(*toCopy.m_fvNomHistData))
74  , m_fvNomParamData(toCopy.m_fvNomParamData)
75  , m_fvNomMassDefData(toCopy.m_fvNomMassDefData)
76  , m_fvNomHistMC(!toCopy.m_fvNomHistMC ? nullptr : new UncertaintyHistogram(*toCopy.m_fvNomHistMC))
77  , m_fvNomParamMC(toCopy.m_fvNomParamMC)
78  , m_fvNomMassDefMC(toCopy.m_fvNomMassDefMC)
79  , m_mQCDNomHistData(!toCopy.m_mQCDNomHistData ? nullptr : new UncertaintyHistogram(*toCopy.m_mQCDNomHistData))
80  , m_mQCDNomParamData(toCopy.m_mQCDNomParamData)
81  , m_mQCDNomMassDefData(toCopy.m_mQCDNomMassDefData)
82  , m_mQCDNomHistMC(!toCopy.m_mQCDNomHistMC ? nullptr : new UncertaintyHistogram(*toCopy.m_mQCDNomHistMC))
83  , m_mQCDNomParamMC(toCopy.m_mQCDNomParamMC)
84  , m_mQCDNomMassDefMC(toCopy.m_mQCDNomMassDefMC)
85  , m_mWZNomHistData(!toCopy.m_mWZNomHistData ? nullptr : new UncertaintyHistogram(*toCopy.m_mWZNomHistData))
86  , m_mWZNomParamData(toCopy.m_mWZNomParamData)
87  , m_mWZNomMassDefData(toCopy.m_mWZNomMassDefData)
88  , m_mWZNomHistMC(!toCopy.m_mWZNomHistMC ? nullptr : new UncertaintyHistogram(*toCopy.m_mWZNomHistMC))
89  , m_mWZNomParamMC(toCopy.m_mWZNomParamMC)
90  , m_mWZNomMassDefMC(toCopy.m_mWZNomMassDefMC)
91  , m_mHbbNomHistData(!toCopy.m_mHbbNomHistData ? nullptr : new UncertaintyHistogram(*toCopy.m_mHbbNomHistData))
92  , m_mHbbNomParamData(toCopy.m_mHbbNomParamData)
93  , m_mHbbNomMassDefData(toCopy.m_mHbbNomMassDefData)
94  , m_mHbbNomHistMC(!toCopy.m_mHbbNomHistMC ? nullptr : new UncertaintyHistogram(*toCopy.m_mHbbNomHistMC))
95  , m_mHbbNomParamMC(toCopy.m_mHbbNomParamMC)
96  , m_mHbbNomMassDefMC(toCopy.m_mHbbNomMassDefMC)
97  , m_mTopNomHistData(!toCopy.m_mTopNomHistData ? nullptr : new UncertaintyHistogram(*toCopy.m_mTopNomHistData))
98  , m_mTopNomParamData(toCopy.m_mTopNomParamData)
99  , m_mTopNomMassDefData(toCopy.m_mTopNomMassDefData)
100  , m_mTopNomHistMC(!toCopy.m_mTopNomHistMC ? nullptr : new UncertaintyHistogram(*toCopy.m_mTopNomHistMC))
101  , m_mTopNomParamMC(toCopy.m_mTopNomParamMC)
102  , m_mTopNomMassDefMC(toCopy.m_mTopNomMassDefMC)
103 { }

◆ ~ResolutionHelper()

jet::ResolutionHelper::~ResolutionHelper ( )
virtual

Member Function Documentation

◆ getNominalResolution()

std::tuple< const UncertaintyHistogram *, CompParametrization::TypeEnum, CompMassDef::TypeEnum > jet::ResolutionHelper::getNominalResolution ( const CompScaleVar::TypeEnum  smearType,
const JetTopology::TypeEnum  topology,
const bool  readMC 
) const

Definition at line 354 of file Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx.

355 {
356  // First get the resolution histogram and parametrization
357  const jet::UncertaintyHistogram* resolution = nullptr;
360 
361  if (!m_isInit)
362  {
363  ATH_MSG_ERROR("Asking for the nominal resolution before initialization");
364  return std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum>(NULL,CompParametrization::UNKNOWN,CompMassDef::UNKNOWN);
365  }
366 
367 
368  switch (smearType)
369  {
372  switch (topology)
373  {
374  case JetTopology::QCD:
375  if (readMC)
376  {
378  param = m_mQCDNomParamMC;
379  massDef = m_mQCDNomMassDefMC;
380  }
381  else
382  {
384  param = m_mQCDNomParamData;
385  massDef = m_mQCDNomMassDefData;
386  }
387  break;
388 
389  case JetTopology::WZ:
390  if (readMC)
391  {
393  param = m_mWZNomParamMC;
394  massDef = m_mWZNomMassDefMC;
395  }
396  else
397  {
399  param = m_mWZNomParamData;
400  massDef = m_mWZNomMassDefData;
401  }
402  break;
403 
404  case JetTopology::Hbb:
405  if (readMC)
406  {
408  param = m_mHbbNomParamMC;
409  massDef = m_mHbbNomMassDefMC;
410  }
411  else
412  {
414  param = m_mHbbNomParamData;
415  massDef = m_mHbbNomMassDefData;
416  }
417  break;
418 
419  case JetTopology::Top:
420  if (readMC)
421  {
423  param = m_mTopNomParamMC;
424  massDef = m_mTopNomMassDefMC;
425  }
426  else
427  {
429  param = m_mTopNomParamData;
430  massDef = m_mTopNomMassDefData;
431  }
432  break;
433 
434  case JetTopology::MIXED:
435  // We shouldn't read this, as it was checked at a higher level
436  // Just to be safe, check it and return error code
437  ATH_MSG_ERROR("Mass resolution depends on a single jet topology, not a mixed topology");
438  return std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum>(NULL,CompParametrization::UNKNOWN,CompMassDef::UNKNOWN);
439 
440  default:
441  // We shouldn't read this, as it was checked at a higher level
442  // Just to be safe, check it and return error code
443  ATH_MSG_ERROR("Mass resolution depends on the jet topology, which was not specified");
444  return std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum>(NULL,CompParametrization::UNKNOWN,CompMassDef::UNKNOWN);
445  }
446  break;
447 
448  case CompScaleVar::PtRes:
450  if (readMC)
451  {
453  param = m_ptNomParamMC;
454  massDef = m_ptNomMassDefMC;
455  }
456  else
457  {
459  param = m_ptNomParamData;
460  massDef = m_ptNomMassDefData;
461  }
462  break;
463 
466  if (readMC)
467  {
469  param = m_fvNomParamMC;
470  massDef = m_fvNomMassDefMC;
471  }
472  else
473  {
475  param = m_fvNomParamData;
476  massDef = m_fvNomMassDefData;
477  }
478  break;
479 
480  default:
481  // This is not a resolution uncertainty component
482  // We should not get here
483  // Print an erorr and return error code
484  ATH_MSG_ERROR("Asked for the smearing factor for a non-resolution component");
485  return std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum>(NULL,CompParametrization::UNKNOWN,CompMassDef::UNKNOWN);
486  }
487  return std::tuple<const UncertaintyHistogram*,CompParametrization::TypeEnum,CompMassDef::TypeEnum>(resolution,param,massDef);
488 }

◆ hasRelevantInfo()

bool jet::ResolutionHelper::hasRelevantInfo ( const CompScaleVar::TypeEnum  type,
const JetTopology::TypeEnum  topology 
) const

Definition at line 490 of file Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx.

491 {
492  if (!m_isInit)
493  {
494  throw std::runtime_error("Asking for nominal resolution information before initialization");
495  return false;
496  }
497 
498  // Check that the nominal MC histograms for the specified type exist
499  // We have already checked that the parametrizations exist for each histogram
500  // We have already checked that the data histograms exist for each MC if relevant
501  switch (type)
502  {
503  case CompScaleVar::PtRes:
505  return m_ptNomHistMC != nullptr;
506 
509  return m_fvNomHistMC != nullptr;
510 
513  switch (topology)
514  {
515  case JetTopology::QCD:
516  return m_mQCDNomHistMC != nullptr;
517 
518  case JetTopology::WZ:
519  return m_mWZNomHistMC != nullptr;
520 
521  case JetTopology::Hbb:
522  return m_mHbbNomHistMC != nullptr;
523 
524  case JetTopology::Top:
525  return m_mTopNomHistMC != nullptr;
526 
527  default:
528  throw std::runtime_error(Form("Unexpected topology type, cannot determine if relevant info exists: %s",JetTopology::enumToString(topology).Data()));
529  return false;
530  }
531 
532  default:
533  throw std::runtime_error(Form("Unexpected variable type, cannot determine if relevant info exists: %s",CompScaleVar::enumToString(type).Data()));
534  return false;
535  }
536 }

◆ initialize()

StatusCode jet::ResolutionHelper::initialize ( TEnv &  settings,
TFile *  histFile,
const TString &  MCtype 
)
virtual

Definition at line 199 of file Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx.

200 {
201  if (m_isInit)
202  {
203  ATH_MSG_ERROR("Blocking double-initialization: " << m_name);
204  return StatusCode::FAILURE;
205  }
206 
207  // Read nominal resolution information from the configuration file
208  // In many cases (especially configs before summer 2018), there are no inputs to find
209  // As such, it is perfectly normal behaviour to read zero inputs from the file
210  // However, there are some expectations
211  // There should be no cases of data resolution without MC resolution
212  // There can be cases of MC resolution without data resolution
213  // Histograms and their parametrizations must be paired (potentially also with mass)
214 
215  // Expected format:
216  // KeyString: HistName,Parametrization
217  // KeyString: HistName,Parametrization,MassDef
218  // Example:
219  // NominalPtResData: PtResData,PtAbsEta
220  // Histogram name is PtResData_JETDEF
221  // Parametrization is pT vs |eta|
222  // NominalMassResMC: MassResMC,PtMass,Calo
223  // Histogram name is MassResMC_JETDEF
224  // Parametrization is pT vs m/pt
225  // Mass definition is calorimeter (not track-assisted or combined)
226 
227 
228  // Start with nominal pT resolution
229  if (parseInput(settings,histFile,"NominalPtResData","",m_ptNomHistData,m_ptNomParamData,m_ptNomMassDefData,MCtype).isFailure())
230  return StatusCode::FAILURE;
231  if (parseInput(settings,histFile,"NominalPtResMC","",m_ptNomHistMC,m_ptNomParamMC,m_ptNomMassDefMC,MCtype).isFailure())
232  return StatusCode::FAILURE;
234  {
235  ATH_MSG_ERROR("There should never be a nominal data resolution without a nominal MC resolution (pT)");
236  return StatusCode::FAILURE;
237  }
238 
239  // Now the nominal four-vector resolution
240  if (parseInput(settings,histFile,"NominalFourVecResData","",m_fvNomHistData,m_fvNomParamData,m_fvNomMassDefData,MCtype).isFailure())
241  return StatusCode::FAILURE;
242  if (parseInput(settings,histFile,"NominalFourVecResMC","",m_fvNomHistMC,m_fvNomParamMC,m_fvNomMassDefMC,MCtype).isFailure())
243  return StatusCode::FAILURE;
245  {
246  ATH_MSG_ERROR("There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
247  return StatusCode::FAILURE;
248  }
249 
250  // Now the nominal mass resolution (topology-dependent)
251  // For simplicity, this is done with separate histograms for each one
252  // Lots of code duplication, but time is of the essence, and it works
253 
254  // QCD topology
255  if (parseInput(settings,histFile,"NominalMassResDataQCD","",m_mQCDNomHistData,m_mQCDNomParamData,m_mQCDNomMassDefData,MCtype).isFailure())
256  return StatusCode::FAILURE;
257  if (parseInput(settings,histFile,"NominalMassResMCQCD","",m_mQCDNomHistMC,m_mQCDNomParamMC,m_mQCDNomMassDefMC,MCtype).isFailure())
258  return StatusCode::FAILURE;
260  {
261  ATH_MSG_ERROR("There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
262  return StatusCode::FAILURE;
263  }
264 
265  // WZ topology
266  if (parseInput(settings,histFile,"NominalMassResDataWZ","",m_mWZNomHistData,m_mWZNomParamData,m_mWZNomMassDefData,MCtype).isFailure())
267  return StatusCode::FAILURE;
268  if (parseInput(settings,histFile,"NominalMassResMCWZ","",m_mWZNomHistMC,m_mWZNomParamMC,m_mWZNomMassDefMC,MCtype).isFailure())
269  return StatusCode::FAILURE;
271  {
272  ATH_MSG_ERROR("There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
273  return StatusCode::FAILURE;
274  }
275 
276  // Hbb topology
277  if (parseInput(settings,histFile,"NominalMassResDataHbb","",m_mHbbNomHistData,m_mHbbNomParamData,m_mHbbNomMassDefData,MCtype).isFailure())
278  return StatusCode::FAILURE;
279  if (parseInput(settings,histFile,"NominalMassResMCHbb","",m_mHbbNomHistMC,m_mHbbNomParamMC,m_mHbbNomMassDefMC,MCtype).isFailure())
280  return StatusCode::FAILURE;
282  {
283  ATH_MSG_ERROR("There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
284  return StatusCode::FAILURE;
285  }
286 
287  // Top topology
288  if (parseInput(settings,histFile,"NominalMassResDataTop","",m_mTopNomHistData,m_mTopNomParamData,m_mTopNomMassDefData,MCtype).isFailure())
289  return StatusCode::FAILURE;
290  if (parseInput(settings,histFile,"NominalMassResMCTop","",m_mTopNomHistMC,m_mTopNomParamMC,m_mTopNomMassDefMC,MCtype).isFailure())
291  return StatusCode::FAILURE;
293  {
294  ATH_MSG_ERROR("There should never be a nominal data resolution without a nominal MC resolution (four-vector)");
295  return StatusCode::FAILURE;
296  }
297 
298  // Check if the user has specified if this is full correlations or MC-only
299  TString smearType = settings.GetValue("ResolutionSmearOnlyMC","");
300  if (smearType != "")
301  {
302  if (!smearType.CompareTo("true",TString::kIgnoreCase))
303  m_smearOnlyMC = true;
304  else if (!smearType.CompareTo("false",TString::kIgnoreCase))
305  m_smearOnlyMC = false;
306  else
307  {
308  ATH_MSG_ERROR("The value of ResolutionSmearOnlyMC doesn't look like the expected boolean: " << smearType.Data());
309  return StatusCode::FAILURE;
310  }
311  ATH_MSG_INFO(Form(" ResolutionSmearOnlyMC: \"%s\"",m_smearOnlyMC ? "true" : "false"));
312  }
313 
314  // If we are also smearing data, we need the data histograms for any MC histogram
315  if (!m_smearOnlyMC)
316  {
318  {
319  ATH_MSG_ERROR("Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for pT");
320  return StatusCode::FAILURE;
321  }
323  {
324  ATH_MSG_ERROR("Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for fourvec");
325  return StatusCode::FAILURE;
326  }
328  {
329  ATH_MSG_ERROR("Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mQCD");
330  return StatusCode::FAILURE;
331  }
333  {
334  ATH_MSG_ERROR("Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mWZ");
335  return StatusCode::FAILURE;
336  }
338  {
339  ATH_MSG_ERROR("Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mHbb");
340  return StatusCode::FAILURE;
341  }
343  {
344  ATH_MSG_ERROR("Requested full smearing correlations (both data and MC), but only provided the MC nominal histogram for mTop");
345  return StatusCode::FAILURE;
346  }
347  }
348 
349 
350  m_isInit = true;
351  return StatusCode::SUCCESS;
352 }

◆ 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  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ 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
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
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  }

◆ parseInput()

StatusCode jet::ResolutionHelper::parseInput ( TEnv &  settings,
TFile *  histFile,
const TString &  key,
const TString &  defaultValue,
UncertaintyHistogram *&  hist,
CompParametrization::TypeEnum param,
CompMassDef::TypeEnum massDef,
const TString &  MCtype 
)
private

Definition at line 121 of file Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx.

122 {
123  // Get the string
124  TString value = settings.GetValue(key,defaultValue);
125 
126  // Check the trivial case
127  if (value == "")
128  return StatusCode::SUCCESS;
129 
130  // Ensure it matches the expected format
131  if (!value.Contains(","))
132  {
133  ATH_MSG_ERROR("Key of " << key.Data() << " has an unexpected value format (missing comma): " << value.Data());
134  return StatusCode::FAILURE;
135  }
136 
137  // Split the string
138  std::vector<TString> splitValue = utils::vectorize<TString>(value,", ");
139  if (splitValue.size() < 3)
140  {
141  ATH_MSG_ERROR("Key of " << key.Data() << " has unexpected value format (less than 3 strings): " << value.Data());
142  return StatusCode::FAILURE;
143  }
144  else if (splitValue.size() > 4)
145  {
146  ATH_MSG_ERROR("Key of " << key.Data() << " has unexpected value format (more than 4 strings): " << value.Data());
147  return StatusCode::FAILURE;
148  }
149 
150  // Ensure that the parametrization is valid
151  param = CompParametrization::stringToEnum(splitValue.at(1));
152  if (param == CompParametrization::UNKNOWN)
153  {
154  ATH_MSG_ERROR("Key of " << key.Data() << " has unexpected parametrization value: " << splitValue.at(1));
155  return StatusCode::FAILURE;
156  }
157 
158  // Ensure that the interpolation type is valid
159  Interpolate::TypeEnum interp = Interpolate::stringToEnum(splitValue.at(2));
160  if (interp == Interpolate::UNKNOWN)
161  {
162  ATH_MSG_ERROR("Key of " << key.Data() << " has unexpected interpolation type: " << splitValue.at(2));
163  return StatusCode::FAILURE;
164  }
165 
166  // If this is a mass parametrization, ensure that a mass definition was specified
168  {
169  if (splitValue.size() != 4)
170  {
171  ATH_MSG_ERROR("Key of " << key.Data() << " has unexpected value format (missing mass definition): " << value.Data());
172  return StatusCode::FAILURE;
173  }
174  massDef = CompMassDef::stringToEnum(splitValue.at(3));
175  if (massDef == CompMassDef::UNKNOWN)
176  {
177  ATH_MSG_ERROR("Key of " << key.Data() << " has unexpected mass definition: " << splitValue.at(3));
178  return StatusCode::FAILURE;
179  }
180  }
181 
182  // Replace generic MCTYPE string with the user-specified type if applicable
183  TString histName = splitValue.at(0);
184  histName.ReplaceAll("MCTYPE",MCtype);
185 
186  // Create the histogram
187  hist = new UncertaintyHistogram(histName+"_"+m_jetDef.c_str(),interp);
188 
189  // Initialize the histogram
190  if (hist->initialize(histFile).isFailure())
191  return StatusCode::FAILURE;
192 
193  // Print out that we successfully read the input
194  ATH_MSG_INFO(Form(" %s: \"%s\"",key.Data(),value.Data()));
195 
196  return StatusCode::SUCCESS;
197 }

◆ 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 }

◆ smearDataAndMC()

bool jet::ResolutionHelper::smearDataAndMC ( ) const
inline

◆ smearOnlyMC()

bool jet::ResolutionHelper::smearOnlyMC ( ) const
inline

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_fvNomHistData

UncertaintyHistogram* jet::ResolutionHelper::m_fvNomHistData
private

◆ m_fvNomHistMC

UncertaintyHistogram* jet::ResolutionHelper::m_fvNomHistMC
private

◆ m_fvNomMassDefData

CompMassDef::TypeEnum jet::ResolutionHelper::m_fvNomMassDefData
private

◆ m_fvNomMassDefMC

CompMassDef::TypeEnum jet::ResolutionHelper::m_fvNomMassDefMC
private

◆ m_fvNomParamData

CompParametrization::TypeEnum jet::ResolutionHelper::m_fvNomParamData
private

◆ m_fvNomParamMC

CompParametrization::TypeEnum jet::ResolutionHelper::m_fvNomParamMC
private

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_isInit

bool jet::ResolutionHelper::m_isInit
private

◆ m_jetDef

std::string jet::ResolutionHelper::m_jetDef
private

◆ m_lvl

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

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_mHbbNomHistData

UncertaintyHistogram* jet::ResolutionHelper::m_mHbbNomHistData
private

◆ m_mHbbNomHistMC

UncertaintyHistogram* jet::ResolutionHelper::m_mHbbNomHistMC
private

◆ m_mHbbNomMassDefData

CompMassDef::TypeEnum jet::ResolutionHelper::m_mHbbNomMassDefData
private

◆ m_mHbbNomMassDefMC

CompMassDef::TypeEnum jet::ResolutionHelper::m_mHbbNomMassDefMC
private

◆ m_mHbbNomParamData

CompParametrization::TypeEnum jet::ResolutionHelper::m_mHbbNomParamData
private

◆ m_mHbbNomParamMC

CompParametrization::TypeEnum jet::ResolutionHelper::m_mHbbNomParamMC
private

◆ m_mQCDNomHistData

UncertaintyHistogram* jet::ResolutionHelper::m_mQCDNomHistData
private

◆ m_mQCDNomHistMC

UncertaintyHistogram* jet::ResolutionHelper::m_mQCDNomHistMC
private

◆ m_mQCDNomMassDefData

CompMassDef::TypeEnum jet::ResolutionHelper::m_mQCDNomMassDefData
private

◆ m_mQCDNomMassDefMC

CompMassDef::TypeEnum jet::ResolutionHelper::m_mQCDNomMassDefMC
private

◆ m_mQCDNomParamData

CompParametrization::TypeEnum jet::ResolutionHelper::m_mQCDNomParamData
private

◆ m_mQCDNomParamMC

CompParametrization::TypeEnum jet::ResolutionHelper::m_mQCDNomParamMC
private

◆ 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_mTopNomHistData

UncertaintyHistogram* jet::ResolutionHelper::m_mTopNomHistData
private

◆ m_mTopNomHistMC

UncertaintyHistogram* jet::ResolutionHelper::m_mTopNomHistMC
private

◆ m_mTopNomMassDefData

CompMassDef::TypeEnum jet::ResolutionHelper::m_mTopNomMassDefData
private

◆ m_mTopNomMassDefMC

CompMassDef::TypeEnum jet::ResolutionHelper::m_mTopNomMassDefMC
private

◆ m_mTopNomParamData

CompParametrization::TypeEnum jet::ResolutionHelper::m_mTopNomParamData
private

◆ m_mTopNomParamMC

CompParametrization::TypeEnum jet::ResolutionHelper::m_mTopNomParamMC
private

◆ m_mWZNomHistData

UncertaintyHistogram* jet::ResolutionHelper::m_mWZNomHistData
private

◆ m_mWZNomHistMC

UncertaintyHistogram* jet::ResolutionHelper::m_mWZNomHistMC
private

◆ m_mWZNomMassDefData

CompMassDef::TypeEnum jet::ResolutionHelper::m_mWZNomMassDefData
private

◆ m_mWZNomMassDefMC

CompMassDef::TypeEnum jet::ResolutionHelper::m_mWZNomMassDefMC
private

◆ m_mWZNomParamData

CompParametrization::TypeEnum jet::ResolutionHelper::m_mWZNomParamData
private

◆ m_mWZNomParamMC

CompParametrization::TypeEnum jet::ResolutionHelper::m_mWZNomParamMC
private

◆ m_name

std::string jet::ResolutionHelper::m_name
private

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_ptNomHistData

UncertaintyHistogram* jet::ResolutionHelper::m_ptNomHistData
private

◆ m_ptNomHistMC

UncertaintyHistogram* jet::ResolutionHelper::m_ptNomHistMC
private

◆ m_ptNomMassDefData

CompMassDef::TypeEnum jet::ResolutionHelper::m_ptNomMassDefData
private

◆ m_ptNomMassDefMC

CompMassDef::TypeEnum jet::ResolutionHelper::m_ptNomMassDefMC
private

◆ m_ptNomParamData

CompParametrization::TypeEnum jet::ResolutionHelper::m_ptNomParamData
private

◆ m_ptNomParamMC

CompParametrization::TypeEnum jet::ResolutionHelper::m_ptNomParamMC
private

◆ m_smearOnlyMC

bool jet::ResolutionHelper::m_smearOnlyMC
private

The documentation for this class was generated from the following files:
jet::CompMassDef::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:71
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
jet::CompParametrization::UNKNOWN
@ UNKNOWN
Definition: UncertaintyEnum.h:46
jet::CompScaleVar::FourVecResAbs
@ FourVecResAbs
Definition: UncertaintyEnum.h:117
jet::CompScaleVar::MassRes
@ MassRes
Definition: UncertaintyEnum.h:112
jet::ResolutionHelper::m_mQCDNomHistData
UncertaintyHistogram * m_mQCDNomHistData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:59
jet::Interpolate::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:241
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Data
@ Data
Definition: BaseObject.h:11
plotmaker.hist
hist
Definition: plotmaker.py:148
jet::JetTopology::Top
@ Top
Definition: UncertaintyEnum.h:213
jet::JetTopology::WZ
@ WZ
Definition: UncertaintyEnum.h:211
jet::ResolutionHelper::m_mWZNomParamData
CompParametrization::TypeEnum m_mWZNomParamData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:67
jet::ResolutionHelper::m_jetDef
std::string m_jetDef
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:39
jet::ResolutionHelper::m_mWZNomMassDefData
CompMassDef::TypeEnum m_mWZNomMassDefData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:68
jet::ResolutionHelper::m_fvNomParamData
CompParametrization::TypeEnum m_fvNomParamData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:53
athena.value
value
Definition: athena.py:124
jet::ResolutionHelper::m_mQCDNomHistMC
UncertaintyHistogram * m_mQCDNomHistMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:62
jet::ResolutionHelper::m_mHbbNomParamMC
CompParametrization::TypeEnum m_mHbbNomParamMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:77
jet::ResolutionHelper::m_mWZNomHistMC
UncertaintyHistogram * m_mWZNomHistMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:69
jet::ResolutionHelper::m_mTopNomMassDefMC
CompMassDef::TypeEnum m_mTopNomMassDefMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:85
jet::ResolutionHelper::m_mTopNomHistData
UncertaintyHistogram * m_mTopNomHistData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:80
jet::ResolutionHelper::m_fvNomHistData
UncertaintyHistogram * m_fvNomHistData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:52
jet::ResolutionHelper::m_ptNomMassDefData
CompMassDef::TypeEnum m_ptNomMassDefData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:47
jet::ResolutionHelper::m_mQCDNomMassDefData
CompMassDef::TypeEnum m_mQCDNomMassDefData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:61
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
jet::ResolutionHelper::m_mQCDNomParamData
CompParametrization::TypeEnum m_mQCDNomParamData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:60
jet::ResolutionHelper::m_mWZNomMassDefMC
CompMassDef::TypeEnum m_mWZNomMassDefMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:71
jet::ResolutionHelper::m_isInit
bool m_isInit
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:40
jet::CompScaleVar::enumToString
TString enumToString(const TypeEnum type)
Definition: UncertaintyEnum.cxx:250
jet::CompMassDef::stringToEnum
TypeEnum stringToEnum(const TString &type)
Definition: UncertaintyEnum.cxx:203
CalculateHighPtTerm.jetDef
dictionary jetDef
Definition: ICHEP2016/CalculateHighPtTerm.py:28
jet::ResolutionHelper::m_mWZNomHistData
UncertaintyHistogram * m_mWZNomHistData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:66
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
JESUNC_SAFE_DELETE
#define JESUNC_SAFE_DELETE(T)
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/Helpers.h:25
jet::ResolutionHelper::m_mWZNomParamMC
CompParametrization::TypeEnum m_mWZNomParamMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:70
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
jet::ResolutionHelper::m_ptNomHistData
UncertaintyHistogram * m_ptNomHistData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:45
jet::ResolutionHelper::m_ptNomParamData
CompParametrization::TypeEnum m_ptNomParamData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:46
jet::ResolutionHelper::m_fvNomParamMC
CompParametrization::TypeEnum m_fvNomParamMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:56
jet::CompParametrization::includesMass
bool includesMass(const TypeEnum type)
Definition: UncertaintyEnum.cxx:156
jet::CompScaleVar::FourVecRes
@ FourVecRes
Definition: UncertaintyEnum.h:116
jet::JetTopology::enumToString
TString enumToString(const TypeEnum type)
Definition: UncertaintyEnum.cxx:609
jet::CompScaleVar::PtResAbs
@ PtResAbs
Definition: UncertaintyEnum.h:115
jet::CompScaleVar::PtRes
@ PtRes
Definition: UncertaintyEnum.h:114
jet::ResolutionHelper::m_mHbbNomHistData
UncertaintyHistogram * m_mHbbNomHistData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:73
jet::ResolutionHelper::m_fvNomMassDefData
CompMassDef::TypeEnum m_fvNomMassDefData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:54
jet::ResolutionHelper::m_ptNomParamMC
CompParametrization::TypeEnum m_ptNomParamMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:49
jet::ResolutionHelper::m_mHbbNomHistMC
UncertaintyHistogram * m_mHbbNomHistMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:76
jet::ResolutionHelper::m_mHbbNomParamData
CompParametrization::TypeEnum m_mHbbNomParamData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:74
jet::ResolutionHelper::m_smearOnlyMC
bool m_smearOnlyMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:42
jet::JetTopology::MIXED
@ MIXED
Definition: UncertaintyEnum.h:214
jet::ResolutionHelper::parseInput
StatusCode parseInput(TEnv &settings, TFile *histFile, const TString &key, const TString &defaultValue, UncertaintyHistogram *&hist, CompParametrization::TypeEnum &param, CompMassDef::TypeEnum &massDef, const TString &MCtype)
Definition: Reconstruction/Jet/JetUncertainties/Root/ResolutionHelper.cxx:121
jet::Interpolate::stringToEnum
TypeEnum stringToEnum(const TString &type)
Definition: UncertaintyEnum.cxx:657
jet::JetTopology::QCD
@ QCD
Definition: UncertaintyEnum.h:210
jet::ResolutionHelper::m_mTopNomMassDefData
CompMassDef::TypeEnum m_mTopNomMassDefData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:82
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
jet::CompParametrization::TypeEnum
TypeEnum
Definition: UncertaintyEnum.h:45
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
jet::ResolutionHelper::m_mTopNomHistMC
UncertaintyHistogram * m_mTopNomHistMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:83
jet::ResolutionHelper::m_mHbbNomMassDefData
CompMassDef::TypeEnum m_mHbbNomMassDefData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:75
jet::UncertaintyHistogram
Definition: UncertaintyHistogram.h:25
jet::CompParametrization::stringToEnum
TypeEnum stringToEnum(const TString &type)
Definition: UncertaintyEnum.cxx:112
jet::ResolutionHelper::m_ptNomHistMC
UncertaintyHistogram * m_ptNomHistMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:48
jet::CompMassDef::UNKNOWN
@ UNKNOWN
Definition: UncertaintyEnum.h:72
jet::JetTopology::Hbb
@ Hbb
Definition: UncertaintyEnum.h:212
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
jet::ResolutionHelper::m_mHbbNomMassDefMC
CompMassDef::TypeEnum m_mHbbNomMassDefMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:78
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
jet::Interpolate::UNKNOWN
@ UNKNOWN
Definition: UncertaintyEnum.h:242
jet::CompScaleVar::MassResAbs
@ MassResAbs
Definition: UncertaintyEnum.h:113
jet::ResolutionHelper::m_ptNomMassDefMC
CompMassDef::TypeEnum m_ptNomMassDefMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:50
jet::ResolutionHelper::m_mQCDNomMassDefMC
CompMassDef::TypeEnum m_mQCDNomMassDefMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:64
jet::ResolutionHelper::m_mQCDNomParamMC
CompParametrization::TypeEnum m_mQCDNomParamMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:63
jet::ResolutionHelper::m_name
std::string m_name
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:38
jet::ResolutionHelper::m_fvNomMassDefMC
CompMassDef::TypeEnum m_fvNomMassDefMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:57
jet::ResolutionHelper::m_fvNomHistMC
UncertaintyHistogram * m_fvNomHistMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:55
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
jet::ResolutionHelper::m_mTopNomParamData
CompParametrization::TypeEnum m_mTopNomParamData
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:81
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
jet::ResolutionHelper::m_mTopNomParamMC
CompParametrization::TypeEnum m_mTopNomParamMC
Definition: Reconstruction/Jet/JetUncertainties/JetUncertainties/ResolutionHelper.h:84