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

#include <OptionHelper.h>

Inheritance diagram for jet::OptionHelper:
Collaboration diagram for jet::OptionHelper:

Public Member Functions

 OptionHelper (const std::string &name="OptionHelper")
 ~OptionHelper ()
bool Initialize (const std::vector< TString > &options)
bool IsPublicFormat () const
bool IsEtaDepPileup () const
bool IgnorePT () const
TString GetNamePrefix () const
TString GetCalibArea () const
TString GetPath () const
bool GetIsData () const
bool IgnoreNoMatch () const
bool DoATLASLabel () const
TString GetATLASLabel () const
TString GetBunchSpacing () const
bool DrawTotal () const
TString TotalUncName () const
bool SpecifyTagger () const
double AxisMax () const
double AxisMin () const
std::pair< double, double > xAxisRange () const
bool AbsValue () const
bool LogPt () const
TString getMassType () const
std::pair< double, double > fillShift () const
bool TwoColumnLegend () const
std::vector< double > GetPtBins () const
std::vector< double > GetEtaBins () const
std::vector< double > GetFixedPtVals () const
std::vector< double > GetFixedEtaVals () const
std::vector< double > GetFixedMoverPtVals () const
std::vector< double > GetFixedMassVals () const
bool IsSmallR () const
bool IsLargeR () const
bool IsJER () const
bool IsTLA () const
bool IsSpecialComposition () const
TString GetCompositionPath () const
TString GetCompositionName () const
int GetNjetFlavour () const
int FixedTruthLabel () const
LargeRJetTruthLabel::TypeEnum FixedLargeRJetTruthLabel () const
TString TruthLabelMoment () const
TString TagScaleFactorName () const
TString FixedLargeRJetTagResultName () const
int FixedLargeRJetTagAccept () const
bool CompareOnly () const
TString DoCompare () const
std::vector< TString > GetCompareVals () const
std::vector< CompScaleVar::TypeEnumGetScaleVars () const
const std::vector< std::string > VariablesToShift () const
JetTopology::TypeEnum GetTopology () const
TString GetInputsDir () const
TString GetDumpFile () 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.

Private Member Functions

TString getOptionValue (const std::vector< TString > &options, const TString optionName) const
template<typename T>
getOptionValueWithDefault (const std::vector< TString > &options, const TString optionName, const T defaultVal)
std::vector< TString > getCompareVals (const std::vector< TString > &options) const
void checkInit () const
std::vector< double > getBins (const TString &toParse) const
void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

bool m_isInit
bool m_isPublic
bool m_isEtaDepPU
bool m_ignorePT
TString m_compNamePrefix
TString m_calibArea
TString m_path
bool m_isData
bool m_ignoreNoMatch
bool m_doATLASLabel
TString m_ATLASLabel
TString m_bunchSpacing
bool m_doTotalUnc
TString m_totalUncName
bool m_specifyTagger
double m_axisMax
double m_axisMin
std::pair< double, double > m_xAxisRange
bool m_absVal
bool m_logPt
TString m_massType
std::pair< double, double > m_fillShift
bool m_twoColumnLegend
TString m_ptBins
TString m_etaBins
TString m_fixedPtVals
TString m_fixedEtaVals
TString m_fixedMoverPtVals
TString m_fixedMassVals
bool m_isSmallR
bool m_isLargeR
bool m_isJER
bool m_isTLA
TString m_composition
int m_nJetFlavour
int m_truthLabel
LargeRJetTruthLabel::TypeEnum m_largeRJetTruthLabel
TString m_truthLabelMoment
bool m_isDijet
TString m_tagSFname
TString m_largeRjetTagResultName
int m_largeRjetTagAccept
bool m_onlyCompare
TString m_doCompare
std::vector< TString > m_compareVals
std::vector< CompScaleVar::TypeEnumm_scaleVars
std::vector< std::string > m_systFilters
JetTopology::TypeEnum m_topology
TString m_inputsDir
TString m_dumpFile
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 22 of file OptionHelper.h.

Constructor & Destructor Documentation

◆ OptionHelper()

jet::OptionHelper::OptionHelper ( const std::string & name = "OptionHelper")

Definition at line 178 of file OptionHelper.h.

