ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
BTaggingTruthTaggingTool Class Reference

#include <BTaggingTruthTaggingTool.h>

Inheritance diagram for BTaggingTruthTaggingTool:
Collaboration diagram for BTaggingTruthTaggingTool:

Classes

struct  jetVariable
 
struct  TagBin
 Create a proper constructor for Athena. More...
 
struct  TRFinfo
 

Public Member Functions

 BTaggingTruthTaggingTool (const std::string &name)
 Create a constructor for standalone usage. More...
 
StatusCode CalculateResults (std::vector< float > &pt, std::vector< float > &eta, std::vector< int > &flav, std::vector< float > &tagw, Analysis::TruthTagResults &results, int rand_seed=-1)
 
StatusCode CalculateResults (const xAOD::JetContainer &jets, Analysis::TruthTagResults &results, int rand_seed=-1)
 
StatusCode CalculateResultsONNX (const std::vector< std::vector< float >> &node_feat, std::vector< float > &tagw, Analysis::TruthTagResults &results, int rand_seed=-1)
 
StatusCode CalculateResultsONNX (const xAOD::JetContainer &jets, const std::vector< std::vector< float >> &node_feat, Analysis::TruthTagResults &results, int rand_seed=-1)
 
StatusCode setEffMapIndex (const std::string &flavour, unsigned int index)
 Declare the interface that the class provides. More...
 
void setUseSystematics (bool useSystematics)
 
virtual ~BTaggingTruthTaggingTool ()
 
StatusCode initialize ()
 Dummy implementation of the initialisation function. More...
 
CP::SystematicSet affectingSystematics () const
 the list of all systematics this tool can be affected by More...
 
StatusCode applySystematicVariation (const CP::SystematicSet &systConfig)
 effects: configure this tool for the given list of systematic variations. More...
 
CP::SystematicSet recommendedSystematics () const
 the list of all systematics this tool recommends to use More...
 
bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 Declare the interface that this class provides. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

enum  NjetsTagStrategy { AllJets =-1, Leading2SignalJets =2, Leading3SignalJets =3 }
 will be set according to m_taggingStrategy More...
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode CalculateResults (TRFinfo &trfinf, Analysis::TruthTagResults &results, int rand_seed=-1)
 
StatusCode setJets (TRFinfo &trfinf, std::vector< float > &pt, std::vector< float > &eta, std::vector< int > &flav, std::vector< float > &tagw)
 
StatusCode setJets (TRFinfo &trfinf, const xAOD::JetContainer &jets)
 
StatusCode setJets (TRFinfo &trfinf, std::vector< int > &flav, std::vector< Analysis::CalibrationDataVariables > *vars)
 
StatusCode setJets (TRFinfo &trfinf, const std::vector< std::vector< float >> &node_feat, std::vector< float > &tagw)
 
StatusCode setJets (TRFinfo &trfinf, const xAOD::JetContainer &jets, const std::vector< std::vector< float >> &node_feat)
 
StatusCode setJets (TRFinfo &trfinf, std::vector< int > &flav, const std::vector< Analysis::CalibrationDataVariables > *vars, const std::vector< std::vector< float >> &node_feat)
 
StatusCode GetTruthTagWeights (TRFinfo &trfinf, std::vector< float > &trf_weight_ex, std::vector< float > &trf_weight_in)
 
StatusCode getTagPermutation (TRFinfo &trfinf, std::vector< std::vector< bool > > &trf_chosen_perm_ex, std::vector< std::vector< bool > > &trf_chosen_perm_in)
 
StatusCode getQuantiles (TRFinfo &trfinf, std::vector< std::vector< int > > &trf_bin_ex, std::vector< std::vector< int > > &trf_bin_in)
 
float getEvtSF (TRFinfo &trfinf, std::vector< int > &quantiles)
 
StatusCode getDirectTaggedJets (TRFinfo &trfinf, std::vector< bool > &is_tagged)
 
StatusCode getTRFweight (TRFinfo &trfinf, unsigned int nbtag, bool isInclusive)
 
StatusCode getAllEffMC (TRFinfo &trfinf)
 
StatusCode getAllEffMCCDI (TRFinfo &trfinf)
 
StatusCode getAllEffMCGNN (TRFinfo &trfinf)
 
StatusCode getAllEffSF (TRFinfo &trfinf, int=0)
 
int jetFlavourLabel (const xAOD::Jet &jet)
 
int GAFinalHadronFlavourLabel (const xAOD::Jet &jet)
 
int ExclusiveConeHadronFlavourLabel (const xAOD::Jet &jet)
 
std::vector< std::string > split (const std::string &str, char token)
 
StatusCode check_syst_range (unsigned int sys)
 
std::vector< std::vector< bool > > generatePermutations (int njets, int tags, int start=0)
 
float trfWeight (TRFinfo &trfinf, const std::vector< bool > &tags)
 
StatusCode chooseAllTagPermutation (TRFinfo &trfinf, unsigned int nbtag)
 
StatusCode chooseTagPermutation (TRFinfo &trfinf, unsigned int nbtag, bool isIncl)
 
StatusCode chooseAllTagBins (TRFinfo &trfinf)
 
StatusCode chooseTagBins_cum (TRFinfo &trfinf, std::vector< bool > &tagconf, bool isIncl, unsigned int nbtag)
 
StatusCode generateRandomTaggerScores (std::vector< std::vector< int > > &quantiles, std::vector< std::vector< float > > &btag_scores, std::vector< std::vector< float > > &ctag_scores)
 
float getTagBinsConfProb (TRFinfo &trfinf, std::vector< int > &tagws)
 
StatusCode fillVariables (const xAOD::Jet &jet, Analysis::CalibrationDataVariables &x)
 
StatusCode fillVariables (const float jetPt, const float jetEta, const float jetTagWeight, Analysis::CalibrationDataVariables &x)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::vector< std::string > m_availableOP_fixCut = {"FixedCutBEff_85", "FixedCutBEff_77","FixedCutBEff_70","FixedCutBEff_60"}
 
TFile * m_inf
 
std::vector< TagBinm_cuts
 
bool m_initialised
 
std::vector< CP::SystematicSetm_eff_syst
 
std::vector< std::string > m_sys_name
 
std::string m_SFFile
 name of the data/MC efficiency scale factor calibration file (may be changed by the PathResolver) More...
 
std::string m_EffFile
 name of the optional MC efficiency file (may be changed by the PathResolver) More...
 
std::string m_SFBName
 name of the data/MC scale factor calibration for b jets More...
 
std::string m_SFCName
 name of the data/MC scale factor calibration for charm jets More...
 
std::string m_SFTName
 name of the data/MC scale factor calibration for tau jets More...
 
std::string m_SFLightName
 name of the data/MC scale factor calibration for light-flavour jets More...
 
std::string m_EVReductionB
 specification of the eigenvector reduction strategy for b jets (if eigenvectors are used) More...
 
std::string m_EVReductionC
 specification of the eigenvector reduction strategy for c jets (if eigenvectors are used) More...
 
std::string m_EVReductionLight
 specification of the eigenvector reduction strategy for light-flavour jets (if eigenvectors are used) More...
 
std::string m_EffBName
 semicolon-separated list of MC efficiency parametrisation names for b jets More...
 
std::string m_EffCName
 semicolon-separated list of MC efficiency parametrisation names for charm jets More...
 
std::string m_EffTName
 semicolon-separated list of MC efficiency parametrisation names for tau jets More...
 
std::string m_EffLightName
 semicolon-separated list of MC efficiency parametrisation names for light-flavour jets More...
 
std::string m_excludeFromEV
 semicolon-separated list of uncertainties to be excluded from the eigenvector variation procedure More...
 
std::string m_taggerName
 tagger name More...
 
std::string m_OP
 operating point More...
 
std::string m_cutBenchmark
 operating point when running in Continuous More...
 
std::string m_jetAuthor
 jet collection name More...
 
std::string m_systStrategy
 systematics model to be used (current choices are "SFEigen" and "Envelope") More...
 
bool m_useDevFile
 if true, attempt to retrieve the data/MC efficiency scale factor calibration files from the @PathResolver development area More...
 
bool m_coneFlavourLabel
 if true, use cone-based labelling (as opposed to ghost association) More...
 
std::string m_excludeEV
 in case of continuous WP you can choose to ignore some of the eigenvectors More...
 
bool m_doDirectTag
 possibility to compute the direct tagging SFs map directly from the TruthTaggingTool More...
 
std::string m_pathToONNX
 if this string is empty, the onnx tool won't be used More...
 
std::string m_taggingStrategy
 tagging strategy is required to do TT with GNN, when we don't want to truth tag all the jets (eg. 'leading2SignalJets')
More...
 
NjetsTagStrategy m_njetsTagStrategy
 
float m_maxEta
 
float m_minPt
 
float m_maxRangePt
 
bool m_doOnlyUpVariations
 
bool m_ignoreSF
 
bool m_usePerm
 
bool m_useQuntile
 
bool m_continuous
 
bool m_continuous2D
 
bool m_useSys
 
int m_nbtag
 
int m_nbins
 
std::vector< int > m_OperatingBins
 
unsigned int m_OP_index_for_GNN
 
std::map< int, asg::AnaToolHandle< IBTaggingEfficiencyTool > > m_effTool_allBins
 
asg::AnaToolHandle< IBTaggingEfficiencyToolm_effTool
 
asg::AnaToolHandle< IBTaggingSelectionToolm_selTool
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Tool to apply flavour-tagging requirements on jets @modified by Ilaria Luise, Nilotpal Kakati in March 2022

Author
C. Rizzi, M. Ughetto @contact chiar.nosp@m.a.ri.nosp@m.zzi@c.nosp@m.ern..nosp@m.ch, mughe.nosp@m.tto@.nosp@m.cern..nosp@m.ch @contact ilari.nosp@m.a.lu.nosp@m.ise@c.nosp@m.ern..nosp@m.ch, nkaka.nosp@m.ti@c.nosp@m.ern.c.nosp@m.h

Definition at line 46 of file BTaggingTruthTaggingTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ NjetsTagStrategy

will be set according to m_taggingStrategy

Enumerator
AllJets 
Leading2SignalJets 
Leading3SignalJets 

Definition at line 259 of file BTaggingTruthTaggingTool.h.

Constructor & Destructor Documentation

◆ BTaggingTruthTaggingTool()

BTaggingTruthTaggingTool::BTaggingTruthTaggingTool ( const std::string &  name)

Create a constructor for standalone usage.

Definition at line 39 of file BTaggingTruthTaggingTool.cxx.

