![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <BTaggingTruthTaggingTool.h>
|
| 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 |
|
|
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 | ConeFinalPartonFlavourLabel (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...
|
|
|
std::vector< std::string > | m_availableOP_fixCut = {"FixedCutBEff_85", "FixedCutBEff_77","FixedCutBEff_70","FixedCutBEff_60"} |
|
TFile * | m_inf |
|
std::vector< TagBin > | m_cuts |
|
bool | m_initialised |
|
std::vector< CP::SystematicSet > | m_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...
|
|
bool | m_oldConeFlavourLabel |
| when using cone-based labelling (see above), if true, use the "traditional" (parton-based) labelling instead of the current default (hadron-based, exclusive) 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< IBTaggingEfficiencyTool > | m_effTool |
|
asg::AnaToolHandle< IBTaggingSelectionTool > | m_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 |
|
◆ StoreGateSvc_t
◆ NjetsTagStrategy
will be set according to m_taggingStrategy
Enumerator |
---|
AllJets | |
Leading2SignalJets | |
Leading3SignalJets | |
Definition at line 261 of file BTaggingTruthTaggingTool.h.
◆ BTaggingTruthTaggingTool()
BTaggingTruthTaggingTool::BTaggingTruthTaggingTool |
( |
const std::string & |
name | ) |
|
Create a constructor for standalone usage.
Definition at line 35 of file BTaggingTruthTaggingTool.cxx.
37 m_effTool (
"BTaggingEfficiencyTool/effTool",
this),
38 m_selTool (
"BTaggingSelectionTool/selTool",
this)
45 declareProperty(
"UsePermutations",
m_usePerm=
true,
"if the chosen permutation is used, a reweighting is applied to the TRF weight for systematics");
46 declareProperty(
"UseQuantile",
m_useQuntile=
true,
"if the chosen quantile is used, a reweighting is applied to the TRF weight for systematics");
47 declareProperty(
"UseSystematics",
m_useSys=
false,
"will the results contain all systematic variations, or just the nominal");
57 declareProperty(
"OperatingPoint",
m_OP=
"FixedCutBEff_77",
"operating point as specified in CDI file");
59 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)");
60 declareProperty(
"UseDevelopmentFile",
m_useDevFile =
false,
"specify whether or not to use the (PathResolver) area for temporary scale factor calibration CDI files");
64 declareProperty(
"ScaleFactorTCalibration",
m_SFTName =
"default",
"name of tau-jet scale factor calibration object");
66 declareProperty(
"EigenvectorReductionB",
m_EVReductionB =
"Loose",
"b-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'");
67 declareProperty(
"EigenvectorReductionC",
m_EVReductionC =
"Loose",
"c-jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'");
68 declareProperty(
"EigenvectorReductionLight",
m_EVReductionLight =
"Loose",
"light-flavour jet scale factor Eigenvector reduction strategy; choose between 'Loose', 'Medium', 'Tight'");
69 declareProperty(
"EfficiencyBCalibrations",
m_EffBName =
"default",
"(semicolon-separated) name(s) of b-jet efficiency object(s)");
70 declareProperty(
"EfficiencyCCalibrations",
m_EffCName =
"default",
"(semicolon-separated) name(s) of c-jet efficiency object(s)");
71 declareProperty(
"EfficiencyTCalibrations",
m_EffTName =
"default",
"(semicolon-separated) name(s) of tau-jet efficiency object(s)");
72 declareProperty(
"EfficiencyLightCalibrations",
m_EffLightName =
"default",
"(semicolon-separated) name(s) of light-flavour-jet efficiency object(s)");
73 declareProperty(
"ExcludeFromEigenVectorTreatment",
m_excludeFromEV =
"",
"(semicolon-separated) names of uncertainties to be excluded from eigenvector decomposition (if used)");
74 declareProperty(
"SystematicsStrategy",
m_systStrategy =
"SFEigen",
"name of systematics model; presently choose between 'SFEigen' and 'Envelope'");
75 declareProperty(
"ConeFlavourLabel",
m_coneFlavourLabel =
true,
"specify whether or not to use the cone-based flavour labelling instead of the default ghost association based labelling");
76 declareProperty(
"OldConeFlavourLabel",
m_oldConeFlavourLabel =
false,
"when using cone-based flavour labelling, specify whether or not to use the (deprecated) Run-1 legacy labelling");
77 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");
78 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");
79 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.");
80 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");
83 declareProperty(
"TaggingStrategy",
m_taggingStrategy =
"AllJets",
"tagging strategy in the Analysis (eg. 'leading2SignalJets' in boosted VHbb). Required to do TT with GNN");
◆ ~BTaggingTruthTaggingTool()
BTaggingTruthTaggingTool::~BTaggingTruthTaggingTool |
( |
| ) |
|
|
virtual |
◆ affectingSystematics()
SystematicSet BTaggingTruthTaggingTool::affectingSystematics |
( |
| ) |
const |
|
virtual |
◆ applySystematicVariation()
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 101 of file BTaggingTruthTaggingTool.cxx.
103 for (
auto syst : systConfig) {
105 ATH_MSG_WARNING(
"applySystematicVariation was called for " << syst.name() <<
" but BTaggingTruthTaggingTool does not apply Systematic Variations");
108 return StatusCode::SUCCESS;
◆ CalculateResults() [1/3]
◆ 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 |
◆ CalculateResults() [3/3]
Definition at line 475 of file BTaggingTruthTaggingTool.cxx.
480 trfinf.rand.SetSeed(rand_seed);
483 std::vector<float> trf_weight_ex, trf_weight_in;
485 trf_weight_ex.clear();
486 trf_weight_in.clear();
507 for(
unsigned int sys = 0;
sys < n_systs; ++
sys){
522 std::vector<int> is_tagged;
524 is_tagged.push_back(
static_cast<int>(
t));
531 for(
unsigned int ntj=0; ntj< trfinf.trfw_ex.size(); ntj++){
532 if(ntj > trfinf.njets) {
535 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.");
552 return StatusCode::SUCCESS;
◆ 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 |
◆ CalculateResultsONNX() [2/2]
◆ check_syst_range()
StatusCode BTaggingTruthTaggingTool::check_syst_range |
( |
unsigned int |
sys | ) |
|
|
private |
◆ chooseAllTagBins()
StatusCode BTaggingTruthTaggingTool::chooseAllTagBins |
( |
TRFinfo & |
trfinf | ) |
|
|
private |
Definition at line 918 of file BTaggingTruthTaggingTool.cxx.
920 trfinf.tbins_ex.clear();
921 trfinf.tbins_in.clear();
922 trfinf.tbins_ex.resize( trfinf.trfw_ex.size());
923 trfinf.tbins_in.resize( trfinf.trfw_in.size());
925 trfinf.binsprob_ex.clear();
926 trfinf.binsprob_in.clear();
927 trfinf.binsprob_ex.resize( trfinf.trfw_ex.size());
928 trfinf.binsprob_in.resize( trfinf.trfw_in.size());
930 if(trfinf.perm_ex.size() != trfinf.perm_in.size())
ATH_MSG_WARNING(
"Different sizes in exclusive and inclusive permutation choices");
932 for(
unsigned int nb=0;
nb<trfinf.perm_ex.size();
nb++) {
936 return StatusCode::SUCCESS;
◆ chooseAllTagPermutation()
StatusCode BTaggingTruthTaggingTool::chooseAllTagPermutation |
( |
TRFinfo & |
trfinf, |
|
|
unsigned int |
nbtag |
|
) |
| |
|
private |
Definition at line 823 of file BTaggingTruthTaggingTool.cxx.
828 return StatusCode::FAILURE;
831 unsigned int njets = trfinf.njets;
832 unsigned int limit = (njets > 7) ? 8 : njets+1;
833 unsigned int max = (njets < nbtag+1) ?
limit : nbtag+1;
835 trfinf.perm_ex.clear(), trfinf.perm_ex.resize(nbtag+1);
836 trfinf.perm_in.clear(), trfinf.perm_in.resize(nbtag+1);
838 trfinf.permprob_ex.clear(), trfinf.permprob_ex.resize(nbtag+1);
839 trfinf.permprob_in.clear(), trfinf.permprob_in.resize(nbtag+1);
841 for(
unsigned int i=0;
i<
max;
i++) {
846 return StatusCode::SUCCESS;
◆ chooseTagBins_cum()
StatusCode BTaggingTruthTaggingTool::chooseTagBins_cum |
( |
TRFinfo & |
trfinf, |
|
|
std::vector< bool > & |
tagconf, |
|
|
bool |
isIncl, |
|
|
unsigned int |
nbtag |
|
) |
| |
|
private |
Definition at line 940 of file BTaggingTruthTaggingTool.cxx.
941 std::vector<int> btagops;
945 std::vector<float> incl;
946 std::vector<float> untagged_bins;
952 untagged_bins.push_back(
bin);
958 for(
unsigned int j=0; j<tagconf.size(); j++) {
966 sum += trfinf.effMC_allBins[tagged_bin][j];
970 float theX = trfinf.rand.Uniform(
sum);
971 auto tag_index = std::lower_bound(incl.begin(), incl.end(), theX) - incl.begin();
973 btagops.push_back(tbin_choice);
974 prob *= (trfinf.effMC_allBins[tbin_choice][j]);
975 ATH_MSG_DEBUG(
"it " <<tag_index <<
" theX " <<theX <<
" effMC " <<trfinf.effMC_allBins[tbin_choice][j] <<
" prob* " <<
prob);
978 float untag_sum = 0. ;
981 for(
auto bin : untagged_bins){
982 untag_sum += trfinf.effMC_allBins[
bin][j];
983 incl.push_back(untag_sum);
986 float theX = trfinf.rand.Uniform(untag_sum);
987 auto untag_index = std::lower_bound(incl.begin(), incl.end(), theX) - incl.begin();
988 float utbin_choice = untagged_bins[untag_index];
989 btagops.push_back(utbin_choice);
990 prob *= 1 - trfinf.effMC_allBins[utbin_choice][j];
991 ATH_MSG_DEBUG(
" unt_bin " <<untag_index <<
" theX " <<theX<<
" 1-effMC " <<1-trfinf.effMC_allBins[utbin_choice][j] <<
" prob* " <<
prob);
995 if(btagops.size() != tagconf.size()) {
996 ATH_MSG_ERROR(
"You should not be here -> wrong size of tag bins vector. btagops: " <<btagops.size() <<
" tagconf: " <<tagconf.size());
997 return StatusCode::FAILURE;
1000 trfinf.tbins_in.at(nbtag) = btagops;
1001 trfinf.binsprob_in.at(nbtag) =
prob;
1005 trfinf.tbins_ex.at(nbtag) = btagops;
1006 trfinf.binsprob_ex.at(nbtag) =
prob;
1009 return StatusCode::SUCCESS;
◆ chooseTagPermutation()
StatusCode BTaggingTruthTaggingTool::chooseTagPermutation |
( |
TRFinfo & |
trfinf, |
|
|
unsigned int |
nbtag, |
|
|
bool |
isIncl |
|
) |
| |
|
private |
Definition at line 849 of file BTaggingTruthTaggingTool.cxx.
850 std::vector<float> incl;
851 std::vector<std::pair<unsigned int, unsigned int> > trackPerm;
854 for(
unsigned int itag=nbtag; itag < trfinf.permsWeight.size(); itag++) {
855 for(
unsigned int ip = 0;
ip < trfinf.permsWeight.at(itag).
size();
ip++) {
856 sum += trfinf.permsWeight.at(itag).at(
ip);
858 trackPerm.push_back(std::make_pair(itag,
ip));
863 sum = trfinf.permsSumWeight.at(nbtag).back();
864 incl = trfinf.permsSumWeight.at(nbtag);
865 for(
unsigned int ip = 0;
ip < trfinf.permsSumWeight.at(nbtag).
size();
ip++) trackPerm.push_back(std::make_pair(nbtag,
ip));
867 float theX = trfinf.rand.Uniform(
sum);
868 for(
unsigned int ip=0;
ip < incl.size();
ip++) {
870 if(incl.at(
ip) >= theX) {
872 trfinf.perm_in.at(nbtag) = trfinf.perms[trfinf.njets].at(trackPerm.at(
ip).first).at(trackPerm.at(
ip).second);
873 trfinf.permprob_in.at(nbtag) = trfinf.permsWeight.at(trackPerm.at(
ip).first).at(trackPerm.at(
ip).second) / trfinf.trfw_in.at(nbtag);
876 trfinf.perm_ex.at(nbtag) = trfinf.perms[trfinf.njets].at(trackPerm.at(
ip).first).at(trackPerm.at(
ip).second);
877 trfinf.permprob_ex.at(nbtag) = trfinf.permsWeight.at(trackPerm.at(
ip).first).at(trackPerm.at(
ip).second) / trfinf.trfw_ex.at(nbtag);
879 return StatusCode::SUCCESS;
882 return StatusCode::SUCCESS;
◆ ConeFinalPartonFlavourLabel()
int BTaggingTruthTaggingTool::ConeFinalPartonFlavourLabel |
( |
const xAOD::Jet & |
jet | ) |
|
|
private |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ ExclusiveConeHadronFlavourLabel()
int BTaggingTruthTaggingTool::ExclusiveConeHadronFlavourLabel |
( |
const xAOD::Jet & |
jet | ) |
|
|
private |
◆ extraDeps_update_handler()
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]
◆ fillVariables() [2/2]
Definition at line 431 of file BTaggingTruthTaggingTool.cxx.
433 x.jetEta =
jet.eta();
437 if (!tagInfo)
return StatusCode::FAILURE;
440 if(!(
code==CorrectionCode::Ok ||
code==CorrectionCode::OutOfValidityRange)){
441 ATH_MSG_ERROR(
"BTaggingSelectionTool::getTaggerWeight returned CorrectionCode::Error");
442 return StatusCode::FAILURE;
445 return StatusCode::SUCCESS;
◆ GAFinalHadronFlavourLabel()
int BTaggingTruthTaggingTool::GAFinalHadronFlavourLabel |
( |
const xAOD::Jet & |
jet | ) |
|
|
private |
Definition at line 1113 of file BTaggingTruthTaggingTool.cxx.
1115 const std::string labelB =
"GhostBHadronsFinal";
1116 const std::string labelC =
"GhostCHadronsFinal";
1117 const std::string labelTau =
"GhostTausFinal";
1119 std::vector<const IParticle*> ghostB;
1120 if (
jet.getAssociatedObjects<
IParticle>(labelB, ghostB) && ghostB.size() > 0)
return 5;
1121 std::vector<const IParticle*> ghostC;
1122 if (
jet.getAssociatedObjects<
IParticle>(labelC, ghostC) && ghostC.size() > 0)
return 4;
1123 std::vector<const IParticle*> ghostTau;
1124 if (
jet.getAssociatedObjects<
IParticle>(labelTau, ghostTau) && ghostTau.size() > 0)
return 15;
◆ generatePermutations()
std::vector< std::vector< bool > > BTaggingTruthTaggingTool::generatePermutations |
( |
int |
njets, |
|
|
int |
tags, |
|
|
int |
start = 0 |
|
) |
| |
|
private |
Definition at line 678 of file BTaggingTruthTaggingTool.cxx.
679 std::vector<std::vector<bool> > perm;
680 std::vector<std::vector<bool> > temp_perm;
682 std::vector<bool>
tags(njets,
false);
683 perm.push_back(
tags);
685 else if(
tags == njets) {
686 std::vector<bool>
tags(njets,
true);
687 perm.push_back(
tags);
692 for(
unsigned int j=0; j<temp_perm.size(); j++){
693 temp_perm.at(j).at(
i)=
true;
694 perm.push_back(temp_perm.at(j));
◆ 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 1177 of file BTaggingTruthTaggingTool.cxx.
1181 btag_scores.clear();
1182 btag_scores.resize(quantiles.size());
1185 ctag_scores.clear();
1186 ctag_scores.resize(quantiles.size());
1189 for(
unsigned int i=0;
i <quantiles.size();
i++ ){
1191 btag_scores.at(
i).resize(quantiles.at(
i).size());
1193 ctag_scores.at(
i).resize(quantiles.at(
i).size());
1195 unsigned int njets = quantiles.at(
i).size();
1196 for(
unsigned int j=0; j < njets; j++ ){
1198 int temp_quantile = (
m_continuous2D) ? quantiles.at(
i).at(j) : quantiles.at(
i).at(j) -1;
1200 float btag_low =
m_cuts[temp_quantile].bcut_low;
1201 float btag_hig =
m_cuts[temp_quantile].bcut_hig;
1203 float ctag_low =
m_cuts[temp_quantile].ccut_low;
1204 float ctag_hig =
m_cuts[temp_quantile].ccut_hig;
1206 btag_scores.at(
i).at(j) = btag_low + random.Uniform()*(btag_hig - btag_low );
1208 ctag_scores.at(
i).at(j) = ctag_low + random.Uniform()*(ctag_hig - ctag_low );
1211 return StatusCode::SUCCESS;
◆ getAllEffMC()
StatusCode BTaggingTruthTaggingTool::getAllEffMC |
( |
TRFinfo & |
trfinf | ) |
|
|
private |
◆ getAllEffMCCDI()
StatusCode BTaggingTruthTaggingTool::getAllEffMCCDI |
( |
TRFinfo & |
trfinf | ) |
|
|
private |
Definition at line 646 of file BTaggingTruthTaggingTool.cxx.
650 trfinf.effMC_allBins[
bin].clear();
652 for(
size_t jet=0;
jet < trfinf.jets.size();
jet++){
658 trfinf.jets.at(
jet).vars.jetTagWeight =
bin+0.5;
662 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 if(!(
code==CorrectionCode::Ok ||
code==CorrectionCode::OutOfValidityRange)){
666 ATH_MSG_ERROR(
"BTaggingEfficiencyTool::getMCEfficiency returned CorrectionCode::Error");
667 return StatusCode::FAILURE;
670 trfinf.effMC_allBins[
bin].push_back(eff_all);
671 ATH_MSG_DEBUG(
"effMC_allBins: tag bin: " <<
bin <<
" tagw: " << trfinf.jets.at(
jet).vars.jetTagWeight <<
" eff: " <<eff_all);
675 return StatusCode::SUCCESS;
◆ getAllEffMCGNN()
StatusCode BTaggingTruthTaggingTool::getAllEffMCGNN |
( |
TRFinfo & |
trfinf | ) |
|
|
private |
Definition at line 611 of file BTaggingTruthTaggingTool.cxx.
614 trfinf.effMC_allBins[
bin].clear();
617 std::vector<std::vector<float>> tmp_effMC_allBins;
620 if(!(
code==CorrectionCode::Ok ||
code==CorrectionCode::OutOfValidityRange)){
621 ATH_MSG_ERROR(
"BTaggingEfficiencyTool::getMCEfficiencyONNX returned CorrectionCode::Error");
622 return StatusCode::FAILURE;
628 std::vector<float> tmp_effMC_oneBin;
629 for (
unsigned int jet_index=0; jet_index<trfinf.njets; jet_index++){
630 tmp_effMC_oneBin.push_back(tmp_effMC_allBins[jet_index][
bin]);
632 trfinf.effMC_allBins[
bin] = tmp_effMC_oneBin;
636 for (
unsigned int jet_index=0; jet_index<trfinf.njets; jet_index++){
638 trfinf.effMC_allBins[0].push_back(1-tmp_effMC);
639 trfinf.effMC_allBins[1].push_back(tmp_effMC);
643 return StatusCode::SUCCESS;
◆ getAllEffSF()
StatusCode BTaggingTruthTaggingTool::getAllEffSF |
( |
TRFinfo & |
trfinf, |
|
|
int |
= 0 |
|
) |
| |
|
private |
◆ getDirectTaggedJets()
StatusCode BTaggingTruthTaggingTool::getDirectTaggedJets |
( |
TRFinfo & |
trfinf, |
|
|
std::vector< bool > & |
is_tagged |
|
) |
| |
|
private |
Definition at line 1033 of file BTaggingTruthTaggingTool.cxx.
1035 std::vector<int> appo;
1036 auto is_jettag =
false;
1037 for(
const auto &
jet : trfinf.jets) {
1038 ATH_MSG_DEBUG(
"pt " <<
jet.vars.jetPt <<
" eta " <<
jet.vars.jetEta <<
" wei " <<
jet.vars.jetTagWeight);
1042 if(is_jettag) is_tagged.push_back(1);
1043 else is_tagged.push_back(0);
1046 return StatusCode::SUCCESS;
◆ getEvtSF()
float BTaggingTruthTaggingTool::getEvtSF |
( |
TRFinfo & |
trfinf, |
|
|
std::vector< int > & |
quantiles |
|
) |
| |
|
private |
Definition at line 1050 of file BTaggingTruthTaggingTool.cxx.
1057 for(
unsigned int i =0;
i< trfinf.njets;
i++) {
1062 bool is_btagged = quantiles.at(
i);
1065 if(!(
code==CorrectionCode::Ok ||
code==CorrectionCode::OutOfValidityRange)){
1066 ATH_MSG_ERROR(
"BTaggingEfficiencyTool::getScaleFactor returned CorrectionCode::Error");
1071 int bin = quantiles.at(
i);
1077 if(!(
code==CorrectionCode::Ok ||
code==CorrectionCode::OutOfValidityRange)){
1078 ATH_MSG_ERROR(
"BTaggingEfficiencyTool::getScaleFactor returned CorrectionCode::Error");
1081 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);
◆ getKey()
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
-
ptr | The 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.
121 #ifdef XAOD_STANDALONE
124 return evtStore()->event()->getKey( ptr );
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ 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
-
ptr | The 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.
108 #ifdef XAOD_STANDALONE
111 return evtStore()->event()->getName( ptr );
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ 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 898 of file BTaggingTruthTaggingTool.cxx.
899 trf_bin_ex.resize(trfinf.tbins_ex.size());
900 for(
unsigned int i =0;
i<trfinf.tbins_ex.size();
i++)
901 trf_bin_ex.at(
i).resize(trfinf.tbins_ex.at(
i).size());
903 trf_bin_in.resize(trfinf.tbins_in.size());
904 for(
unsigned int i =0;
i<trfinf.tbins_in.size();
i++)
905 trf_bin_in.at(
i).resize(trfinf.tbins_in.at(
i).size());
907 for(
unsigned int i =0;
i<trfinf.tbins_ex.size();
i++)
908 for(
unsigned int j=0; j<trfinf.tbins_ex.at(
i).
size(); j++)
911 for(
unsigned int i =0;
i<trfinf.tbins_in.size();
i++)
912 for(
unsigned int j=0; j<trfinf.tbins_in.at(
i).size(); j++)
915 return StatusCode::SUCCESS;
◆ getTagBinsConfProb()
float BTaggingTruthTaggingTool::getTagBinsConfProb |
( |
TRFinfo & |
trfinf, |
|
|
std::vector< int > & |
tagws |
|
) |
| |
|
private |
Definition at line 1012 of file BTaggingTruthTaggingTool.cxx.
1014 for(
unsigned int j=0; j<tagws.size(); j++) {
1019 sum_tag += trfinf.effMC_allBins[
bin][j];
1022 prob *= (trfinf.effMC_allBins[tagws.at(j)][j]) / sum_tag;
1026 prob *= (1 - trfinf.effMC_allBins[tagws.at(j)][j]) / (1 - sum_tag);
◆ 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 806 of file BTaggingTruthTaggingTool.cxx.
807 trf_chosen_perm_ex.resize(
m_nbtag+1);
808 trf_chosen_perm_in.resize(
m_nbtag+1);
809 trf_chosen_perm_ex = trfinf.perm_ex;
810 trf_chosen_perm_in = trfinf.perm_in;
811 std::string print_perm =
"Permutation: ";
812 for(
auto perm: trfinf.perm_ex){
820 return StatusCode::SUCCESS;
◆ getTRFweight()
StatusCode BTaggingTruthTaggingTool::getTRFweight |
( |
TRFinfo & |
trfinf, |
|
|
unsigned int |
nbtag, |
|
|
bool |
isInclusive |
|
) |
| |
|
private |
Definition at line 726 of file BTaggingTruthTaggingTool.cxx.
728 unsigned int njets = trfinf.njets;
730 unsigned int limit = (njets > 7) ? 8 : njets+1;
733 auto& perm = trfinf.perms[njets];
739 trfinf.permsWeight.clear(), trfinf.permsWeight.resize(
limit);
740 trfinf.permsSumWeight.clear(), trfinf.permsSumWeight.resize(
limit);
743 unsigned int max = nbtag+1;
744 trfinf.trfw_ex.clear(), trfinf.trfw_in.clear();
745 trfinf.trfw_ex.resize(
max), trfinf.trfw_in.resize(
max);
748 trfinf.perm_ex.clear(), trfinf.perm_in.clear();
749 trfinf.perm_ex.resize(
max), trfinf.perm_in.resize(
max);
750 trfinf.permprob_ex.clear(), trfinf.permprob_in.clear();
751 trfinf.permprob_ex.resize(
max), trfinf.permprob_in.resize(
max);
754 for(
unsigned int i=0;
i<
limit;
i++) {
755 std::vector<float> weights;
758 trfinf.permsWeight.at(
i).clear();
759 trfinf.permsSumWeight.at(
i).clear();
760 trfinf.permsWeight.at(
i).resize(trfinf.perms[njets].at(
i).size());
761 trfinf.permsSumWeight.at(
i).resize(trfinf.perms[njets].at(
i).size());
764 for(
unsigned int p=0;
p<trfinf.perms[njets].at(
i).
size();
p++) {
768 trfinf.permsWeight.at(
i).at(
p) =
w;
769 trfinf.permsSumWeight.at(
i).at(
p) =
sum;
775 trfinf.trfw_ex.at(
i) =
sum;
776 if(
i == 0) trfinf.trfw_in.at(0) = 1.;
777 else trfinf.trfw_in.at(
i) = trfinf.trfw_in.at(
i-1) - trfinf.trfw_ex.at(
i-1);
778 ATH_MSG_DEBUG(
"i = " <<
i <<
" sum = " <<
sum <<
" TRF in " << trfinf.trfw_in.at(
i) <<
" ex = " << trfinf.trfw_ex.at(
i));
781 ATH_MSG_DEBUG(
"before return, nbtag = " << nbtag <<
" size de trfinf.trfw_in = " << trfinf.trfw_in.size());
782 return StatusCode::SUCCESS;
785 std::vector<float> weights;
786 float sum = 0.,
w = 0.;
787 size_t size = trfinf.perms[njets].at(nbtag).size();
788 trfinf.permsWeight.at(nbtag).clear();
789 trfinf.permsSumWeight.at(nbtag).clear();
790 trfinf.permsWeight.at(nbtag).resize(
size);
791 trfinf.permsSumWeight.at(nbtag).resize(
size);
793 for(
unsigned int p=0;
p<trfinf.perms[njets].at(nbtag).
size();
p++) {
794 w =
trfWeight(trfinf,trfinf.perms[njets].at(nbtag).at(
p));
796 trfinf.permsWeight.at(nbtag).at(
p) =
w;
797 trfinf.permsSumWeight.at(nbtag).at(
p) =
sum;
799 trfinf.trfw_ex.at(nbtag) =
sum;
800 return StatusCode::SUCCESS;
802 return StatusCode::SUCCESS;
◆ GetTruthTagWeights()
StatusCode BTaggingTruthTaggingTool::GetTruthTagWeights |
( |
TRFinfo & |
trfinf, |
|
|
std::vector< float > & |
trf_weight_ex, |
|
|
std::vector< float > & |
trf_weight_in |
|
) |
| |
|
private |
Definition at line 456 of file BTaggingTruthTaggingTool.cxx.
469 trf_weight_ex = trfinf.trfw_ex;
470 trf_weight_in = trfinf.trfw_in;
471 return StatusCode::SUCCESS;
◆ 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 121 of file BTaggingTruthTaggingTool.cxx.
163 if(
m_OP.find(
"Continuous") != std::string::npos){
166 if(
m_OP.find(
"Continuous2D") != std::string::npos)
171 for (
const auto & tag_bin : tag_benchmarks ){
184 ATH_MSG_ERROR(
"UseQuantile is available only in Continuous WP. Please consider switching the Operating Point.");
185 return StatusCode::FAILURE;
200 std::vector<std::string> excludeEV_vector;
204 for (
const auto & syst : systs) {
206 string s = syst.name();
208 if(std::any_of(excludeEV_vector.begin(), excludeEV_vector.end(), [&
s](
const std::string&
str) { return str.find(s) != std::string::npos; }))
continue;
211 ATH_MSG_INFO(
"Adding systematic " << syst.name() <<
"to the list ");
213 ATH_MSG_DEBUG(
"Adding systematic " << syst.name() <<
"to the list ");
223 m_inf = TFile::Open(pathtofile,
"read");
225 float min_cut_low = (
m_taggerName ==
"MV2c10") ? -1 : -20;
226 float max_cut_hig = (
m_taggerName ==
"MV2c10") ? +1 : +20;
228 if(
m_OP ==
"Continuous"){
229 std::vector<float> bin_edges;
230 bin_edges.push_back(min_cut_low);
233 float cutval = ((TVector*)
m_inf->Get(cutname))[0](0);
234 bin_edges.push_back(cutval);
236 bin_edges.push_back(max_cut_hig);
237 for (
unsigned int be = 0 ;
be < bin_edges.size()-1 ;
be++){
241 TagBin one_cut = TagBin(is_tagbin, bin_edges.at(
be), bin_edges.at(
be+1));
242 m_cuts.push_back(one_cut);
245 else if (
m_OP.find(
"Continuous2D") != std::string::npos){
246 ATH_MSG_INFO(
"TruthTagging initialization: Working with Continuous2D WP.");
248 TMatrixD* cuts2D = (TMatrixD*)
m_inf->Get(cutname);
251 for (
int bin = 0;
bin < cuts2D->GetNrows();
bin++){
253 <<(*cuts2D)(
bin,1) <<
" b-cuts : "
254 <<(*cuts2D)(
bin,2) <<
" "
262 float c_tagcut_low = ((*cuts2D)(
bin,0) < min_cut_low) ? min_cut_low : (*cuts2D)(
bin,0);
263 float c_tagcut_hig = ((*cuts2D)(
bin,1) > max_cut_hig) ? max_cut_hig : (*cuts2D)(
bin,1);
264 float b_tagcut_low = ((*cuts2D)(
bin,2) < min_cut_low) ? min_cut_low : (*cuts2D)(
bin,2);
265 float b_tagcut_hig = ((*cuts2D)(
bin,3) > max_cut_hig) ? max_cut_hig : (*cuts2D)(
bin,3);
267 TagBin one_cut = TagBin(is_tagbin, b_tagcut_low, b_tagcut_hig, c_tagcut_low, c_tagcut_hig);
268 m_cuts.push_back(one_cut);
273 float cutval = ((TVector*)
m_inf->Get(cutname))[0](0);
275 TagBin untag_bin = TagBin(
false, min_cut_low, cutval);
276 TagBin tag_bin = TagBin(
true, cutval, max_cut_hig);
278 m_cuts.push_back(untag_bin);
279 m_cuts.push_back(tag_bin);
284 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);
301 return StatusCode::FAILURE;
304 return StatusCode::SUCCESS;
◆ inputHandles()
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()
◆ jetFlavourLabel()
int BTaggingTruthTaggingTool::jetFlavourLabel |
( |
const xAOD::Jet & |
jet | ) |
|
|
private |
◆ msg() [1/2]
◆ msg() [2/2]
◆ 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.
◆ msgLvl()
◆ outputHandles()
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 |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, top::TopObjectSelection, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ recommendedSystematics()
SystematicSet BTaggingTruthTaggingTool::recommendedSystematics |
( |
| ) |
const |
|
virtual |
◆ renounce()
◆ renounceArray()
◆ setEffMapIndex()
StatusCode BTaggingTruthTaggingTool::setEffMapIndex |
( |
const std::string & |
flavour, |
|
|
unsigned int |
index |
|
) |
| |
|
virtual |
◆ setJets() [1/6]
StatusCode BTaggingTruthTaggingTool::setJets |
( |
TRFinfo & |
trfinf, |
|
|
const std::vector< std::vector< float >> & |
node_feat, |
|
|
std::vector< float > & |
tagw |
|
) |
| |
|
private |
Definition at line 362 of file BTaggingTruthTaggingTool.cxx.
364 if(node_feat.size()!=tagw.size()){
365 ATH_MSG_ERROR(
"Vectors of node_feat (outer axis) and tagw should have same size" );
366 return StatusCode::FAILURE;
369 std::vector<int> flav;
370 std::vector<Analysis::CalibrationDataVariables>* vars =
new std::vector<Analysis::CalibrationDataVariables>(0);
371 for(
unsigned int i =0;
i<tagw.size();
i++){
375 float pt = node_feat.at(
i)[1];
376 float eta = node_feat.at(
i)[2];
379 vars->push_back(vars_appo);
380 flav.push_back(node_feat.at(
i)[0]);
384 return StatusCode::SUCCESS;
◆ setJets() [2/6]
Definition at line 327 of file BTaggingTruthTaggingTool.cxx.
329 std::vector<int> flav;
330 std::vector<Analysis::CalibrationDataVariables>* vars =
new std::vector<Analysis::CalibrationDataVariables>(0);
334 vars->push_back(vars_appo);
341 return StatusCode::SUCCESS;
◆ setJets() [3/6]
Definition at line 388 of file BTaggingTruthTaggingTool.cxx.
390 std::vector<int> flav;
391 std::vector<Analysis::CalibrationDataVariables>* vars =
new std::vector<Analysis::CalibrationDataVariables>(0);
395 vars->push_back(vars_appo);
401 return StatusCode::SUCCESS;
◆ 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 308 of file BTaggingTruthTaggingTool.cxx.
310 if(
pt.size()!=
eta.size() ||
pt.size()!=flav.size() ||
pt.size()!=tagw.size()){
311 ATH_MSG_ERROR(
"Vectors of pt, eta, flav and tagw should have same size" );
312 return StatusCode::FAILURE;
315 std::vector<Analysis::CalibrationDataVariables>* vars =
new std::vector<Analysis::CalibrationDataVariables>(0);
316 for(
unsigned int i =0;
i<
pt.size();
i++){
319 vars->push_back(vars_appo);
324 return StatusCode::SUCCESS;
◆ setJets() [5/6]
Definition at line 407 of file BTaggingTruthTaggingTool.cxx.
408 if(flav.size()!=vars->size()){
409 ATH_MSG_ERROR(
"Vector of CalibrationDataVariables and flavour should have same size" );
410 return StatusCode::FAILURE;
415 trfinf.njets = vars->size();
420 for(
unsigned int i =0;
i<trfinf.njets;
i++){
421 jetVariable jetVar_appo;
422 jetVar_appo.flav=flav.at(
i);
423 jetVar_appo.vars=vars->at(
i);
424 trfinf.jets.push_back(jetVar_appo);
426 trfinf.node_feat = node_feat;
427 return StatusCode::SUCCESS;
◆ setJets() [6/6]
Definition at line 344 of file BTaggingTruthTaggingTool.cxx.
345 if(flav.size()!=vars->size()){
346 ATH_MSG_ERROR(
"Vector of CalibrationDataVariables and flavour should have same size" );
347 return StatusCode::FAILURE;
350 for(
unsigned int i =0;
i<vars->size();
i++){
351 jetVariable jetVar_appo;
352 jetVar_appo.flav=flav.at(
i);
353 jetVar_appo.vars=vars->at(
i);
354 trfinf.jets.push_back(jetVar_appo);
357 trfinf.njets=trfinf.jets.size();
358 return StatusCode::SUCCESS;
◆ setUseSystematics()
void BTaggingTruthTaggingTool::setUseSystematics |
( |
bool |
useSystematics | ) |
|
◆ split()
std::vector< std::string > BTaggingTruthTaggingTool::split |
( |
const std::string & |
str, |
|
|
char |
token |
|
) |
| |
|
private |
◆ sysInitialize()
◆ sysStart()
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 |
◆ updateVHKA()
◆ m_availableOP_fixCut
std::vector<std::string> BTaggingTruthTaggingTool::m_availableOP_fixCut = {"FixedCutBEff_85", "FixedCutBEff_77","FixedCutBEff_70","FixedCutBEff_60"} |
|
private |
◆ m_coneFlavourLabel
bool BTaggingTruthTaggingTool::m_coneFlavourLabel |
|
private |
◆ m_continuous
bool BTaggingTruthTaggingTool::m_continuous |
|
private |
◆ m_continuous2D
bool BTaggingTruthTaggingTool::m_continuous2D |
|
private |
◆ m_cutBenchmark
std::string BTaggingTruthTaggingTool::m_cutBenchmark |
|
private |
◆ m_cuts
std::vector<TagBin> BTaggingTruthTaggingTool::m_cuts |
|
private |
◆ m_detStore
◆ m_doDirectTag
bool BTaggingTruthTaggingTool::m_doDirectTag |
|
private |
◆ m_doOnlyUpVariations
bool BTaggingTruthTaggingTool::m_doOnlyUpVariations |
|
private |
◆ m_eff_syst
◆ m_EffBName
std::string BTaggingTruthTaggingTool::m_EffBName |
|
private |
◆ m_EffCName
std::string BTaggingTruthTaggingTool::m_EffCName |
|
private |
◆ m_EffFile
std::string BTaggingTruthTaggingTool::m_EffFile |
|
private |
◆ m_EffLightName
std::string BTaggingTruthTaggingTool::m_EffLightName |
|
private |
◆ m_EffTName
std::string BTaggingTruthTaggingTool::m_EffTName |
|
private |
◆ m_effTool
◆ m_effTool_allBins
◆ 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
◆ m_excludeEV
std::string BTaggingTruthTaggingTool::m_excludeEV |
|
private |
◆ 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 |
◆ m_inf
TFile* BTaggingTruthTaggingTool::m_inf |
|
private |
◆ m_initialised
bool BTaggingTruthTaggingTool::m_initialised |
|
private |
◆ m_jetAuthor
std::string BTaggingTruthTaggingTool::m_jetAuthor |
|
private |
◆ m_maxEta
float BTaggingTruthTaggingTool::m_maxEta |
|
private |
◆ m_maxRangePt
float BTaggingTruthTaggingTool::m_maxRangePt |
|
private |
◆ m_minPt
float BTaggingTruthTaggingTool::m_minPt |
|
private |
◆ m_nbins
int BTaggingTruthTaggingTool::m_nbins |
|
private |
◆ m_nbtag
int BTaggingTruthTaggingTool::m_nbtag |
|
private |
◆ m_njetsTagStrategy
◆ m_oldConeFlavourLabel
bool BTaggingTruthTaggingTool::m_oldConeFlavourLabel |
|
private |
when using cone-based labelling (see above), if true, use the "traditional" (parton-based) labelling instead of the current default (hadron-based, exclusive)
Definition at line 251 of file BTaggingTruthTaggingTool.h.
◆ m_OP
std::string BTaggingTruthTaggingTool::m_OP |
|
private |
◆ m_OP_index_for_GNN
unsigned int BTaggingTruthTaggingTool::m_OP_index_for_GNN |
|
private |
◆ m_OperatingBins
std::vector<int> BTaggingTruthTaggingTool::m_OperatingBins |
|
private |
◆ m_pathToONNX
std::string BTaggingTruthTaggingTool::m_pathToONNX |
|
private |
◆ m_selTool
◆ m_SFBName
std::string BTaggingTruthTaggingTool::m_SFBName |
|
private |
◆ m_SFCName
std::string BTaggingTruthTaggingTool::m_SFCName |
|
private |
◆ m_SFFile
std::string BTaggingTruthTaggingTool::m_SFFile |
|
private |
◆ m_SFLightName
std::string BTaggingTruthTaggingTool::m_SFLightName |
|
private |
◆ m_SFTName
std::string BTaggingTruthTaggingTool::m_SFTName |
|
private |
◆ m_sys_name
std::vector<std::string> BTaggingTruthTaggingTool::m_sys_name |
|
private |
◆ m_systStrategy
std::string BTaggingTruthTaggingTool::m_systStrategy |
|
private |
◆ m_taggerName
std::string BTaggingTruthTaggingTool::m_taggerName |
|
private |
◆ 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 259 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 |
◆ m_useQuntile
bool BTaggingTruthTaggingTool::m_useQuntile |
|
private |
◆ m_useSys
bool BTaggingTruthTaggingTool::m_useSys |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::string find(const std::string &s)
return a remapped string
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
const float SF[NF]
Cross sections for Fluor.
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::vector< std::string > tags
::StatusCode StatusCode
StatusCode definition for legacy code.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
std::string to_string(const DetectorType &type)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
#define ATH_MSG_WARNING(x)
Return value from object correction CP tools.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>