179 : asg::AsgMessaging(name)
180 , m_isInit(false)
181
182 , m_isPublic(false)
183 , m_isEtaDepPU(false)
184 , m_ignorePT(false)
185 , m_compNamePrefix("JET_")
186 , m_calibArea("")
187 , m_path("")
188 , m_isData(false)
189 , m_ignoreNoMatch(false)
190
191 , m_doATLASLabel(true)
192 , m_ATLASLabel("Internal")
193 , m_bunchSpacing("")
194 , m_doTotalUnc(true)
195 , m_totalUncName("Total uncertainty")
196 , m_specifyTagger(true)
197 , m_axisMax(-1)
198 , m_axisMin(0)
199 , m_xAxisRange(0,0)
200 , m_absVal(true)
201 , m_logPt(true)
202 , m_massType("")
203 , m_fillShift(0,0)
204 , m_twoColumnLegend(false)
205
206 , m_ptBins("")
207 , m_etaBins("")
208 , m_fixedPtVals("")
209 , m_fixedEtaVals("")
211 , m_fixedMassVals("")
212
213 , m_isSmallR(true)
214 , m_isLargeR(false)
215 , m_isJER(false)
216 , m_isTLA(false)
217
218 , m_composition("")
219 , m_nJetFlavour(-1)
220 , m_truthLabel(0)
223 , m_isDijet(false)
224
225 , m_tagSFname("")
228
229 , m_onlyCompare(false)
230 , m_doCompare("")
231 , m_compareVals()
232
233 , m_scaleVars()
234 , m_systFilters()
236
237 , m_inputsDir("/eos/atlas/atlascerngroupdisk/perf-jets/JetUncertainties/Inputs/")
238
239 , m_dumpFile("")
240{ }
TString m_truthLabelMoment
std::pair< double, double > m_fillShift
std::vector< TString > m_compareVals
TString m_fixedMoverPtVals
std::pair< double, double > m_xAxisRange
std::vector< CompScaleVar::TypeEnum > m_scaleVars
std::vector< std::string > m_systFilters
JetTopology::TypeEnum m_topology
LargeRJetTruthLabel::TypeEnum m_largeRJetTruthLabel
TString m_largeRjetTagResultName

◆ ~OptionHelper()

jet::OptionHelper::~OptionHelper ( )
inline

Definition at line 27 of file OptionHelper.h.

27{}

Member Function Documentation

◆ AbsValue()

bool jet::OptionHelper::AbsValue ( ) const
inline

Definition at line 54 of file OptionHelper.h.

54{ checkInit(); return m_absVal; }
void checkInit() const

◆ AxisMax()

double jet::OptionHelper::AxisMax ( ) const
inline

Definition at line 51 of file OptionHelper.h.

51{ checkInit(); return m_axisMax < 0 ? (IsLargeR()? 0.2 : 0.1) : m_axisMax; }
bool IsLargeR() const

◆ AxisMin()

double jet::OptionHelper::AxisMin ( ) const
inline

Definition at line 52 of file OptionHelper.h.

52{ checkInit(); return m_axisMin; }

◆ checkInit()

void jet::OptionHelper::checkInit ( ) const
private

Definition at line 431 of file OptionHelper.h.

432{
433 if (!m_isInit)
434 {
435 ATH_MSG_FATAL("Asked for a value before initializing the tool");
436 throw std::runtime_error("Initialization failure");
437 }
438}
#define ATH_MSG_FATAL(x)

◆ CompareOnly()

bool jet::OptionHelper::CompareOnly ( ) const
inline

Definition at line 89 of file OptionHelper.h.

89{ checkInit(); return m_onlyCompare; }

◆ DoATLASLabel()

bool jet::OptionHelper::DoATLASLabel ( ) const
inline

Definition at line 45 of file OptionHelper.h.

45{ checkInit(); return m_doATLASLabel; }

◆ DoCompare()

TString jet::OptionHelper::DoCompare ( ) const
inline

Definition at line 90 of file OptionHelper.h.

90{ checkInit(); return m_doCompare; }

◆ DrawTotal()

bool jet::OptionHelper::DrawTotal ( ) const
inline

Definition at line 48 of file OptionHelper.h.

48{ checkInit(); return m_doTotalUnc; }

◆ fillShift()

std::pair< double, double > jet::OptionHelper::fillShift ( ) const
inline

Definition at line 57 of file OptionHelper.h.

57{ checkInit(); return m_fillShift; }

◆ FixedLargeRJetTagAccept()

int jet::OptionHelper::FixedLargeRJetTagAccept ( ) const
inline

Definition at line 86 of file OptionHelper.h.

◆ FixedLargeRJetTagResultName()

TString jet::OptionHelper::FixedLargeRJetTagResultName ( ) const
inline

Definition at line 85 of file OptionHelper.h.

◆ FixedLargeRJetTruthLabel()

LargeRJetTruthLabel::TypeEnum jet::OptionHelper::FixedLargeRJetTruthLabel ( ) const
inline

Definition at line 79 of file OptionHelper.h.

◆ FixedTruthLabel()

int jet::OptionHelper::FixedTruthLabel ( ) const
inline

Definition at line 78 of file OptionHelper.h.

78{ checkInit(); return m_truthLabel; }

◆ GetATLASLabel()

TString jet::OptionHelper::GetATLASLabel ( ) const
inline

Definition at line 46 of file OptionHelper.h.