40  : asg::AsgTool( name ),
41  m_effTool ("BTaggingEfficiencyTool/effTool", this),
42  m_selTool ("BTaggingSelectionTool/selTool", this)
43  {
44 
45  m_initialised = false;
46 
47  // properties of BTaggingTruthTaggingTool
48  declareProperty( "IgnoreScaleFactors", m_ignoreSF=true, "ignore scale factors in computation of TRF weight");
49  declareProperty( "UsePermutations", m_usePerm=true, "if the chosen permutation is used, a reweighting is applied to the TRF weight for systematics");
50  declareProperty( "UseQuantile", m_useQuntile=true, "if the chosen quantile is used, a reweighting is applied to the TRF weight for systematics");
51  declareProperty( "UseSystematics", m_useSys=false, "will the results contain all systematic variations, or just the nominal");
52  declareProperty( "MaxNtagged", m_nbtag=2, "what is the maximal possible number of tagged jets");
53 
54  // properties of BtaggingSelectionTool
55  declareProperty( "MaxEta", m_maxEta = 2.5 );
56  declareProperty( "MinPt", m_minPt = 20000 /*MeV*/);
57  declareProperty( "MaxRangePt", m_maxRangePt = 1000000 /*MeV*/);
58 
59  // properties of BTaggingEfficiencyTool
60  declareProperty("TaggerName", m_taggerName="MV2c10", "tagging algorithm name as specified in CDI file");
61  declareProperty("OperatingPoint", m_OP="FixedCutBEff_77", "operating point as specified in CDI file");
62  declareProperty("JetAuthor", m_jetAuthor="AntiKt4EMTopoJets", "jet collection & JVF/JVT specification in CDI file");
63  declareProperty("ScaleFactorFileName", m_SFFile = "xAODBTaggingEfficiency/13TeV/2016-20_7-13TeV-MC15-CDI-July12_v1.root", "name of the official scale factor calibration CDI file (uses PathResolver)");
64  declareProperty("UseDevelopmentFile", m_useDevFile = false, "specify whether or not to use the (PathResolver) area for temporary scale factor calibration CDI files");
65  declareProperty("EfficiencyFileName", m_EffFile = "", "name of optional user-provided MC efficiency CDI file");
66  declareProperty("ScaleFactorBCalibration", m_SFBName = "default", "name of b-jet scale factor calibration object");
67  declareProperty("ScaleFactorCCalibration", m_SFCName = "default", "name of c-jet scale factor calibration object");
68  declareProperty("ScaleFactorTCalibration", m_SFTName = "default", "name of tau-jet scale factor calibration object");
69  declareProperty("ScaleFactorLightCalibration", m_SFLightName = "default", "name of light-flavour jet scale factor calibration object");
70  declareProperty("EigenvectorReductionB", m_EVReductionB = "Loose", "b-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'");
71  declareProperty("EigenvectorReductionC", m_EVReductionC = "Loose", "c-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'");
72  declareProperty("EigenvectorReductionLight", m_EVReductionLight = "Loose","light-flavour jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'");
73  declareProperty("EfficiencyBCalibrations", m_EffBName = "default", "(semicolon-separated) name(s) of b-jet efficiency object(s)");
74  declareProperty("EfficiencyCCalibrations", m_EffCName = "default", "(semicolon-separated) name(s) of c-jet efficiency object(s)");
75  declareProperty("EfficiencyTCalibrations", m_EffTName = "default", "(semicolon-separated) name(s) of tau-jet efficiency object(s)");
76  declareProperty("EfficiencyLightCalibrations", m_EffLightName = "default", "(semicolon-separated) name(s) of light-flavour-jet efficiency object(s)");
77  declareProperty("ExcludeFromEigenVectorTreatment", m_excludeFromEV = "", "(semicolon-separated) names of uncertainties to be excluded from eigenvector decomposition (if used)");
78  declareProperty("SystematicsStrategy", m_systStrategy = "SFEigen", "name of systematics model; presently choose between 'SFEigen' and 'Envelope'");
79  declareProperty("ConeFlavourLabel", m_coneFlavourLabel = true, "specify whether or not to use the cone-based flavour labelling instead of the default ghost association based labelling");
80  declareProperty("CutBenchmark", m_cutBenchmark = "1,2", "if you want to run in continuous you need to fix a benchmark - it does something only if running in Continuous OP");
81  declareProperty("ExcludeSpecificEigens", m_excludeEV = "" , "(semicolon-separated) names of Eigens you want to exclude. in case of continuous some eigenvectors can be ignored to make the computation faster");
82  declareProperty("StoreOnlyUpVariations", m_doOnlyUpVariations = false , "If set to true it processes only the __1up b-tagging variations. It speeds up the computation in case of symmetric variations.");
83  declareProperty("doDirectTagging", m_doDirectTag = false , "If set to true it also computes and stores the direct tagging choice and the related SFs for each jet");
84  // if it is empty, the onnx tool won't be initialised
85  declareProperty( "pathToONNX", m_pathToONNX = "", "path to the onnx file that will be used for inference");
86  declareProperty( "TaggingStrategy", m_taggingStrategy = "AllJets", "tagging strategy in the Analysis (eg. 'leading2SignalJets' in boosted VHbb). Required to do TT with GNN");
87 }

◆ ~BTaggingTruthTaggingTool()

BTaggingTruthTaggingTool::~BTaggingTruthTaggingTool ( )
virtual

Definition at line 1101 of file BTaggingTruthTaggingTool.cxx.

1101  {
1102 
1103  // delete trfinf.jets;
1104 
1105 }

Member Function Documentation

◆ affectingSystematics()

SystematicSet BTaggingTruthTaggingTool::affectingSystematics ( ) const
virtual

the list of all systematics this tool can be affected by

Implements CP::IReentrantSystematicsTool.

Definition at line 100 of file BTaggingTruthTaggingTool.cxx.

100  {
102 }

◆ applySystematicVariation()

StatusCode BTaggingTruthTaggingTool::applySystematicVariation ( const CP::SystematicSet systConfig)
virtual

effects: configure this tool for the given list of systematic variations.

any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors

Implements CP::ISystematicsTool.

Definition at line 104 of file BTaggingTruthTaggingTool.cxx.

105 {
106  for (auto syst : systConfig) {
107  CP::SystematicSet myset;
108  ATH_MSG_WARNING("applySystematicVariation was called for " << syst.name() << " but BTaggingTruthTaggingTool does not apply Systematic Variations");
109  //the truth tagging tool provides results for all possible systematic variations in its results objects, the user does not need to call each one seperatly.
110  }
111  return StatusCode::SUCCESS;
112 }

◆ CalculateResults() [1/3]

StatusCode BTaggingTruthTaggingTool::CalculateResults ( const xAOD::JetContainer jets,
Analysis::TruthTagResults results,
int  rand_seed = -1 
)
virtual

Implements IBTaggingTruthTaggingTool.

Definition at line 569 of file BTaggingTruthTaggingTool.cxx.

569  {
570 
572 
573  TRFinfo trfinf;
574 
575  ANA_CHECK(setJets(trfinf,jets));
576 
577  return CalculateResults(trfinf,results,rand_seed);
578 }

◆ CalculateResults() [2/3]

StatusCode BTaggingTruthTaggingTool::CalculateResults ( std::vector< float > &  pt,
std::vector< float > &  eta,
std::vector< int > &  flav,
std::vector< float > &  tagw,
Analysis::TruthTagResults results,
int  rand_seed = -1 
)
virtual

Implements IBTaggingTruthTaggingTool.

Definition at line 558 of file BTaggingTruthTaggingTool.cxx.

558  {
559 
561 
562  TRFinfo trfinf;
563 
564  ANA_CHECK(setJets(trfinf,pt, eta, flav, tagw));
565 
566  return CalculateResults(trfinf,results,rand_seed);
567 }

◆ CalculateResults() [3/3]

StatusCode BTaggingTruthTaggingTool::CalculateResults ( TRFinfo trfinf,
Analysis::TruthTagResults results,
int  rand_seed = -1 
)
private

Definition at line 477 of file BTaggingTruthTaggingTool.cxx.

477  {
479  results.clear();
480 
481  if(rand_seed!=-1){
482  trfinf.rand.SetSeed(rand_seed);
483  }
484 
485  std::vector<float> trf_weight_ex, trf_weight_in;
486 
487  trf_weight_ex.clear();
488  trf_weight_in.clear();
489 
490  ANA_CHECK(GetTruthTagWeights(trfinf, trf_weight_ex, trf_weight_in));
491 
492  ANA_CHECK(getTagPermutation(trfinf,results.trf_chosen_perm_ex,results.trf_chosen_perm_in));
493 
494  //modify quantiles according to the different conventions
495  ANA_CHECK(getQuantiles(trfinf,results.trf_bin_ex, results.trf_bin_in));
496 
497  //new tagger scores
498  ANA_CHECK(generateRandomTaggerScores(results.trf_bin_ex, results.trf_bin_score_ex, results.trf_ctag_bin_score_ex));
499  ANA_CHECK(generateRandomTaggerScores(results.trf_bin_in, results.trf_bin_score_in, results.trf_ctag_bin_score_in));
500 
501  //direct tag
502  if(m_doDirectTag)
503  ANA_CHECK( getDirectTaggedJets(trfinf, results.is_tagged) );
504 
505  //handle systematics
506  unsigned int n_systs = (m_useSys) ? m_eff_syst.size() : 1;
507  results.syst_names.clear();
508 
509  for(unsigned int sys = 0; sys < n_systs; ++sys){
510  if(sys!=0 && m_useSys) {
512  }
513 
514  results.syst_names.push_back(m_sys_name.at(sys));
515 
516  results.map_trf_weight_ex[m_sys_name.at(sys)].resize(trfinf.trfw_ex.size());
517  results.map_trf_weight_in[m_sys_name.at(sys)].resize(trfinf.trfw_in.size());
518 
519  results.map_SF_ex[m_sys_name.at(sys)].resize(trfinf.trfw_ex.size());
520  results.map_SF_in[m_sys_name.at(sys)].resize(trfinf.trfw_in.size());
521 
522  //direct tagging
523  if(m_doDirectTag){
524  std::vector<int> is_tagged;
525  for(auto t : results.is_tagged){
526  is_tagged.push_back(static_cast<int>(t));
527  }
528  results.map_SF[m_sys_name.at(sys)]=getEvtSF(trfinf,is_tagged);
529  }
530 
531  //go over the ntag combinations.
532  //ntj = number of tagged jets
533  for(unsigned int ntj=0; ntj< trfinf.trfw_ex.size(); ntj++){
534  if(ntj > trfinf.njets) {
535  results.map_SF_ex[m_sys_name.at(sys)].at(ntj) = 1.;
536  results.map_SF_in[m_sys_name.at(sys)].at(ntj) = 1.;
537  ATH_MSG_DEBUG("number of jets: " <<trfinf.njets <<" less than max btag: " <<m_nbtag <<". Return BTag SF = 1. Consider applying an event pre-selection if this happens too often.");
538  }
539  else{
540  results.map_SF_ex[m_sys_name.at(sys)].at(ntj) = getEvtSF(trfinf,results.trf_bin_ex.at(ntj));
541  results.map_SF_in[m_sys_name.at(sys)].at(ntj) = getEvtSF(trfinf,results.trf_bin_in.at(ntj));
542  }
543 
544  results.map_trf_weight_ex[m_sys_name.at(sys)].at(ntj) = trfinf.trfw_ex.at(ntj) * results.map_SF_ex[m_sys_name.at(sys)].at(ntj);
545  results.map_trf_weight_in[m_sys_name.at(sys)].at(ntj) = trfinf.trfw_in.at(ntj) * results.map_SF_in[m_sys_name.at(sys)].at(ntj);
546  }
547  }
548 
549  if(m_useSys) { // reset syst to nominal
550  CP::SystematicSet defaultSet;
552  }
553 
554  return StatusCode::SUCCESS;
555 
556 }

◆ CalculateResultsONNX() [1/2]

StatusCode BTaggingTruthTaggingTool::CalculateResultsONNX ( const std::vector< std::vector< float >> &  node_feat,
std::vector< float > &  tagw,
Analysis::TruthTagResults results,
int  rand_seed = -1 
)
virtual

Implements IBTaggingTruthTaggingTool.

Definition at line 581 of file BTaggingTruthTaggingTool.cxx.

581  {
582 
584 
585  TRFinfo trfinf;
586 
587  ANA_CHECK(setJets(trfinf, node_feat, tagw));
588 
589  return CalculateResults(trfinf, results, rand_seed);
590 }

◆ CalculateResultsONNX() [2/2]

StatusCode BTaggingTruthTaggingTool::CalculateResultsONNX ( const xAOD::JetContainer jets,
const std::vector< std::vector< float >> &  node_feat,
Analysis::TruthTagResults results,
int  rand_seed = -1 
)
virtual

Implements IBTaggingTruthTaggingTool.

Definition at line 593 of file BTaggingTruthTaggingTool.cxx.

593  {
594 
596 
597  TRFinfo trfinf;
598 
599  ANA_CHECK(setJets(trfinf, jets, node_feat));
600 
601  return CalculateResults(trfinf, results, rand_seed);
602 }

◆ check_syst_range()

StatusCode BTaggingTruthTaggingTool::check_syst_range ( unsigned int  sys)
private

Definition at line 1093 of file BTaggingTruthTaggingTool.cxx.

1093  {
1094  if(sys < m_eff_syst.size()) return StatusCode::SUCCESS;
1095  ATH_MSG_ERROR(sys << " Out of range of available systematics");
1096  return StatusCode::FAILURE;
1097 }

◆ chooseAllTagBins()

StatusCode BTaggingTruthTaggingTool::chooseAllTagBins ( TRFinfo trfinf)
private

Definition at line 920 of file BTaggingTruthTaggingTool.cxx.

920  {
922  trfinf.tbins_ex.clear();
923  trfinf.tbins_in.clear();
924  trfinf.tbins_ex.resize( trfinf.trfw_ex.size());
925  trfinf.tbins_in.resize( trfinf.trfw_in.size());
926 
927  trfinf.binsprob_ex.clear();
928  trfinf.binsprob_in.clear();
929  trfinf.binsprob_ex.resize( trfinf.trfw_ex.size());
930  trfinf.binsprob_in.resize( trfinf.trfw_in.size());
931 
932  if(trfinf.perm_ex.size() != trfinf.perm_in.size()) ATH_MSG_WARNING("Different sizes in exclusive and inclusive permutation choices");
933 
934  for(unsigned int nb=0; nb<trfinf.perm_ex.size(); nb++) {
935  ANA_CHECK(chooseTagBins_cum(trfinf,trfinf.perm_ex.at(nb), false, nb));
936  ANA_CHECK(chooseTagBins_cum(trfinf,trfinf.perm_in.at(nb), true, nb));
937  }
938  return StatusCode::SUCCESS;
939 }

◆ chooseAllTagPermutation()

StatusCode BTaggingTruthTaggingTool::chooseAllTagPermutation ( TRFinfo trfinf,
unsigned int  nbtag 
)
private

Definition at line 825 of file BTaggingTruthTaggingTool.cxx.

