ATLAS Offline Software
Loading...
Searching...
No Matches
JSSTaggerUtils Class Reference

#include <JSSTaggerUtils.h>

Inheritance diagram for JSSTaggerUtils:
Collaboration diagram for JSSTaggerUtils:

Public Member Functions

 JSSTaggerUtils (const std::string &name)
 Constructor.
virtual StatusCode initialize () override
 Run once at the start of the job to setup everything.
virtual StatusCode tag (const xAOD::Jet &jet) const override
 IJetSelectorTool interface.
TH2D MakeJetImage (TString TagImage, const xAOD::Jet *jet, std::vector< xAOD::JetConstituent > constituents) const override
StatusCode GetImageScore (const xAOD::JetContainer &jets) const override
StatusCode GetConstScore (const xAOD::JetContainer &jets) const override
StatusCode GetQGConstScore (const xAOD::JetContainer &jets) const override
StatusCode GetTopConstScore (const xAOD::JetContainer &jets) const override
StatusCode GetWConstScore (const xAOD::JetContainer &jets) const override
StatusCode GetHLScore (const xAOD::JetContainer &jets) const override
std::map< std::string, double > GetJSSVars (const xAOD::Jet &jet) const override
StatusCode ReadScaler () override
virtual StatusCode decorate (const xAOD::JetContainer &jets) const override
 Decorate jet collection with tagging info.
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
virtual StatusCode modify (xAOD::JetContainer &jets) const override final
 Concrete implementation of the function inherited from IJetModifier.
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Public Attributes

std::map< std::string, std::vector< double > > m_scaler

Protected Types

enum  TAGCLASS { Unknown , WBoson , ZBoson , TopQuark }
 TAGTYPE enum. More...

Protected Member Functions

StatusCode getConfigReader ()
 Get configReader StatusCode.
StatusCode resetCuts (asg::AcceptData &acceptData) const
 Reset cuts.
bool passKinRange (const xAOD::Jet &jet) const
 Check if jet passes kinematic constraints.
StatusCode checkKinRange (const xAOD::Jet &jet, asg::AcceptData &acceptData) const
 Check and record if jet passes kinematic constraints.
int calculateJSSRatios (const xAOD::Jet &jet) const
 Calculate JSS moment ratios in case they are not already saved TODO: Remove this once JSSMomentTools is modified to take const jets.
void decorateJSSRatios (const xAOD::JetContainer &jets) const
int findPV () const
 Find the PV (to be used for Ntrk)
int GetUnGroomTracks (const xAOD::Jet &jet, int indexPV) const
 Retrieve Ntrk variable from the ungroomed parent jet.
StatusCode getWeight (const xAOD::Jet &jet, bool passSel, asg::AcceptData &acceptData) const
 Get SF weight.
std::pair< double, double > getSF (const xAOD::Jet &jet, const std::string &truthLabelStr) const
 Get scale factor and efficiency.
std::string getTruthLabelStr (const xAOD::Jet &jet, asg::AcceptData &acceptData) const
void printCuts () const
 Print configured cuts.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Protected Attributes

TEnv m_configReader
 TEnv instance to read config files.