46{ checkInit(); return m_ATLASLabel; }

◆ getBins()

std::vector< double > jet::OptionHelper::getBins ( const TString & toParse) const
private

Definition at line 444 of file OptionHelper.h.

445{
446 // Ensure this is in the expected format
447 // type&numBins&minVal&maxVal
448 // type is either "U" for uniform or "L" for logarithmic
449 std::vector<TString> tokens = jet::utils::vectorize<TString>(toParse,"&");
450
451 // Check the number of tokens
452 if (tokens.size() != 4)
453 {
454 ATH_MSG_FATAL("Unexpected format for bins: " << toParse.Data());
455 throw std::runtime_error("Parse failure");
456 }
457
458 // Check the type
459 const bool isUniform = (tokens.at(0) == "U") || (tokens.at(0) == "u");
460 const bool isLog = (tokens.at(0) == "L") || (tokens.at(0) == "l");
461 if (!isUniform && !isLog)
462 {
463 ATH_MSG_FATAL("Unexpected binning type (token 0), only U/u and L/l are currently supported: " << toParse.Data());
464 throw std::runtime_error("Parse failure");
465 }
466
467 // Check the number of bins
468 unsigned numBins = 0;
469 if (!jet::utils::getTypeObjFromString(tokens.at(1),numBins))
470 {
471 ATH_MSG_FATAL("Number of bins (token 1) was not an unsigned int: " << toParse.Data());
472 throw std::runtime_error("Parse failure");
473 }
474
475 // Check the min and max
476 double minVal = 0, maxVal = 0;
477 if (!jet::utils::getTypeObjFromString(tokens.at(2),minVal))
478 {
479 ATH_MSG_FATAL("Number of bins (token 2) was not a double: " << toParse.Data());
480 throw std::runtime_error("Parse failure");
481 }
482 if (!jet::utils::getTypeObjFromString(tokens.at(3),maxVal))
483 {
484 ATH_MSG_FATAL("Number of bins (token 3) was not a double: " << toParse.Data());
485 throw std::runtime_error("Parse failure");
486 }
487 if (maxVal < minVal)
488 {
489 ATH_MSG_FATAL("The maximum value is smaller than the minimum: " << toParse.Data());
490 throw std::runtime_error("Parse failure");
491 }
492
493 // Done checking, finally return the bins
494 if (isUniform)
495 return jet::utils::getUniformBins(numBins,minVal,maxVal);
496 return jet::utils::getLogBins(numBins,minVal,maxVal);
497}
std::vector< double > getLogBins(const size_t numBins, const double minVal, const double maxVal)
bool getTypeObjFromString(const std::string &str, T &obj)
bool vectorize(const TString &str, const TString &sep, std::vector< T > &result)
std::vector< double > getUniformBins(const size_t numBins, const double minVal, const double maxVal)

◆ GetBunchSpacing()

TString jet::OptionHelper::GetBunchSpacing ( ) const
inline

Definition at line 47 of file OptionHelper.h.

47{ checkInit(); return m_bunchSpacing; }

◆ GetCalibArea()

TString jet::OptionHelper::GetCalibArea ( ) const
inline

Definition at line 39 of file OptionHelper.h.

39{ checkInit(); return m_calibArea; }

◆ GetCompareVals()

std::vector< TString > jet::OptionHelper::GetCompareVals ( ) const
inline

Definition at line 91 of file OptionHelper.h.

91{ checkInit(); return m_compareVals; }

◆ getCompareVals()

std::vector< TString > jet::OptionHelper::getCompareVals ( const std::vector< TString > & options) const
private

Definition at line 418 of file OptionHelper.h.

419{
420 std::vector<TString> returnVal;
421 for (int i=1; i> 0; i++) {
422 TString optname = TString::Format("compareConfig%i",i);
423 const TString thisname = getOptionValue(options,optname);
424 if (thisname != "") returnVal.push_back(thisname);
425 else break;
426 }
427 return returnVal;
428}
TString getOptionValue(const std::vector< TString > &options, const TString optionName) const

◆ GetCompositionName()

TString jet::OptionHelper::GetCompositionName ( ) const

Definition at line 627 of file OptionHelper.h.

628{
629 checkInit();
630
631 // Trivial case (unknown composition)
632 if (m_composition == "")
633 return "unknown composition";
634 // Path-based case (user specified the file path, return "custom" as name)
635 if (m_composition.Contains(".root"))
636 {
637 return "custom composition";
638 }
639 // Name-based case (user specified name, interpret or return it)
640 if (!m_composition.Contains(".root"))
641 {
642 if (!m_composition.CompareTo("Unknown",TString::kIgnoreCase))
643 return "unknown composition";
644 if (!m_composition.CompareTo("Dijet",TString::kIgnoreCase))
645 return "inclusive jets";
646 if (!m_composition.CompareTo("Gino",TString::kIgnoreCase))
647 return "Gino's composition";
648 return m_composition + " composition";
649 }
650
651 ATH_MSG_FATAL("Unable to interpret special composition name: " << m_composition);
652 throw std::runtime_error("Composition name failure");
653 return "";
654}