825  {
826 
828 
829  if(!m_usePerm){
830  return StatusCode::FAILURE;
831  }
832 
833  unsigned int njets = trfinf.njets;
834  unsigned int limit = (njets > 7) ? 8 : njets+1;
835  unsigned int max = (njets < nbtag+1) ? limit : nbtag+1;
836 
837  trfinf.perm_ex.clear(), trfinf.perm_ex.resize(nbtag+1);
838  trfinf.perm_in.clear(), trfinf.perm_in.resize(nbtag+1);
839 
840  trfinf.permprob_ex.clear(), trfinf.permprob_ex.resize(nbtag+1);
841  trfinf.permprob_in.clear(), trfinf.permprob_in.resize(nbtag+1);
842 
843  for(unsigned int i=0; i<max; i++) { // need +1 as 0 is included
844  ANA_CHECK(chooseTagPermutation(trfinf,i,false));
845  ANA_CHECK(chooseTagPermutation(trfinf,i,true));
846  }
847 
848  return StatusCode::SUCCESS;
849 }

◆ chooseTagBins_cum()

StatusCode BTaggingTruthTaggingTool::chooseTagBins_cum ( TRFinfo trfinf,
std::vector< bool > &  tagconf,
bool  isIncl,
unsigned int  nbtag 
)
private

Definition at line 942 of file BTaggingTruthTaggingTool.cxx.

942  {
943  std::vector<int> btagops;
944 
945  ATH_MSG_DEBUG("chooseTagBins_cum ntag: " <<nbtag);
946 
947  std::vector<float> incl;
948  std::vector<float> untagged_bins;
949  float prob = 1.;
950 
951  //define the untagged bins
952  for (int bin=0; bin<m_nbins; bin++) {
953  if (std::count(m_OperatingBins.begin(), m_OperatingBins.end(), bin)) continue;
954  untagged_bins.push_back(bin);
955  }
956 
957  //How to calculate Probabilities:
958  //sum: [---- P(bin 0) -----][-- P(bin 1) ---][- P(bin 2) -]
959  //random X up to sum of the bins. pick one prob based on the efficiency
960  for(unsigned int j=0; j<tagconf.size(); j++) {
961 
962  ATH_MSG_DEBUG("tagconf.at(tc) " <<tagconf.at(j));
963 
964  if(tagconf.at(j)) { // tagged jet
965  float sum=0.;
966  incl.clear();
967  for (int tagged_bin : m_OperatingBins){
968  sum += trfinf.effMC_allBins[tagged_bin][j];
969  incl.push_back(sum);
970  }
971 
972  float theX = trfinf.rand.Uniform(sum);
973  auto tag_index = std::lower_bound(incl.begin(), incl.end(), theX) - incl.begin();
974  float tbin_choice = m_OperatingBins[tag_index];
975  btagops.push_back(tbin_choice);
976  prob *= (trfinf.effMC_allBins[tbin_choice][j]);
977  ATH_MSG_DEBUG("it " <<tag_index <<" theX " <<theX <<" effMC " <<trfinf.effMC_allBins[tbin_choice][j] <<" prob* " <<prob);
978  } //tagged
979  else { // untagged jet
980  float untag_sum = 0. ;
981  incl.clear();
982  //sum over untagged bins
983  for(auto bin : untagged_bins){
984  untag_sum += trfinf.effMC_allBins[bin][j];
985  incl.push_back(untag_sum);
986  }
987 
988  float theX = trfinf.rand.Uniform(untag_sum);
989  auto untag_index = std::lower_bound(incl.begin(), incl.end(), theX) - incl.begin();
990  float utbin_choice = untagged_bins[untag_index];
991  btagops.push_back(utbin_choice);
992  prob *= 1 - trfinf.effMC_allBins[utbin_choice][j];
993  ATH_MSG_DEBUG(" unt_bin " <<untag_index <<" theX " <<theX<<" 1-effMC " <<1-trfinf.effMC_allBins[utbin_choice][j] <<" prob* " <<prob);
994  }
995  }
996 
997  if(btagops.size() != tagconf.size()) {
998  ATH_MSG_ERROR("You should not be here -> wrong size of tag bins vector. btagops: " <<btagops.size() <<" tagconf: " <<tagconf.size());
999  return StatusCode::FAILURE;
1000  }
1001  if(isIncl) {
1002  trfinf.tbins_in.at(nbtag) = btagops;
1003  trfinf.binsprob_in.at(nbtag) = prob;
1004  ATH_MSG_DEBUG("incl, nbtag " << nbtag << " prob " << prob);
1005  }
1006  else {
1007  trfinf.tbins_ex.at(nbtag) = btagops;
1008  trfinf.binsprob_ex.at(nbtag) = prob;
1009  ATH_MSG_DEBUG("excl, nbtag " << nbtag << " prob " << prob);
1010  }
1011  return StatusCode::SUCCESS;
1012 }

◆ chooseTagPermutation()

StatusCode BTaggingTruthTaggingTool::chooseTagPermutation ( TRFinfo trfinf,
unsigned int  nbtag,
bool  isIncl 
)
private

Definition at line 851 of file BTaggingTruthTaggingTool.cxx.