asg::AcceptInfo m_acceptInfo
 Object that stores the results for a jet.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decTaggedKey {this, "TaggedName", "Tagged", "SG key for Tagged"}
 WriteDecorHandle keys for tagging bools.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decValidPtRangeHighKey {this, "ValidPtRangeHighName", "ValidPtRangeHigh", "SG key for ValidPtRangeHigh"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decValidPtRangeLowKey {this, "ValidPtRangeLowName", "ValidPtRangeLow", "SG key for ValidPtRangeLow"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decValidEtaRangeKey {this, "ValidEtaRangeName", "ValidEtaRange", "SG key for ValidEtaRange"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decValidKinRangeKey {this, "ValidKinRangeName", "ValidKinRange", "SG key for ValidKinRange"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decValidJetContentKey {this, "ValidJetContentName", "ValidJetContent", "SG key for ValidJetContent"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decValidEventContentKey {this, "ValidEventContentName", "ValidEventContent", "SG key for ValidEventContent"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decPassMassKey {this, "PassMassName", "PassMass", "SG key for PassMass"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decPassScoreKey {this, "PassScoreName", "PassScore", "SG key for PassScore"}
const int m_nWarnMax = 10
 Maximum number of warnings.
std::atomic< int > m_nWarnVar
 Warning counters.
bool m_ptGeV = false
 Flag to indicate units pT is defined in Set to false by default.
bool m_useMassCut = false
 Flag to indicate if mass window cut is used.
bool m_useScoreCut = false
 Flag to indicate if a discriminant score is used.
TAGCLASS m_tagClass {Unknown}
std::string m_containerName
 Configurable members.
bool m_isSmallRJet = false
std::string m_weightConfigPath
 Path to the SF configuration root file.
std::string m_configFile
 Configuration file name.
std::string m_calibArea
 Location where config files live on cvmfs.
std::string m_kerasConfigFileName
 Keras configurations for ML taggers.
std::string m_kerasConfigFilePath
std::string m_kerasConfigOutputName
std::string m_kerasCalibArea
std::string m_tmvaConfigFileName
 TMVA configurations for BDT taggers.
std::string m_tmvaConfigFilePath
std::string m_tmvaCalibArea
std::string m_wkpt
 Tagger information.
std::string m_tagType
float m_jetPtMin {}
 Kinematic bounds for the jet - the units are controlled by m_ptGeV.
float m_jetPtMax {}
float m_jetEtaMax {}
bool m_useECFG = false
 Flags controlling whether generalized ECF moments or L-series ratios are needed TODO: Implement the functionality controlled by these.
bool m_useLSeries = false
SG::WriteDecorHandleKey< xAOD::JetContainerm_decTau21WTAKey {this, "Tau21WTANameOut", "Tau21_wta", "SG key for Tau21_wta"}
 WriteDecorHandle keys for JSS moments.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decTau32WTAKey {this, "Tau32WTANameOut", "Tau32_wta", "SG key for Tau32_wta"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decTau42WTAKey {this, "Tau42WTANameOut", "Tau42_wta", "SG key for Tau42_wta"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decC2Key {this, "C2NameOut", "C2", "SG key for C2"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decD2Key {this, "D2NameOut", "D2", "SG key for D2"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decE3Key {this, "e3NameOut", "e3", "SG key for e3"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decL2Key {this, "L2NameOut", "L2", "SG key for L2"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decL3Key {this, "L3NameOut", "L3", "SG key for L3"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readTau1WTAKey {this, "Tau1WTAName", "Tau1_wta", "SG key for Tau1_wta"}
 ReadDecorHandle keys for JSS moments.
SG::ReadDecorHandleKey< xAOD::JetContainerm_readTau2WTAKey {this, "Tau2WTAName", "Tau2_wta", "SG key for Tau2_wta"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readTau3WTAKey {this, "Tau3WTAName", "Tau3_wta", "SG key for Tau3_wta"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readTau4WTAKey {this, "Tau4WTAName", "Tau4_wta", "SG key for Tau4_wta"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readECF1Key {this, "ECF1Name", "ECF1", "SG key for ECF1"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readECF2Key {this, "ECF2Name", "ECF2", "SG key for ECF2"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readECF3Key {this, "ECF3Name", "ECF3", "SG key for ECF3"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readSplit12Key {this, "Split12Name", "Split12", "SG key for Split12"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readSplit23Key {this, "Split23Name", "Split23", "SG key for Split23"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readQwKey {this, "QwName", "Qw", "SG key for Qw"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readThrustMajKey {this, "ThrustMajName", "ThrustMaj", "SG key for ThrustMaj"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readSphericityKey {this, "SphericityName", "Sphericity", "SG key for Sphericity"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readECFG331Key {this, "ECFG331Name", "ECFG_3_3_1", "SG key for ECFG_3_3_1"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readECFG311Key {this, "ECFG311Name", "ECFG_3_1_1", "SG key for ECFG_3_1_1"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readECFG212Key {this, "ECFG212Name", "ECFG_2_1_2", "SG key for ECFG_2_1_2"}
SG::ReadDecorHandleKey< xAOD::JetContainerm_readParentKey {this, "ParentName", "Parent", "SG key for Parent"}
Gaudi::Property< bool > m_suppressInputDependence {this, "SuppressInputDependence", false}
Gaudi::Property< bool > m_suppressOutputDependence {this, "SuppressOutputDependence", false}
std::string m_strMassCutLow
 Strings for cut functions.
std::string m_strMassCutHigh
std::string m_strScoreCut
std::unique_ptr< TF1 > m_funcMassCutLow
 TF1 for cut functions.
std::unique_ptr< TF1 > m_funcMassCutHigh
std::unique_ptr< TF1 > m_funcScoreCut
std::string m_decorationName
 Decoration name.
bool m_calcSF {}
 Flag to calculate scale factor.
bool m_isMC {}
std::string m_weightDecorationName
 String for scale factor decoration names.
std::string m_weightFileName
std::string m_weightHistogramName
std::string m_efficiencyHistogramName
std::string m_weightFlavors
std::unique_ptr< TFile > m_weightConfig
 Histograms for scale factors.
std::map< std::string, std::unique_ptr< TH2D > > m_weightHistograms
std::map< std::string, std::unique_ptr< TH2D > > m_efficiencyHistograms
bool m_truthLabelUseTRUTH3 {}
 Truth label options.
std::string m_truthParticleContainerName
std::string m_truthBosonContainerName
std::string m_truthTopQuarkContainerName
std::string m_truthLabelName
SG::ReadDecorHandleKey< xAOD::JetContainerm_readTruthLabelKey {this, "truthLabelName", "truthLabel", "SG key for truthLabel"}
 Truth label ReadDecorHandle key.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decCutMLowKey {this, "CutMLowName", "Cut_mlow", "SG key for Cut_mlow"}
 WriteDecorHandle keys for cut values.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decCutMHighKey {this, "CutMHighName", "Cut_mhigh", "SG key for Cut_mhigh"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decScoreCutKey {this, "CutScoreName", "Cut_score", "SG key for Cut_score"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decScoreValueKey {this, "ScoreName", "Score", "SG key for Score"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decWeightKey {this, "weightName", "weight", "SG key for weight"}
 WriteDecorHandle keys for SF.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decEfficiencyKey {this, "efficiencyName", "efficiency", "SG key for efficiency"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decEffSFKey {this, "effSFName", "effSF", "SG key for effSF"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decSigeffSFKey {this, "sigeffSFName", "sigeffSF", "SG key for effSF"}

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

int m_nbins_eta {}
int m_nbins_phi {}
double m_min_eta {}
double m_max_eta {}
double m_min_phi {}
double m_max_phi {}
int m_ncolors {}
bool m_dorscaling {}
double m_rscaling_p0 {}
double m_rscaling_p1 {}
bool m_UseConstTagger {}
ToolHandle< AthONNX::IJSSMLToolm_MLBosonTagger {"", this}
bool m_UseHLTagger {}
ToolHandle< AthONNX::IJSSMLToolm_MLBosonTagger_HL {"", this}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decNConstituentsKey {this, "nConstituentsName", "nConstituents", "SG key for constituents multiplicity"}
 WriteDecorHandle keys.
SG::WriteDecorHandleKey< xAOD::JetContainerm_decNTopoTowersKey {this, "nTopoTowersName", "nTopoTowers", "SG key for towers multiplicity"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decConstScoreKey {this, "ConstScoreNameDec", "ConstScore", "SG key for ConstScore"}
SG::WriteDecorHandleKey< xAOD::JetContainerm_decHLScoreKey {this, "HLScoreName", "HLScore", "SG key for HLScore"}
std::unique_ptr< SG::ConstAccessor< float > > m_constScoreAcc = nullptr
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 14 of file JSSTaggerUtils.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

◆ TAGCLASS

enum JSSTaggerBase::TAGCLASS
protectedinherited

TAGTYPE enum.

Enumerator
Unknown 
WBoson 
ZBoson 
TopQuark 

Definition at line 97 of file JSSTaggerBase.h.

Constructor & Destructor Documentation

◆ JSSTaggerUtils()

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

Constructor.

Definition at line 35 of file JSSTaggerUtils.cxx.

35 :
36 JSSTaggerBase( name )
37{
38 declareProperty("MLBosonTagger", m_MLBosonTagger, "Tool to manage the data pre-processing and inference of the Const model");
39 declareProperty("MLBosonTaggerHL", m_MLBosonTagger_HL, "Tool to manage the data pre-processing and inference of the High-Level model");
40 declareProperty("nPixelsEta", m_nbins_eta);
41 declareProperty("nPixelsPhi", m_nbins_phi);
42 declareProperty("nColors", m_ncolors);
43 declareProperty("MinEtaRange", m_min_eta);
44 declareProperty("MaxEtaRange", m_max_eta);
45 declareProperty("MinPhiRange", m_min_phi);
46 declareProperty("MaxPhiRange", m_max_phi);
47 declareProperty("DoRScaling", m_dorscaling);
48 declareProperty("RScaling_p0", m_rscaling_p0);
49 declareProperty("RScaling_p1", m_rscaling_p1);
50}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
JSSTaggerBase(const std::string &name)
Default constructor - to be used in all derived classes.
ToolHandle< AthONNX::IJSSMLTool > m_MLBosonTagger_HL
ToolHandle< AthONNX::IJSSMLTool > m_MLBosonTagger

Member Function Documentation

◆ calculateJSSRatios()

int JSSTaggerBase::calculateJSSRatios ( const xAOD::Jet & jet) const
protectedinherited

Calculate JSS moment ratios in case they are not already saved TODO: Remove this once JSSMomentTools is modified to take const jets.

Calculate JSS moment ratios in case they are not already saved These are calculated by hand here because JetSubStructureMomentTools does not operate on const jets.

This should be changed in the future

Create write decor handles

WTA N-subjettiness ratios

ECF ratios

Definition at line 413 of file JSSTaggerBase.cxx.

413 {
414
415 int result = 0;
416
418 SG::WriteDecorHandle<xAOD::JetContainer, float> decTau21WTA(m_decTau21WTAKey);
419 SG::WriteDecorHandle<xAOD::JetContainer, float> decTau32WTA(m_decTau32WTAKey);
420 SG::WriteDecorHandle<xAOD::JetContainer, float> decTau42WTA(m_decTau42WTAKey);
421 SG::WriteDecorHandle<xAOD::JetContainer, float> decC2(m_decC2Key);
422 SG::WriteDecorHandle<xAOD::JetContainer, float> decD2(m_decD2Key);
423 SG::WriteDecorHandle<xAOD::JetContainer, float> decE3(m_decE3Key);
424 SG::WriteDecorHandle<xAOD::JetContainer, float> decL2(m_decL2Key);
425 SG::WriteDecorHandle<xAOD::JetContainer, float> decL3(m_decL3Key);
426
428 float tau21_wta = -999.0;
429 float tau32_wta = -999.0;
430 float tau42_wta = -999.0;
431
432 if(!m_isSmallRJet){
433 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau1WTA(m_readTau1WTAKey);
434 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau2WTA(m_readTau2WTAKey);
435 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau3WTA(m_readTau3WTAKey);
436 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau4WTA(m_readTau4WTAKey);
437
438 float tau1_wta = readTau1WTA(jet);
439 float tau2_wta = readTau2WTA(jet);
440 float tau3_wta = readTau3WTA(jet);
441 float tau4_wta = readTau4WTA(jet);
442
443 if ( tau1_wta > 1e-8 ) {
444 tau21_wta = tau2_wta / tau1_wta;
445 }
446 else result = 1;
447
448 if ( tau2_wta > 1e-8 ) {
449 tau32_wta = tau3_wta / tau2_wta;
450 tau42_wta = tau4_wta / tau2_wta;
451 }
452 else result = 1;
453 }
454
455 decTau21WTA(jet) = tau21_wta;
456 decTau32WTA(jet) = tau32_wta;
457 decTau42WTA(jet) = tau42_wta;
458
460 float C2 = -999.0;
461 float D2 = -999.0;
462 float e3 = -999.0;
463
464 // L-series for UFO top taggers
465 float L2 = -999.0;
466 float L3 = -999.0;
467
468 if(!m_isSmallRJet){
469 SG::ReadDecorHandle<xAOD::JetContainer, float> readECF1(m_readECF1Key);
470 SG::ReadDecorHandle<xAOD::JetContainer, float> readECF2(m_readECF2Key);
471 SG::ReadDecorHandle<xAOD::JetContainer, float> readECF3(m_readECF3Key);
472
473 float ECF1 = readECF1(jet);
474 float ECF2 = readECF2(jet);
475 float ECF3 = readECF3(jet);
476
477 if ( ECF2 > 1e-8 ) {
478 C2 = ECF3 * ECF1 / std::pow( ECF2, 2.0 );
479 D2 = ECF3 * std::pow( ECF1, 3.0 ) / std::pow( ECF2, 3.0 );
480 }
481 else result = 1;
482
483 e3 = ECF3 / std::pow( ECF1, 3.0 );
484
485 SG::ReadDecorHandle<xAOD::JetContainer, float> readECFG331(m_readECFG331Key);
486 SG::ReadDecorHandle<xAOD::JetContainer, float> readECFG311(m_readECFG311Key);
487 SG::ReadDecorHandle<xAOD::JetContainer, float> readECFG212(m_readECFG212Key);
488
489 if(readECFG331.isAvailable() && readECFG212.isAvailable()){
490 if(readECFG212(jet) > 1e-8){
491 L2 = readECFG331(jet) / std::pow(readECFG212(jet), 1.5);
492 }
493 else result = 1;
494 }
495
496 if(readECFG331.isAvailable() && readECFG311.isAvailable()){
497 if(readECFG331(jet) > 1e-8){
498 L3 = readECFG311(jet) / std::pow(readECFG331(jet), 1./3.);
499 }
500 else result = 1;
501 }
502 }
503
504 decC2(jet) = C2;
505 decD2(jet) = D2;
506 decE3(jet) = e3;
507
508 static const SG::AuxElement::ConstAccessor<float> accL2("L2");
509 if(!accL2.isAvailable(jet)) decL2(jet) = L2;
510
511 static const SG::AuxElement::ConstAccessor<float> accL3("L3");
512 if(!accL3.isAvailable(jet)) decL3(jet) = L3;
513
514 // TODO: Add ECFG for ANN tagger whenever it is defined
515
516 return result;
517
518}
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readECF2Key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readECFG331Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decTau21WTAKey
WriteDecorHandle keys for JSS moments.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readECF1Key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readTau4WTAKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readECFG311Key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readTau3WTAKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readTau2WTAKey
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readECF3Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decC2Key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readTau1WTAKey
ReadDecorHandle keys for JSS moments.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readECFG212Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decL2Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decE3Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decD2Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decTau42WTAKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decL3Key
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decTau32WTAKey

◆ checkKinRange()

StatusCode JSSTaggerBase::checkKinRange ( const xAOD::Jet & jet,
asg::AcceptData & acceptData ) const
protectedinherited

Check and record if jet passes kinematic constraints.

Check each kinematic constraint Print warnings using counters

Create write decor handles

Decorate kinematic pass information

Definition at line 367 of file JSSTaggerBase.cxx.

367 {
368
369 float scale = 1.0;
370 if ( m_ptGeV ) scale = 1.e3;
371
372 bool passKinRange = true;
373
376 if ( std::abs(jet.eta()) > m_jetEtaMax ) {
377 ATH_MSG_VERBOSE( "Jet does not pass basic kinematic selection (|eta| < " << m_jetEtaMax << "). Jet eta = " << jet.eta() );
378 acceptData.setCutResult( "ValidEtaRange", false );
379 passKinRange = false;
380 }
381
382 if ( jet.pt() < m_jetPtMin * scale ) {
383 ATH_MSG_VERBOSE( "Jet does not pass basic kinematic selection (pT > " << m_jetPtMin * scale / 1.e3 << "). Jet pT = " << jet.pt() / 1.e3 << " GeV" );
384 acceptData.setCutResult( "ValidPtRangeLow", false );
385 passKinRange = false;
386 }
387
388 if ( jet.pt() > m_jetPtMax * scale ) {
389 ATH_MSG_VERBOSE( "Jet does not pass basic kinematic selection (pT < " << m_jetPtMax * scale / 1.e3 << "). Jet pT = " << jet.pt() / 1.e3 << " GeV" );
390 acceptData.setCutResult( "ValidPtRangeHigh", false );
391 passKinRange = false;
392 }
393
395 SG::WriteDecorHandle<xAOD::JetContainer, bool> decValidPtRangeHigh(m_decValidPtRangeHighKey);
396 SG::WriteDecorHandle<xAOD::JetContainer, bool> decValidPtRangeLow(m_decValidPtRangeLowKey);
397 SG::WriteDecorHandle<xAOD::JetContainer, bool> decValidEtaRange(m_decValidEtaRangeKey);
398 SG::WriteDecorHandle<xAOD::JetContainer, bool> decValidKinRange(m_decValidKinRangeKey);
399
401 decValidPtRangeHigh(jet) = acceptData.getCutResult( "ValidPtRangeHigh" );
402 decValidPtRangeLow(jet) = acceptData.getCutResult( "ValidPtRangeLow" );
403 decValidEtaRange(jet) = acceptData.getCutResult( "ValidEtaRange" );
404 decValidKinRange(jet) = passKinRange;
405
406 return StatusCode::SUCCESS;
407
408}
#define ATH_MSG_VERBOSE(x)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decValidPtRangeHighKey
float m_jetPtMin
Kinematic bounds for the jet - the units are controlled by m_ptGeV.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decValidPtRangeLowKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decValidKinRangeKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decValidEtaRangeKey
bool passKinRange(const xAOD::Jet &jet) const
Check if jet passes kinematic constraints.
bool m_ptGeV
Flag to indicate units pT is defined in Set to false by default.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
Definition AcceptData.h:134
bool getCutResult(const std::string &cutName) const
Get the result of a cut, based on the cut name (safer)
Definition AcceptData.h:98
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ decorate()

StatusCode JSSTaggerBase::decorate ( const xAOD::JetContainer & jets) const
overridevirtualinherited

Decorate jet collection with tagging info.

Loop over jet collection and decorate each jet.

Implements IJetDecorator.

Reimplemented in JSSWTopTaggerANN, and JSSWTopTaggerDNN.

Definition at line 285 of file JSSTaggerBase.cxx.

285 {
286
287 for ( const auto *jet : jets ) {
288 ATH_CHECK( tag(*jet) );
289 }
290
291 return StatusCode::SUCCESS;
292
293}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode tag(const xAOD::Jet &jet) const =0
Decorate single jet with tagging info.

◆ decorateJSSRatios()

void JSSTaggerBase::decorateJSSRatios ( const xAOD::JetContainer & jets) const
protectedinherited

Create write decor handles

WTA N-subjettiness ratios

ECF ratios

Definition at line 521 of file JSSTaggerBase.cxx.

521 {
522
524 SG::WriteDecorHandle<xAOD::JetContainer, float> decTau21WTA(m_decTau21WTAKey);
525 bool decor_available = decTau21WTA.isAvailable();
526 if(decor_available) return;
527
528 SG::WriteDecorHandle<xAOD::JetContainer, float> decTau32WTA(m_decTau32WTAKey);
529 SG::WriteDecorHandle<xAOD::JetContainer, float> decTau42WTA(m_decTau42WTAKey);
530 SG::WriteDecorHandle<xAOD::JetContainer, float> decC2(m_decC2Key);
531 SG::WriteDecorHandle<xAOD::JetContainer, float> decD2(m_decD2Key);
532 SG::WriteDecorHandle<xAOD::JetContainer, float> decE3(m_decE3Key);
533 SG::WriteDecorHandle<xAOD::JetContainer, float> decL2(m_decL2Key);
534 SG::WriteDecorHandle<xAOD::JetContainer, float> decL3(m_decL3Key);
535
536 // Use pointers here so we can create only the ones we're configured for
537 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readTau1WTA;
538 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readTau2WTA;
539 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readTau3WTA;
540 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readTau4WTA;
541
542 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readECF1;
543 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readECF2;
544 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readECF3;
545
546 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readECFG331;
547 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readECFG311;
548 std::unique_ptr<SG::ReadDecorHandle<xAOD::JetContainer, float>> readECFG212;
549
550 if(!m_isSmallRJet){
551 readTau1WTA = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readTau1WTAKey);
552 readTau2WTA = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readTau2WTAKey);
553 readTau3WTA = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readTau3WTAKey);
554 readTau4WTA = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readTau4WTAKey);
555
556 readECF1 = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readECF1Key);
557 readECF2 = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readECF2Key);
558 readECF3 = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readECF3Key);
559
560 readECFG331 = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readECFG331Key);
561 readECFG311 = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readECFG311Key);
562 readECFG212 = std::make_unique<SG::ReadDecorHandle<xAOD::JetContainer, float> >(m_readECFG212Key);
563 }
564
565 for(const xAOD::Jet* jet : jets){
566
567 float tau21_wta = -999.0;
568 float tau32_wta = -999.0;
569 float tau42_wta = -999.0;
570
571 float C2 = -999.0;
572 float D2 = -999.0;
573 float e3 = -999.0;
574
575 float L2 = -999.0;
576 float L3 = -999.0;
577
578 if(!m_isSmallRJet){
579
581 float tau1_wta = (*readTau1WTA)(*jet);
582 float tau2_wta = (*readTau2WTA)(*jet);
583 float tau3_wta = (*readTau3WTA)(*jet);
584 float tau4_wta = (*readTau4WTA)(*jet);
585
586 if ( tau1_wta > 1e-8 ) {
587 tau21_wta = tau2_wta / tau1_wta;
588 }
589
590 if ( tau2_wta > 1e-8 ) {
591 tau32_wta = tau3_wta / tau2_wta;
592 tau42_wta = tau4_wta / tau2_wta;
593 }
594
596 float ECF1 = (*readECF1)(*jet);
597 float ECF2 = (*readECF2)(*jet);
598 float ECF3 = (*readECF3)(*jet);
599
600 if ( ECF2 > 1e-8 ) {
601 C2 = ECF3 * ECF1 / std::pow( ECF2, 2.0 );
602 D2 = ECF3 * std::pow( ECF1, 3.0 ) / std::pow( ECF2, 3.0 );
603 }
604
605 e3 = ECF3 / std::pow( ECF1, 3.0 );
606
607 // L-series for UFO top taggers
608 if((*readECFG331).isAvailable() && (*readECFG212).isAvailable()){
609 if((*readECFG212)(*jet) > 1e-8){
610 L2 = (*readECFG331)(*jet) / std::pow((*readECFG212)(*jet), 1.5);
611 }
612 }
613
614 if((*readECFG331).isAvailable() && (*readECFG311).isAvailable()){
615 if((*readECFG331)(*jet) > 1e-8){
616 L3 = (*readECFG311)(*jet) / std::pow((*readECFG331)(*jet), 1./3.);
617 }
618 }
619 }
620
621 decTau21WTA(*jet) = tau21_wta;
622 decTau32WTA(*jet) = tau32_wta;
623 decTau42WTA(*jet) = tau42_wta;
624
625 decC2(*jet) = C2;
626 decD2(*jet) = D2;
627 decE3(*jet) = e3;
628
629 static const SG::AuxElement::ConstAccessor<float> accL2("L2");
630 if(!accL2.isAvailable(*jet)) decL2(*jet) = L2;
631
632 static const SG::AuxElement::ConstAccessor<float> accL3("L3");
633 if(!accL3.isAvailable(*jet)) decL3(*jet) = L3;
634
635 // TODO: Add ECFG for ANN tagger whenever it is defined
636
637 }
638
639 return;
640
641}
Jet_v1 Jet
Definition of the current "jet version".

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

◆ evtStore()

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.

◆ 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

◆ findPV()

int JSSTaggerBase::findPV ( ) const
protectedinherited

Find the PV (to be used for Ntrk)

Definition at line 644 of file JSSTaggerBase.cxx.

644 {
645
646 int indexPV = -1;
647
648 const xAOD::VertexContainer* vxCont = nullptr;
649 if ( evtStore()->retrieve( vxCont, "PrimaryVertices" ).isFailure() ) {
650 ATH_MSG_WARNING( "Unable to retrieve primary vertex container PrimaryVertices" );
651 }
652 else {
653 int vtx_counter = 0;
654 for ( const auto *vx : *vxCont ) {
655 if ( vx->vertexType()==xAOD::VxType::PriVtx ) {
656 indexPV = vtx_counter;
657 break;
658 }
659 vtx_counter++;
660 }
661 }
662
663 return indexPV;
664
665}
#define ATH_MSG_WARNING(x)
ServiceHandle< StoreGateSvc > & evtStore()
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
@ PriVtx
Primary vertex.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".

◆ getConfigReader()

StatusCode JSSTaggerBase::getConfigReader ( )
protectedinherited

Get configReader StatusCode.

Get configReader TEnv.

Check for the existence of the configuration file

https://root.cern.ch/root/roottalk/roottalk02/5332.html

Definition at line 296 of file JSSTaggerBase.cxx.

296 {
297
298 ATH_MSG_INFO( "Using config file : " << m_configFile );
299
301 std::string configPath;
302
303 if ( m_calibArea.compare("Local") == 0 ) {
305 }
306 else if ( m_calibArea.find("eos") != std::string::npos) {
307 configPath = PathResolverFindCalibFile((m_calibArea+"/"+m_configFile).c_str());
308 configPath = (m_calibArea+"/"+m_configFile).c_str();
309 }
310 else {
311 configPath = PathResolverFindCalibFile(("BoostedJetTaggers/"+m_calibArea+"/"+m_configFile).c_str());
312 }
313
315 FileStat_t fStats;
316 int fSuccess = gSystem->GetPathInfo(configPath.c_str(), fStats);
317 if ( fSuccess ) {
318 ATH_MSG_ERROR( "Recommendations file " << m_configFile << " could not be found" );
319 return StatusCode::FAILURE;
320 }
321 else {
322 ATH_MSG_DEBUG( "Recommendations file was found : " << configPath );
323 }
324
325 if ( m_configReader.ReadFile( configPath.c_str(), EEnvLevel(0) ) ) {
326 ATH_MSG_ERROR( "Error while reading config file : "<< configPath );
327 return StatusCode::FAILURE;
328 }
329
330 return StatusCode::SUCCESS;
331
332}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
std::string m_calibArea
Location where config files live on cvmfs.
std::string m_configFile
Configuration file name.
TEnv m_configReader
TEnv instance to read config files.

◆ GetConstScore()

StatusCode JSSTaggerUtils::GetConstScore ( const xAOD::JetContainer & jets) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 236 of file JSSTaggerUtils.cxx.

236 {
237
238 SG::WriteDecorHandle<xAOD::JetContainer, float> decConstScore(m_decConstScoreKey);
239 SG::WriteDecorHandle<xAOD::JetContainer, float> decNConstituents(m_decNConstituentsKey);
240 SG::WriteDecorHandle<xAOD::JetContainer, float> decNTopoTowers(m_decNTopoTowersKey);
241
242 for(const xAOD::Jet *jet : jets){
243
244 // init value
245 float score (-99.);
246
247 // get constituents
248 std::vector<xAOD::JetConstituent> constituents = jet -> getConstituents().asSTLVector();
249 std::sort( constituents.begin(), constituents.end(), DescendingPtSorterConstituents) ;
250
251 int MaxConstituents (100);
252 std::vector<xAOD::JetConstituent> constituentsForModel;
253
254 if( constituents.size() > 100 )
255 constituentsForModel = std::vector<xAOD::JetConstituent> (constituents.begin(), constituents.begin() + MaxConstituents);
256 else
257 constituentsForModel = constituents;
258
259 // get towers
260 std::vector<const xAOD::CaloCluster*> towers;
262 if (towersAcc.isAvailable(*jet)){
263 // Vector of towers linked to jets
264 std::vector<ElementLink<DataVector<xAOD::IParticle>>> towerLinks = towersAcc(*jet);
265 for (auto link_itr : towerLinks){
266 if (!link_itr.isValid()) continue;
267 towers.push_back(dynamic_cast<const xAOD::CaloCluster *>(*link_itr));
268 }
269 }
271
272 // use ML tool on constituents
273 std::vector<float> m, pT, eta, phi, E;
274 for(auto cnst : constituents){
275 m.push_back( cnst -> m() );
276 pT.push_back( cnst -> pt() );
277 eta.push_back( cnst -> eta() );
278 phi.push_back( cnst -> phi() );
279 E.push_back( cnst -> e() );
280 }
281 std::vector<std::vector<float>> constituents_packed = {m, pT, eta, phi};
282
283 m.clear(); pT.clear(); eta.clear(); phi.clear();
284 for(auto cnst : towers){
285 m.push_back( cnst -> m() );
286 pT.push_back( cnst -> pt() );
287 eta.push_back( cnst -> eta() );
288 phi.push_back( cnst -> phi() );
289 E.push_back( cnst -> e() );
290 }
291 std::vector<std::vector<float>> towers_packed = {m, pT, eta, phi};
292
293 // pack for the ML tool
294 std::vector<std::vector<float>> inputs_packed = {
295 constituents_packed.at(0), constituents_packed.at(1), constituents_packed.at(2), constituents_packed.at(3),
296 towers_packed.at(0), towers_packed.at(1), towers_packed.at(2), towers_packed.at(3),
297 };
298
299 // evaluate the model
300 if( (constituents.size() + towers.size()) > 1 )
301 score = m_MLBosonTagger -> retrieveConstituentsScore(inputs_packed);
302
303 // save decorator
304 decConstScore(*jet) = score;
305
306 // and inputs as well
307 decNConstituents(*jet) = constituents.size();
308 decNTopoTowers(*jet) = towers.size();
309
310 }
311
312 return StatusCode::SUCCESS;
313
314}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool DescendingPtSorterConstituents(const xAOD::JetConstituent p1, const xAOD::JetConstituent p2)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decNTopoTowersKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decNConstituentsKey
WriteDecorHandle keys.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decConstScoreKey
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ GetHLScore()

StatusCode JSSTaggerUtils::GetHLScore ( const xAOD::JetContainer & jets) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 457 of file JSSTaggerUtils.cxx.

457 {
458
459 SG::WriteDecorHandle<xAOD::JetContainer, float> decHLScore(m_decHLScoreKey);
460
461 // make available JSS variables
462 decorateJSSRatios(jets);
463
464 for(const xAOD::Jet* jet : jets){
465
466 // init value
467 float score (-99.);
468
469 // get input variables
470 std::map<std::string, double> JSSVars = GetJSSVars(*jet);
471
472 // evaluate the model
473 score = m_MLBosonTagger_HL -> retrieveHighLevelScore(JSSVars);
474
475 // save decorator
476 decHLScore(*jet) = score;
477
478 }
479
480 return StatusCode::SUCCESS;
481
482}
void decorateJSSRatios(const xAOD::JetContainer &jets) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decHLScoreKey
std::map< std::string, double > GetJSSVars(const xAOD::Jet &jet) const override

◆ GetImageScore()

StatusCode JSSTaggerUtils::GetImageScore ( const xAOD::JetContainer & jets) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 170 of file JSSTaggerUtils.cxx.

170 {
171
172 SG::WriteDecorHandle<xAOD::JetContainer, float> decConstScore(m_decConstScoreKey);
173
174 for(const xAOD::Jet* jet : jets){
175
176 // init value
177 float score (-99.);
178
179 // preliminary actions for constituents
180 // add a dedicated function for this?
181
182 // get constituents
183 std::vector<xAOD::JetConstituent> constituents = jet -> getConstituents().asSTLVector();
184 std::sort( constituents.begin(), constituents.end(), DescendingPtSorterConstituents) ;
185
186 int MaxConstituents (100);
187 std::vector<xAOD::JetConstituent> constituentsForModel;
188
189 if( constituents.size() > 100 )
190 constituentsForModel = std::vector<xAOD::JetConstituent> (constituents.begin(), constituents.begin() + MaxConstituents);
191 else
192 constituentsForModel = constituents;
193
194 // constituents - charged
195 std::vector<xAOD::JetConstituent> csts_charged = constituentsForModel;
196 csts_charged.erase( std::remove_if( csts_charged.begin(), csts_charged.end(),
197 [] (xAOD::JetConstituent constituent) -> bool {
198 const xAOD::FlowElement* ufo = dynamic_cast<const xAOD::FlowElement*>(constituent.rawConstituent());
199 return ufo -> signalType() != xAOD::FlowElement::SignalType::Charged;
200 }), csts_charged.end()) ;
201
202 // constituents - neutral
203 std::vector<xAOD::JetConstituent> csts_neutral = constituentsForModel;
204 csts_neutral.erase( std::remove_if( csts_neutral.begin(), csts_neutral.end(),
205 [] (xAOD::JetConstituent constituent) -> bool {
206 const xAOD::FlowElement* ufo = dynamic_cast<const xAOD::FlowElement*>(constituent.rawConstituent());
207 return ufo -> signalType() != xAOD::FlowElement::SignalType::Neutral;
208 }), csts_neutral.end()) ;
209
210 // constituents - combined
211 std::vector<xAOD::JetConstituent> csts_combined = constituentsForModel;
212 csts_combined.erase( std::remove_if( csts_combined.begin(), csts_combined.end(),
213 [] (xAOD::JetConstituent constituent){
214 const xAOD::FlowElement* ufo = dynamic_cast<const xAOD::FlowElement*>(constituent.rawConstituent());
215 return ufo -> signalType() != xAOD::FlowElement::SignalType::Combined;
216 }), csts_combined.end()) ;
217
218 // use ML tool on constituents
219 TH2D ImageCharged = MakeJetImage("Charged" , jet, csts_charged );
220 TH2D ImageNeutral = MakeJetImage("Neutral" , jet, csts_neutral );
221 TH2D ImageCombined = MakeJetImage("Combined", jet, csts_combined);
222
223 std::vector<TH2D> Images = {ImageCharged, ImageNeutral, ImageCombined};
224
225 // evaluate the model
226 score = m_MLBosonTagger -> retrieveConstituentsScore(Images);
227
228 // save decorator
229 decConstScore(*jet) = score;
230 }
231
232 return StatusCode::SUCCESS;
233
234}
TH2D MakeJetImage(TString TagImage, const xAOD::Jet *jet, std::vector< xAOD::JetConstituent > constituents) const override
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.

◆ GetJSSVars()

std::map< std::string, double > JSSTaggerUtils::GetJSSVars ( const xAOD::Jet & jet) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 484 of file JSSTaggerUtils.cxx.

484 {
485
486 std::map<std::string, double> JSSVars;
487
488 // retrieve ungroomed tracks multiplicity
489 int nUngrTracks (-1);
490 int pv_location = findPV();
491 if(pv_location != -1)
492 nUngrTracks = GetUnGroomTracks(jet, pv_location);
493
494 // store input variables
495 JSSVars["pT"] = jet.pt();
496 JSSVars["nTracks"] = nUngrTracks;
497 JSSVars["CNN"] = (*m_constScoreAcc)(jet);
498
499 // define the decorator readers
500 SG::ReadDecorHandle<xAOD::JetContainer, float> readSplit12(m_readSplit12Key);
501 SG::ReadDecorHandle<xAOD::JetContainer, float> readSplit23(m_readSplit23Key);
502
503 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau1_wta(m_readTau1WTAKey);
504 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau2_wta(m_readTau2WTAKey);
505 SG::ReadDecorHandle<xAOD::JetContainer, float> readTau3_wta(m_readTau3WTAKey);
506
507 SG::ReadDecorHandle<xAOD::JetContainer, float> readECF1(m_readECF1Key);
508 SG::ReadDecorHandle<xAOD::JetContainer, float> readECF2(m_readECF2Key);
509 SG::ReadDecorHandle<xAOD::JetContainer, float> readECF3(m_readECF3Key);
510
511 SG::ReadDecorHandle<xAOD::JetContainer, float> readQw(m_readQwKey);
512
513 // define the ConstAccessor
514 static const SG::ConstAccessor<float> FoxWolfram0Acc("FoxWolfram0");
515 static const SG::ConstAccessor<float> FoxWolfram2Acc("FoxWolfram2");
516 static const SG::ConstAccessor<float> PlanarFlowAcc("PlanarFlow");
517 static const SG::ConstAccessor<float> AngularityAcc("Angularity");
518 static const SG::ConstAccessor<float> AplanarityAcc("Aplanarity");
519 static const SG::ConstAccessor<float> ZCut12Acc("ZCut12");
520 static const SG::ConstAccessor<float> KtDRAcc("KtDR");
521 static const SG::ConstAccessor<float> D2Acc("D2");
522
523 // split
524 JSSVars["Split12"] = readSplit12(jet);
525 JSSVars["Split23"] = readSplit23(jet);
526
527 // Energy Correlation Functions
528 JSSVars["D2"] = D2Acc(jet);
529
530 // Tau123 WTA
531 JSSVars["Tau1_wta"] = readTau1_wta(jet);
532 JSSVars["Tau2_wta"] = readTau2_wta(jet);
533 JSSVars["Tau3_wta"] = readTau3_wta(jet);
534
535 // ECF
536 JSSVars["ECF1"] = readECF1(jet);
537 JSSVars["ECF2"] = readECF2(jet);
538 JSSVars["ECF3"] = readECF3(jet);
539
540 // Qw
541 JSSVars["Qw"] = readQw(jet);
542
543 // Other moments
544 JSSVars["FoxWolfram0"] = FoxWolfram0Acc.withDefault(jet, -99.);
545 JSSVars["FoxWolfram2"] = FoxWolfram2Acc.withDefault(jet, -99.);
546 JSSVars["PlanarFlow"] = PlanarFlowAcc.withDefault(jet, -99.);
547 JSSVars["Angularity"] = AngularityAcc.withDefault(jet, -99.);
548 JSSVars["Aplanarity"] = AplanarityAcc.withDefault(jet, -99.);
549 JSSVars["ZCut12"] = ZCut12Acc.withDefault(jet, -99.);
550 JSSVars["KtDR"] = KtDRAcc.withDefault(jet, -99.);
551
552 return JSSVars;
553
554}
int GetUnGroomTracks(const xAOD::Jet &jet, int indexPV) const
Retrieve Ntrk variable from the ungroomed parent jet.
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readQwKey
int findPV() const
Find the PV (to be used for Ntrk)
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readSplit23Key
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readSplit12Key

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

◆ GetQGConstScore()

StatusCode JSSTaggerUtils::GetQGConstScore ( const xAOD::JetContainer & jets) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 316 of file JSSTaggerUtils.cxx.

316 {
317
318 SG::WriteDecorHandle<xAOD::JetContainer, float> decConstScore(m_decConstScoreKey);
319
320 for(const xAOD::Jet *jet : jets){
321
322 // init value
323 float score (-99.);
324
325 // get constituents
326 std::vector<xAOD::JetConstituent> constituents = jet -> getConstituents().asSTLVector();
327 std::sort( constituents.begin(), constituents.end(), DescendingPtSorterConstituents) ;
328
329 // get towers
330 std::vector<const xAOD::CaloCluster*> towers;
332 if (towersAcc.isAvailable(*jet)){
333 // Vector of towers linked to jets
334 std::vector<ElementLink<DataVector<xAOD::IParticle>>> towerLinks = towersAcc(*jet);
335 for (auto link_itr : towerLinks){
336 if (!link_itr.isValid()) continue;
337 towers.push_back(dynamic_cast<const xAOD::CaloCluster *>(*link_itr));
338 }
339 }
341
342 // use ML tool on constituents
343 std::vector<float> m, pT, eta, phi, E, isTower, px, py, pz;
344 for(auto cnst : constituents){
345 m.push_back( cnst -> m() );
346 pT.push_back( cnst -> pt() );
347 eta.push_back( cnst -> eta() );
348 phi.push_back( cnst -> phi() );
349 E.push_back( cnst -> e() );
350 isTower.push_back(0.);
351 px.push_back( cnst -> pt() * std::cos(cnst -> phi()) );
352 py.push_back( cnst -> pt() * std::sin(cnst -> phi()) );
353 pz.push_back( cnst -> pt() * std::sinh(cnst -> eta()) );
354 }
355
356 for(auto cnst : towers){
357 m.push_back( cnst -> m() );
358 pT.push_back( cnst -> pt() );
359 eta.push_back( cnst -> eta() );
360 phi.push_back( cnst -> phi() );
361 E.push_back( cnst -> e() );
362 isTower.push_back(1.);
363 px.push_back( cnst -> pt() * std::cos(cnst -> phi()) );
364 py.push_back( cnst -> pt() * std::sin(cnst -> phi()) );
365 pz.push_back( cnst -> pt() * std::sinh(cnst -> eta()) );
366 }
367
368 // put together constituents + towers
369 std::vector<std::vector<float>> features_packed;
370
371 for(long unsigned int f=0; f<pT.size(); f++){
372 std::vector<float> features = { m.at(f), pT.at(f), eta.at(f), phi.at(f), E.at(f), isTower.at(f), px.at(f), py.at(f), pz.at(f) };
373 features_packed.push_back(features);
374 }
375
376 // sort them
377 std::sort(features_packed.begin(), features_packed.end(), [](const auto& i, const auto& j) { return i.at(1) > j.at(1); });
378
379 // global aux variables
380 float sum_features_px = std::accumulate(px.begin(), px.end(), 0);
381 float sum_features_py = std::accumulate(py.begin(), py.end(), 0);
382 float sum_features_pz = std::accumulate(pz.begin(), pz.end(), 0);
383
384 float sum_features_pT = sqrt( sum_features_px*sum_features_px + sum_features_py*sum_features_py);
385 float sum_features_eta = std::asinh( sum_features_pz / Clip(sum_features_pT) );
386 float sum_features_phi = std::atan2( sum_features_py, sum_features_px );
387
388 // build constituents and interaction variables
389 std::vector<std::vector<float>> const_vars;
390 std::vector<std::vector<std::vector<float>>> inter_vars;
391
392 for(auto const &feature_i : features_packed){
393
394 // calculate variables: constituents
395 float log_pT = log( Clip(feature_i.at(1) / sum_features_pT) );
396 float log_E = log( Clip(feature_i.at(4) / sum_features_pT) );
397 float eta = feature_i.at(2) - sum_features_eta;
398 float phi = feature_i.at(3) - sum_features_phi;
399 float DR = sqrt((feature_i.at(2) - sum_features_eta)*(feature_i.at(2) - sum_features_eta) + (feature_i.at(3) - sum_features_phi)*(feature_i.at(3) - sum_features_phi));
400 float log_m = log(Clip(feature_i.at(0)));
401 float type = feature_i.at(5);
402
403 std::vector<float> vars = {log_pT, log_E, eta, phi, DR, log_m, type};
404 const_vars.push_back(vars);
405
406 // calculate variables: interactions
407 std::vector<std::vector<float>> inter_vars_int;
408 for(auto const &feature_j : features_packed){
409
410 // preparing variables
411 float delta = sqrt((feature_i.at(2)-feature_j.at(2))*(feature_i.at(2)-feature_j.at(2)) + (feature_i.at(3)-feature_j.at(3))*(feature_i.at(3)-feature_j.at(3)));
412 float min = feature_i.at(1) != feature_j.at(1) ? std::min(feature_i.at(1), feature_j.at(1)): 0.;
413 float mass2 = (feature_i.at(4)/sum_features_pT + feature_j.at(4)/sum_features_pT) * (feature_i.at(4)/sum_features_pT + feature_j.at(4)/sum_features_pT);
414 mass2 -= (feature_i.at(6)/sum_features_pT + feature_j.at(6)/sum_features_pT) * (feature_i.at(6)/sum_features_pT + feature_j.at(6)/sum_features_pT);
415 mass2 -= (feature_i.at(7)/sum_features_pT + feature_j.at(7)/sum_features_pT) * (feature_i.at(7)/sum_features_pT + feature_j.at(7)/sum_features_pT);
416 mass2 -= (feature_i.at(8)/sum_features_pT + feature_j.at(8)/sum_features_pT) * (feature_i.at(8)/sum_features_pT + feature_j.at(8)/sum_features_pT);
417
418 // final values
419 float log_delta = log(Clip(delta));
420 float log_mindelta = log(Clip(min * delta / sum_features_pT));
421 float min_over_pT = min / (feature_i.at(1) + feature_j.at(1));
422 float log_mass = log(Clip(mass2));
423
424 // set the diagonal to 0
425 if(feature_i==feature_j){
426 log_delta = 0;
427 log_mindelta = 0;
428 min_over_pT = 0;
429 log_mass = 0;
430 }
431
432 std::vector<float> vars = { log_delta,
433 log_mindelta,
434 min_over_pT,
435 log_mass
436 };
437 inter_vars_int.push_back(vars);
438
439 }
440
441 inter_vars.push_back(inter_vars_int);
442 }
443
444 // evaluate the model
445 if( (constituents.size() + towers.size()) > 1 )
446 score = m_MLBosonTagger -> retrieveConstituentsScore(const_vars, inter_vars);
447
448 // save decorator
449 decConstScore(*jet) = score;
450
451 }
452
453 return StatusCode::SUCCESS;
454
455}
float Clip(float in, float low=1.e-36, float high=1.e+30)
#define min(a, b)
Definition cfImp.cxx:40

◆ getSF()

std::pair< double, double > JSSTaggerBase::getSF ( const xAOD::Jet & jet,
const std::string & truthLabelStr ) const
protectedinherited

Get scale factor and efficiency.

To apply W-tagging efficiency SF to Z-tagger, jet mass is shifted by 10.803 GeV

Definition at line 780 of file JSSTaggerBase.cxx.

780 {
781
782 if ( !passKinRange(jet) ) return std::make_pair( 1.0, 1.0 );
783
784
785 double logmOverPt = std::log(jet.m()/jet.pt());
786 if ( m_decorationName.find("SmoothZ") != std::string::npos ||
787 m_decorationName.find("SmoothInclusiveZ") != std::string::npos ) {
789 const double WtoZmassShift = 10803;
790 logmOverPt = std::log((jet.m()-WtoZmassShift)/jet.pt());
791 }
792
793 if ( logmOverPt > 0 ) logmOverPt = 0;
794
795 double SF = 1.0;
796 double eff = 1.0;
797
798 if ( m_weightHistograms.count(truthLabelStr.c_str()) ) {
799
800 int pt_mPt_bin = (m_weightHistograms.find(truthLabelStr.c_str())->second)->FindBin(jet.pt()*0.001, logmOverPt);
801 SF = (m_weightHistograms.find(truthLabelStr.c_str())->second)->GetBinContent(pt_mPt_bin);
802
803 if ( !m_efficiencyHistogramName.empty() ) {
804 eff = (m_efficiencyHistograms.find(truthLabelStr.c_str())->second)->GetBinContent(pt_mPt_bin);
805 }
806
807 }
808 else {
809 // set the efficiency for "Other" category to be the signal efficiency
810 std::string signal_truthLabel="";
811 if ( m_weightHistograms.count("t_qqb") ) {
812 signal_truthLabel="t_qqb";
813 }else if ( m_weightHistograms.count("V_qq") ){
814 signal_truthLabel="V_qq";
815 }else if ( m_weightHistograms.count("t") ){
816 signal_truthLabel="t";
817 }
818 if ( !signal_truthLabel.empty() && !m_efficiencyHistogramName.empty() ){
819 int pt_mPt_bin = (m_weightHistograms.find(signal_truthLabel.c_str())->second)->FindBin(jet.pt()*0.001, logmOverPt);
820 eff = (m_efficiencyHistograms.find(signal_truthLabel.c_str())->second)->GetBinContent(pt_mPt_bin);
821 }
822
823 return std::make_pair( 1.0, eff );
824 }
825
826 if ( SF < 1e-3 ) {
827 ATH_MSG_DEBUG( "(pt, m/pt) (" << jet.pt()/1.e3 << ", " << jet.m()/jet.pt() << ") is out of range for SF calculation. Returning 1.0" );
828 return std::make_pair( 1.0, 1.0 );
829 }
830 else {
831 return std::make_pair( SF, eff );
832 }
833
834}
std::string m_decorationName
Decoration name.
std::map< std::string, std::unique_ptr< TH2D > > m_efficiencyHistograms
std::map< std::string, std::unique_ptr< TH2D > > m_weightHistograms
std::string m_efficiencyHistogramName
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
const float SF[NF]
Cross sections for Fluor.

◆ GetTopConstScore()

StatusCode JSSTaggerUtils::GetTopConstScore ( const xAOD::JetContainer & jets) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 641 of file JSSTaggerUtils.cxx.

641 {
642
643 SG::WriteDecorHandle<xAOD::JetContainer, float> decConstScore(m_decConstScoreKey);
644
645 for(const xAOD::Jet *jet : jets){
646
647 // init value
648 float score (-99.);
649 int parity (1);
650
651 // get constituents
652 std::vector<xAOD::JetConstituent> constituents = jet -> getConstituents().asSTLVector();
653 std::sort( constituents.begin(), constituents.end(), DescendingPtSorterConstituents) ;
654
655 // skim constituents
656 // nMaxConstituents: used to compute the sum_pT and sum_E for the pre-processing
657 // nInputConstituents: actual input to the network
658 long unsigned int nMaxConstituents (100);
659 long unsigned int nInputConstituents (80);
660
661 std::vector<float> pT_nMax, E_nMax;
662 for(auto cnst : constituents){
663 pT_nMax.push_back( cnst -> pt() );
664 E_nMax.push_back( cnst -> e() );
665 if(pT_nMax.size()==nMaxConstituents) break;
666 }
667
668 // remove non physical constituents
669 constituents.erase( std::remove_if( constituents.begin(), constituents.end(),
670 [] (xAOD::JetConstituent constituent) -> bool {return log(constituent -> pt()) < 0.1;}),
671 constituents.end()) ;
672
673 // use ML tool on constituents
674 std::vector<float> pT, eta, phi, E, isValid, px, py, pz;
675 for(auto cnst : constituents){
676 pT.push_back( cnst -> pt() );
677 eta.push_back( cnst -> eta() );
678 phi.push_back( cnst -> phi() );
679 E.push_back( cnst -> e() );
680 isValid.push_back(1.);
681 px.push_back( cnst -> pt() * std::cos(cnst -> phi()) );
682 py.push_back( cnst -> pt() * std::sin(cnst -> phi()) );
683 pz.push_back( cnst -> pt() * std::sinh(cnst -> eta()) );
684 }
685
686
687 // global aux variables
688 float sum_features_E = std::accumulate(E_nMax.begin(), E_nMax.end(), 0.);
689 float sum_features_pT_scalar = std::accumulate(pT_nMax.begin(), pT_nMax.end(), 0.);
690
691 TLorentzVector constituent0;
692 if(constituents.size() > 0)
693 constituent0.SetPtEtaPhiE(pT.at(0), eta.at(0), phi.at(0), E.at(0));
694
695 float angle (0.);
696 if(constituents.size() > 1){
697 float deta01 = eta.at(1) - eta.at(0);
698 float dphi01 = phi.at(1) - phi.at(0);
699 if(dphi01 > std::numbers::pi) dphi01 -= 2*std::numbers::pi;
700 else if(dphi01 < -std::numbers::pi) dphi01 += 2*std::numbers::pi;
701
702 angle = std::atan2(dphi01, deta01) + std::numbers::pi/2;
703 }
704
705 // build constituents, mask and base momentum for interaction variables
706 std::vector<std::vector<float>> const_vars;
707 std::vector<std::vector<float>> masks_vars;
708 std::vector<std::vector<std::vector<float>>> inter_vars;
709
710 for(long unsigned int i=0; i<constituents.size(); i++){
711
712 // up to nInputConstituents constituents
713 if(const_vars.size()==nInputConstituents) break;
714
715 // put the constituent in a tlv for help
716 TLorentzVector constituent_i;
717 constituent_i.SetPtEtaPhiE(pT.at(i), eta.at(i), phi.at(i), E.at(i));
718
719 // flip/rot of constituents: center
720 float eta_center = eta.at(i) - eta.at(0);
721 float phi_center = constituent_i.DeltaPhi(constituent0);
722
723 // flip/rot of constituents: rotate
724 // ToDo: this does not make sense when nConst == 1,
725 // but it also true that the score is not retrieved for those jets,
726 // should we add a further protection?
727 float eta_rot = eta_center * cos(angle) + phi_center * sin(angle);
728 float phi_rot = -eta_center * sin(angle) + phi_center * cos(angle);
729
730 // flip/rot of constituents: parity
731 if(i==2 && eta_rot<0.) parity = -1;
732 float eta_flip = eta_rot * parity;
733
734 // calculate constituents variables
735 float log_pT = log( pT.at(i));
736 float log_E = log( E.at(i));
737 float log_pT_rel = log( pT.at(i) / sum_features_pT_scalar);
738 float log_E_rel = log( E.at(i) / sum_features_E);
739 float Deta = eta_flip;
740 float Dphi = phi_rot;
741 float DR = sqrt(Deta*Deta + Dphi*Dphi);
742
743 // pack: constituents variables
744 std::vector<float> vars = {log_pT, log_E, log_pT_rel, log_E_rel, DR, Deta, Dphi};
745 const_vars.push_back(vars);
746
747 // pack: mask variable
748 vars = {1.};
749 masks_vars.push_back(vars);
750
751 // explict interaction variables
752 // calculate variables: interactions
753 std::vector<std::vector<float>> inter_vars_int;
754 for(long unsigned int j=0; j<constituents.size(); j++){
755
756 // tlv for constituents
757 // todo: harmonise with the previous one
758 TLorentzVector constituent_j;
759 constituent_j.SetPtEtaPhiE(pT.at(j), eta.at(j), phi.at(j), E.at(j));
760
761 // preparing variables
762
763 // custom rapidity calculation
764 double rap_i = 0.5 * log( 1 + (2 * pz.at(i)) / Clip(E.at(i) - pz.at(i), 1.e-8) );
765 double rap_j = 0.5 * log( 1 + (2 * pz.at(j)) / Clip(E.at(j) - pz.at(j), 1.e-8) );
766 double deltaY = rap_i - rap_j;
767 double deltaPhi = TVector2::Phi_mpi_pi(constituent_i.Phi() - constituent_j.Phi());
768 double delta = std::sqrt(deltaY * deltaY + deltaPhi * deltaPhi);
769
770 float min = pT.at(i) != pT.at(j) ? std::min(pT.at(i), pT.at(j)): pT.at(i);
771 float mass2 = (E.at(i) + E.at(j)) * (E.at(i) + E.at(j));
772 mass2 -= (px.at(i) + px.at(j)) * (px.at(i) + px.at(j));
773 mass2 -= (py.at(i) + py.at(j)) * (py.at(i) + py.at(j));
774 mass2 -= (pz.at(i) + pz.at(j)) * (pz.at(i) + pz.at(j));
775
776 // final values
777 float log_delta = log(Clip(delta, 1.e-8));
778 float log_mindelta = log(Clip(min * delta, 1.e-8));
779 float log_min_over_pT = log(Clip(min / (pT.at(i) + pT.at(j)), 1.e-8));
780 float log_mass = log(Clip(mass2, 1.e-8));
781
782 std::vector<float> vars = { log_mindelta,
783 log_min_over_pT,
784 log_delta,
785 log_mass
786 };
787 inter_vars_int.push_back(vars);
788
789 }
790 inter_vars.push_back(inter_vars_int);
791
792 }
793
794 for(long unsigned int i=constituents.size(); i<nInputConstituents; i++){
795 // pack: constituents variables
796 std::vector<float> vars = {-18.4207, -18.4207, -18.4207, -18.4207, -18.4207, -18.4207, -18.4207};
797 const_vars.push_back(vars);
798
799 // pack: interaction variables
800 vars = {-18.4207, -18.4207, -18.4207, -18.4207};
801 std::vector<std::vector<float>> vars_inter;
802 for(long unsigned int j=0; j<nInputConstituents; j++){
803 vars_inter.push_back(vars);
804 }
805 inter_vars.push_back(vars_inter);
806
807 // pack: mask variable
808 vars = {0.};
809 masks_vars.push_back(vars);
810 }
811
812 // further adjustment for interaction variables
813 for(long unsigned int i=0; i<constituents.size(); i++){
814 std::vector<float> vars = {0., 0., 0., 0.};
815 vars = {-18.4207, -18.4207, -18.4207, -18.4207};
816 for(long unsigned int j=constituents.size(); j<nInputConstituents; j++){
817 inter_vars.at(i).push_back(vars);
818 }
819 }
820
821 // evaluate the model
822 if( constituents.size() > 1 )
823 score = m_MLBosonTagger -> retrieveConstituentsScore(const_vars, inter_vars, masks_vars);
824
825 // save decorator
826 // the model return the qcd node score
827 // therefore, we use 1 - score to have
828 // top jet: 1, q/g jet: 0
829 decConstScore(*jet) = 1 - score;
830
831 }
832
833 return StatusCode::SUCCESS;
834
835}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)

◆ getTruthLabelStr()

std::string JSSTaggerBase::getTruthLabelStr ( const xAOD::Jet & jet,
asg::AcceptData & acceptData ) const
protectedinherited

Truth label string

Truth label value

Contained top tagger

Contained top

QCD

TCC W/Z 2-var tagger

Top

W/Z

QCD

Pass mass and D2

Fail mass, pass D2

Pass mass, fail D2

Fail mass and D2

W/Z tagger

Top

W/Z

QCD

Top

QCD

Definition at line 838 of file JSSTaggerBase.cxx.

838 {
840 std::string truthLabelStr;
841
843 SG::ReadDecorHandle<xAOD::JetContainer, int> readTruthLabel(m_readTruthLabelKey);
844 LargeRJetTruthLabel::TypeEnum jetContainment = LargeRJetTruthLabel::intToEnum(readTruthLabel(jet));
845
847 if ( m_weightHistograms.count("t_qqb") ) {
848
850 if ( jetContainment==LargeRJetTruthLabel::tqqb ) {
851 truthLabelStr = "t_qqb";
852 }
854 else if ( jetContainment==LargeRJetTruthLabel::notruth || jetContainment==LargeRJetTruthLabel::qcd ) {
855 truthLabelStr = "q";
856 }
857
858 }
860 else if ( m_weightHistograms.count("V_qq_passMpassD2") ) {
861
863 if ( jetContainment==LargeRJetTruthLabel::tqqb || jetContainment==LargeRJetTruthLabel::other_From_t ) {
864 truthLabelStr = "t_";
865 }
867 else if ( jetContainment==LargeRJetTruthLabel::Wqq || jetContainment==LargeRJetTruthLabel::Zqq || jetContainment==LargeRJetTruthLabel::Wqq_From_t ) {
868 truthLabelStr = "V_qq_";
869 }
871 else if ( jetContainment==LargeRJetTruthLabel::notruth || jetContainment==LargeRJetTruthLabel::qcd ) {
872 truthLabelStr = "q_";
873 }
874
876 if ( acceptData.getCutResult("PassMassLow") && acceptData.getCutResult("PassMassHigh") && acceptData.getCutResult("PassD2") ) {
877 truthLabelStr += "passMpassD2";
878 }
880 else if ( !(acceptData.getCutResult("PassMassLow") && acceptData.getCutResult("PassMassHigh")) && acceptData.getCutResult("PassD2") ) {
881 truthLabelStr += "failMpassD2";
882 }
884 else if ( acceptData.getCutResult("PassMassLow") && acceptData.getCutResult("PassMassHigh") && !acceptData.getCutResult("PassD2") ) {
885 truthLabelStr += "passMfailD2";
886 }
888 else{
889 truthLabelStr += "failMfailD2";
890 }
891
892 }
893
895 else if ( m_weightHistograms.count("V_qq") ) {
896
898 if ( jetContainment==LargeRJetTruthLabel::tqqb || jetContainment==LargeRJetTruthLabel::other_From_t ) {
899 truthLabelStr = "t";
900 }
902 else if ( jetContainment==LargeRJetTruthLabel::Wqq || jetContainment==LargeRJetTruthLabel::Zqq || jetContainment==LargeRJetTruthLabel::Wqq_From_t ) {
903 truthLabelStr = "V_qq";
904 }
906 else if ( jetContainment==LargeRJetTruthLabel::notruth || jetContainment==LargeRJetTruthLabel::qcd ) {
907 truthLabelStr = "q";
908 }
909 }
910
911 // inclusive top tagger
912 else {
914 if ( jetContainment==LargeRJetTruthLabel::tqqb || jetContainment==LargeRJetTruthLabel::other_From_t || jetContainment==LargeRJetTruthLabel::Wqq_From_t ) {
915 truthLabelStr = "t";
916 }
918 else if ( jetContainment==LargeRJetTruthLabel::notruth || jetContainment==LargeRJetTruthLabel::qcd ) {
919 truthLabelStr = "q";
920 }
921
922 }
923
924 return truthLabelStr;
925}
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readTruthLabelKey
Truth label ReadDecorHandle key.
TypeEnum intToEnum(const int type)

◆ GetUnGroomTracks()

int JSSTaggerBase::GetUnGroomTracks ( const xAOD::Jet & jet,
int indexPV ) const
protectedinherited

Retrieve Ntrk variable from the ungroomed parent jet.

Retrieve the Ntrk variable from the ungroomed parent jet.

Definition at line 668 of file JSSTaggerBase.cxx.

668 {
669
670 SG::ReadDecorHandle<xAOD::JetContainer, ElementLink<xAOD::JetContainer> > readParent(m_readParentKey);
671
672 const xAOD::Jet * ungroomedJet = nullptr;
673 if ( readParent.isAvailable() ) {
674 const ElementLink<xAOD::JetContainer>& linkToUngroomed = readParent(jet);
675 if ( linkToUngroomed.isValid() ) {
676 ungroomedJet = *linkToUngroomed;
677
678 static const SG::AuxElement::ConstAccessor< std::vector<int> >acc_Ntrk("NumTrkPt500");
679
680 if ( acc_Ntrk.isAvailable(*ungroomedJet) ) {
681
682 const std::vector<int>& NTrkPt500 = acc_Ntrk(*ungroomedJet);
683
684 int jet_ntrk = NTrkPt500.at(indexPV);
685 return jet_ntrk;
686
687 }
688 else {
689 ATH_MSG_ERROR("WARNING: Unable to retrieve Ntrk of the ungroomed parent jet. Please make sure this variable is in your derivations!!!");
690 }
691 }
692 else {
693 ATH_MSG_ERROR("WARNING: Unable to retrieve the parent ungroomed jet. Please make sure this variable is in your derivations!!!");
694 }
695 }
696 else {
697 ATH_MSG_ERROR("WARNING: Unable to retrieve the link to the parent ungroomed jet. Please make sure this variable is in your derivations!!!");
698 }
699
700 return -999;
701
702}
SG::ReadDecorHandleKey< xAOD::JetContainer > m_readParentKey

◆ GetWConstScore()

StatusCode JSSTaggerUtils::GetWConstScore ( const xAOD::JetContainer & jets) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 837 of file JSSTaggerUtils.cxx.

837 {
838
839 SG::WriteDecorHandle<xAOD::JetContainer, float> decConstScore(m_decConstScoreKey);
840
841 // define vectors to store constituents for calculations
842 long unsigned int nMaxConstituents (100);
843 std::vector<float> pT, eta, phi, E, isValid, px, py, pz;
844 pT.reserve(nMaxConstituents); eta.reserve(nMaxConstituents); phi.reserve(nMaxConstituents); E.reserve(nMaxConstituents);
845 isValid.reserve(nMaxConstituents);
846 px.reserve(nMaxConstituents); py.reserve(nMaxConstituents); pz.reserve(nMaxConstituents);
847
848 for(const xAOD::Jet *jet : jets){
849
850 // init value
851 float score (-99.);
852
853 // get constituents
854 std::vector<xAOD::JetConstituent> constituents = jet -> getConstituents().asSTLVector();
855
856 // skip non physical constituents
857 constituents.erase( std::remove_if( constituents.begin(), constituents.end(),
858 [] (xAOD::JetConstituent constituent) -> bool {return constituent -> pt() < 1.e-8;}),
859 constituents.end()) ;
860
861 // sort by pT
862 std::sort( constituents.begin(), constituents.end(), DescendingPtSorterConstituents) ;
863
864 std::vector<xAOD::JetConstituent> constituentsForModel;
865
866 if( constituents.size() > nMaxConstituents )
867 {
868 constituentsForModel = std::vector<xAOD::JetConstituent> (constituents.begin(), constituents.begin() + nMaxConstituents);
869 }
870 else
871 constituentsForModel = constituents;
872
873 // fill vectors of constituents for calculation
874 pT.clear(); eta.clear(); phi.clear(); E.clear();
875 isValid.clear();
876 px.clear(); py.clear(); pz.clear();
877 for(auto cnst : constituentsForModel){
878 pT.push_back( cnst -> pt() );
879 eta.push_back( cnst -> eta() );
880 phi.push_back( cnst -> phi() );
881 E.push_back( cnst -> e() );
882 isValid.push_back(1.);
883 px.push_back( cnst -> pt() * std::cos(cnst -> phi()) );
884 py.push_back( cnst -> pt() * std::sin(cnst -> phi()) );
885 pz.push_back( cnst -> pt() * std::sinh(cnst -> eta()) );
886 }
887
888 // build constituents, mask and base momentum for interaction variables
889 std::vector<std::vector<float>> const_vars;
890 std::vector<std::vector<float>> masks_vars;
891 std::vector<std::vector<std::vector<float>>> inter_vars;
892
893 for(long unsigned int i=0; i<constituentsForModel.size(); i++){
894
895 // put the constituent in a tlv for help
896 TLorentzVector constituent_i;
897 constituent_i.SetPtEtaPhiE(pT.at(i), eta.at(i), phi.at(i), E.at(i));
898
899 // calculate variables
900 float log_pT = log( pT.at(i));
901 float log_E = log( E.at(i));
902 float log_pT_rel = log( pT.at(i) / jet -> pt());
903 float log_E_rel = log( E.at(i) / jet -> e());
904 float Deta = eta.at(i) - jet -> eta();
905 float Dphi = constituent_i.DeltaPhi(jet -> p4());
906 float DR = sqrt(Deta*Deta + Dphi*Dphi);
907
908 // pack: constituents variables
909 std::vector<float> vars = {log_E, log_pT, log_E_rel, log_pT_rel, Deta, Dphi, DR};
910 const_vars.push_back(vars);
911
912 // pack: mask variable
913 vars = {1.};
914 masks_vars.push_back(vars);
915
916 // explict interaction variables
917 // calculate variables: interactions
918 std::vector<std::vector<float>> inter_vars_int;
919 for(long unsigned int j=0; j<constituentsForModel.size(); j++){
920
921 // tlv for constituents
922 TLorentzVector constituent_j;
923 constituent_j.SetPtEtaPhiE(pT.at(j), eta.at(j), phi.at(j), E.at(j));
924
925 // preparing variables
926 float delta = constituent_i.DeltaR(constituent_j, true);
927 float min = std::min(pT.at(i), pT.at(j));
928 float mass2 = (constituent_i + constituent_j).M2();
929
930 // final values
931 float log_delta = log(Clip(delta, 1.e-8));
932 float log_mindelta = log(Clip(min * delta, 1.e-8));
933 float log_min_over_pT = log(Clip(min / (pT.at(i) + pT.at(j)), 1.e-8));
934 float log_mass = log(Clip(mass2, 1.e-8));
935
936 std::vector<float> vars = { log_delta,
937 log_mindelta,
938 log_min_over_pT,
939 log_mass
940 };
941 inter_vars_int.push_back(vars);
942 }
943
944 inter_vars.push_back(inter_vars_int);
945 }
946
947 // evaluate the model
948 if( constituents.size() > 1 )
949 score = m_MLBosonTagger -> retrieveConstituentsScore(const_vars, inter_vars, masks_vars);
950
951 // save decorator
952 decConstScore(*jet) = score;
953 }
954
955 return StatusCode::SUCCESS;
956}

◆ getWeight()

StatusCode JSSTaggerBase::getWeight ( const xAOD::Jet & jet,
bool passSel,
asg::AcceptData & acceptData ) const
protectedinherited

Get SF weight.

Inefficiency SF is directly used

Efficiency SF

Calculate inefficiency SF

If inefficiency SF is not available, SF is always 1.0

Create write decor handles

Decorate values

Definition at line 706 of file JSSTaggerBase.cxx.

706 {
707 if ( !m_calcSF ) return StatusCode::SUCCESS;
708
709 float weight = 1.0;
710 float effSF = 1.0;
711 float sigeffSF = 1.0;
712 float efficiency = 1.0;
713
714 if ( m_isMC ) {
715
716 std::string truthLabelStr = getTruthLabelStr( jet, acceptData );
717 std::tie(effSF, efficiency) = getSF( jet, truthLabelStr );
718
719 // calculate signal efficiency SF
720 if ( m_weightHistograms.count("t_qqb") ) {
721 sigeffSF = getSF(jet, "t_qqb").first;
722 } else if ( m_weightHistograms.count("V_qq") ) {
723 sigeffSF = getSF(jet, "V_qq").first;
724 } else if ( m_weightHistograms.count("t") ){
725 sigeffSF = getSF(jet, "t").first;
726 } else {
727 sigeffSF = 1.0;
728 }
729
731 if ( m_weightFlavors.find("fail") != std::string::npos ) {
732 weight = effSF;
733 }
734
735 else {
736
738 if ( passSel ) {
739 weight = effSF;
740 }
741
743 else {
745 if ( m_efficiencyHistogramName.empty() ) {
746 weight = 1.0;
747 }
748 else if ( efficiency < 1.0 ) {
749 weight = ( 1. - effSF * efficiency ) / ( 1. - efficiency );
750 }
751 else {
752 weight = 1.0;
753 }
754 }
755 }
756
757 }
758
759 else {
760 weight = 1.0;
761 }
762
764 SG::WriteDecorHandle<xAOD::JetContainer, float> decWeight(m_decWeightKey);
765 SG::WriteDecorHandle<xAOD::JetContainer, float> decEfficiency(m_decEfficiencyKey);
766 SG::WriteDecorHandle<xAOD::JetContainer, float> decEffSF(m_decEffSFKey);
767 SG::WriteDecorHandle<xAOD::JetContainer, float> decSigeffSF(m_decSigeffSFKey);
768
770 decWeight(jet) = weight;
771 decEfficiency(jet) = efficiency;
772 decEffSF(jet) = effSF;
773 decSigeffSF(jet) = sigeffSF;
774
775 return StatusCode::SUCCESS;
776
777}
std::string getTruthLabelStr(const xAOD::Jet &jet, asg::AcceptData &acceptData) const
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decWeightKey
WriteDecorHandle keys for SF.
bool m_calcSF
Flag to calculate scale factor.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decEffSFKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decEfficiencyKey
std::string m_weightFlavors
std::pair< double, double > getSF(const xAOD::Jet &jet, const std::string &truthLabelStr) const
Get scale factor and efficiency.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_decSigeffSFKey
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")

◆ initialize()

StatusCode JSSTaggerUtils::initialize ( void )
overridevirtual

Run once at the start of the job to setup everything.

Get configReader

Get the decoration name

Initialize decorators

Reimplemented from JSSTaggerBase.

Definition at line 52 of file JSSTaggerUtils.cxx.

52 {
53
54 ATH_MSG_INFO( "Initializing JSSTaggerUtils tool" );
55
56 ATH_MSG_INFO( " m_calibArea : " << m_calibArea );
57 ATH_MSG_INFO( " m_configFile : " << m_configFile );
58
59 if ( ! m_configFile.empty() ) {
60
63
65 m_decorationName = m_configReader.GetValue("DecorationName", "");
66
67 m_UseConstTagger = !((std::string)m_configReader.GetValue("ConstTaggerFileName", "")).empty();
68 m_UseHLTagger = !((std::string)m_configReader.GetValue("HLTaggerFileName", "")).empty();
69
70 std::string ConstTaggerFileName = m_configReader.GetValue("ConstTaggerFileName", "aaa");
71 std::string HLTaggerFileName = m_configReader.GetValue("HLTaggerFileName", "aaa");
72
73 if(m_UseConstTagger && m_MLBosonTagger.empty()){
74 // init tool
75 std::string ModelPath = "";
76 if ( m_calibArea.compare("Local") == 0 ) {
77 ModelPath = PathResolverFindCalibFile(ConstTaggerFileName);
78 }
79 else if ( m_calibArea.find("eos") != std::string::npos) {
80 ModelPath = (ConstTaggerFileName);
81 }
82 else{
83 ModelPath = PathResolverFindCalibFile(("BoostedJetTaggers/" + m_calibArea + "/" + ConstTaggerFileName).c_str());
84 }
85 ATH_MSG_INFO("JSSTaggerUtils::MLBosonTagger()" << " + ModelPath " << ModelPath );
86
87 asg::AsgToolConfig config ("AthONNX::JSSMLTool/MLBosonTagger");
88 ATH_CHECK( config.setProperty("ModelPath", ModelPath));
89
90 // get model paramters from the config file
91 ATH_MSG_INFO("JSSTaggerUtils::MLBosonTagger() read value from config" );
92
93 // set parameters
94 ATH_CHECK( config.setProperty("nPixelsX", (int)m_configReader.GetValue("nPixelsEta", -99)) );
95 ATH_CHECK( config.setProperty("nPixelsY", (int)m_configReader.GetValue("nPixelsPhi", -99)) );
96 ATH_CHECK( config.setProperty("nPixelsZ", (int)m_configReader.GetValue("nColors", -99)) );
97
98 m_nbins_eta = (int)m_configReader.GetValue("nPixelsEta", -99);
99 m_nbins_phi = (int)m_configReader.GetValue("nPixelsPhi", -99);
100 m_ncolors = m_configReader.GetValue("nColors", -99);
101 m_min_eta = m_configReader.GetValue("aEta", -99.);
102 m_max_eta = m_configReader.GetValue("bEta", -99.);
103 m_min_phi = m_configReader.GetValue("aPhi", -99.);
104 m_max_phi = m_configReader.GetValue("bPhi", -99.);
105 m_dorscaling = (bool)m_configReader.GetValue("DoRScaling", -99);
106 m_rscaling_p0 = m_configReader.GetValue("RScaling_p0", -99.);
107 m_rscaling_p1 = m_configReader.GetValue("RScaling_p1", -99.);
108
109 ATH_CHECK( config.makePrivateTool(m_MLBosonTagger) );
110 ATH_CHECK( m_MLBosonTagger.retrieve() );
111
112 }
113 if(m_UseHLTagger){
114 // init tool
115 std::string ModelPath = "";
116 if ( m_calibArea.compare("Local") == 0 ) {
117 ModelPath = PathResolverFindCalibFile(HLTaggerFileName);
118 }
119 else if ( m_calibArea.find("eos") != std::string::npos) {
120 ModelPath = (HLTaggerFileName);
121 }
122 else{
123 ModelPath = PathResolverFindCalibFile(("BoostedJetTaggers/" + m_calibArea + "/" + HLTaggerFileName).c_str());
124 }
125 ATH_MSG_INFO("JSSTaggerUtils::MLBosonTagger()" << " + ModelPath " << ModelPath );
126
127 asg::AsgToolConfig config ("AthONNX::JSSMLTool/MLBosonTaggerHL");
128 ATH_CHECK( config.setProperty("ModelPath", ModelPath));
129
130 ATH_CHECK( config.makePrivateTool(m_MLBosonTagger_HL) );
131 ATH_CHECK( m_MLBosonTagger_HL.retrieve() );
132
133 // get model paramters from the config file
134 ATH_MSG_INFO("JSSTaggerUtils::MLBosonTagger() read value from config" );
136
137 }
138
139 }
140
142 ATH_MSG_INFO( "Decorators that will be attached to jet :" );
144
146 ATH_CHECK( m_decNConstituentsKey.initialize() );
148 ATH_CHECK( m_decNTopoTowersKey.initialize() );
149
151 ATH_CHECK( m_decConstScoreKey.initialize() );
152
153 m_constScoreAcc = std::make_unique<SG::ConstAccessor<float>>(m_decorationName + "_ConstScore");
154
156 ATH_CHECK( m_decHLScoreKey.initialize() );
157
158 return StatusCode::SUCCESS;
159
160}
StatusCode getConfigReader()
Get configReader StatusCode.
std::string m_containerName
Configurable members.
virtual StatusCode initialize() override
Initialize the tool.
std::unique_ptr< SG::ConstAccessor< float > > m_constScoreAcc
StatusCode ReadScaler() override
setBGCode setTAP setLVL2ErrorBits bool

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

◆ MakeJetImage()

TH2D JSSTaggerUtils::MakeJetImage ( TString TagImage,
const xAOD::Jet * jet,
std::vector< xAOD::JetConstituent > constituents ) const
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 600 of file JSSTaggerUtils.cxx.

601 {
602
603 double eta (-99.), phi (-99.), pT (-99.), z (-99.);
604 int BinEta (-99), BinPhi (-99);
605
606 auto cst_pT = [] ( double sum, xAOD::JetConstituent cst ){
607 return sum + cst.pt(); };
608 double SumPT = std::accumulate( constituents.begin(), constituents.end(), 0., cst_pT) ;
609
610 auto Image = std::make_unique<TH2D>("Image_" + TagImage, "Image_" + TagImage,
612
613 for( auto& cst : constituents ){
614 eta = cst -> eta() - jet -> eta() ;
615 phi = cst -> phi() - jet -> phi() ;
616 pT = cst -> pt() ;
617
618 // apply r-scaling
619 if( m_dorscaling ){
620 eta *= 1. / (m_rscaling_p0 + m_rscaling_p1/jet->pt());
621 phi *= 1. / (m_rscaling_p0 + m_rscaling_p1/jet->pt());
622 }
623
624 BinEta = Image -> GetXaxis() -> FindBin(eta);
625 BinPhi = Image -> GetYaxis() -> FindBin(phi);
626
627 z = pT / SumPT ;
628
629 int x = m_nbins_phi+1-BinPhi, y = BinEta; // transpose + flip
630
631 double current_z = Image -> GetBinContent( x, y );
632
633 if( eta>m_min_eta && eta<m_max_eta && phi>m_min_phi && phi<m_max_phi ) // avoid overflow pixels
634 Image -> SetBinContent( x, y, current_z += z );
635 }
636
637 return *Image;
638
639 }
#define y
#define x
#define z
Int_t FindBin(const TAxis *axis, const double x)

◆ modify()

virtual StatusCode IJetDecorator::modify ( xAOD::JetContainer & jets) const
inlinefinaloverridevirtualinherited

Concrete implementation of the function inherited from IJetModifier.

Implements IJetModifier.

Definition at line 32 of file IJetDecorator.h.

32{return decorate(jets);};
virtual StatusCode decorate(const xAOD::JetContainer &jets) const =0
Decorate a jet collection without otherwise modifying it.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ 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 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

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

◆ passKinRange()

bool JSSTaggerBase::passKinRange ( const xAOD::Jet & jet) const
protectedinherited

Check if jet passes kinematic constraints.

Definition at line 353 of file JSSTaggerBase.cxx.

353 {
354
355 float scale = 1.0;
356 if ( m_ptGeV ) scale = 1.e3;
357
358 if ( jet.pt() < m_jetPtMin * scale ) return false;
359 if ( jet.pt() > m_jetPtMax * scale ) return false;
360 if ( std::abs( jet.eta() ) > m_jetEtaMax ) return false;
361
362 return true;
363
364}

◆ print()

◆ printCuts()

void JSSTaggerBase::printCuts ( ) const
protectedinherited

Print configured cuts.

Definition at line 927 of file JSSTaggerBase.cxx.

927 {
928 ATH_MSG_INFO( "After tagging, you will have access to the following cuts as an asg::AcceptData : (<NCut>) <cut> : <description>)" );
929 int nCuts = m_acceptInfo.getNCuts();
930 for ( int iCut=0; iCut < nCuts; iCut++ ) {
931 std::string cut_string = "";
932 cut_string += " (";
933 cut_string += std::to_string(iCut);
934 cut_string += ") ";
935 cut_string += m_acceptInfo.getCutName(iCut).data();
936 cut_string += " : ";
937 cut_string += m_acceptInfo.getCutDescription(iCut).data();
938 ATH_MSG_INFO( cut_string );
939 }
940}
asg::AcceptInfo m_acceptInfo
Object that stores the results for a jet.

◆ ReadScaler()

StatusCode JSSTaggerUtils::ReadScaler ( )
overridevirtual

Implements IJSSTaggerUtils.

Definition at line 556 of file JSSTaggerUtils.cxx.

556 {
557
558 // input list
559 std::vector<std::string> vars_list = {
560 "pT","CNN","D2","nTracks","ZCut12",
561 "Tau1_wta","Tau2_wta","Tau3_wta",
562 "KtDR","Split12","Split23",
563 "ECF1","ECF2","ECF3",
564 "Angularity","FoxWolfram0","FoxWolfram2",
565 "Aplanarity","PlanarFlow","Qw",
566 };
567
568 // loop and read
569 for(const std::string & var : vars_list){
570 std::string s_mean = var + "_mean";
571 std::string s_std = var + "_std";
572 double mean = m_configReader.GetValue(s_mean.c_str(), -99.);
573 double std = m_configReader.GetValue(s_std.c_str() , -99.);
574
575 if(mean==-99. && std==-99.){
576 ATH_MSG_ERROR("ERROR: one of the parameter for " << var << " is missing, please, double check the config!!!");
577 return StatusCode::FAILURE;
578 }
579 else if(mean==-99. || std==-99.){
580 ATH_MSG_ERROR("ERROR: parameters for " << var << " are missing, please, double check the config!!!");
581 return StatusCode::FAILURE;
582 }
583 else{
584 m_scaler[var] = {mean, std};
585 }
586
587 // pass the features scaling paramters to the ML tool
588 // we need to apply the data pre-processing
589 // before to apply the model inference via ONNX
590
591 // ToDo: change this to a property
592 ATH_CHECK( m_MLBosonTagger_HL -> SetScaler(m_scaler) );
593
594 }
595
596 return StatusCode::SUCCESS;
597
598}
std::map< std::string, std::vector< double > > m_scaler
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")

◆ 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();
384 }
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)

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

◆ resetCuts()

StatusCode JSSTaggerBase::resetCuts ( asg::AcceptData & acceptData) const
protectedinherited

Reset cuts.

Reset the AcceptData cut results to false

Initialize common cuts to true by default

Definition at line 335 of file JSSTaggerBase.cxx.

335 {
336
338 acceptData.clear();
339
341 acceptData.setCutResult( "ValidJetContent", true );
342 acceptData.setCutResult( "ValidEventContent", true );
343
344 acceptData.setCutResult( "ValidPtRangeHigh", true );
345 acceptData.setCutResult( "ValidPtRangeLow" , true );
346 acceptData.setCutResult( "ValidEtaRange" , true );
347
348 return StatusCode::SUCCESS;
349
350}
void clear()
Clear all bits.
Definition AcceptData.h:54

◆ 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 asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

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

◆ tag()

StatusCode JSSTaggerUtils::tag ( const xAOD::Jet & jet) const
overridevirtual

IJetSelectorTool interface.

Implements JSSTaggerBase.

Definition at line 162 of file JSSTaggerUtils.cxx.

162 {
163
164 ATH_MSG_DEBUG( "Obtaining JSS Tagger Utils result " << jet.pt() << " " << jet.m() );
165
166 return StatusCode::SUCCESS;
167
168}

◆ 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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_acceptInfo

asg::AcceptInfo JSSTaggerBase::m_acceptInfo
protectedinherited

Object that stores the results for a jet.

Definition at line 66 of file JSSTaggerBase.h.

◆ m_calcSF

bool JSSTaggerBase::m_calcSF {}
protectedinherited

Flag to calculate scale factor.

Definition at line 192 of file JSSTaggerBase.h.

192{};

◆ m_calibArea

std::string JSSTaggerBase::m_calibArea
protectedinherited

Location where config files live on cvmfs.

Definition at line 113 of file JSSTaggerBase.h.

◆ m_configFile

std::string JSSTaggerBase::m_configFile
protectedinherited

Configuration file name.

Definition at line 110 of file JSSTaggerBase.h.

◆ m_configReader

TEnv JSSTaggerBase::m_configReader
protectedinherited

TEnv instance to read config files.

Definition at line 63 of file JSSTaggerBase.h.

◆ m_constScoreAcc

std::unique_ptr<SG::ConstAccessor<float> > JSSTaggerUtils::m_constScoreAcc = nullptr
private

Definition at line 67 of file JSSTaggerUtils.h.

◆ m_containerName

std::string JSSTaggerBase::m_containerName
protectedinherited

Configurable members.

Jet container name

Definition at line 103 of file JSSTaggerBase.h.

◆ m_decC2Key

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decC2Key {this, "C2NameOut", "C2", "SG key for C2"}
protectedinherited

Definition at line 145 of file JSSTaggerBase.h.

145{this, "C2NameOut", "C2", "SG key for C2"};

◆ m_decConstScoreKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerUtils::m_decConstScoreKey {this, "ConstScoreNameDec", "ConstScore", "SG key for ConstScore"}
private

Definition at line 64 of file JSSTaggerUtils.h.

64{this, "ConstScoreNameDec", "ConstScore", "SG key for ConstScore"};

◆ m_decCutMHighKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decCutMHighKey {this, "CutMHighName", "Cut_mhigh", "SG key for Cut_mhigh"}
protectedinherited

Definition at line 219 of file JSSTaggerBase.h.

219{this, "CutMHighName", "Cut_mhigh", "SG key for Cut_mhigh"};

◆ m_decCutMLowKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decCutMLowKey {this, "CutMLowName", "Cut_mlow", "SG key for Cut_mlow"}
protectedinherited

WriteDecorHandle keys for cut values.

Definition at line 218 of file JSSTaggerBase.h.

218{this, "CutMLowName", "Cut_mlow", "SG key for Cut_mlow"};

◆ m_decD2Key

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decD2Key {this, "D2NameOut", "D2", "SG key for D2"}
protectedinherited

Definition at line 146 of file JSSTaggerBase.h.

146{this, "D2NameOut", "D2", "SG key for D2"};

◆ m_decE3Key

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decE3Key {this, "e3NameOut", "e3", "SG key for e3"}
protectedinherited

Definition at line 147 of file JSSTaggerBase.h.

147{this, "e3NameOut", "e3", "SG key for e3"};

◆ m_decEfficiencyKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decEfficiencyKey {this, "efficiencyName", "efficiency", "SG key for efficiency"}
protectedinherited

Definition at line 225 of file JSSTaggerBase.h.

225{this, "efficiencyName", "efficiency", "SG key for efficiency"};

◆ m_decEffSFKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decEffSFKey {this, "effSFName", "effSF", "SG key for effSF"}
protectedinherited

Definition at line 226 of file JSSTaggerBase.h.

226{this, "effSFName", "effSF", "SG key for effSF"};

◆ m_decHLScoreKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerUtils::m_decHLScoreKey {this, "HLScoreName", "HLScore", "SG key for HLScore"}
private

Definition at line 65 of file JSSTaggerUtils.h.

65{this, "HLScoreName", "HLScore", "SG key for HLScore"};

◆ m_decL2Key

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decL2Key {this, "L2NameOut", "L2", "SG key for L2"}
protectedinherited

Definition at line 148 of file JSSTaggerBase.h.

148{this, "L2NameOut", "L2", "SG key for L2"};

◆ m_decL3Key

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decL3Key {this, "L3NameOut", "L3", "SG key for L3"}
protectedinherited

Definition at line 149 of file JSSTaggerBase.h.

149{this, "L3NameOut", "L3", "SG key for L3"};

◆ m_decNConstituentsKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerUtils::m_decNConstituentsKey {this, "nConstituentsName", "nConstituents", "SG key for constituents multiplicity"}
private

WriteDecorHandle keys.

Definition at line 62 of file JSSTaggerUtils.h.

62{this, "nConstituentsName", "nConstituents", "SG key for constituents multiplicity"};

◆ m_decNTopoTowersKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerUtils::m_decNTopoTowersKey {this, "nTopoTowersName", "nTopoTowers", "SG key for towers multiplicity"}
private

Definition at line 63 of file JSSTaggerUtils.h.

63{this, "nTopoTowersName", "nTopoTowers", "SG key for towers multiplicity"};

◆ m_decorationName

std::string JSSTaggerBase::m_decorationName
protectedinherited

Decoration name.

Definition at line 189 of file JSSTaggerBase.h.

◆ m_decPassMassKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decPassMassKey {this, "PassMassName", "PassMass", "SG key for PassMass"}
protectedinherited

Definition at line 77 of file JSSTaggerBase.h.

77{this, "PassMassName", "PassMass", "SG key for PassMass"};

◆ m_decPassScoreKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decPassScoreKey {this, "PassScoreName", "PassScore", "SG key for PassScore"}
protectedinherited

Definition at line 78 of file JSSTaggerBase.h.

78{this, "PassScoreName", "PassScore", "SG key for PassScore"};

◆ m_decScoreCutKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decScoreCutKey {this, "CutScoreName", "Cut_score", "SG key for Cut_score"}
protectedinherited

Definition at line 220 of file JSSTaggerBase.h.

220{this, "CutScoreName", "Cut_score", "SG key for Cut_score"};

◆ m_decScoreValueKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decScoreValueKey {this, "ScoreName", "Score", "SG key for Score"}
protectedinherited

Definition at line 221 of file JSSTaggerBase.h.

221{this, "ScoreName", "Score", "SG key for Score"};

◆ m_decSigeffSFKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decSigeffSFKey {this, "sigeffSFName", "sigeffSF", "SG key for effSF"}
protectedinherited

Definition at line 227 of file JSSTaggerBase.h.

227{this, "sigeffSFName", "sigeffSF", "SG key for effSF"};

◆ m_decTaggedKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decTaggedKey {this, "TaggedName", "Tagged", "SG key for Tagged"}
protectedinherited

WriteDecorHandle keys for tagging bools.

Definition at line 69 of file JSSTaggerBase.h.

69{this, "TaggedName", "Tagged", "SG key for Tagged"};

◆ m_decTau21WTAKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decTau21WTAKey {this, "Tau21WTANameOut", "Tau21_wta", "SG key for Tau21_wta"}
protectedinherited

WriteDecorHandle keys for JSS moments.

Definition at line 141 of file JSSTaggerBase.h.

141{this, "Tau21WTANameOut", "Tau21_wta", "SG key for Tau21_wta"};

◆ m_decTau32WTAKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decTau32WTAKey {this, "Tau32WTANameOut", "Tau32_wta", "SG key for Tau32_wta"}
protectedinherited

Definition at line 142 of file JSSTaggerBase.h.

142{this, "Tau32WTANameOut", "Tau32_wta", "SG key for Tau32_wta"};

◆ m_decTau42WTAKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decTau42WTAKey {this, "Tau42WTANameOut", "Tau42_wta", "SG key for Tau42_wta"}
protectedinherited

Definition at line 143 of file JSSTaggerBase.h.

143{this, "Tau42WTANameOut", "Tau42_wta", "SG key for Tau42_wta"};

◆ m_decValidEtaRangeKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decValidEtaRangeKey {this, "ValidEtaRangeName", "ValidEtaRange", "SG key for ValidEtaRange"}
protectedinherited

Definition at line 72 of file JSSTaggerBase.h.

72{this, "ValidEtaRangeName", "ValidEtaRange", "SG key for ValidEtaRange"};

◆ m_decValidEventContentKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decValidEventContentKey {this, "ValidEventContentName", "ValidEventContent", "SG key for ValidEventContent"}
protectedinherited

Definition at line 75 of file JSSTaggerBase.h.

75{this, "ValidEventContentName", "ValidEventContent", "SG key for ValidEventContent"};

◆ m_decValidJetContentKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decValidJetContentKey {this, "ValidJetContentName", "ValidJetContent", "SG key for ValidJetContent"}
protectedinherited

Definition at line 74 of file JSSTaggerBase.h.

74{this, "ValidJetContentName", "ValidJetContent", "SG key for ValidJetContent"};

◆ m_decValidKinRangeKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decValidKinRangeKey {this, "ValidKinRangeName", "ValidKinRange", "SG key for ValidKinRange"}
protectedinherited

Definition at line 73 of file JSSTaggerBase.h.

73{this, "ValidKinRangeName", "ValidKinRange", "SG key for ValidKinRange"};

◆ m_decValidPtRangeHighKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decValidPtRangeHighKey {this, "ValidPtRangeHighName", "ValidPtRangeHigh", "SG key for ValidPtRangeHigh"}
protectedinherited

Definition at line 70 of file JSSTaggerBase.h.

70{this, "ValidPtRangeHighName", "ValidPtRangeHigh", "SG key for ValidPtRangeHigh"};

◆ m_decValidPtRangeLowKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decValidPtRangeLowKey {this, "ValidPtRangeLowName", "ValidPtRangeLow", "SG key for ValidPtRangeLow"}
protectedinherited

Definition at line 71 of file JSSTaggerBase.h.

71{this, "ValidPtRangeLowName", "ValidPtRangeLow", "SG key for ValidPtRangeLow"};

◆ m_decWeightKey

SG::WriteDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_decWeightKey {this, "weightName", "weight", "SG key for weight"}
protectedinherited

WriteDecorHandle keys for SF.

Definition at line 224 of file JSSTaggerBase.h.

224{this, "weightName", "weight", "SG key for weight"};

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

bool JSSTaggerUtils::m_dorscaling {}
private

Definition at line 49 of file JSSTaggerUtils.h.

49{};

◆ m_efficiencyHistogramName

std::string JSSTaggerBase::m_efficiencyHistogramName
protectedinherited

Definition at line 199 of file JSSTaggerBase.h.

◆ m_efficiencyHistograms

std::map<std::string, std::unique_ptr<TH2D> > JSSTaggerBase::m_efficiencyHistograms
protectedinherited

Definition at line 205 of file JSSTaggerBase.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_funcMassCutHigh

std::unique_ptr<TF1> JSSTaggerBase::m_funcMassCutHigh
protectedinherited

Definition at line 185 of file JSSTaggerBase.h.

◆ m_funcMassCutLow

std::unique_ptr<TF1> JSSTaggerBase::m_funcMassCutLow
protectedinherited

TF1 for cut functions.

Definition at line 184 of file JSSTaggerBase.h.

◆ m_funcScoreCut

std::unique_ptr<TF1> JSSTaggerBase::m_funcScoreCut
protectedinherited

Definition at line 186 of file JSSTaggerBase.h.

◆ m_isMC

bool JSSTaggerBase::m_isMC {}
protectedinherited

Definition at line 193 of file JSSTaggerBase.h.

193{};

◆ m_isSmallRJet

bool JSSTaggerBase::m_isSmallRJet = false
protectedinherited

Definition at line 104 of file JSSTaggerBase.h.

◆ m_jetEtaMax

float JSSTaggerBase::m_jetEtaMax {}
protectedinherited

Definition at line 133 of file JSSTaggerBase.h.

133{};

◆ m_jetPtMax

float JSSTaggerBase::m_jetPtMax {}
protectedinherited

Definition at line 132 of file JSSTaggerBase.h.

132{};

◆ m_jetPtMin

float JSSTaggerBase::m_jetPtMin {}
protectedinherited

Kinematic bounds for the jet - the units are controlled by m_ptGeV.

Definition at line 131 of file JSSTaggerBase.h.

131{};

◆ m_kerasCalibArea

std::string JSSTaggerBase::m_kerasCalibArea
protectedinherited

Definition at line 119 of file JSSTaggerBase.h.

◆ m_kerasConfigFileName

std::string JSSTaggerBase::m_kerasConfigFileName
protectedinherited

Keras configurations for ML taggers.

Definition at line 116 of file JSSTaggerBase.h.

◆ m_kerasConfigFilePath

std::string JSSTaggerBase::m_kerasConfigFilePath
protectedinherited

Definition at line 117 of file JSSTaggerBase.h.

◆ m_kerasConfigOutputName

std::string JSSTaggerBase::m_kerasConfigOutputName
protectedinherited

Definition at line 118 of file JSSTaggerBase.h.

◆ m_max_eta

double JSSTaggerUtils::m_max_eta {}
private

Definition at line 47 of file JSSTaggerUtils.h.

47{}, m_max_eta{}, m_min_phi{}, m_max_phi{};

◆ m_max_phi

double JSSTaggerUtils::m_max_phi {}
private

Definition at line 47 of file JSSTaggerUtils.h.

47{}, m_max_eta{}, m_min_phi{}, m_max_phi{};

◆ m_min_eta

double JSSTaggerUtils::m_min_eta {}
private

Definition at line 47 of file JSSTaggerUtils.h.

47{}, m_max_eta{}, m_min_phi{}, m_max_phi{};

◆ m_min_phi

double JSSTaggerUtils::m_min_phi {}
private

Definition at line 47 of file JSSTaggerUtils.h.

47{}, m_max_eta{}, m_min_phi{}, m_max_phi{};

◆ m_MLBosonTagger

ToolHandle<AthONNX::IJSSMLTool> JSSTaggerUtils::m_MLBosonTagger {"", this}
private

Definition at line 55 of file JSSTaggerUtils.h.

55{"", this};

◆ m_MLBosonTagger_HL

ToolHandle<AthONNX::IJSSMLTool> JSSTaggerUtils::m_MLBosonTagger_HL {"", this}
private

Definition at line 59 of file JSSTaggerUtils.h.

59{"", this};

◆ m_nbins_eta

int JSSTaggerUtils::m_nbins_eta {}
private

Definition at line 46 of file JSSTaggerUtils.h.

46{}, m_nbins_phi{};

◆ m_nbins_phi

int JSSTaggerUtils::m_nbins_phi {}
private

Definition at line 46 of file JSSTaggerUtils.h.

46{}, m_nbins_phi{};

◆ m_ncolors

int JSSTaggerUtils::m_ncolors {}
private

Definition at line 48 of file JSSTaggerUtils.h.

48{};

◆ m_nWarnMax

const int JSSTaggerBase::m_nWarnMax = 10
protectedinherited

Maximum number of warnings.

Definition at line 81 of file JSSTaggerBase.h.

◆ m_nWarnVar

std::atomic<int> JSSTaggerBase::m_nWarnVar
mutableprotectedinherited

Warning counters.

Definition at line 84 of file JSSTaggerBase.h.

◆ m_ptGeV

bool JSSTaggerBase::m_ptGeV = false
protectedinherited

Flag to indicate units pT is defined in Set to false by default.

Definition at line 88 of file JSSTaggerBase.h.

◆ m_readECF1Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readECF1Key {this, "ECF1Name", "ECF1", "SG key for ECF1"}
protectedinherited

Definition at line 157 of file JSSTaggerBase.h.

157{this, "ECF1Name", "ECF1", "SG key for ECF1"};

◆ m_readECF2Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readECF2Key {this, "ECF2Name", "ECF2", "SG key for ECF2"}
protectedinherited

Definition at line 158 of file JSSTaggerBase.h.

158{this, "ECF2Name", "ECF2", "SG key for ECF2"};

◆ m_readECF3Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readECF3Key {this, "ECF3Name", "ECF3", "SG key for ECF3"}
protectedinherited

Definition at line 159 of file JSSTaggerBase.h.

159{this, "ECF3Name", "ECF3", "SG key for ECF3"};

◆ m_readECFG212Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readECFG212Key {this, "ECFG212Name", "ECFG_2_1_2", "SG key for ECFG_2_1_2"}
protectedinherited

Definition at line 171 of file JSSTaggerBase.h.

171{this, "ECFG212Name", "ECFG_2_1_2", "SG key for ECFG_2_1_2"};

◆ m_readECFG311Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readECFG311Key {this, "ECFG311Name", "ECFG_3_1_1", "SG key for ECFG_3_1_1"}
protectedinherited

Definition at line 170 of file JSSTaggerBase.h.

170{this, "ECFG311Name", "ECFG_3_1_1", "SG key for ECFG_3_1_1"};

◆ m_readECFG331Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readECFG331Key {this, "ECFG331Name", "ECFG_3_3_1", "SG key for ECFG_3_3_1"}
protectedinherited

Definition at line 169 of file JSSTaggerBase.h.

169{this, "ECFG331Name", "ECFG_3_3_1", "SG key for ECFG_3_3_1"};

◆ m_readParentKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readParentKey {this, "ParentName", "Parent", "SG key for Parent"}
protectedinherited

Definition at line 173 of file JSSTaggerBase.h.

173{this, "ParentName", "Parent", "SG key for Parent"};

◆ m_readQwKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readQwKey {this, "QwName", "Qw", "SG key for Qw"}
protectedinherited

Definition at line 164 of file JSSTaggerBase.h.

164{this, "QwName", "Qw", "SG key for Qw"};

◆ m_readSphericityKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readSphericityKey {this, "SphericityName", "Sphericity", "SG key for Sphericity"}
protectedinherited

Definition at line 167 of file JSSTaggerBase.h.

167{this, "SphericityName", "Sphericity", "SG key for Sphericity"};

◆ m_readSplit12Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readSplit12Key {this, "Split12Name", "Split12", "SG key for Split12"}
protectedinherited

Definition at line 161 of file JSSTaggerBase.h.

161{this, "Split12Name", "Split12", "SG key for Split12"};

◆ m_readSplit23Key

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readSplit23Key {this, "Split23Name", "Split23", "SG key for Split23"}
protectedinherited

Definition at line 162 of file JSSTaggerBase.h.

162{this, "Split23Name", "Split23", "SG key for Split23"};

◆ m_readTau1WTAKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readTau1WTAKey {this, "Tau1WTAName", "Tau1_wta", "SG key for Tau1_wta"}
protectedinherited

ReadDecorHandle keys for JSS moments.

Definition at line 152 of file JSSTaggerBase.h.

152{this, "Tau1WTAName", "Tau1_wta", "SG key for Tau1_wta"};

◆ m_readTau2WTAKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readTau2WTAKey {this, "Tau2WTAName", "Tau2_wta", "SG key for Tau2_wta"}
protectedinherited

Definition at line 153 of file JSSTaggerBase.h.

153{this, "Tau2WTAName", "Tau2_wta", "SG key for Tau2_wta"};

◆ m_readTau3WTAKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readTau3WTAKey {this, "Tau3WTAName", "Tau3_wta", "SG key for Tau3_wta"}
protectedinherited

Definition at line 154 of file JSSTaggerBase.h.

154{this, "Tau3WTAName", "Tau3_wta", "SG key for Tau3_wta"};

◆ m_readTau4WTAKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readTau4WTAKey {this, "Tau4WTAName", "Tau4_wta", "SG key for Tau4_wta"}
protectedinherited

Definition at line 155 of file JSSTaggerBase.h.

155{this, "Tau4WTAName", "Tau4_wta", "SG key for Tau4_wta"};

◆ m_readThrustMajKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readThrustMajKey {this, "ThrustMajName", "ThrustMaj", "SG key for ThrustMaj"}
protectedinherited

Definition at line 166 of file JSSTaggerBase.h.

166{this, "ThrustMajName", "ThrustMaj", "SG key for ThrustMaj"};

◆ m_readTruthLabelKey

SG::ReadDecorHandleKey<xAOD::JetContainer> JSSTaggerBase::m_readTruthLabelKey {this, "truthLabelName", "truthLabel", "SG key for truthLabel"}
protectedinherited

Truth label ReadDecorHandle key.

Definition at line 215 of file JSSTaggerBase.h.

215{this, "truthLabelName", "truthLabel", "SG key for truthLabel"};

◆ m_rscaling_p0

double JSSTaggerUtils::m_rscaling_p0 {}
private

Definition at line 50 of file JSSTaggerUtils.h.

50{}, m_rscaling_p1{};

◆ m_rscaling_p1

double JSSTaggerUtils::m_rscaling_p1 {}
private

Definition at line 50 of file JSSTaggerUtils.h.

50{}, m_rscaling_p1{};

◆ m_scaler

std::map<std::string, std::vector<double> > JSSTaggerUtils::m_scaler

Definition at line 42 of file JSSTaggerUtils.h.

◆ m_strMassCutHigh

std::string JSSTaggerBase::m_strMassCutHigh
protectedinherited

Definition at line 180 of file JSSTaggerBase.h.

◆ m_strMassCutLow

std::string JSSTaggerBase::m_strMassCutLow
protectedinherited

Strings for cut functions.

Definition at line 179 of file JSSTaggerBase.h.

◆ m_strScoreCut

std::string JSSTaggerBase::m_strScoreCut
protectedinherited

Definition at line 181 of file JSSTaggerBase.h.

◆ m_suppressInputDependence

Gaudi::Property<bool> JSSTaggerBase::m_suppressInputDependence {this, "SuppressInputDependence", false}
protectedinherited

Definition at line 175 of file JSSTaggerBase.h.

175{this, "SuppressInputDependence", false};

◆ m_suppressOutputDependence

Gaudi::Property<bool> JSSTaggerBase::m_suppressOutputDependence {this, "SuppressOutputDependence", false}
protectedinherited

Definition at line 176 of file JSSTaggerBase.h.

176{this, "SuppressOutputDependence", false};

◆ m_tagClass

TAGCLASS JSSTaggerBase::m_tagClass {Unknown}
protectedinherited

Definition at line 98 of file JSSTaggerBase.h.

98{Unknown};

◆ m_tagType

std::string JSSTaggerBase::m_tagType
protectedinherited

Definition at line 128 of file JSSTaggerBase.h.

◆ m_tmvaCalibArea

std::string JSSTaggerBase::m_tmvaCalibArea
protectedinherited

Definition at line 124 of file JSSTaggerBase.h.

◆ m_tmvaConfigFileName

std::string JSSTaggerBase::m_tmvaConfigFileName
protectedinherited

TMVA configurations for BDT taggers.

Definition at line 122 of file JSSTaggerBase.h.

◆ m_tmvaConfigFilePath

std::string JSSTaggerBase::m_tmvaConfigFilePath
protectedinherited

Definition at line 123 of file JSSTaggerBase.h.

◆ m_truthBosonContainerName

std::string JSSTaggerBase::m_truthBosonContainerName
protectedinherited

Definition at line 210 of file JSSTaggerBase.h.

◆ m_truthLabelName

std::string JSSTaggerBase::m_truthLabelName
protectedinherited

Definition at line 212 of file JSSTaggerBase.h.

◆ m_truthLabelUseTRUTH3

bool JSSTaggerBase::m_truthLabelUseTRUTH3 {}
protectedinherited

Truth label options.

Definition at line 208 of file JSSTaggerBase.h.

208{};

◆ m_truthParticleContainerName

std::string JSSTaggerBase::m_truthParticleContainerName
protectedinherited

Definition at line 209 of file JSSTaggerBase.h.

◆ m_truthTopQuarkContainerName

std::string JSSTaggerBase::m_truthTopQuarkContainerName
protectedinherited

Definition at line 211 of file JSSTaggerBase.h.

◆ m_UseConstTagger

bool JSSTaggerUtils::m_UseConstTagger {}
private

Definition at line 54 of file JSSTaggerUtils.h.

54{};

◆ m_useECFG

bool JSSTaggerBase::m_useECFG = false
protectedinherited

Flags controlling whether generalized ECF moments or L-series ratios are needed TODO: Implement the functionality controlled by these.

Definition at line 137 of file JSSTaggerBase.h.

◆ m_UseHLTagger

bool JSSTaggerUtils::m_UseHLTagger {}
private

Definition at line 58 of file JSSTaggerUtils.h.

58{};

◆ m_useLSeries

bool JSSTaggerBase::m_useLSeries = false
protectedinherited

Definition at line 138 of file JSSTaggerBase.h.

◆ m_useMassCut

bool JSSTaggerBase::m_useMassCut = false
protectedinherited

Flag to indicate if mass window cut is used.

Definition at line 91 of file JSSTaggerBase.h.

◆ m_useScoreCut

bool JSSTaggerBase::m_useScoreCut = false
protectedinherited

Flag to indicate if a discriminant score is used.

Definition at line 94 of file JSSTaggerBase.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.

◆ m_weightConfig

std::unique_ptr<TFile> JSSTaggerBase::m_weightConfig
protectedinherited

Histograms for scale factors.

Definition at line 203 of file JSSTaggerBase.h.

◆ m_weightConfigPath

std::string JSSTaggerBase::m_weightConfigPath
protectedinherited

Path to the SF configuration root file.

Definition at line 107 of file JSSTaggerBase.h.

◆ m_weightDecorationName

std::string JSSTaggerBase::m_weightDecorationName
protectedinherited

String for scale factor decoration names.

Definition at line 196 of file JSSTaggerBase.h.

◆ m_weightFileName

std::string JSSTaggerBase::m_weightFileName
protectedinherited

Definition at line 197 of file JSSTaggerBase.h.

◆ m_weightFlavors

std::string JSSTaggerBase::m_weightFlavors
protectedinherited

Definition at line 200 of file JSSTaggerBase.h.

◆ m_weightHistogramName

std::string JSSTaggerBase::m_weightHistogramName
protectedinherited

Definition at line 198 of file JSSTaggerBase.h.

◆ m_weightHistograms

std::map<std::string, std::unique_ptr<TH2D> > JSSTaggerBase::m_weightHistograms
protectedinherited

Definition at line 204 of file JSSTaggerBase.h.

◆ m_wkpt

std::string JSSTaggerBase::m_wkpt
protectedinherited

Tagger information.

Definition at line 127 of file JSSTaggerBase.h.


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