◆ GetCompositionPath()

TString jet::OptionHelper::GetCompositionPath ( ) const

Definition at line 601 of file OptionHelper.h.

602{
603 checkInit();
604
605 // Trivial case (unknown composition)
606 if (m_composition == "")
607 return "";
608 // Path-based case (user specified file path, return it)
609 if (m_composition.Contains(".root"))
610 return m_composition;
611 // Name-based case (user specified name, return expected path)
612 else
613 {
614 if (!m_composition.CompareTo("Unknown",TString::kIgnoreCase))
615 return "";
616 if (!m_composition.CompareTo("Dijet",TString::kIgnoreCase))
617 return GetInputsDir()+"/DijetFlavourComp_13TeV.root";
618 if (!m_composition.CompareTo("Gino",TString::kIgnoreCase))
619 return GetInputsDir()+"/GinoComposition.root";
620 }
621
622 ATH_MSG_FATAL("Unable to interpret special composition path: " << m_composition);
623 throw std::runtime_error("Composition path failure");
624 return "";
625}
TString GetInputsDir() const

◆ GetDumpFile()

TString jet::OptionHelper::GetDumpFile ( ) const
inline

Definition at line 102 of file OptionHelper.h.

102{ checkInit(); return m_dumpFile; }

◆ GetEtaBins()

std::vector< double > jet::OptionHelper::GetEtaBins ( ) const

Definition at line 520 of file OptionHelper.h.

521{
522 checkInit();
523 std::vector<double> bins;
524
525 // Check if the user has provided something
526 if (m_etaBins == "")
527 bins = jet::utils::getUniformBins(1800,-4.5,4.5);
528 else
530
531 return bins;
532}
static const std::vector< std::string > bins
std::vector< double > getBins(const TString &toParse) const

◆ GetFixedEtaVals()

std::vector< double > jet::OptionHelper::GetFixedEtaVals ( ) const

Definition at line 550 of file OptionHelper.h.

551{
552 checkInit();
553 std::vector<double> bins;
554
555 if (m_fixedEtaVals != "")
556 {
557 if (m_fixedEtaVals != "NONE")
559 }
560 else if (IsLargeR())
562 else if (IsJER())
563 bins = jet::utils::vectorize<double>("0,0.8,1.2,2.1,2.8,3.2,3.6",",");
564 else
565 bins = jet::utils::vectorize<double>("0,0.5,1,2,2.5,3,4",",");
566
567 return bins;
568}
bool IsJER() const

◆ GetFixedMassVals()

std::vector< double > jet::OptionHelper::GetFixedMassVals ( ) const

Definition at line 590 of file OptionHelper.h.

591{
592 checkInit();
593 std::vector<double> bins;
594
595 if (m_fixedMassVals != "" && m_fixedMassVals != "NONE")
597
598 return bins;
599}

◆ GetFixedMoverPtVals()

std::vector< double > jet::OptionHelper::GetFixedMoverPtVals ( ) const

Definition at line 570 of file OptionHelper.h.

571{
572 checkInit();
573 std::vector<double> bins;
574
575 if (m_fixedMoverPtVals != "")
576 {
577 if (m_fixedMoverPtVals != "NONE")
579 }
580 else if (!IsLargeR())
582 else if (IsPublicFormat())
583 bins = jet::utils::vectorize<double>("0.101",",");
584 else
585 bins = jet::utils::vectorize<double>("0.001,0.05,0.101,0.15,0.201,0.25,0.301,0.35,0.401,0.45,0.501,0.55,0.601,0.65,0.701,0.75,0.801,0.85,0.901,0.95,1.001",",");
586
587 return bins;
588}
bool IsPublicFormat() const

◆ GetFixedPtVals()

std::vector< double > jet::OptionHelper::GetFixedPtVals ( ) const

Definition at line 534 of file OptionHelper.h.

535{
536 checkInit();
537 std::vector<double> bins;
538
539 if (m_fixedPtVals != "")
540 {
541 if (m_fixedPtVals != "NONE")
543 }
544 else
545 bins = jet::utils::vectorize<double>("25,40,60,80,120",",");
546
547 return bins;
548}

◆ GetInputsDir()

TString jet::OptionHelper::GetInputsDir ( ) const
inline

Definition at line 99 of file OptionHelper.h.

99{ checkInit(); return m_inputsDir; }

◆ GetIsData()

bool jet::OptionHelper::GetIsData ( ) const
inline

Definition at line 41 of file OptionHelper.h.