851  {
852  std::vector<float> incl;
853  std::vector<std::pair<unsigned int, unsigned int> > trackPerm;
854  float sum = 0;
855  if(isIncl) {
856  for(unsigned int itag=nbtag; itag < trfinf.permsWeight.size(); itag++) {
857  for(unsigned int ip = 0; ip < trfinf.permsWeight.at(itag).size(); ip++) {
858  sum += trfinf.permsWeight.at(itag).at(ip);
859  incl.push_back(sum);
860  trackPerm.push_back(std::make_pair(itag,ip));
861  }
862  }
863  }
864  else { // in exclusive case
865  sum = trfinf.permsSumWeight.at(nbtag).back();
866  incl = trfinf.permsSumWeight.at(nbtag);
867  for(unsigned int ip = 0; ip < trfinf.permsSumWeight.at(nbtag).size(); ip++) trackPerm.push_back(std::make_pair(nbtag,ip));
868  }
869  float theX = trfinf.rand.Uniform(sum);
870  for(unsigned int ip=0; ip < incl.size(); ip++) {
871  ATH_MSG_DEBUG("incl.at(ip): " << incl.at(ip) << " theX: " << theX);
872  if(incl.at(ip) >= theX) {
873  if(isIncl) {
874  trfinf.perm_in.at(nbtag) = trfinf.perms[trfinf.njets].at(trackPerm.at(ip).first).at(trackPerm.at(ip).second);
875  trfinf.permprob_in.at(nbtag) = trfinf.permsWeight.at(trackPerm.at(ip).first).at(trackPerm.at(ip).second) / trfinf.trfw_in.at(nbtag);
876  }
877  else {
878  trfinf.perm_ex.at(nbtag) = trfinf.perms[trfinf.njets].at(trackPerm.at(ip).first).at(trackPerm.at(ip).second);
879  trfinf.permprob_ex.at(nbtag) = trfinf.permsWeight.at(trackPerm.at(ip).first).at(trackPerm.at(ip).second) / trfinf.trfw_ex.at(nbtag);
880  }
881  return StatusCode::SUCCESS;
882  }
883  }
884  return StatusCode::SUCCESS;
885 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ ExclusiveConeHadronFlavourLabel()

int BTaggingTruthTaggingTool::ExclusiveConeHadronFlavourLabel ( const xAOD::Jet jet)
private

Definition at line 1132 of file BTaggingTruthTaggingTool.cxx.

1132  {
1133  // default label means "invalid"
1134  int label = -1;
1135  // We don't check the return value, as we would not be able to handle it gracefully anyway
1136  jet.getAttribute("HadronConeExclTruthLabelID",label);
1137  return label;
1138 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillVariables() [1/2]

StatusCode BTaggingTruthTaggingTool::fillVariables ( const float  jetPt,
const float  jetEta,
const float  jetTagWeight,
Analysis::CalibrationDataVariables x 
)
private

Definition at line 450 of file BTaggingTruthTaggingTool.cxx.

450  {
451  x.jetPt = jetPt;
452  x.jetEta = jetEta;
453  x.jetTagWeight = jetTagWeight;
454  x.jetAuthor = m_jetAuthor;
455  return StatusCode::SUCCESS;
456 }

◆ fillVariables() [2/2]

StatusCode BTaggingTruthTaggingTool::fillVariables ( const xAOD::Jet jet,
Analysis::CalibrationDataVariables x 
)
private

Definition at line 433 of file BTaggingTruthTaggingTool.cxx.

433  {
434  x.jetPt = jet.pt();
435  x.jetEta = jet.eta();
436  x.jetAuthor = m_jetAuthor;
437 
439  if (!tagInfo) return StatusCode::FAILURE;
440 
441  CorrectionCode code = m_selTool->getTaggerWeight(jet, x.jetTagWeight);
442  if(!(code==CorrectionCode::Ok || code==CorrectionCode::OutOfValidityRange)){
443  ATH_MSG_ERROR("BTaggingSelectionTool::getTaggerWeight returned CorrectionCode::Error");
444  return StatusCode::FAILURE;
445  }
446 
447  return StatusCode::SUCCESS;
448 }

◆ GAFinalHadronFlavourLabel()

int BTaggingTruthTaggingTool::GAFinalHadronFlavourLabel ( const xAOD::Jet jet)
private

Definition at line 1115 of file BTaggingTruthTaggingTool.cxx.

1115  {
1116 
1117  const std::string labelB = "GhostBHadronsFinal";
1118  const std::string labelC = "GhostCHadronsFinal";
1119  const std::string labelTau = "GhostTausFinal";
1120 
1121  std::vector<const IParticle*> ghostB;
1122  if (jet.getAssociatedObjects<IParticle>(labelB, ghostB) && ghostB.size() > 0) return 5;
1123  std::vector<const IParticle*> ghostC;
1124  if (jet.getAssociatedObjects<IParticle>(labelC, ghostC) && ghostC.size() > 0) return 4;
1125  std::vector<const IParticle*> ghostTau;
1126  if (jet.getAssociatedObjects<IParticle>(labelTau, ghostTau) && ghostTau.size() > 0) return 15;
1127 
1128 
1129  return 0;
1130 }

◆ generatePermutations()

std::vector< std::vector< bool > > BTaggingTruthTaggingTool::generatePermutations ( int  njets,
int  tags,
int  start = 0 
)
private

Definition at line 680 of file BTaggingTruthTaggingTool.cxx.

680  {
681  std::vector<std::vector<bool> > perm;
682  std::vector<std::vector<bool> > temp_perm;
683  if(tags==0){
684  std::vector<bool> tags(njets,false);
685  perm.push_back(tags);
686  }
687  else if(tags == njets) {
688  std::vector<bool> tags(njets,true);
689  perm.push_back(tags);
690  }
691  else {
692  for(int i=start; i<njets;i++){
693  temp_perm = generatePermutations(njets,tags-1,i+1);
694  for(unsigned int j=0; j<temp_perm.size(); j++){
695  temp_perm.at(j).at(i)=true;
696  perm.push_back(temp_perm.at(j));
697  }
698  }
699  }
700  return perm;
701 }

◆ generateRandomTaggerScores()

StatusCode BTaggingTruthTaggingTool::generateRandomTaggerScores ( std::vector< std::vector< int > > &  quantiles,
std::vector< std::vector< float > > &  btag_scores,
std::vector< std::vector< float > > &  ctag_scores 
)
private

Definition at line 1169 of file BTaggingTruthTaggingTool.cxx.

1169  {
1170 
1171  TRandom3 random;
1172 
1173  btag_scores.clear();
1174  btag_scores.resize(quantiles.size());
1175 
1176  if(m_continuous2D){
1177  ctag_scores.clear();
1178  ctag_scores.resize(quantiles.size());
1179  }
1180 
1181  for(unsigned int i=0; i <quantiles.size(); i++ ){
1182 
1183  btag_scores.at(i).resize(quantiles.at(i).size());
1184  if(m_continuous2D)
1185  ctag_scores.at(i).resize(quantiles.at(i).size());
1186 
1187  unsigned int njets = quantiles.at(i).size();
1188  for(unsigned int j=0; j < njets; j++ ){
1189 
1190  int temp_quantile = (m_continuous2D) ? quantiles.at(i).at(j) : quantiles.at(i).at(j) -1;
1191 
1192  float btag_low = m_cuts[temp_quantile].bcut_low;
1193  float btag_hig = m_cuts[temp_quantile].bcut_hig;
1194 
1195  float ctag_low = m_cuts[temp_quantile].ccut_low;
1196  float ctag_hig = m_cuts[temp_quantile].ccut_hig;
1197 
1198  btag_scores.at(i).at(j) = btag_low + random.Uniform()*(btag_hig - btag_low );
1199  if(m_continuous2D)
1200  ctag_scores.at(i).at(j) = ctag_low + random.Uniform()*(ctag_hig - ctag_low );
1201  }
1202  }
1203  return StatusCode::SUCCESS;
1204 
1205 }

◆ getAllEffMC()

StatusCode BTaggingTruthTaggingTool::getAllEffMC ( TRFinfo trfinf)
private

Definition at line 604 of file BTaggingTruthTaggingTool.cxx.

604  {
605  if (trfinf.node_feat.size() == 0){
606  return getAllEffMCCDI(trfinf);
607  } else {
608  return getAllEffMCGNN(trfinf);
609  }
610 }

◆ getAllEffMCCDI()

StatusCode BTaggingTruthTaggingTool::getAllEffMCCDI ( TRFinfo trfinf)
private

Definition at line 648 of file BTaggingTruthTaggingTool.cxx.

648  {
649 
650  float eff_all =1.;
651  for(int bin = 0; bin < m_nbins; bin++)
652  trfinf.effMC_allBins[bin].clear();
653 
654  for(size_t jet=0; jet < trfinf.jets.size(); jet++){
655  for(int bin = 0; bin < m_nbins; bin++){ // loop on bins
656  eff_all=1.;
657 
658  //set a dumb value of the truth tag weight to get the different efficiency maps for each bin. to be improved..
659  if (m_continuous2D)
660  trfinf.jets.at(jet).vars.jetTagWeight = bin+0.5;
661  else
662  trfinf.jets.at(jet).vars.jetTagWeight = (m_cuts[bin].bcut_low + m_cuts[bin].bcut_hig)/2.;
663 
664  ATH_MSG_DEBUG("effMC_allBins: tag bin: " <<bin <<" tagw: " << trfinf.jets.at(jet).vars.jetTagWeight <<" " <<m_cuts[bin].bcut_low <<" " << m_cuts[bin].bcut_hig <<" " <<trfinf.jets.at(jet).vars.jetPt <<" " <<trfinf.jets.at(jet).vars.jetEta <<" " <<trfinf.jets.at(jet).flav);
665  //get the efficiency
666  CorrectionCode code = m_effTool->getMCEfficiency(trfinf.jets.at(jet).flav, trfinf.jets.at(jet).vars, eff_all);
667  if(!(code==CorrectionCode::Ok || code==CorrectionCode::OutOfValidityRange)){
668  ATH_MSG_ERROR("BTaggingEfficiencyTool::getMCEfficiency returned CorrectionCode::Error");
669  return StatusCode::FAILURE;
670  }
671 
672  trfinf.effMC_allBins[bin].push_back(eff_all);
673  ATH_MSG_DEBUG("effMC_allBins: tag bin: " <<bin <<" tagw: " << trfinf.jets.at(jet).vars.jetTagWeight <<" eff: " <<eff_all);
674  } // end loop on bins
675  } // end loop on jets
676 
677  return StatusCode::SUCCESS;
678 }

◆ getAllEffMCGNN()

StatusCode BTaggingTruthTaggingTool::getAllEffMCGNN ( TRFinfo trfinf)
private

Definition at line 613 of file BTaggingTruthTaggingTool.cxx.

613  {
614 
615  for(int bin = 0; bin < m_nbins; bin++)
616  trfinf.effMC_allBins[bin].clear();
617 
618  //extract efficiency
619  std::vector<std::vector<float>> tmp_effMC_allBins; // shape:{num_jets, num_wp}
620  CorrectionCode code = m_effTool->getMCEfficiencyONNX(trfinf.node_feat, tmp_effMC_allBins);
621 
622  if(!(code==CorrectionCode::Ok || code==CorrectionCode::OutOfValidityRange)){
623  ATH_MSG_ERROR("BTaggingEfficiencyTool::getMCEfficiencyONNX returned CorrectionCode::Error");
624  return StatusCode::FAILURE;
625  }
626 
627  if(m_continuous) {
628  for(int bin = 0; bin < m_nbins; bin++){
629  // need to transpose
630  std::vector<float> tmp_effMC_oneBin; // shape: {num_jet} = trfinf.njets
631  for (unsigned int jet_index=0; jet_index<trfinf.njets; jet_index++){
632  tmp_effMC_oneBin.push_back(tmp_effMC_allBins[jet_index][bin]);
633  }
634  trfinf.effMC_allBins[bin] = tmp_effMC_oneBin;
635  }
636  } // m_continuous
637  else{
638  for (unsigned int jet_index=0; jet_index<trfinf.njets; jet_index++){
639  float tmp_effMC = std::accumulate(tmp_effMC_allBins[jet_index].begin()+m_OP_index_for_GNN, tmp_effMC_allBins[jet_index].end(), 0.0);
640  trfinf.effMC_allBins[0].push_back(1-tmp_effMC);
641  trfinf.effMC_allBins[1].push_back(tmp_effMC);
642  }
643  } // !m_continuous
644 
645  return StatusCode::SUCCESS;
646 }

◆ getAllEffSF()

StatusCode BTaggingTruthTaggingTool::getAllEffSF ( TRFinfo trfinf,
int  = 0 
)
private

◆ getDirectTaggedJets()

StatusCode BTaggingTruthTaggingTool::getDirectTaggedJets ( TRFinfo trfinf,
std::vector< bool > &  is_tagged 
)
private

Definition at line 1035 of file BTaggingTruthTaggingTool.cxx.

1035  {
1036  is_tagged.clear();
1037  std::vector<int> appo;
1038  auto is_jettag = false;
1039  for(const auto &jet : trfinf.jets) {
1040  ATH_MSG_DEBUG("pt " << jet.vars.jetPt << " eta " << jet.vars.jetEta << " wei " << jet.vars.jetTagWeight);
1041  is_jettag = static_cast<bool>(m_selTool->accept(jet.vars.jetPt, jet.vars.jetEta, jet.vars.jetTagWeight));
1042 
1043  ATH_MSG_DEBUG("is tagged? " << is_jettag);
1044  if(is_jettag) is_tagged.push_back(1);
1045  else is_tagged.push_back(0);
1046  }
1047 
1048  return StatusCode::SUCCESS;
1049 }

◆ getEvtSF()

float BTaggingTruthTaggingTool::getEvtSF ( TRFinfo trfinf,
std::vector< int > &  quantiles 
)
private

Definition at line 1052 of file BTaggingTruthTaggingTool.cxx.

1052  {
1053 
1054  float SF = 1.;
1055 
1056  if (m_ignoreSF)
1057  return SF;
1058 
1059  for(unsigned int i =0; i< trfinf.njets; i++) {
1060  float jetSF = 1;
1061 
1062  if(!m_continuous){ //FixedCut
1063 
1064  bool is_btagged = quantiles.at(i);
1065  auto code = (is_btagged) ? m_effTool->getScaleFactor(trfinf.jets.at(i).flav, trfinf.jets.at(i).vars, jetSF) : m_effTool->getInefficiencyScaleFactor(trfinf.jets.at(i).flav, trfinf.jets.at(i).vars, jetSF);
1066 
1067  if(!(code==CorrectionCode::Ok || code==CorrectionCode::OutOfValidityRange)){
1068  ATH_MSG_ERROR("BTaggingEfficiencyTool::getScaleFactor returned CorrectionCode::Error");
1069  return -99.;
1070  }
1071  }
1072  else{ //continuous & continuous2D
1073  int bin = quantiles.at(i);
1074  //set new tagweight bin according to the final decision
1075  //the quantile convention for continuous is: bin+1!
1076  trfinf.jets.at(i).vars.jetTagWeight = (m_continuous2D) ? bin+0.5 : (m_cuts[bin-1].bcut_low + m_cuts[bin-1].bcut_hig)/2.;
1077 
1078  auto code = m_effTool->getScaleFactor(trfinf.jets.at(i).flav, trfinf.jets.at(i).vars, jetSF);
1079  if(!(code==CorrectionCode::Ok || code==CorrectionCode::OutOfValidityRange)){
1080  ATH_MSG_ERROR("BTaggingEfficiencyTool::getScaleFactor returned CorrectionCode::Error");
1081  return -99;
1082  }
1083  ATH_MSG_DEBUG("BIN " <<bin <<"SF: pt " <<trfinf.jets.at(i).vars.jetPt <<" " <<trfinf.jets.at(i).vars.jetEta <<" " <<trfinf.jets.at(i).vars.jetTagWeight <<" jetSF " <<jetSF);
1084  }
1085  SF*=jetSF;
1086  } //loop over jets
1087 
1088  ATH_MSG_DEBUG(" FINAL SF : " <<SF);
1089  return SF;
1090 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ getQuantiles()

StatusCode BTaggingTruthTaggingTool::getQuantiles ( TRFinfo trfinf,
std::vector< std::vector< int > > &  trf_bin_ex,
std::vector< std::vector< int > > &  trf_bin_in 
)
private

Definition at line 900 of file BTaggingTruthTaggingTool.cxx.

900  {
901  trf_bin_ex.resize(trfinf.tbins_ex.size());
902  for(unsigned int i =0; i<trfinf.tbins_ex.size(); i++)
903  trf_bin_ex.at(i).resize(trfinf.tbins_ex.at(i).size());
904 
905  trf_bin_in.resize(trfinf.tbins_in.size());
906  for(unsigned int i =0; i<trfinf.tbins_in.size(); i++)
907  trf_bin_in.at(i).resize(trfinf.tbins_in.at(i).size());
908  // increasing the value by 1 to match conventions in selectionTool (not continuous2D)
909  for(unsigned int i =0; i<trfinf.tbins_ex.size(); i++)
910  for(unsigned int j=0; j<trfinf.tbins_ex.at(i).size(); j++)
911  trf_bin_ex.at(i).at(j)= (m_continuous2D || !m_continuous) ? trfinf.tbins_ex.at(i).at(j) : trfinf.tbins_ex.at(i).at(j) +1;
912 
913  for(unsigned int i =0; i<trfinf.tbins_in.size(); i++)
914  for(unsigned int j=0; j<trfinf.tbins_in.at(i).size(); j++)
915  trf_bin_in.at(i).at(j) = (m_continuous2D || !m_continuous) ? trfinf.tbins_in.at(i).at(j) : trfinf.tbins_in.at(i).at(j) +1;
916 
917  return StatusCode::SUCCESS;
918 }

◆ getTagBinsConfProb()

float BTaggingTruthTaggingTool::getTagBinsConfProb ( TRFinfo trfinf,
std::vector< int > &  tagws 
)
private

Definition at line 1014 of file BTaggingTruthTaggingTool.cxx.

1014  {
1015  float prob = 1.;
1016  for(unsigned int j=0; j<tagws.size(); j++) {
1017 
1018  float sum_tag = 0.;
1019  //calculate sum of all tagged bins
1020  for (auto bin : m_OperatingBins)
1021  sum_tag += trfinf.effMC_allBins[bin][j];
1022 
1023  if(std::count(m_OperatingBins.begin(), m_OperatingBins.end(), tagws.at(j) ) ) { // tagged
1024  prob *= (trfinf.effMC_allBins[tagws.at(j)][j]) / sum_tag;
1025  ATH_MSG_DEBUG("prob " << prob);
1026  }
1027  else { // untagged
1028  prob *= (1 - trfinf.effMC_allBins[tagws.at(j)][j]) / (1 - sum_tag);
1029  ATH_MSG_DEBUG("prob " << prob);
1030  }
1031  }
1032  return prob;
1033 }

◆ getTagPermutation()

StatusCode BTaggingTruthTaggingTool::getTagPermutation ( TRFinfo trfinf,
std::vector< std::vector< bool > > &  trf_chosen_perm_ex,
std::vector< std::vector< bool > > &  trf_chosen_perm_in 
)
private

Definition at line 808 of file BTaggingTruthTaggingTool.cxx.

808  {
809  trf_chosen_perm_ex.resize(m_nbtag+1);
810  trf_chosen_perm_in.resize(m_nbtag+1);
811  trf_chosen_perm_ex = trfinf.perm_ex;
812  trf_chosen_perm_in = trfinf.perm_in;
813  std::string print_perm = "Permutation: ";
814  for(const auto& perm: trfinf.perm_ex){
815  for(auto is: perm) {
816  if(is) print_perm+=std::to_string(1);
817  else print_perm+=std::to_string(0);
818  print_perm+=" ";
819  }
820  }
821  ATH_MSG_DEBUG(print_perm);
822  return StatusCode::SUCCESS;
823 }

◆ getTRFweight()

StatusCode BTaggingTruthTaggingTool::getTRFweight ( TRFinfo trfinf,
unsigned int  nbtag,
bool  isInclusive 
)
private

Definition at line 728 of file BTaggingTruthTaggingTool.cxx.

728  {
729 
730  unsigned int njets = trfinf.njets;
731  // Consider permutations of njet jets with up to limit b-tags
732  unsigned int limit = (njets > 7) ? 8 : njets+1;
733 
734  // Permutations: njets, ntags, permutations
735  auto& perm = trfinf.perms[njets];
736  if (perm.empty()) { // if I don't have already saved the possible permutations for njet
737  perm.resize (limit);
738  for(unsigned int i=0;i<limit;i++)
739  trfinf.perms[njets].at(i) = generatePermutations(njets,i);
740  }
741  trfinf.permsWeight.clear(), trfinf.permsWeight.resize(limit); // trfinf.permsWeight.at(i).at(j): TRF weight of the j-th perm with i b-tags
742  trfinf.permsSumWeight.clear(), trfinf.permsSumWeight.resize(limit); // trfinf.permsSumWeight.at(i).at(j): partial sum of TRF weight of the permutations with i b-tags up to j (0,1,..,j-th) perm. Used in the choice of the selected permutation
743 
744  // compute TRF weight
745  unsigned int max = nbtag+1; // from 0 to nbtag b-tags --> nbtag+1 positions
746  trfinf.trfw_ex.clear(), trfinf.trfw_in.clear();
747  trfinf.trfw_ex.resize(max), trfinf.trfw_in.resize(max);
748 
749  //clear and resize elements of trfinf
750  trfinf.perm_ex.clear(), trfinf.perm_in.clear(); // vector<vector<bool>> --> for each number of tags the chosen permutation
751  trfinf.perm_ex.resize(max), trfinf.perm_in.resize(max);
752  trfinf.permprob_ex.clear(), trfinf.permprob_in.clear(); // probability of the perm in trfinf.perm_ex/in
753  trfinf.permprob_ex.resize(max), trfinf.permprob_in.resize(max);
754 
755  if(isInclusive) {
756  for(unsigned int i=0; i<limit; i++) { // note: I consider maximum limit tags. It's an approximation
757  std::vector<float> weights;
758  float sum = 0.;
759  float w = 0.; //weight
760  trfinf.permsWeight.at(i).clear();
761  trfinf.permsSumWeight.at(i).clear();
762  trfinf.permsWeight.at(i).resize(trfinf.perms[njets].at(i).size());
763  trfinf.permsSumWeight.at(i).resize(trfinf.perms[njets].at(i).size());
764 
765  // loop on all the permutations with i tags
766  for(unsigned int p=0; p<trfinf.perms[njets].at(i).size(); p++) {
767 
768  w = trfWeight(trfinf,trfinf.perms[njets].at(i).at(p));
769  sum+=w;
770  trfinf.permsWeight.at(i).at(p) = w;
771  trfinf.permsSumWeight.at(i).at(p) = sum;
772 
773  ATH_MSG_DEBUG("nbtag = " << i << " wei = " << w << " sum = " << sum);
774  }
775  if(i<limit && i<max) {
776  // note: I need to already have the exclusive weights filled to compite the inclusive
777  trfinf.trfw_ex.at(i) = sum; // sum of TRF weights for all perm with i b-tags
778  if(i == 0) trfinf.trfw_in.at(0) = 1.;
779  else trfinf.trfw_in.at(i) = trfinf.trfw_in.at(i-1) - trfinf.trfw_ex.at(i-1); // P(>=4) = P(>=3) - P(==3)
780  ATH_MSG_DEBUG("i = " << i << " sum = " << sum << " TRF in " << trfinf.trfw_in.at(i) << " ex = " << trfinf.trfw_ex.at(i));
781  }
782  }
783  ATH_MSG_DEBUG("before return, nbtag = " << nbtag << " size de trfinf.trfw_in = " << trfinf.trfw_in.size());
784  return StatusCode::SUCCESS;
785  }
786  else { // exclusive case, only one calculation needed
787  std::vector<float> weights;
788  float sum = 0., w = 0.;
789  size_t size = trfinf.perms[njets].at(nbtag).size();
790  trfinf.permsWeight.at(nbtag).clear();
791  trfinf.permsSumWeight.at(nbtag).clear();
792  trfinf.permsWeight.at(nbtag).resize(size);
793  trfinf.permsSumWeight.at(nbtag).resize(size);
794  // loop on all the permutations with i tags
795  for(unsigned int p=0; p<trfinf.perms[njets].at(nbtag).size(); p++) {
796  w = trfWeight(trfinf,trfinf.perms[njets].at(nbtag).at(p));
797  sum+=w;
798  trfinf.permsWeight.at(nbtag).at(p) = w;
799  trfinf.permsSumWeight.at(nbtag).at(p) = sum;
800  }
801  trfinf.trfw_ex.at(nbtag) = sum;
802  return StatusCode::SUCCESS;
803  }
804  return StatusCode::SUCCESS;
805 }

◆ GetTruthTagWeights()

StatusCode BTaggingTruthTaggingTool::GetTruthTagWeights ( TRFinfo trfinf,
std::vector< float > &  trf_weight_ex,
std::vector< float > &  trf_weight_in 
)
private

Definition at line 458 of file BTaggingTruthTaggingTool.cxx.

458  {
459 
461  //get MC efficiencies
462  ANA_CHECK(getAllEffMC(trfinf));
463  //compute truth tag weights
464  ANA_CHECK(getTRFweight(trfinf,m_nbtag, true));
465  // choice of the selected permutation
467 
468  // choice of the tagged bins
469  ANA_CHECK(chooseAllTagBins(trfinf));
470 
471  trf_weight_ex = trfinf.trfw_ex;
472  trf_weight_in = trfinf.trfw_in;
473  return StatusCode::SUCCESS;
474 }

◆ initialize()

StatusCode BTaggingTruthTaggingTool::initialize ( )
virtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 124 of file BTaggingTruthTaggingTool.cxx.

124  {
125 
127  m_initialised = true;
128 
133  ANA_CHECK(m_selTool.setProperty("OperatingPoint", m_OP));
135  ANA_CHECK(m_selTool.setProperty("FlvTagCutDefinitionsFileName", m_SFFile));
137 
140  ANA_CHECK(m_effTool.setProperty("OperatingPoint", m_OP));
142  ANA_CHECK(m_effTool.setProperty("ScaleFactorFileName", m_SFFile ));
143  ANA_CHECK(m_effTool.setProperty("UseDevelopmentFile", m_useDevFile ));
144  ANA_CHECK(m_effTool.setProperty("EfficiencyFileName", m_EffFile ));
145  ANA_CHECK(m_effTool.setProperty("ScaleFactorBCalibration", m_SFBName ));
146  ANA_CHECK(m_effTool.setProperty("ScaleFactorCCalibration", m_SFCName ));
147  ANA_CHECK(m_effTool.setProperty("ScaleFactorTCalibration", m_SFTName ));
148  ANA_CHECK(m_effTool.setProperty("ScaleFactorLightCalibration", m_SFLightName ));
149  ANA_CHECK(m_effTool.setProperty("EigenvectorReductionB", m_EVReductionB ));
150  ANA_CHECK(m_effTool.setProperty("EigenvectorReductionC", m_EVReductionC ));
151  ANA_CHECK(m_effTool.setProperty("EigenvectorReductionLight", m_EVReductionLight ));
152  ANA_CHECK(m_effTool.setProperty("EfficiencyBCalibrations", m_EffBName ));
153  ANA_CHECK(m_effTool.setProperty("EfficiencyCCalibrations", m_EffCName ));
154  ANA_CHECK(m_effTool.setProperty("EfficiencyTCalibrations", m_EffTName ));
155  ANA_CHECK(m_effTool.setProperty("EfficiencyLightCalibrations", m_EffLightName ));
156  ANA_CHECK(m_effTool.setProperty("ExcludeFromEigenVectorTreatment", m_excludeFromEV ));
157  ANA_CHECK(m_effTool.setProperty("SystematicsStrategy", m_systStrategy ));
158  ANA_CHECK(m_effTool.setProperty("ConeFlavourLabel", m_coneFlavourLabel ));
159  ANA_CHECK(m_effTool.setProperty("pathToONNX", m_pathToONNX ));
160 
162 
163  m_continuous = false;
164  m_continuous2D = false;
165  if(m_OP.find("Continuous") != std::string::npos){
166  ATH_MSG_INFO("You are running in Continuous and you chose " << m_cutBenchmark <<" as benchmarks" );
167  m_continuous = true;
168  if(m_OP.find("Continuous2D") != std::string::npos)
169  m_continuous2D = true;
170 
171  //tokenize the quantiles that will be used as tagged bin indices.
172  std::vector<std::string> tag_benchmarks = split(m_cutBenchmark, ',');
173  for (const auto & tag_bin : tag_benchmarks ){
174  if(m_continuous2D)
175  m_OperatingBins.push_back(std::atoi(tag_bin.c_str()));
176  else //continuous
177  m_OperatingBins.push_back(std::atoi(tag_bin.c_str())-1); //different convention
178  }
179  }
180  else{ //FixedCut working points
181  m_OperatingBins.clear();
182  m_OperatingBins.push_back(1); //first bin: untagged, second bin: tagged.
183 }
184 
185  if(m_useQuntile && !m_continuous){
186  ATH_MSG_ERROR("UseQuantile is available only in Continuous WP. Please consider switching the Operating Point.");
187  return StatusCode::FAILURE;
188  }
189 
190  if (m_pathToONNX != ""){
191  // 60% = 4, 70% = 3, 77% = 2, 85% = 1, 100% = 0
192  m_OP_index_for_GNN = find(m_availableOP_fixCut.begin(), m_availableOP_fixCut.end(), m_OP) - m_availableOP_fixCut.begin() + 1; // GNN predicts 5 bins
193  }
194 
195  m_eff_syst.clear();
196  m_sys_name.clear();
197  CP::SystematicSet def_set;
198  m_eff_syst.push_back(def_set);
199  m_sys_name.push_back("Nominal");
200 
201  if(m_useSys){
202  std::vector<std::string> excludeEV_vector;
203  if(m_excludeEV != "")
204  excludeEV_vector = split(m_excludeEV, ';');
206  for (const auto & syst : systs) {
207  CP::SystematicSet myset;
208  string s = syst.name();
209  if(m_doOnlyUpVariations && s.find("__1down") !=string::npos) continue;
210  if(std::any_of(excludeEV_vector.begin(), excludeEV_vector.end(), [&s](const std::string& str) { return str.find(s) != std::string::npos; })) continue;
211  myset.insert(syst);
212  if(m_excludeEV != "")
213  ATH_MSG_INFO("Adding systematic " << syst.name() << "to the list ");
214  else
215  ATH_MSG_DEBUG("Adding systematic " << syst.name() << "to the list ");
216  m_eff_syst.push_back(myset);
217  m_sys_name.push_back(syst.name());
218  }
219  }
220 
221  ATH_MSG_INFO("end of systematics ");
222 
223  //set the cuts
224  TString pathtofile = PathResolverFindCalibFile(m_SFFile);
225  m_inf = TFile::Open(pathtofile, "read");
226 
227  float min_cut_low = (m_taggerName == "MV2c10") ? -1 : -20;
228  float max_cut_hig = (m_taggerName == "MV2c10") ? +1 : +20;
229 
230  if(m_OP == "Continuous"){
231  std::vector<float> bin_edges;
232  bin_edges.push_back(min_cut_low);
233  for (const std::string& bin_name : m_availableOP_fixCut){
234  TString cutname = m_taggerName+"/"+m_jetAuthor+"/"+bin_name+"/cutvalue";
235  float cutval = ((TVector*) m_inf->Get(cutname))[0](0);
236  bin_edges.push_back(cutval);
237  }
238  bin_edges.push_back(max_cut_hig);
239  for (unsigned int be = 0 ; be < bin_edges.size()-1 ; be++){
240  //check if the bin is one of the bins used for btagging
241  //NB. i+1 is to follow the convention 1-5!
242  bool is_tagbin = std::count(m_OperatingBins.begin(), m_OperatingBins.end(), be);
243  TagBin one_cut = TagBin(is_tagbin, bin_edges.at(be), bin_edges.at(be+1));
244  m_cuts.push_back(one_cut);
245  }
246  } //== continuous
247  else if (m_OP.find("Continuous2D") != std::string::npos){
248  ATH_MSG_INFO("TruthTagging initialization: Working with Continuous2D WP.");
249  TString cutname = m_taggerName+"/"+m_jetAuthor+"/Continuous2D/cutvalue";
250  TMatrixD* cuts2D = (TMatrixD*) m_inf->Get(cutname);
251  ATH_MSG_DEBUG("Counting " <<cuts2D->GetNrows() <<" bins ");
252 
253  for (int bin = 0; bin < cuts2D->GetNrows(); bin++){
254  ATH_MSG_DEBUG("INITIALIZATION c-cuts : " <<(*cuts2D)(bin,0) <<" "
255  <<(*cuts2D)(bin,1) <<" b-cuts : "
256  <<(*cuts2D)(bin,2) <<" "
257  <<(*cuts2D)(bin,3));
258 
259  //check if the bin is one of the bins used for btagging
260  //NB. i follows the convention 0-4 of the continuous2D tagging
261  bool is_tagbin = std::count(m_OperatingBins.begin(), m_OperatingBins.end(), bin);
262 
263  //set protection limits, so the final generated tagweight values have a meaning
264  float c_tagcut_low = ((*cuts2D)(bin,0) < min_cut_low) ? min_cut_low : (*cuts2D)(bin,0);
265  float c_tagcut_hig = ((*cuts2D)(bin,1) > max_cut_hig) ? max_cut_hig : (*cuts2D)(bin,1);
266  float b_tagcut_low = ((*cuts2D)(bin,2) < min_cut_low) ? min_cut_low : (*cuts2D)(bin,2);
267  float b_tagcut_hig = ((*cuts2D)(bin,3) > max_cut_hig) ? max_cut_hig : (*cuts2D)(bin,3);
268 
269  TagBin one_cut = TagBin(is_tagbin, b_tagcut_low, b_tagcut_hig, c_tagcut_low, c_tagcut_hig);
270  m_cuts.push_back(one_cut);
271  }
272  }//continuous2D
273  else{ //fixed-cut
274  TString cutname = m_taggerName+"/"+m_jetAuthor+"/"+m_OP+"/cutvalue";
275  float cutval = ((TVector*) m_inf->Get(cutname))[0](0);
276 
277  TagBin untag_bin = TagBin(false, min_cut_low, cutval); //bin 0
278  TagBin tag_bin = TagBin(true, cutval, max_cut_hig); //bin 1
279 
280  m_cuts.push_back(untag_bin);
281  m_cuts.push_back(tag_bin);
282  } //FixedCut
283 
284  if(m_continuous)
285  for (const auto& c : m_cuts){
286  ATH_MSG_INFO("b-tag low: " <<c.bcut_low <<" b-tag hig: " <<c.bcut_hig <<" c-tag low: " <<c.ccut_low <<" c-tag hig: " <<c.ccut_hig <<" Added to tag bins: " <<c.is_tagbin);
287  }
288 
289  //total number of bins. helpful in loops
290  m_nbins = m_cuts.size(); //FixedCut
291  ATH_MSG_INFO("Total number of bins: " <<m_nbins);
292 
293 
294  // "AllJets" is the default strategy
295  if (m_taggingStrategy == "AllJets"){
297  } else if (m_taggingStrategy == "Leading2SignalJets"){
299  } else if (m_taggingStrategy == "Leading3SignalJets"){
301  } else {
302  ATH_MSG_ERROR("BTaggingTruthTaggingTool::tagging strategy " << m_taggingStrategy << " is not implemented in the TruthTagging Tool");
303  return StatusCode::FAILURE;
304  }
305 
306  return StatusCode::SUCCESS;
307  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isAffectedBySystematic()

bool BTaggingTruthTaggingTool::isAffectedBySystematic ( const CP::SystematicVariation systematic) const
virtual

Declare the interface that this class provides.

returns: whether this tool is affected by the given systematics

Implements CP::ISystematicsTool.

Definition at line 114 of file BTaggingTruthTaggingTool.cxx.

115 {
117  return sys.find( systematic) != sys.end();
118 }

◆ jetFlavourLabel()

int BTaggingTruthTaggingTool::jetFlavourLabel ( const xAOD::Jet jet)
private

Definition at line 1108 of file BTaggingTruthTaggingTool.cxx.

1108  {
1109  if (m_coneFlavourLabel)
1111  else
1113 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ recommendedSystematics()

SystematicSet BTaggingTruthTaggingTool::recommendedSystematics ( ) const
virtual

the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 120 of file BTaggingTruthTaggingTool.cxx.

120  {
121  return affectingSystematics();
122 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setEffMapIndex()

StatusCode BTaggingTruthTaggingTool::setEffMapIndex ( const std::string &  flavour,
unsigned int  index 
)
virtual

Declare the interface that the class provides.

Implements IBTaggingTruthTaggingTool.

Definition at line 89 of file BTaggingTruthTaggingTool.cxx.

89  {
91  return StatusCode::SUCCESS;
92 }

◆ setJets() [1/6]

StatusCode BTaggingTruthTaggingTool::setJets ( TRFinfo trfinf,
const std::vector< std::vector< float >> &  node_feat,
std::vector< float > &  tagw 
)
private

Definition at line 364 of file BTaggingTruthTaggingTool.cxx.

364  {
366  if(node_feat.size()!=tagw.size()){
367  ATH_MSG_ERROR( "Vectors of node_feat (outer axis) and tagw should have same size" );
368  return StatusCode::FAILURE;
369  }
370 
371  std::vector<int> flav;
372  std::vector<Analysis::CalibrationDataVariables>* vars = new std::vector<Analysis::CalibrationDataVariables>(0);
373  for(unsigned int i =0; i<tagw.size(); i++){
375 
376  // node_feat[i] is always {flav, pt, eta, ...}
377  float pt = node_feat.at(i)[1];
378  float eta = node_feat.at(i)[2];
379 
380  ANA_CHECK(fillVariables(pt, eta, tagw.at(i), vars_appo));
381  vars->push_back(vars_appo);
382  flav.push_back(node_feat.at(i)[0]);
383  }
384 
385  ANA_CHECK(setJets(trfinf, flav, vars, node_feat));
386  return StatusCode::SUCCESS;
387 }

◆ setJets() [2/6]

StatusCode BTaggingTruthTaggingTool::setJets ( TRFinfo trfinf,
const xAOD::JetContainer jets 
)
private

Definition at line 329 of file BTaggingTruthTaggingTool.cxx.

329  {
331  std::vector<int> flav;
332  std::vector<Analysis::CalibrationDataVariables>* vars = new std::vector<Analysis::CalibrationDataVariables>(0);
333  for(const auto jet : jets) {
335  ANA_CHECK(fillVariables(*jet, vars_appo));
336  vars->push_back(vars_appo);
337  flav.push_back(jetFlavourLabel(*jet));
338  }
339 
340  ANA_CHECK(setJets(trfinf,flav, vars));
341  delete vars;
342  flav.clear();
343  return StatusCode::SUCCESS;
344 }

◆ setJets() [3/6]

StatusCode BTaggingTruthTaggingTool::setJets ( TRFinfo trfinf,
const xAOD::JetContainer jets,
const std::vector< std::vector< float >> &  node_feat 
)
private

Definition at line 390 of file BTaggingTruthTaggingTool.cxx.

390  {
392  std::vector<int> flav;
393  std::vector<Analysis::CalibrationDataVariables>* vars = new std::vector<Analysis::CalibrationDataVariables>(0);
394  for(const auto jet : jets) {
396  ANA_CHECK(fillVariables(*jet, vars_appo));
397  vars->push_back(vars_appo);
398  flav.push_back(jetFlavourLabel(*jet));
399  }
400 
401  ANA_CHECK(setJets(trfinf, flav, vars, node_feat));
402  flav.clear();
403  return StatusCode::SUCCESS;
404 }

◆ setJets() [4/6]

StatusCode BTaggingTruthTaggingTool::setJets ( TRFinfo trfinf,
std::vector< float > &  pt,
std::vector< float > &  eta,
std::vector< int > &  flav,
std::vector< float > &  tagw 
)
private

Definition at line 310 of file BTaggingTruthTaggingTool.cxx.

310  {
312  if(pt.size()!=eta.size() || pt.size()!=flav.size() || pt.size()!=tagw.size()){
313  ATH_MSG_ERROR( "Vectors of pt, eta, flav and tagw should have same size" );
314  return StatusCode::FAILURE;
315  }
316 
317  std::vector<Analysis::CalibrationDataVariables>* vars = new std::vector<Analysis::CalibrationDataVariables>(0);
318  for(unsigned int i =0; i<pt.size(); i++){
320  ANA_CHECK(fillVariables(pt.at(i), eta.at(i), tagw.at(i), vars_appo));
321  vars->push_back(vars_appo);
322  }
323 
324  ANA_CHECK(setJets(trfinf,flav, vars));
325  delete vars;
326  return StatusCode::SUCCESS;
327 }

◆ setJets() [5/6]

StatusCode BTaggingTruthTaggingTool::setJets ( TRFinfo trfinf,
std::vector< int > &  flav,
const std::vector< Analysis::CalibrationDataVariables > *  vars,
const std::vector< std::vector< float >> &  node_feat 
)
private

Definition at line 409 of file BTaggingTruthTaggingTool.cxx.

409  {
410  if(flav.size()!=vars->size()){
411  ATH_MSG_ERROR( "Vector of CalibrationDataVariables and flavour should have same size" );
412  return StatusCode::FAILURE;
413  }
414  trfinf.jets.clear();
415 
416  if (m_njetsTagStrategy == -1){
417  trfinf.njets = vars->size();
418  } else {
419  trfinf.njets = std::min(static_cast<unsigned int>(m_njetsTagStrategy), static_cast<unsigned int>(vars->size()));
420  }
421 
422  for(unsigned int i =0; i<trfinf.njets; i++){
423  jetVariable jetVar_appo;
424  jetVar_appo.flav=flav.at(i);
425  jetVar_appo.vars=vars->at(i);
426  trfinf.jets.push_back(jetVar_appo);
427  }
428  trfinf.node_feat = node_feat;
429  return StatusCode::SUCCESS;
430 }

◆ setJets() [6/6]

StatusCode BTaggingTruthTaggingTool::setJets ( TRFinfo trfinf,
std::vector< int > &  flav,
std::vector< Analysis::CalibrationDataVariables > *  vars 
)
private

Definition at line 346 of file BTaggingTruthTaggingTool.cxx.

346  {
347  if(flav.size()!=vars->size()){
348  ATH_MSG_ERROR( "Vector of CalibrationDataVariables and flavour should have same size" );
349  return StatusCode::FAILURE;
350  }
351  trfinf.jets.clear();
352  for(unsigned int i =0; i<vars->size(); i++){
353  jetVariable jetVar_appo;
354  jetVar_appo.flav=flav.at(i);
355  jetVar_appo.vars=vars->at(i);
356  trfinf.jets.push_back(jetVar_appo);
357 
358  }
359  trfinf.njets=trfinf.jets.size();
360  return StatusCode::SUCCESS;
361 }

◆ setUseSystematics()

void BTaggingTruthTaggingTool::setUseSystematics ( bool  useSystematics)

Definition at line 94 of file BTaggingTruthTaggingTool.cxx.

94  {
95  ATH_MSG_DEBUG("setting the use of systematics to: " <<useSystematics);
96  m_useSys = useSystematics;
97  ATH_MSG_DEBUG(" m_useSys = " << m_useSys);
98 }

◆ split()

std::vector< std::string > BTaggingTruthTaggingTool::split ( const std::string &  str,
char  token 
)
private

Definition at line 1154 of file BTaggingTruthTaggingTool.cxx.

1154  {
1155  std::vector<std::string> result;
1156  if (str.size() > 0) {
1157  std::string::size_type end;
1158  std::string tmp(str);
1159  do {
1160  end = tmp.find(token);
1161  std::string entry = trim(tmp.substr(0,end));
1162  if (entry.size() > 0) result.push_back(entry);
1163  if (end != std::string::npos) tmp = tmp.substr(end+1);
1164  } while (end != std::string::npos);
1165  }
1166  return result;
1167 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ trfWeight()

float BTaggingTruthTaggingTool::trfWeight ( TRFinfo trfinf,
const std::vector< bool > &  tags 
)
private

Definition at line 704 of file BTaggingTruthTaggingTool.cxx.

704  {
705 
706  float weight = 1;
707  for (unsigned int t=0; t<tags.size();t++) {
708  float trf = 0.;
709 
710  //sum of the efficiencies in the tagged bins
711  for (int bin : m_OperatingBins){
712 
713  trf += trfinf.effMC_allBins[bin][t];
714 
715  }
716  if(trf>1.) {
717  ATH_MSG_WARNING("Truth Tagging weight > 1. --> setting it to 1. check maps!");
718  trf = 1.;
719  }
720  if(tags.at(t)) weight *= trf;
721  else weight *= (1.-trf);
722  ATH_MSG_DEBUG("weight " <<weight);
723  } // end loop over jets
724  return weight;
725 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_availableOP_fixCut

std::vector<std::string> BTaggingTruthTaggingTool::m_availableOP_fixCut = {"FixedCutBEff_85", "FixedCutBEff_77","FixedCutBEff_70","FixedCutBEff_60"}
private

Definition at line 179 of file BTaggingTruthTaggingTool.h.

◆ m_coneFlavourLabel

bool BTaggingTruthTaggingTool::m_coneFlavourLabel
private

if true, use cone-based labelling (as opposed to ghost association)

Definition at line 249 of file BTaggingTruthTaggingTool.h.

◆ m_continuous

bool BTaggingTruthTaggingTool::m_continuous
private

Definition at line 276 of file BTaggingTruthTaggingTool.h.

◆ m_continuous2D

bool BTaggingTruthTaggingTool::m_continuous2D
private

Definition at line 277 of file BTaggingTruthTaggingTool.h.

◆ m_cutBenchmark

std::string BTaggingTruthTaggingTool::m_cutBenchmark
private

operating point when running in Continuous

Definition at line 241 of file BTaggingTruthTaggingTool.h.

◆ m_cuts

std::vector<TagBin> BTaggingTruthTaggingTool::m_cuts
private

Definition at line 184 of file BTaggingTruthTaggingTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doDirectTag

bool BTaggingTruthTaggingTool::m_doDirectTag
private

possibility to compute the direct tagging SFs map directly from the TruthTaggingTool

Definition at line 253 of file BTaggingTruthTaggingTool.h.

◆ m_doOnlyUpVariations

bool BTaggingTruthTaggingTool::m_doOnlyUpVariations
private

Definition at line 272 of file BTaggingTruthTaggingTool.h.

◆ m_eff_syst

std::vector<CP::SystematicSet> BTaggingTruthTaggingTool::m_eff_syst
private

Definition at line 195 of file BTaggingTruthTaggingTool.h.

◆ m_EffBName

std::string BTaggingTruthTaggingTool::m_EffBName
private

semicolon-separated list of MC efficiency parametrisation names for b jets

Definition at line 227 of file BTaggingTruthTaggingTool.h.

◆ m_EffCName

std::string BTaggingTruthTaggingTool::m_EffCName
private

semicolon-separated list of MC efficiency parametrisation names for charm jets

Definition at line 229 of file BTaggingTruthTaggingTool.h.

◆ m_EffFile

std::string BTaggingTruthTaggingTool::m_EffFile
private

name of the optional MC efficiency file (may be changed by the PathResolver)

Definition at line 211 of file BTaggingTruthTaggingTool.h.

◆ m_EffLightName

std::string BTaggingTruthTaggingTool::m_EffLightName
private

semicolon-separated list of MC efficiency parametrisation names for light-flavour jets

Definition at line 233 of file BTaggingTruthTaggingTool.h.

◆ m_EffTName

std::string BTaggingTruthTaggingTool::m_EffTName
private

semicolon-separated list of MC efficiency parametrisation names for tau jets

Definition at line 231 of file BTaggingTruthTaggingTool.h.

◆ m_effTool

asg::AnaToolHandle<IBTaggingEfficiencyTool> BTaggingTruthTaggingTool::m_effTool
private

Definition at line 287 of file BTaggingTruthTaggingTool.h.

◆ m_effTool_allBins

std::map<int, asg::AnaToolHandle<IBTaggingEfficiencyTool> > BTaggingTruthTaggingTool::m_effTool_allBins
private

Definition at line 284 of file BTaggingTruthTaggingTool.h.

◆ m_EVReductionB

std::string BTaggingTruthTaggingTool::m_EVReductionB
private

specification of the eigenvector reduction strategy for b jets (if eigenvectors are used)

Definition at line 221 of file BTaggingTruthTaggingTool.h.

◆ m_EVReductionC

std::string BTaggingTruthTaggingTool::m_EVReductionC
private

specification of the eigenvector reduction strategy for c jets (if eigenvectors are used)

Definition at line 223 of file BTaggingTruthTaggingTool.h.

◆ m_EVReductionLight

std::string BTaggingTruthTaggingTool::m_EVReductionLight
private

specification of the eigenvector reduction strategy for light-flavour jets (if eigenvectors are used)

Definition at line 225 of file BTaggingTruthTaggingTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_excludeEV

std::string BTaggingTruthTaggingTool::m_excludeEV
private

in case of continuous WP you can choose to ignore some of the eigenvectors

Definition at line 251 of file BTaggingTruthTaggingTool.h.

◆ m_excludeFromEV

std::string BTaggingTruthTaggingTool::m_excludeFromEV
private

semicolon-separated list of uncertainties to be excluded from the eigenvector variation procedure

Definition at line 235 of file BTaggingTruthTaggingTool.h.

◆ m_ignoreSF

bool BTaggingTruthTaggingTool::m_ignoreSF
private

Definition at line 273 of file BTaggingTruthTaggingTool.h.

◆ m_inf

TFile* BTaggingTruthTaggingTool::m_inf
private

Definition at line 181 of file BTaggingTruthTaggingTool.h.

◆ m_initialised

bool BTaggingTruthTaggingTool::m_initialised
private

Definition at line 186 of file BTaggingTruthTaggingTool.h.

◆ m_jetAuthor

std::string BTaggingTruthTaggingTool::m_jetAuthor
private

jet collection name

Definition at line 243 of file BTaggingTruthTaggingTool.h.

◆ m_maxEta

float BTaggingTruthTaggingTool::m_maxEta
private

Definition at line 266 of file BTaggingTruthTaggingTool.h.

◆ m_maxRangePt

float BTaggingTruthTaggingTool::m_maxRangePt
private

Definition at line 268 of file BTaggingTruthTaggingTool.h.

◆ m_minPt

float BTaggingTruthTaggingTool::m_minPt
private

Definition at line 267 of file BTaggingTruthTaggingTool.h.

◆ m_nbins

int BTaggingTruthTaggingTool::m_nbins
private

Definition at line 280 of file BTaggingTruthTaggingTool.h.

◆ m_nbtag

int BTaggingTruthTaggingTool::m_nbtag
private

Definition at line 279 of file BTaggingTruthTaggingTool.h.

◆ m_njetsTagStrategy

NjetsTagStrategy BTaggingTruthTaggingTool::m_njetsTagStrategy
private

Definition at line 260 of file BTaggingTruthTaggingTool.h.

◆ m_OP

std::string BTaggingTruthTaggingTool::m_OP
private

operating point

Definition at line 239 of file BTaggingTruthTaggingTool.h.

◆ m_OP_index_for_GNN

unsigned int BTaggingTruthTaggingTool::m_OP_index_for_GNN
private

Definition at line 282 of file BTaggingTruthTaggingTool.h.

◆ m_OperatingBins

std::vector<int> BTaggingTruthTaggingTool::m_OperatingBins
private

Definition at line 281 of file BTaggingTruthTaggingTool.h.

◆ m_pathToONNX

std::string BTaggingTruthTaggingTool::m_pathToONNX
private

if this string is empty, the onnx tool won't be used

Definition at line 255 of file BTaggingTruthTaggingTool.h.

◆ m_selTool

asg::AnaToolHandle<IBTaggingSelectionTool> BTaggingTruthTaggingTool::m_selTool
private

Definition at line 288 of file BTaggingTruthTaggingTool.h.

◆ m_SFBName

std::string BTaggingTruthTaggingTool::m_SFBName
private

name of the data/MC scale factor calibration for b jets

Definition at line 213 of file BTaggingTruthTaggingTool.h.

◆ m_SFCName

std::string BTaggingTruthTaggingTool::m_SFCName
private

name of the data/MC scale factor calibration for charm jets

Definition at line 215 of file BTaggingTruthTaggingTool.h.

◆ m_SFFile

std::string BTaggingTruthTaggingTool::m_SFFile
private

name of the data/MC efficiency scale factor calibration file (may be changed by the PathResolver)

Definition at line 209 of file BTaggingTruthTaggingTool.h.

◆ m_SFLightName

std::string BTaggingTruthTaggingTool::m_SFLightName
private

name of the data/MC scale factor calibration for light-flavour jets

Definition at line 219 of file BTaggingTruthTaggingTool.h.

◆ m_SFTName

std::string BTaggingTruthTaggingTool::m_SFTName
private

name of the data/MC scale factor calibration for tau jets

Definition at line 217 of file BTaggingTruthTaggingTool.h.

◆ m_sys_name

std::vector<std::string> BTaggingTruthTaggingTool::m_sys_name
private

Definition at line 196 of file BTaggingTruthTaggingTool.h.

◆ m_systStrategy

std::string BTaggingTruthTaggingTool::m_systStrategy
private

systematics model to be used (current choices are "SFEigen" and "Envelope")

Definition at line 245 of file BTaggingTruthTaggingTool.h.

◆ m_taggerName

std::string BTaggingTruthTaggingTool::m_taggerName
private

tagger name

Definition at line 237 of file BTaggingTruthTaggingTool.h.

◆ m_taggingStrategy

std::string BTaggingTruthTaggingTool::m_taggingStrategy
private

tagging strategy is required to do TT with GNN, when we don't want to truth tag all the jets (eg. 'leading2SignalJets')

Definition at line 257 of file BTaggingTruthTaggingTool.h.

◆ m_useDevFile

bool BTaggingTruthTaggingTool::m_useDevFile
private

if true, attempt to retrieve the data/MC efficiency scale factor calibration files from the @PathResolver development area

Definition at line 247 of file BTaggingTruthTaggingTool.h.

◆ m_usePerm

bool BTaggingTruthTaggingTool::m_usePerm
private

Definition at line 274 of file BTaggingTruthTaggingTool.h.

◆ m_useQuntile

bool BTaggingTruthTaggingTool::m_useQuntile
private

Definition at line 275 of file BTaggingTruthTaggingTool.h.

◆ m_useSys

bool BTaggingTruthTaggingTool::m_useSys
private

Definition at line 278 of file BTaggingTruthTaggingTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
asg::AnaToolHandle::initialize
StatusCode initialize()
initialize the tool
BTaggingTruthTaggingTool::GAFinalHadronFlavourLabel
int GAFinalHadronFlavourLabel(const xAOD::Jet &jet)
Definition: BTaggingTruthTaggingTool.cxx:1115
BTaggingTruthTaggingTool::getAllEffMCGNN
StatusCode getAllEffMCGNN(TRFinfo &trfinf)
Definition: BTaggingTruthTaggingTool.cxx:613
BTaggingTruthTaggingTool::m_EffCName
std::string m_EffCName
semicolon-separated list of MC efficiency parametrisation names for charm jets
Definition: BTaggingTruthTaggingTool.h:229
BTaggingTruthTaggingTool::m_OP_index_for_GNN
unsigned int m_OP_index_for_GNN
Definition: BTaggingTruthTaggingTool.h:282
verify_menu_config.results
results
Definition: verify_menu_config.py:67
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
BTaggingTruthTaggingTool::m_inf
TFile * m_inf
Definition: BTaggingTruthTaggingTool.h:181
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
BTaggingTruthTaggingTool::m_minPt
float m_minPt
Definition: BTaggingTruthTaggingTool.h:267
get_generator_info.result
result
Definition: get_generator_info.py:21
BTaggingTruthTaggingTool::m_EVReductionC
std::string m_EVReductionC
specification of the eigenvector reduction strategy for c jets (if eigenvectors are used)
Definition: BTaggingTruthTaggingTool.h:223
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
max
#define max(a, b)
Definition: cfImp.cxx:41
BTaggingTruthTaggingTool::m_pathToONNX
std::string m_pathToONNX
if this string is empty, the onnx tool won't be used
Definition: BTaggingTruthTaggingTool.h:255
IBTaggingEfficiencyTool::getMCEfficiencyONNX
virtual CP::CorrectionCode getMCEfficiencyONNX(const std::vector< std::vector< float >> &node_feat, std::vector< float > &effAllJet)=0
BTaggingTruthTaggingTool::m_cutBenchmark
std::string m_cutBenchmark
operating point when running in Continuous
Definition: BTaggingTruthTaggingTool.h:241
BTaggingTruthTaggingTool::setJets
StatusCode setJets(TRFinfo &trfinf, std::vector< float > &pt, std::vector< float > &eta, std::vector< int > &flav, std::vector< float > &tagw)
Definition: BTaggingTruthTaggingTool.cxx:310
BTaggingTruthTaggingTool::m_systStrategy
std::string m_systStrategy
systematics model to be used (current choices are "SFEigen" and "Envelope")
Definition: BTaggingTruthTaggingTool.h:245
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
BTaggingTruthTaggingTool::Leading2SignalJets
@ Leading2SignalJets
Definition: BTaggingTruthTaggingTool.h:259
trim
std::string trim(const std::string &str, const std::string &whitespace=" \t")
Definition: BTaggingTruthTaggingTool.cxx:1141
BTaggingTruthTaggingTool::fillVariables
StatusCode fillVariables(const xAOD::Jet &jet, Analysis::CalibrationDataVariables &x)
Definition: BTaggingTruthTaggingTool.cxx:433
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
BTaggingTruthTaggingTool::m_coneFlavourLabel
bool m_coneFlavourLabel
if true, use cone-based labelling (as opposed to ghost association)
Definition: BTaggingTruthTaggingTool.h:249
BTaggingTruthTaggingTool::m_cuts
std::vector< TagBin > m_cuts
Definition: BTaggingTruthTaggingTool.h:184
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
BTaggingTruthTaggingTool::chooseTagPermutation
StatusCode chooseTagPermutation(TRFinfo &trfinf, unsigned int nbtag, bool isIncl)
Definition: BTaggingTruthTaggingTool.cxx:851
BTaggingTruthTaggingTool::m_initialised
bool m_initialised
Definition: BTaggingTruthTaggingTool.h:186
BTaggingTruthTaggingTool::m_OperatingBins
std::vector< int > m_OperatingBins
Definition: BTaggingTruthTaggingTool.h:281
BTaggingTruthTaggingTool::m_useDevFile
bool m_useDevFile
if true, attempt to retrieve the data/MC efficiency scale factor calibration files from the @PathReso...
Definition: BTaggingTruthTaggingTool.h:247
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
test_pyathena.pt
pt
Definition: test_pyathena.py:11
TRT_PAI_gasdata::SF
const float SF[NF]
Cross sections for Fluor.
Definition: TRT_PAI_gasdata.h:285
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
BTaggingTruthTaggingTool::m_EffTName
std::string m_EffTName
semicolon-separated list of MC efficiency parametrisation names for tau jets
Definition: BTaggingTruthTaggingTool.h:231
bin
Definition: BinsDiffFromStripMedian.h:43
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
IBTaggingSelectionTool::getTaggerWeight
virtual CP::CorrectionCode getTaggerWeight(const xAOD::Jet &jet, double &tagweight) const =0
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
BTaggingTruthTaggingTool::m_maxEta
float m_maxEta
Definition: BTaggingTruthTaggingTool.h:266
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
BTaggingTruthTaggingTool::getDirectTaggedJets
StatusCode getDirectTaggedJets(TRFinfo &trfinf, std::vector< bool > &is_tagged)
Definition: BTaggingTruthTaggingTool.cxx:1035
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
BTaggingTruthTaggingTool::m_SFLightName
std::string m_SFLightName
name of the data/MC scale factor calibration for light-flavour jets
Definition: BTaggingTruthTaggingTool.h:219
asg::AnaToolHandle::setProperty
StatusCode setProperty(const std::string &property, const T2 &value)
set the given property of the tool.
covarianceTool.prob
prob
Definition: covarianceTool.py:678
BTaggingTruthTaggingTool::jetFlavourLabel
int jetFlavourLabel(const xAOD::Jet &jet)
Definition: BTaggingTruthTaggingTool.cxx:1108
x
#define x
BTaggingTruthTaggingTool::m_sys_name
std::vector< std::string > m_sys_name
Definition: BTaggingTruthTaggingTool.h:196
BTaggingTruthTaggingTool::affectingSystematics
CP::SystematicSet affectingSystematics() const
the list of all systematics this tool can be affected by
Definition: BTaggingTruthTaggingTool.cxx:100
BTaggingTruthTaggingTool::m_eff_syst
std::vector< CP::SystematicSet > m_eff_syst
Definition: BTaggingTruthTaggingTool.h:195
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
IBTaggingEfficiencyTool::setMapIndex
virtual bool setMapIndex(const std::string &flavour, unsigned int index)=0
ANA_CHECK_THROW
#define ANA_CHECK_THROW(EXP)
check whether the given expression was successful, throwing an exception on failure
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:339
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
BTaggingTruthTaggingTool::getAllEffMC
StatusCode getAllEffMC(TRFinfo &trfinf)
Definition: BTaggingTruthTaggingTool.cxx:604
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
BTaggingTruthTaggingTool::m_jetAuthor
std::string m_jetAuthor
jet collection name
Definition: BTaggingTruthTaggingTool.h:243
histSizes.code
code
Definition: histSizes.py:129
BTaggingTruthTaggingTool::getTRFweight
StatusCode getTRFweight(TRFinfo &trfinf, unsigned int nbtag, bool isInclusive)
Definition: BTaggingTruthTaggingTool.cxx:728
tags
std::vector< std::string > tags
Definition: hcg.cxx:102
BTaggingTruthTaggingTool::m_continuous
bool m_continuous
Definition: BTaggingTruthTaggingTool.h:276
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
BTaggingTruthTaggingTool::m_selTool
asg::AnaToolHandle< IBTaggingSelectionTool > m_selTool
Definition: BTaggingTruthTaggingTool.h:288
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
BTaggingTruthTaggingTool::m_taggerName
std::string m_taggerName
tagger name
Definition: BTaggingTruthTaggingTool.h:237
BTaggingTruthTaggingTool::GetTruthTagWeights
StatusCode GetTruthTagWeights(TRFinfo &trfinf, std::vector< float > &trf_weight_ex, std::vector< float > &trf_weight_in)
Definition: BTaggingTruthTaggingTool.cxx:458
BTaggingTruthTaggingTool::Leading3SignalJets
@ Leading3SignalJets
Definition: BTaggingTruthTaggingTool.h:259
lumiFormat.i
int i
Definition: lumiFormat.py:85
BTaggingTruthTaggingTool::m_excludeEV
std::string m_excludeEV
in case of continuous WP you can choose to ignore some of the eigenvectors
Definition: BTaggingTruthTaggingTool.h:251
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
BTaggingTruthTaggingTool::getQuantiles
StatusCode getQuantiles(TRFinfo &trfinf, std::vector< std::vector< int > > &trf_bin_ex, std::vector< std::vector< int > > &trf_bin_in)
Definition: BTaggingTruthTaggingTool.cxx:900
BTaggingTruthTaggingTool::m_continuous2D
bool m_continuous2D
Definition: BTaggingTruthTaggingTool.h:277
BTaggingTruthTaggingTool::m_useQuntile
bool m_useQuntile
Definition: BTaggingTruthTaggingTool.h:275
BTaggingTruthTaggingTool::m_SFTName
std::string m_SFTName
name of the data/MC scale factor calibration for tau jets
Definition: BTaggingTruthTaggingTool.h:217
BTaggingTruthTaggingTool::ExclusiveConeHadronFlavourLabel
int ExclusiveConeHadronFlavourLabel(const xAOD::Jet &jet)
Definition: BTaggingTruthTaggingTool.cxx:1132
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
IBTaggingEfficiencyTool::getMCEfficiency
virtual CP::CorrectionCode getMCEfficiency(const xAOD::Jet &jet, float &eff)=0
BTaggingTruthTaggingTool::m_doDirectTag
bool m_doDirectTag
possibility to compute the direct tagging SFs map directly from the TruthTaggingTool
Definition: BTaggingTruthTaggingTool.h:253
python.xAODType.dummy
dummy
Definition: xAODType.py:4
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
BTaggingTruthTaggingTool::m_SFBName
std::string m_SFBName
name of the data/MC scale factor calibration for b jets
Definition: BTaggingTruthTaggingTool.h:213
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
BTaggingTruthTaggingTool::m_nbtag
int m_nbtag
Definition: BTaggingTruthTaggingTool.h:279
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
IBTaggingEfficiencyTool::getScaleFactor
virtual CP::CorrectionCode getScaleFactor(const xAOD::Jet &jet, float &sf)=0
Declare the interface that the class provides.
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
BTaggingTruthTaggingTool::m_excludeFromEV
std::string m_excludeFromEV
semicolon-separated list of uncertainties to be excluded from the eigenvector variation procedure
Definition: BTaggingTruthTaggingTool.h:235
CP::IReentrantSystematicsTool::affectingSystematics
virtual SystematicSet affectingSystematics() const =0
the list of all systematics this tool can be affected by
BTaggingTruthTaggingTool::getAllEffMCCDI
StatusCode getAllEffMCCDI(TRFinfo &trfinf)
Definition: BTaggingTruthTaggingTool.cxx:648
min
#define min(a, b)
Definition: cfImp.cxx:40
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
BTaggingTruthTaggingTool::m_useSys
bool m_useSys
Definition: BTaggingTruthTaggingTool.h:278
BTaggingTruthTaggingTool::m_njetsTagStrategy
NjetsTagStrategy m_njetsTagStrategy
Definition: BTaggingTruthTaggingTool.h:260
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
BTaggingTruthTaggingTool::generateRandomTaggerScores
StatusCode generateRandomTaggerScores(std::vector< std::vector< int > > &quantiles, std::vector< std::vector< float > > &btag_scores, std::vector< std::vector< float > > &ctag_scores)
Definition: BTaggingTruthTaggingTool.cxx:1169
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
BTaggingTruthTaggingTool::m_availableOP_fixCut
std::vector< std::string > m_availableOP_fixCut
Definition: BTaggingTruthTaggingTool.h:179
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:88
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
BTaggingTruthTaggingTool::getTagPermutation
StatusCode getTagPermutation(TRFinfo &trfinf, std::vector< std::vector< bool > > &trf_chosen_perm_ex, std::vector< std::vector< bool > > &trf_chosen_perm_in)
Definition: BTaggingTruthTaggingTool.cxx:808
BTaggingTruthTaggingTool::chooseAllTagBins
StatusCode chooseAllTagBins(TRFinfo &trfinf)
Definition: BTaggingTruthTaggingTool.cxx:920
weights
Definition: herwig7_interface.h:44
BTaggingTruthTaggingTool::m_EffBName
std::string m_EffBName
semicolon-separated list of MC efficiency parametrisation names for b jets
Definition: BTaggingTruthTaggingTool.h:227
BTaggingTruthTaggingTool::chooseTagBins_cum
StatusCode chooseTagBins_cum(TRFinfo &trfinf, std::vector< bool > &tagconf, bool isIncl, unsigned int nbtag)
Definition: BTaggingTruthTaggingTool.cxx:942
BTaggingTruthTaggingTool::AllJets
@ AllJets
Definition: BTaggingTruthTaggingTool.h:259
BTaggingTruthTaggingTool::m_effTool
asg::AnaToolHandle< IBTaggingEfficiencyTool > m_effTool
Definition: BTaggingTruthTaggingTool.h:287
BTaggingTruthTaggingTool::split
std::vector< std::string > split(const std::string &str, char token)
Definition: BTaggingTruthTaggingTool.cxx:1154
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
xAOD::BTaggingUtilities::getBTagging
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
Definition: BTaggingUtilities.cxx:37
BTaggingTruthTaggingTool::m_EVReductionB
std::string m_EVReductionB
specification of the eigenvector reduction strategy for b jets (if eigenvectors are used)
Definition: BTaggingTruthTaggingTool.h:221
a
TList * a
Definition: liststreamerinfos.cxx:10
h
BTaggingTruthTaggingTool::m_EVReductionLight
std::string m_EVReductionLight
specification of the eigenvector reduction strategy for light-flavour jets (if eigenvectors are used)
Definition: BTaggingTruthTaggingTool.h:225
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
BTaggingTruthTaggingTool::generatePermutations
std::vector< std::vector< bool > > generatePermutations(int njets, int tags, int start=0)
Definition: BTaggingTruthTaggingTool.cxx:680
ANA_CHECK_SET_TYPE
#define ANA_CHECK_SET_TYPE(TYPE)
set the type for ANA_CHECK to report failures
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:314
BTaggingTruthTaggingTool::CalculateResults
StatusCode CalculateResults(TRFinfo &trfinf, Analysis::TruthTagResults &results, int rand_seed=-1)
Definition: BTaggingTruthTaggingTool.cxx:477
BTaggingTruthTaggingTool::m_SFCName
std::string m_SFCName
name of the data/MC scale factor calibration for charm jets
Definition: BTaggingTruthTaggingTool.h:215
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Analysis::CalibrationDataVariables
Definition: CalibrationDataVariables.h:42
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
BTaggingTruthTaggingTool::chooseAllTagPermutation
StatusCode chooseAllTagPermutation(TRFinfo &trfinf, unsigned int nbtag)
Definition: BTaggingTruthTaggingTool.cxx:825
BTaggingTruthTaggingTool::m_EffFile
std::string m_EffFile
name of the optional MC efficiency file (may be changed by the PathResolver)
Definition: BTaggingTruthTaggingTool.h:211
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
IBTaggingSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *p) const =0
Declare the interface that the class provides.
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
BTaggingTruthTaggingTool::getEvtSF
float getEvtSF(TRFinfo &trfinf, std::vector< int > &quantiles)
Definition: BTaggingTruthTaggingTool.cxx:1052
IBTaggingEfficiencyTool::getInefficiencyScaleFactor
virtual CP::CorrectionCode getInefficiencyScaleFactor(const xAOD::Jet &jet, float &sf)=0
BTaggingTruthTaggingTool::m_ignoreSF
bool m_ignoreSF
Definition: BTaggingTruthTaggingTool.h:273
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
BTaggingTruthTaggingTool::m_usePerm
bool m_usePerm
Definition: BTaggingTruthTaggingTool.h:274
BTaggingTruthTaggingTool::m_EffLightName
std::string m_EffLightName
semicolon-separated list of MC efficiency parametrisation names for light-flavour jets
Definition: BTaggingTruthTaggingTool.h:233
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
BTaggingTruthTaggingTool::m_nbins
int m_nbins
Definition: BTaggingTruthTaggingTool.h:280
hotSpotInTAG.nb
nb
Definition: hotSpotInTAG.py:164
SG::DataProxy
Definition: DataProxy.h:44
IParticle
Definition: Event/EventKernel/EventKernel/IParticle.h:43
CP::ISystematicsTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)=0
effects: configure this tool for the given list of systematic variations.
python.compressB64.c
def c
Definition: compressB64.py:93
updateCoolNtuple.limit
int limit
Definition: updateCoolNtuple.py:45
PlotCalibFromCool.be
be
Definition: PlotCalibFromCool.py:398
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
BTaggingTruthTaggingTool::m_maxRangePt
float m_maxRangePt
Definition: BTaggingTruthTaggingTool.h:268
BTaggingTruthTaggingTool::m_SFFile
std::string m_SFFile
name of the data/MC efficiency scale factor calibration file (may be changed by the PathResolver)
Definition: BTaggingTruthTaggingTool.h:209
BTaggingTruthTaggingTool::m_taggingStrategy
std::string m_taggingStrategy
tagging strategy is required to do TT with GNN, when we don't want to truth tag all the jets (eg....
Definition: BTaggingTruthTaggingTool.h:257
BTaggingTruthTaggingTool::m_doOnlyUpVariations
bool m_doOnlyUpVariations
Definition: BTaggingTruthTaggingTool.h:272
fitman.k
k
Definition: fitman.py:528
BTaggingTruthTaggingTool::trfWeight
float trfWeight(TRFinfo &trfinf, const std::vector< bool > &tags)
Definition: BTaggingTruthTaggingTool.cxx:704
BTaggingTruthTaggingTool::m_OP
std::string m_OP
operating point
Definition: BTaggingTruthTaggingTool.h:239