41{ checkInit(); return m_isData; }

◆ getMassType()

TString jet::OptionHelper::getMassType ( ) const
inline

Definition at line 56 of file OptionHelper.h.

56{ checkInit(); return m_massType; }

◆ GetNamePrefix()

TString jet::OptionHelper::GetNamePrefix ( ) const
inline

Definition at line 38 of file OptionHelper.h.

38{ checkInit(); return m_compNamePrefix; }

◆ GetNjetFlavour()

int jet::OptionHelper::GetNjetFlavour ( ) const
inline

Definition at line 77 of file OptionHelper.h.

77{ checkInit(); return m_nJetFlavour; }

◆ getOptionValue()

TString jet::OptionHelper::getOptionValue ( const std::vector< TString > & options,
const TString optionName ) const
private

Definition at line 393 of file OptionHelper.h.

394{
395 for (size_t iOpt = 0; iOpt < options.size(); ++iOpt)
396 {
397 std::vector<TString> option = jet::utils::vectorize<TString>(options.at(iOpt),"=");
398 if (option.size() != 2)
399 {
400 printf("Bad option, check formatting: %s\n",options.at(iOpt).Data());
401 exit(-1);
402 }
403 if (!option.at(0).CompareTo(optionName,TString::kIgnoreCase))
404 return option.at(1);
405 }
406 return "";
407}

◆ getOptionValueWithDefault()

template<typename T>
T jet::OptionHelper::getOptionValueWithDefault ( const std::vector< TString > & options,
const TString optionName,
const T defaultVal )
private

Definition at line 410 of file OptionHelper.h.

411{
412 const TString optionVal = getOptionValue(options,optionName);
413 if (optionVal == "")
414 return defaultVal;
415 return jet::utils::getTypeObjFromString<T>(optionVal);
416}

◆ GetPath()

TString jet::OptionHelper::GetPath ( ) const
inline

Definition at line 40 of file OptionHelper.h.

40{ checkInit(); return m_path; }

◆ GetPtBins()

std::vector< double > jet::OptionHelper::GetPtBins ( ) const

Definition at line 501 of file OptionHelper.h.

502{
503 checkInit();
504 std::vector<double> bins;
505
506 // Check if the user has provided something
507 if (m_ptBins == "")
508 {
509 if (IsLargeR())
510 bins = jet::utils::getLogBins(2000,200,3000);
511 else
512 bins = jet::utils::getLogBins(2000,15,3000);
513 }
514 else
516
517 return bins;
518}

◆ GetScaleVars()

std::vector< CompScaleVar::TypeEnum > jet::OptionHelper::GetScaleVars ( ) const
inline

Definition at line 94 of file OptionHelper.h.

94{ checkInit(); return m_scaleVars; }

◆ GetTopology()

JetTopology::TypeEnum jet::OptionHelper::GetTopology ( ) const
inline

Definition at line 96 of file OptionHelper.h.

96{ checkInit(); return m_topology; }

◆ IgnoreNoMatch()

bool jet::OptionHelper::IgnoreNoMatch ( ) const
inline

Definition at line 42 of file OptionHelper.h.

42{ checkInit(); return m_ignoreNoMatch; }

◆ IgnorePT()

bool jet::OptionHelper::IgnorePT ( ) const
inline

Definition at line 37 of file OptionHelper.h.

37{ checkInit(); return m_ignorePT; }

◆ Initialize()

bool jet::OptionHelper::Initialize ( const std::vector< TString > & options)

Definition at line 242 of file OptionHelper.h.

243{
244 if (m_isInit)
245 {
246 ATH_MSG_ERROR("The tool has already been initialized, blocking re-initialization");
247 return false;
248 }
249 m_isInit = true;
250
251 // Check for the no-options case
252 if (!options.size()) return true;
253
254 // Options exist, let's parse them
255 m_isPublic = getOptionValueWithDefault(options,"isPublic",m_isPublic);
256 m_isEtaDepPU = getOptionValueWithDefault(options,"isEtaDepPileup",m_isEtaDepPU);
257 m_ignorePT = getOptionValueWithDefault(options,"ignorePT",m_ignorePT);
260 m_path = getOptionValueWithDefault(options,"Path",m_path);
261 m_isData = getOptionValueWithDefault(options,"IsData",m_isData);
263
266 if (m_ATLASLabel == "PUBLIC") m_ATLASLabel = "";
269 m_totalUncName = getOptionValueWithDefault(options,"totalUncName",m_totalUncName).Strip(TString::kBoth,'"');
271 m_axisMax = getOptionValueWithDefault(options,"axisMax",m_axisMax);
272 m_axisMin = getOptionValueWithDefault(options,"axisMin",m_axisMin);
273 TString xAxisRange = getOptionValue(options,"xAxisRange");
274 if (xAxisRange != "")
275 {
276 std::vector<double> range = jet::utils::vectorize<double>(xAxisRange,"&");
277 if (range.size() != 2)
278 ATH_MSG_WARNING("xAxisRange doesn't match expected format of \"val1&val2\". Skipping.");
279 else
280 {
281 const double lowX = range.at(0);
282 const double highX = range.at(1);
283 m_xAxisRange = std::make_pair(lowX,highX);
284 }
285 }
286 m_absVal = getOptionValueWithDefault(options,"absVal",m_absVal);
287 m_logPt = getOptionValueWithDefault(options,"logPt",m_logPt);
289 TString fillShift = getOptionValue(options,"FillLabelShift");
290 if (fillShift != "")
291 {
292 std::vector<double> shift = jet::utils::vectorize<double>(fillShift,"&");
293 if (shift.size() != 2)
294 ATH_MSG_WARNING("FillLabelShift doesn't match expected format of \"val1&val2\". Skipping.");
295 else
296 {
297 const double lowShift = shift.at(0);
298 const double highShift = shift.at(1);
299 m_fillShift = std::make_pair(lowShift,highShift);
300 }
301 }
303
304 m_ptBins = getOptionValueWithDefault(options,"ptBins",m_ptBins);
305 m_etaBins = getOptionValueWithDefault(options,"etaBins",m_etaBins);
310
311 m_isLargeR = getOptionValueWithDefault(options,"isLargeR",m_isLargeR);
312 m_isJER = getOptionValueWithDefault(options,"isJER",m_isJER);
313 m_isTLA = getOptionValueWithDefault(options,"isTLA",m_isTLA);
315
319 TString largeRJetTruthLabelStr = getOptionValue(options,"LargeRJetTruthLabel");
320 if (largeRJetTruthLabelStr != "")
321 {
324 {
325 ATH_MSG_WARNING("LargeRJetTruthLabel is UNKNOWN value, skipping usage: " << largeRJetTruthLabelStr.Data());
326 }
327 }
329 m_isDijet = getOptionValueWithDefault(options,"isDijet",m_isDijet);
330 if (m_isDijet)
331 {
332 if (m_composition == "")
333 m_composition = "Dijet";
334 else
335 {
336 ATH_MSG_ERROR("The composition was double-specified, please check that you don't specify both \"Composition\" and \"isDijet\"");
337 throw std::runtime_error("Double composition failure");
338 }
339 }
340
343 if (m_largeRjetTagResultName != "")
344 {
345 m_largeRjetTagAccept = getOptionValueWithDefault(options,"TagAcceptResult",0);
346 // TODO: enable when available
347 // if (TagResult::intToEnum(m_largeRjetTagAccept) == TagResult::UNKNOWN)
348 // {
349 // ATH_MSG_ERROR("The specified tag result doesn't match any expected value");
350 // throw std::runtime_error("Bad tag result value");
351 // }
352 }
353
356 m_compareVals = getCompareVals(options);
357
359
360 m_dumpFile = getOptionValueWithDefault(options,"dumpFile",m_dumpFile);
361
362 const TString localScaleVar = getOptionValue(options,"scaleVar");
363 if (localScaleVar == "")
364 {
366 else if (m_isLargeR) m_scaleVars.push_back(CompScaleVar::Pt);
367 }
368 else
369 {
370 std::vector<TString> localScaleVarVec = jet::utils::vectorize<TString>(localScaleVar,"&");
371 for (size_t iVar = 0; iVar < localScaleVarVec.size(); ++iVar)
372 m_scaleVars.push_back(CompScaleVar::stringToEnum(localScaleVarVec.at(iVar)));
373 }
374 const TString jetTopology = getOptionValue(options,"topology");
375 if (jetTopology != "")
376 {
379 {
380 ATH_MSG_ERROR("The topology specified is invalid: " << jetTopology.Data());
381 throw std::runtime_error("Topology failure");
382 }
383 }
384
385 const TString systFilterString = getOptionValue(options,"VariablesToShift");
386 if (systFilterString != "")
388
389 return true;
390}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
T getOptionValueWithDefault(const std::vector< TString > &options, const TString optionName, const T defaultVal)
std::pair< double, double > fillShift() const
std::vector< TString > getCompareVals(const std::vector< TString > &options) const
std::pair< double, double > xAxisRange() const
TypeEnum stringToEnum(const TString &name)
TypeEnum stringToEnum(const TString &type)
TypeEnum stringToEnum(const TString &type)

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

◆ IsEtaDepPileup()

bool jet::OptionHelper::IsEtaDepPileup ( ) const
inline

Definition at line 36 of file OptionHelper.h.

36{ checkInit(); return m_isEtaDepPU; }

◆ IsJER()

bool jet::OptionHelper::IsJER ( ) const
inline

Definition at line 70 of file OptionHelper.h.

70{ checkInit(); return m_isJER; }

◆ IsLargeR()

bool jet::OptionHelper::IsLargeR ( ) const
inline

Definition at line 69 of file OptionHelper.h.

69{ checkInit(); return m_isLargeR; }

◆ IsPublicFormat()

bool jet::OptionHelper::IsPublicFormat ( ) const
inline

Definition at line 35 of file OptionHelper.h.

35{ checkInit(); return m_isPublic; }

◆ IsSmallR()

bool jet::OptionHelper::IsSmallR ( ) const
inline

Definition at line 68 of file OptionHelper.h.

68{ checkInit(); return m_isSmallR; }

◆ IsSpecialComposition()

bool jet::OptionHelper::IsSpecialComposition ( ) const
inline

Definition at line 74 of file OptionHelper.h.

74{ checkInit(); return m_composition != ""; }

◆ IsTLA()

bool jet::OptionHelper::IsTLA ( ) const
inline

Definition at line 71 of file OptionHelper.h.

71{ checkInit(); return m_isTLA; }

◆ LogPt()

bool jet::OptionHelper::LogPt ( ) const
inline

Definition at line 55 of file OptionHelper.h.

55{ checkInit(); return m_logPt; }

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

◆ SpecifyTagger()

bool jet::OptionHelper::SpecifyTagger ( ) const
inline

Definition at line 50 of file OptionHelper.h.

50{ checkInit(); return m_specifyTagger; }

◆ TagScaleFactorName()

TString jet::OptionHelper::TagScaleFactorName ( ) const
inline

Definition at line 84 of file OptionHelper.h.

84{ checkInit(); return m_tagSFname; }

◆ TotalUncName()

TString jet::OptionHelper::TotalUncName ( ) const
inline

Definition at line 49 of file OptionHelper.h.

49{ checkInit(); return m_totalUncName; }

◆ TruthLabelMoment()

TString jet::OptionHelper::TruthLabelMoment ( ) const
inline

Definition at line 80 of file OptionHelper.h.

80{checkInit(); return m_truthLabelMoment; }

◆ TwoColumnLegend()

bool jet::OptionHelper::TwoColumnLegend ( ) const
inline

Definition at line 58 of file OptionHelper.h.

58{ checkInit(); return m_twoColumnLegend; }

◆ VariablesToShift()

const std::vector< std::string > jet::OptionHelper::VariablesToShift ( ) const
inline

Definition at line 95 of file OptionHelper.h.

95{ checkInit(); return m_systFilters; }

◆ xAxisRange()

std::pair< double, double > jet::OptionHelper::xAxisRange ( ) const
inline

Definition at line 53 of file OptionHelper.h.

53{ checkInit(); return m_xAxisRange; }

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_absVal

bool jet::OptionHelper::m_absVal
private

Definition at line 125 of file OptionHelper.h.

◆ m_ATLASLabel

TString jet::OptionHelper::m_ATLASLabel
private

Definition at line 117 of file OptionHelper.h.

◆ m_axisMax

double jet::OptionHelper::m_axisMax
private

Definition at line 122 of file OptionHelper.h.

◆ m_axisMin

double jet::OptionHelper::m_axisMin
private

Definition at line 123 of file OptionHelper.h.

◆ m_bunchSpacing

TString jet::OptionHelper::m_bunchSpacing
private

Definition at line 118 of file OptionHelper.h.

◆ m_calibArea

TString jet::OptionHelper::m_calibArea
private

Definition at line 111 of file OptionHelper.h.

◆ m_compareVals

std::vector<TString> jet::OptionHelper::m_compareVals
private

Definition at line 156 of file OptionHelper.h.

◆ m_compNamePrefix

TString jet::OptionHelper::m_compNamePrefix
private

Definition at line 110 of file OptionHelper.h.

◆ m_composition

TString jet::OptionHelper::m_composition
private

Definition at line 143 of file OptionHelper.h.

◆ m_doATLASLabel

bool jet::OptionHelper::m_doATLASLabel
private

Definition at line 116 of file OptionHelper.h.

◆ m_doCompare

TString jet::OptionHelper::m_doCompare
private

Definition at line 155 of file OptionHelper.h.

◆ m_doTotalUnc

bool jet::OptionHelper::m_doTotalUnc
private

Definition at line 119 of file OptionHelper.h.

◆ m_dumpFile

TString jet::OptionHelper::m_dumpFile
private

Definition at line 166 of file OptionHelper.h.

◆ m_etaBins

TString jet::OptionHelper::m_etaBins
private

Definition at line 132 of file OptionHelper.h.

◆ m_fillShift

std::pair<double,double> jet::OptionHelper::m_fillShift
private

Definition at line 128 of file OptionHelper.h.

◆ m_fixedEtaVals

TString jet::OptionHelper::m_fixedEtaVals
private

Definition at line 134 of file OptionHelper.h.

◆ m_fixedMassVals

TString jet::OptionHelper::m_fixedMassVals
private

Definition at line 136 of file OptionHelper.h.

◆ m_fixedMoverPtVals

TString jet::OptionHelper::m_fixedMoverPtVals
private

Definition at line 135 of file OptionHelper.h.

◆ m_fixedPtVals

TString jet::OptionHelper::m_fixedPtVals
private

Definition at line 133 of file OptionHelper.h.

◆ m_ignoreNoMatch

bool jet::OptionHelper::m_ignoreNoMatch
private

Definition at line 114 of file OptionHelper.h.

◆ m_ignorePT

bool jet::OptionHelper::m_ignorePT
private

Definition at line 109 of file OptionHelper.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_inputsDir

TString jet::OptionHelper::m_inputsDir
private

Definition at line 164 of file OptionHelper.h.

◆ m_isData

bool jet::OptionHelper::m_isData
private

Definition at line 113 of file OptionHelper.h.

◆ m_isDijet

bool jet::OptionHelper::m_isDijet
private

Definition at line 148 of file OptionHelper.h.

◆ m_isEtaDepPU

bool jet::OptionHelper::m_isEtaDepPU
private

Definition at line 108 of file OptionHelper.h.

◆ m_isInit

bool jet::OptionHelper::m_isInit
private

Definition at line 105 of file OptionHelper.h.

◆ m_isJER

bool jet::OptionHelper::m_isJER
private

Definition at line 140 of file OptionHelper.h.

◆ m_isLargeR

bool jet::OptionHelper::m_isLargeR
private

Definition at line 139 of file OptionHelper.h.

◆ m_isPublic

bool jet::OptionHelper::m_isPublic
private

Definition at line 107 of file OptionHelper.h.

◆ m_isSmallR

bool jet::OptionHelper::m_isSmallR
private

Definition at line 138 of file OptionHelper.h.

◆ m_isTLA

bool jet::OptionHelper::m_isTLA
private

Definition at line 141 of file OptionHelper.h.

◆ m_largeRjetTagAccept

int jet::OptionHelper::m_largeRjetTagAccept
private

Definition at line 152 of file OptionHelper.h.

◆ m_largeRjetTagResultName

TString jet::OptionHelper::m_largeRjetTagResultName
private

Definition at line 151 of file OptionHelper.h.

◆ m_largeRJetTruthLabel

LargeRJetTruthLabel::TypeEnum jet::OptionHelper::m_largeRJetTruthLabel
private

Definition at line 146 of file OptionHelper.h.

◆ m_logPt

bool jet::OptionHelper::m_logPt
private

Definition at line 126 of file OptionHelper.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_massType

TString jet::OptionHelper::m_massType
private

Definition at line 127 of file OptionHelper.h.

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

int jet::OptionHelper::m_nJetFlavour
private

Definition at line 144 of file OptionHelper.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_onlyCompare

bool jet::OptionHelper::m_onlyCompare
private

Definition at line 154 of file OptionHelper.h.

◆ m_path

TString jet::OptionHelper::m_path
private

Definition at line 112 of file OptionHelper.h.

◆ m_ptBins

TString jet::OptionHelper::m_ptBins
private

Definition at line 131 of file OptionHelper.h.

◆ m_scaleVars

std::vector<CompScaleVar::TypeEnum> jet::OptionHelper::m_scaleVars
private

Definition at line 158 of file OptionHelper.h.

◆ m_specifyTagger

bool jet::OptionHelper::m_specifyTagger
private

Definition at line 121 of file OptionHelper.h.

◆ m_systFilters

std::vector<std::string> jet::OptionHelper::m_systFilters
private

Definition at line 159 of file OptionHelper.h.

◆ m_tagSFname

TString jet::OptionHelper::m_tagSFname
private

Definition at line 150 of file OptionHelper.h.

◆ m_topology

JetTopology::TypeEnum jet::OptionHelper::m_topology
private

Definition at line 160 of file OptionHelper.h.

◆ m_totalUncName

TString jet::OptionHelper::m_totalUncName
private

Definition at line 120 of file OptionHelper.h.

◆ m_truthLabel

int jet::OptionHelper::m_truthLabel
private

Definition at line 145 of file OptionHelper.h.

◆ m_truthLabelMoment

TString jet::OptionHelper::m_truthLabelMoment
private

Definition at line 147 of file OptionHelper.h.

◆ m_twoColumnLegend

bool jet::OptionHelper::m_twoColumnLegend
private

Definition at line 129 of file OptionHelper.h.

◆ m_xAxisRange

std::pair<double,double> jet::OptionHelper::m_xAxisRange
private

Definition at line 124 of file OptionHelper.h.


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