ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Prompt::DecoratePromptLeptonImproved Class Reference

#include <DecoratePromptLeptonImproved.h>

Inheritance diagram for Prompt::DecoratePromptLeptonImproved:
Collaboration diagram for Prompt::DecoratePromptLeptonImproved:

Public Member Functions

 DecoratePromptLeptonImproved (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override
 
virtual StatusCode execute () override
 
virtual StatusCode finalize () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

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

Private Types

typedef std::map< Prompt::Def::Var, SG::AuxElement::Decorator< short > > shortDecoratorMap
 
typedef std::map< Prompt::Def::Var, SG::AuxElement::Decorator< float > > floatDecoratorMap
 
typedef SG::AuxElement::ConstAccessor< float > AccessFloat
 
typedef SG::AuxElement::ConstAccessor< std::vector< ElementLink< xAOD::VertexContainer > > > AccessVertex
 
typedef std::map< Prompt::Def::Var, AccessFloatfloatAccessorMap
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool initializeTMVAReader ()
 
StatusCode initializeDecorators ()
 
void initializeConstAccessors ()
 
void decorateElec (const xAOD::Electron &electron, const xAOD::JetContainer &trackJets, const xAOD::CaloClusterContainer &clusters, const xAOD::Vertex *primaryVertex)
 
void decorateMuon (const xAOD::Muon &muon, const xAOD::JetContainer &trackJets, const xAOD::Vertex *primaryVertex)
 
void getMutualVariables (const xAOD::IParticle &particle, const xAOD::Jet &track_jet, const xAOD::TrackParticle *track, Prompt::VarHolder &vars)
 
void getMuonAnpVariables (const xAOD::Muon &muon, Prompt::VarHolder &vars, const xAOD::Vertex *primaryVertex)
 
void getElectronAnpVariables (const xAOD::Electron &elec, const xAOD::CaloClusterContainer &clusters, Prompt::VarHolder &vars, const xAOD::Vertex *primaryVertex)
 
float accessIsolation (SG::AuxElement::ConstAccessor< float > &isoAccessor, const xAOD::IParticle &particle)
 
void addVarsToTMVA (Prompt::VarHolder &vars)
 
void fillVarDefault (Prompt::VarHolder &vars) const
 
void decorateAuxLepton (const xAOD::IParticle &particle, Prompt::VarHolder &vars)
 
template<class T >
std::pair< double, const xAOD::Jet * > findTrackJet (const T &part, const xAOD::JetContainer &jets)
 
double getVertexLongitudinalNormDist (const xAOD::IParticle &lepton, const xAOD::Vertex *secondaryVertex, const xAOD::Vertex *primaryVertex)
 
double getVertexCosThetaWithLepDir (const xAOD::IParticle &lepton, const xAOD::Vertex *secondaryVertex, const xAOD::Vertex *primaryVertex)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

Gaudi::Property< std::string > m_leptonsName
 
Gaudi::Property< std::string > m_configFileVersion {this, "ConfigFileVersion", "", "BDT weight file version"}
 
Gaudi::Property< std::string > m_configPathOverride {this, "ConfigPathOverride", "", "Path of the local BDT weight file you want to study/test"}
 
Gaudi::Property< std::string > m_inputVarDecoratePrefix {this, "InputVarDecoratePrefix", "", "Prefix of the variables that will be decorated into the lepton"}
 
Gaudi::Property< std::string > m_BDTName {this, "BDTName", "", "BDT name"}
 
Gaudi::Property< std::string > m_methodTitleMVA {this, "MethodTitleMVA", "BDT", "Help to config the path of the BDT xml file"}
 
Gaudi::Property< std::vector< std::string > > m_accessorRNNVars {this, "accessorRNNVars", {}, "Name of the RNN accessor of the lepton"}
 
Gaudi::Property< std::vector< std::string > > m_stringIntVars {this, "stringIntVars", {}, "Vector of the BDT int variables' names and they will be decorated into lepton if not in the veto list"}
 
Gaudi::Property< std::vector< std::string > > m_stringFloatVars {this, "stringFloatVars", {}, "Vector of the BDT float variables' names and they will be decorated into lepton if not in the veto list"}
 
Gaudi::Property< std::vector< std::string > > m_extraDecoratorFloatVars {this, "extraDecoratorFloatVars", {}, "Extra float variables' names you want to compute and decorate into the lepton"}
 
Gaudi::Property< std::vector< std::string > > m_extraDecoratorShortVars {this, "extraDecoratorShortVars", {}, "Extra short variables' names you want to compute and decorate into the lepton"}
 
Gaudi::Property< std::vector< std::string > > m_vetoDecoratorFloatVars {this, "vetoDecoratorFloatVars", {}, "Vector of the float variables' names you do not want to save"}
 
Gaudi::Property< std::vector< std::string > > m_vetoDecoratorShortVars {this, "vetoDecoratorShortVars", {}, "Vector of the short variables' names you do not want to save"}
 
Gaudi::Property< std::vector< double > > m_leptonPtBinsVector {this, "leptonPtBinsVector", {}, "pT bin edges that are used for MVABin calculation"}
 
Gaudi::Property< bool > m_printTime {this, "PrintTime", false, "Whether to print current time"}
 
Gaudi::Property< std::string > m_vertexLinkName {this, "VertexLinkName", "", "ElementLink name of the secondary vertices"}
 
Gaudi::Property< double > m_vertexMinChiSquaredProb {this, "VertexMinChiSquaredProb", 0.03, "Vertex chi2 cut"}
 
Gaudi::Property< double > m_vertexMinThetaBarrElec {this, "VertexMinThetaBarrElec", 0.002, "Vertex theta between lepton and the direction of sv-pv cut for barrel electrons"}
 
Gaudi::Property< double > m_vertexMinThetaEcapElec {this, "VertexMinThetaEcapElec", 0.001, "Vertex theta between lepton and the direction of sv-pv cut for central electrons"}
 
Gaudi::Property< double > m_vertexBarrEcapAbsEtaAt {this, "VertexBarrEcapAbsEtaAt", 1.37, "Relate to the vertex cut above, define the barrel and central electrons by abs(eta)"}
 
Gaudi::Property< double > m_elecMinCalErelConeSize {this, "ElecMinCalErelConeSize", 0.15, "Cut of the cluster for calculating the core energy of the lepton"}
 
Gaudi::Property< double > m_maxLepTrackJetDR {this, "maxLepTrackJetDR", 0.4, "Maximum distance between lepton and track jet for track jet matching"}
 
SG::ReadHandleKey< xAOD::JetContainerm_trackJetsKey
 
SG::ReadHandleKey< xAOD::VertexContainerm_primaryVertexKey
 
SG::ReadHandleKey< xAOD::CaloClusterContainerm_clusterContainerKey
 
SG::ReadHandleKey< xAOD::ElectronContainerm_electronsKey
 
SG::ReadHandleKey< xAOD::MuonContainerm_muonsKey
 
std::vector< Prompt::Def::Varm_intVars
 
std::vector< Prompt::Def::Varm_floatVars
 
std::vector< Prompt::Def::Varm_allVars
 
std::unique_ptr< Prompt::VarHolderm_vars
 
Prompt::Def::Var m_BDTVarKey
 
shortDecoratorMap m_shortMap
 
floatDecoratorMap m_floatMap
 
std::unique_ptr< TMVA::Reader > m_TMVAReader
 
std::vector< Float_t > m_varTMVA
 
std::unique_ptr< AccessFloatm_accessCalIsolation30
 
std::unique_ptr< AccessFloatm_accessTrackIsolation30
 
std::unique_ptr< AccessFloatm_accessTrackIsolation30TTVA
 
std::unique_ptr< AccessFloatm_accessMuonCalE
 
std::unique_ptr< AccessFloatm_accessMuonParamEnergyLoss
 
std::unique_ptr< AccessVertexm_accessDeepSecondaryVertex
 
floatAccessorMap m_accessRNNMap
 
std::unique_ptr< TH1D > m_leptonPtBinHist
 
TStopwatch m_timerAll
 
TStopwatch m_timerExec
 
TStopwatch m_timerMuon
 
TStopwatch m_timerElec
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 56 of file DecoratePromptLeptonImproved.h.

Member Typedef Documentation

◆ AccessFloat

Definition at line 152 of file DecoratePromptLeptonImproved.h.

◆ AccessVertex

Definition at line 153 of file DecoratePromptLeptonImproved.h.

◆ floatAccessorMap

Definition at line 155 of file DecoratePromptLeptonImproved.h.

◆ floatDecoratorMap

Definition at line 150 of file DecoratePromptLeptonImproved.h.

◆ shortDecoratorMap

Definition at line 149 of file DecoratePromptLeptonImproved.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ DecoratePromptLeptonImproved()

Prompt::DecoratePromptLeptonImproved::DecoratePromptLeptonImproved ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 20 of file DecoratePromptLeptonImproved.cxx.

20  :
21  AthAlgorithm(name, pSvcLocator),
23 {}

Member Function Documentation

◆ accessIsolation()

float Prompt::DecoratePromptLeptonImproved::accessIsolation ( SG::AuxElement::ConstAccessor< float > &  isoAccessor,
const xAOD::IParticle particle 
)
private

Definition at line 726 of file DecoratePromptLeptonImproved.cxx.

729  {
730  double isolation = -99., isolationrel = -99.;
731 
732  if(isoAccessor.isAvailable(particle)) {
733  isolation = isoAccessor(particle);
734  }
735  else {
736  ATH_MSG_WARNING("Lepton isolation not found in auxiliary store");
737  }
738 
739  if(particle.pt() > 0.0) {
740  isolationrel = isolation / particle.pt();
741  }
742 
743  return isolationrel;
744 }

◆ addVarsToTMVA()

void Prompt::DecoratePromptLeptonImproved::addVarsToTMVA ( Prompt::VarHolder vars)
private

Definition at line 747 of file DecoratePromptLeptonImproved.cxx.

748 {
749  //
750  // Add variables to TMVA reader
751  //
752  for(unsigned i = 0; i < m_allVars.size(); ++i) {
753  m_varTMVA[i] = 0.0;
754 
755  if(!vars.getVar(m_allVars.at(i), m_varTMVA[i])) {
756  ATH_MSG_WARNING("Missing input variable: " << m_vars->asStr(m_allVars.at(i)));
757  }
758  }
759 
760  //
761  // Decorate lepton with classifier response, if goodJet
762  //
763  float bdt_weight = m_TMVAReader->EvaluateMVA(m_methodTitleMVA.toString());
764 
765  if(m_BDTVarKey != Def::NONE) {
766  vars.addVar(m_BDTVarKey, bdt_weight);
767  }
768  else {
769  ATH_MSG_WARNING("addVarsToTMVA - invalid Def::Var key for " << m_BDTName);
770  }
771 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ decorateAuxLepton()

void Prompt::DecoratePromptLeptonImproved::decorateAuxLepton ( const xAOD::IParticle particle,
Prompt::VarHolder vars 
)
private

Definition at line 789 of file DecoratePromptLeptonImproved.cxx.

793 {
794  //
795  // Decorate lepton with input short variables
796  //
797  for(shortDecoratorMap::value_type &dec: m_shortMap) {
798  double val = 0.0;
799 
800  if(vars.getVar(dec.first, val)) {
801  dec.second(particle) = static_cast<short>(val);
802 
803  ATH_MSG_DEBUG("Short variable: " << vars.asStr(dec.first) << " = " << val);
804  }
805  else {
806  ATH_MSG_WARNING("Short variable " << vars.asStr(dec.first) << " not decorated to lepton");
807  }
808  }
809 
810  //
811  // Decorate lepton with input float variables
812  //
813  for(floatDecoratorMap::value_type &dec: m_floatMap) {
814  double val = 0.0;
815 
816  if(vars.getVar(dec.first, val)) {
817  dec.second(particle) = val;
818 
819  ATH_MSG_DEBUG("Float variable: " << vars.asStr(dec.first) << " = " << val);
820  }
821  else {
822  ATH_MSG_WARNING("Float variable " << vars.asStr(dec.first) << " not decorated to lepton");
823  }
824  }
825 }

◆ decorateElec()

void Prompt::DecoratePromptLeptonImproved::decorateElec ( const xAOD::Electron electron,
const xAOD::JetContainer trackJets,
const xAOD::CaloClusterContainer clusters,
const xAOD::Vertex primaryVertex 
)
private

Definition at line 393 of file DecoratePromptLeptonImproved.cxx.

399 {
400  //
401  // Find nearest track jet to electron
402  //
403  TimerScopeHelper timer(m_timerElec);
404 
405  Prompt::VarHolder vars;
406 
407  std::pair<double, const xAOD::Jet*> match = findTrackJet(electron, trackJets);
408 
409  if(match.second) {
410  //
411  // Get muon calorimeter energy variable, RNN and secondary vertex variables
412  //
413  getElectronAnpVariables(electron, clusters, vars, primaryVertex);
414 
415  //
416  // Get mutual variables, passing track as argument
417  //
418  getMutualVariables(electron, *match.second, electron.trackParticle(), vars);
419 
420  //
421  // Pass variables to TMVA
422  //
423  addVarsToTMVA(vars);
424  }
425  else {
426  //
427  // Decorate electron with default values
428  //
429  fillVarDefault(vars);
430 
431  ATH_MSG_DEBUG("No track jet found near to electron");
432  }
433 
434  //
435  // Decorate electron with input vars and BDT weight
436  //
438 }

◆ decorateMuon()

void Prompt::DecoratePromptLeptonImproved::decorateMuon ( const xAOD::Muon muon,
const xAOD::JetContainer trackJets,
const xAOD::Vertex primaryVertex 
)
private

Definition at line 442 of file DecoratePromptLeptonImproved.cxx.

447 {
448  //
449  // Find nearest track jet to muon
450  //
451  TimerScopeHelper timer(m_timerMuon);
452 
453  Prompt::VarHolder vars;
454 
455  std::pair<double, const xAOD::Jet*> match = findTrackJet(muon, trackJets);
456 
457  if(match.second) {
458  //
459  // Get muon calorimeter energy variable, RNN and secondary vertex variables
460  //
461  getMuonAnpVariables(muon, vars, primaryVertex);
462 
463  //
464  // Get mutual variables, passing track as argument
465  //
466  getMutualVariables(muon, *match.second, muon.primaryTrackParticle(), vars);
467 
468  //
469  // Add variables to TMVA Reader
470  //
471  addVarsToTMVA(vars);
472  }
473  else {
474  //
475  // Decorate muon with default values
476  //
477  fillVarDefault(vars);
478 
479  ATH_MSG_DEBUG("No track jet found near to muon");
480  }
481 
482  //
483  // Decorate muon with input vars and BDT weight
484  //
485  decorateAuxLepton(muon, vars);
486 }

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode Prompt::DecoratePromptLeptonImproved::execute ( )
overridevirtual

Definition at line 126 of file DecoratePromptLeptonImproved.cxx.

127 {
128 
129  //
130  // Start execute timer
131  //
132  TimerScopeHelper timer(m_timerExec);
133 
134  //
135  // Retrieve containers from evtStore
136  //
140 
141  ATH_MSG_DEBUG("======================================="
142  << "\n\t\t\t Size of vertex container: " << vertices ->size()
143  << "\n\t\t\t Size of track jet container: " << trackJets->size()
144  << "\n-----------------------------------------------------------------");
145 
146  //
147  // Find default Primary Vertex
148  //
149  const xAOD::Vertex *primaryVertex = nullptr;
150 
151  for(const xAOD::Vertex *vertex: *vertices) {
152  if(vertex->vertexType() == xAOD::VxType::PriVtx) {
153  primaryVertex = vertex;
154  break;
155  }
156  }
157 
158  if(m_leptonsName == "Electrons") {
159  //
160  // Process electrons
161  //
162  ATH_MSG_DEBUG("Reading " << m_electronsKey);
164 
165  for(const xAOD::Electron *elec: *electrons) {
166  decorateElec(*elec, *trackJets, *clusters, primaryVertex);
167  }
168  } else if(m_leptonsName == "Muons") {
169  //
170  // Process muons
171  //
172  ATH_MSG_DEBUG("Reading " << m_muonsKey);
174 
175  for(const xAOD::Muon *muon: *muons) {
176  decorateMuon(*muon, *trackJets, primaryVertex);
177  ATH_MSG_DEBUG("Muon decorated");
178  }
179  } else {
180  ATH_MSG_ERROR("Must specify Electrons or Muons");
181  return StatusCode::FAILURE;
182  }
183 
184  return StatusCode::SUCCESS;
185 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ fillVarDefault()

void Prompt::DecoratePromptLeptonImproved::fillVarDefault ( Prompt::VarHolder vars) const
private

Definition at line 774 of file DecoratePromptLeptonImproved.cxx.

775 {
776  //
777  // Add default values to VarHolder
778  //
779  for(const floatDecoratorMap::value_type &dec: m_floatMap) {
780  vars.addVar(dec.first, -99.0);
781  }
782 
783  for(const shortDecoratorMap::value_type &dec: m_shortMap) {
784  vars.addVar(dec.first, -99.0);
785  }
786 }

◆ finalize()

StatusCode Prompt::DecoratePromptLeptonImproved::finalize ( )
overridevirtual

Definition at line 106 of file DecoratePromptLeptonImproved.cxx.

107 {
108  if(m_printTime) {
109  //
110  // Print full time stopwatch
111  //
112  m_timerAll.Stop();
113 
114  ATH_MSG_INFO("Real time: " << m_timerAll.RealTime() << "\t CPU time: " << m_timerAll.CpuTime());
115 
116  ATH_MSG_INFO("Execute time: " << PrintResetStopWatch(m_timerExec));
117  ATH_MSG_INFO("Muon time: " << PrintResetStopWatch(m_timerMuon));
118  ATH_MSG_INFO("Elec time: " << PrintResetStopWatch(m_timerElec));
119  }
120 
121  return StatusCode::SUCCESS;
122 }

◆ findTrackJet()

template<class T >
std::pair< double, const xAOD::Jet * > Prompt::DecoratePromptLeptonImproved::findTrackJet ( const T &  part,
const xAOD::JetContainer jets 
)
private

Definition at line 828 of file DecoratePromptLeptonImproved.cxx.

830 {
831  //
832  // Find nearest track jet and a return a pair of dR and xAOD::Jet*
833  //
834  const xAOD::Jet *minjet = 0;
835  double mindr = 10.0;
836  std::pair<double, const xAOD::Jet*> match(mindr, minjet);
837 
838  for(const xAOD::Jet* jet: jets) {
839  const double dr = part.p4().DeltaR(jet->p4());
840 
841  if(!minjet || dr < mindr) {
842  mindr = dr;
843  minjet = jet;
844  match = std::make_pair(mindr, minjet);
845  }
846  }
847 
848 
849  if(minjet && mindr < m_maxLepTrackJetDR) {
850  return match;
851  }
852 
853  minjet = 0;
854  return std::make_pair(10., minjet);
855 }

◆ getElectronAnpVariables()

void Prompt::DecoratePromptLeptonImproved::getElectronAnpVariables ( const xAOD::Electron elec,
const xAOD::CaloClusterContainer clusters,
Prompt::VarHolder vars,
const xAOD::Vertex primaryVertex 
)
private

Definition at line 489 of file DecoratePromptLeptonImproved.cxx.

495 {
496  //
497  // Get Muon variables - calorimeter
498  //
499  double sumCoreEt_large = 0.0, CaloClusterSumEtRel = 0.0;
500 
501  if(elec.caloCluster()) {
502  const double elec_calEta = elec.caloCluster()->eta();
503  const double elec_calPhi = elec.caloCluster()->phi();
504 
505  for(const xAOD::CaloCluster *cluster: clusters) {
506  const double deta = elec_calEta - cluster->eta();
507  const double dphi = TVector2::Phi_mpi_pi(elec_calPhi - cluster->phi());
508  const double dr = std::sqrt(deta*deta + dphi*dphi);
509 
511  sumCoreEt_large += cluster->pt();
512  }
513  }
514  }
515 
516  if(elec.pt() > 0.0) CaloClusterSumEtRel = sumCoreEt_large/elec.pt();
517 
519 
520  //
521  // Get lepton isolation variables
522  //
525 
528 
529  //
530  // Get secondary vertex variable
531  //
532  std::vector<double> goodVertexNdistLong;
533 
534  if(m_accessDeepSecondaryVertex->isAvailable(elec)) {
535  std::vector<ElementLink<xAOD::VertexContainer> > vtxLinks = (*m_accessDeepSecondaryVertex)(elec);
536 
537  for(ElementLink<xAOD::VertexContainer> &vtxLink: vtxLinks) {
538  if(!vtxLink.isValid()) {
539  ATH_MSG_WARNING("VertexContainer : invalid link");
540  continue;
541  }
542 
543  const xAOD::Vertex *vtx = *vtxLink;
544 
545  const double fitProb = Prompt::getVertexFitProb(vtx);
546 
547  if(fitProb < m_vertexMinChiSquaredProb) {
548  continue;
549  }
550 
551  const double theta = std::acos(getVertexCosThetaWithLepDir(elec, vtx, primaryVertex));
552 
553  if (theta < m_vertexMinThetaBarrElec && std::fabs(elec.eta()) <= m_vertexBarrEcapAbsEtaAt) continue;
554  else if (theta < m_vertexMinThetaEcapElec && std::fabs(elec.eta()) > m_vertexBarrEcapAbsEtaAt) continue;
555 
556  const double vertex_ndist_long = getVertexLongitudinalNormDist(elec, vtx, primaryVertex);
557 
558  goodVertexNdistLong.push_back(vertex_ndist_long);
559  }
560  }
561  else {
562  ATH_MSG_WARNING("VertexContainer : " << m_vertexLinkName << " not found for the electron");
563  }
564 
565  double best_vertex_ndist_long = 0.0;
566 
567  if(goodVertexNdistLong.size() > 0) {
568  std::sort(goodVertexNdistLong.begin(), goodVertexNdistLong.end());
569  best_vertex_ndist_long = goodVertexNdistLong.back();
570  }
571 
573  vars.addVar(Prompt::Def::CandVertex_NPassVtx, goodVertexNdistLong.size());
574 }

◆ getMuonAnpVariables()

void Prompt::DecoratePromptLeptonImproved::getMuonAnpVariables ( const xAOD::Muon muon,
Prompt::VarHolder vars,
const xAOD::Vertex primaryVertex 
)
private

Definition at line 577 of file DecoratePromptLeptonImproved.cxx.

582 {
583  //
584  // Get Muon variables - calorimeter
585  //
586  double calE = -99.0, peloss = -99.0, caloClusterERel = -99.0;
587 
588  if(muon.clusterLink().isValid()) {
589  const xAOD::CaloCluster* cluster = *(muon.clusterLink());
590 
591  if(m_accessMuonCalE->isAvailable(*cluster) && m_accessMuonParamEnergyLoss->isAvailable(muon)) {
592  calE = (*m_accessMuonCalE)(*cluster);
593  peloss = (*m_accessMuonParamEnergyLoss)(muon);
594 
595  caloClusterERel = calE/peloss;
596  }
597  else {
598  ATH_MSG_WARNING("Muon calE or ParamEnergyLoss not found in auxiliary store");
599  }
600  }
601 
602  vars.addVar(Prompt::Def::CaloClusterERel, caloClusterERel);
603 
604  //
605  // Get lepton isolation variables
606  //
608  const double ptvarcone30TightTTVAPt500rel = accessIsolation(*m_accessTrackIsolation30TTVA, muon);
609 
611  vars.addVar(Prompt::Def::Ptvarcone30_TightTTVA_pt500rel, ptvarcone30TightTTVAPt500rel);
612 
613  //
614  // Get Muon Secondary Vertex variable
615  //
616  std::vector<double> goodVertexNdistLong;
617 
618  if(m_accessDeepSecondaryVertex->isAvailable(muon)) {
619  std::vector<ElementLink<xAOD::VertexContainer> > vtxLinks = (*m_accessDeepSecondaryVertex)(muon);
620  goodVertexNdistLong.reserve(vtxLinks.size());
621 
622  for(ElementLink<xAOD::VertexContainer> &vtxLink: vtxLinks) {
623  if(!vtxLink.isValid()) {
624  ATH_MSG_WARNING("VertexContainer : invalid link");
625  continue;
626  }
627 
628  const xAOD::Vertex *vtx = *vtxLink;
629 
630  const double fitProb = Prompt::getVertexFitProb(vtx);
631 
632  if(fitProb > m_vertexMinChiSquaredProb) {
633  const double vertex_ndist_long = getVertexLongitudinalNormDist(muon, vtx, primaryVertex);
634 
635  goodVertexNdistLong.push_back(vertex_ndist_long);
636  }
637  }
638  }
639  else {
640  ATH_MSG_WARNING("VertexContainer : " << m_vertexLinkName << " not found for the muon");
641  }
642 
643  double best_vertex_ndist_long = 0.0;
644 
645  if(goodVertexNdistLong.size() > 0) {
646  std::sort(goodVertexNdistLong.begin(), goodVertexNdistLong.end());
647  best_vertex_ndist_long = goodVertexNdistLong.back();
648  }
649 
651  vars.addVar(Prompt::Def::CandVertex_NPassVtx, goodVertexNdistLong.size());
652 }

◆ getMutualVariables()

void Prompt::DecoratePromptLeptonImproved::getMutualVariables ( const xAOD::IParticle particle,
const xAOD::Jet track_jet,
const xAOD::TrackParticle track,
Prompt::VarHolder vars 
)
private

Definition at line 655 of file DecoratePromptLeptonImproved.cxx.

661 {
662  //
663  // Add lepton - jet variables to VarHolder
664  //
665  double PtFrac = -99.;
666  double PtRel = -99.;
667 
668  if(particle.pt() > 0.0 && track_jet.pt() > 0.0) {
669 
670  if(track) {
671  PtFrac = track->pt()/track_jet.pt();
672  }
673 
674  const double angle = particle.p4().Vect().Angle(track_jet.p4().Vect());
675 
676  PtRel = particle.pt() * std::sin(angle);
677  }
678 
679  //
680  // Add vars to VarHolder
681  //
684  vars.addVar(Prompt::Def::DRlj, track_jet.p4().DeltaR(particle.p4()));
686 
687  //
688  // Get RNN variables
689  //
690  for(floatAccessorMap::value_type &acc: m_accessRNNMap) {
691  if(acc.second.isAvailable(particle)) {
692  vars.addVar(acc.first, acc.second(particle));
693  }
694  else {
695  ATH_MSG_WARNING("LeptonTagger RNN not found in auxiliary store for variable=" << vars.asStr(acc.first));
696  }
697  }
698 
699  //
700  // Get lepton variables - pT X bin
701  //
702  const double lepPt = particle.pt();
703 
704  const double xmax = m_leptonPtBinHist->GetXaxis()->GetXmax();
705  const double xmin = m_leptonPtBinHist->GetXaxis()->GetXmin();
706 
707  int curr_bin = 0;
708 
709  if(xmin < lepPt && lepPt < xmax) {
710  curr_bin = m_leptonPtBinHist->FindBin(lepPt);
711  }
712  else if (!(lepPt < xmax)) {
713  curr_bin = m_leptonPtBinHist->GetNbinsX();
714  }
715  else if (!(lepPt > xmin)) {
716  curr_bin = 1;
717  }
718 
719  vars.addVar(Prompt::Def::MVAXBin, curr_bin);
720  vars.addVar(Prompt::Def::RawPt, lepPt);
721 
722  ATH_MSG_DEBUG("getMutualVariables - lepPt = " << lepPt << ", MVAXBin = " << curr_bin);
723 }

◆ getVertexCosThetaWithLepDir()

double Prompt::DecoratePromptLeptonImproved::getVertexCosThetaWithLepDir ( const xAOD::IParticle lepton,
const xAOD::Vertex secondaryVertex,
const xAOD::Vertex primaryVertex 
)
private

Definition at line 885 of file DecoratePromptLeptonImproved.cxx.

888 {
889  //
890  // get the Longitudinal nomalized distance between the secondary vertex and primary vertex
891  //
892  if(!secondaryVertex || !primaryVertex) {
893  ATH_MSG_WARNING("GetVertexThetaWithLepDir - invalid pointer of lepton/secondaryVertex/primaryVertex");
894  return 0.0;
895  }
896 
897  const Amg::Vector3D sv_to_pv_v3 = secondaryVertex->position() - primaryVertex->position();
898 
899  const TVector3 sv_to_pv_t3 = TVector3(sv_to_pv_v3.x(), sv_to_pv_v3.y(), sv_to_pv_v3.z());
900  const TVector3 lepton_dirt = lepton.p4().Vect();
901 
902  const double cos_theta = sv_to_pv_t3.Unit()*lepton_dirt.Unit();
903 
904  return cos_theta;
905 }

◆ getVertexLongitudinalNormDist()

double Prompt::DecoratePromptLeptonImproved::getVertexLongitudinalNormDist ( const xAOD::IParticle lepton,
const xAOD::Vertex secondaryVertex,
const xAOD::Vertex primaryVertex 
)
private

Definition at line 858 of file DecoratePromptLeptonImproved.cxx.

863 {
864  //
865  // get the Longitudinal nomalized distance between the secondary vertex and primary vertex
866  //
867  if(!secondaryVertex || !primaryVertex) {
868  ATH_MSG_WARNING("getVertexLongitudinalNormDist - invalid pointer of lepton/secondaryVertex/primaryVertex");
869  return 0.0;
870  }
871 
872 
873  float normDist_SVPV = 0.0;
874 
875  if(!Prompt::GetAuxVar(*secondaryVertex, normDist_SVPV, "normDistToPriVtx")) {
876  ATH_MSG_WARNING("getVertexLongitudinalNormDist - missing \"normDistToPriVtx\"");
877  }
878 
879  double cos_theta = getVertexCosThetaWithLepDir(lepton, secondaryVertex, primaryVertex);
880 
881  return normDist_SVPV*cos_theta;
882 }

◆ initialize()

StatusCode Prompt::DecoratePromptLeptonImproved::initialize ( )
overridevirtual

Definition at line 26 of file DecoratePromptLeptonImproved.cxx.

27 {
28  ATH_MSG_DEBUG("Initializing DecoratePromptLeptonImproved...");
29  ATH_MSG_DEBUG("m_leptonsName = " << m_leptonsName);
30  if (m_printTime)
31  {
32  //
33  // Reset timers
34  //
35  m_timerAll .Reset();
36  m_timerExec.Reset();
37  m_timerMuon.Reset();
38  m_timerElec.Reset();
39 
40  //
41  // Start full timer
42  //
43  m_timerAll.Start();
44  }
45 
46  ATH_CHECK(m_trackJetsKey.initialize());
47  ATH_CHECK(m_primaryVertexKey.initialize());
49 
50  ATH_MSG_DEBUG("Initializing " << m_electronsKey);
51 
53  ATH_CHECK(m_muonsKey.initialize());
54 
55  ATH_MSG_DEBUG("Number of int vars to read: " << m_stringIntVars.size());
56  ATH_MSG_DEBUG("Number of float vars to read: " << m_stringFloatVars.size());
57 
58  // Setup variable holder
59  m_vars = std::make_unique<Prompt::VarHolder>();
60 
61  //
62  // Read vector<string> vars into vector<Var> and append
63  //
64  m_intVars = m_vars->readVectorVars(m_stringIntVars);
65  m_floatVars = m_vars->readVectorVars(m_stringFloatVars);
66 
67  m_allVars.insert(m_allVars.end(), m_intVars .begin(), m_intVars .end());
68  m_allVars.insert(m_allVars.end(), m_floatVars.begin(), m_floatVars.end());
69 
70  m_varTMVA.resize(m_allVars.size());
71 
72 
73  //
74  // Get key for recording BDT output
75  //
76  m_BDTVarKey = m_vars->registerDynamicVar(m_BDTName);
77 
78  if(m_BDTVarKey == Def::NONE) {
79  ATH_MSG_ERROR("Failed to create key for BDT name=" << m_BDTName);
80  return StatusCode::FAILURE;
81  }
82 
83  //
84  // Fill decorator maps
85  //
87 
88  //
89  // Initialize const accessors
90  //
92 
93  ATH_MSG_DEBUG("Initialized DecoratePromptLeptonImproved.");
94 
95  //
96  // Initialize TMVA Reader
97  //
99 
100  ATH_MSG_DEBUG("Initialized TMVA Reader.");
101 
102  return StatusCode::SUCCESS;
103 }

◆ initializeConstAccessors()

void Prompt::DecoratePromptLeptonImproved::initializeConstAccessors ( )
private

Definition at line 360 of file DecoratePromptLeptonImproved.cxx.

361 {
362  //
363  // Instantiate isolation accessors
364  //
365  m_accessCalIsolation30 = std::make_unique<AccessFloat> ("topoetcone30");
366  m_accessTrackIsolation30 = std::make_unique<AccessFloat> ("ptvarcone30");
367  m_accessTrackIsolation30TTVA = std::make_unique<AccessFloat> ("ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500");
368 
369  m_accessDeepSecondaryVertex = std::make_unique<AccessVertex>(m_vertexLinkName);
370 
371  //
372  // Instantiate accessors for the muon specific variables
373  //
374  m_accessMuonCalE = std::make_unique<AccessFloat> ("calE");
375  m_accessMuonParamEnergyLoss = std::make_unique<AccessFloat> ("ParamEnergyLoss");
376 
377  //
378  // Instantiate accessors for RNN variables
379  //
380  for(const std::string &name: m_accessorRNNVars) {
381  const Def::Var akey = m_vars->registerDynamicVar(name);
382 
383  if(m_accessRNNMap.insert(floatAccessorMap::value_type(akey, AccessFloat(name))).second) {
384  ATH_MSG_DEBUG("Add float RNN accessor: " << name);
385  }
386  else {
387  ATH_MSG_WARNING("Skip duplicate float accessor: " << name);
388  }
389  }
390 }

◆ initializeDecorators()

StatusCode Prompt::DecoratePromptLeptonImproved::initializeDecorators ( )
private

Definition at line 231 of file DecoratePromptLeptonImproved.cxx.

232 {
233  //
234  // Fill short variable map
235  //
238 
239  if(!m_shortMap.insert(shortDecoratorMap::value_type(var, shortDecorator)).second) {
240  ATH_MSG_ERROR("Instantiation of Decorator class failed for short decorator map for var: " << m_vars->asStr(var));
241  return StatusCode::FAILURE;
242  }
243  }
244 
245  //
246  // Fill float variable map
247  //
250 
251  if(!m_floatMap.insert(floatDecoratorMap::value_type(var, floatDecorator)).second) {
252  ATH_MSG_ERROR("Instantiation of Decorator class failed for float decorator map for var: " << m_vars->asStr(var));
253  return StatusCode::FAILURE;
254  }
255  }
256 
257  //
258  // Fill additional variables
259  //
260  if(!m_floatMap.insert(floatDecoratorMap::value_type(m_BDTVarKey, SG::AuxElement::Decorator<float>(m_BDTName))).second) {
261  ATH_MSG_ERROR("Failed to add variable: " << m_vars->asStr(m_BDTVarKey));
262  return StatusCode::FAILURE;
263  }
264 
265  for(const std::string &evar: m_extraDecoratorFloatVars) {
266  const Def::Var ekey = m_vars->registerDynamicVar(evar);
267 
268  if(ekey == Def::NONE) {
269  ATH_MSG_ERROR("Failed to create key for variable name=" << evar);
270  return StatusCode::FAILURE;
271  }
272 
273  if(m_floatMap.find(ekey) != m_floatMap.end()) {
274  ATH_MSG_DEBUG("Ignore duplicate variable name=" << evar);
275  continue;
276  }
277 
278  if(!m_floatMap.insert(floatDecoratorMap::value_type(ekey, SG::AuxElement::Decorator<float>(m_inputVarDecoratePrefix + evar))).second) {
279  ATH_MSG_ERROR("Failed to add variable: \"" << evar << "\"");
280  return StatusCode::FAILURE;
281  }
282  }
283 
284  for(const std::string &evar: m_extraDecoratorShortVars) {
285  const Def::Var ekey = m_vars->registerDynamicVar(evar);
286 
287  if(ekey == Def::NONE) {
288  ATH_MSG_ERROR("Failed to create key for variable name=" << evar);
289  return StatusCode::FAILURE;
290  }
291 
292  if(m_shortMap.find(ekey) != m_shortMap.end()) {
293  ATH_MSG_DEBUG("Ignore duplicate variable name=" << evar);
294  continue;
295  }
296 
297  if(!m_shortMap.insert(shortDecoratorMap::value_type(ekey, SG::AuxElement::Decorator<short>(m_inputVarDecoratePrefix + evar))).second) {
298  ATH_MSG_ERROR("Failed to add variable: \"" << evar << "\"");
299  return StatusCode::FAILURE;
300  }
301  }
302 
303  //
304  // Veto the decorators of the variables in the veto-list if exist
305  //
306  for(const std::string &vvar: m_vetoDecoratorFloatVars) {
307  const Def::Var vkey = m_vars->registerDynamicVar(vvar);
308 
309  if(vkey == Def::NONE) {
310  ATH_MSG_ERROR("Failed to create key for variable name=" << vvar);
311  return StatusCode::FAILURE;
312  }
313 
314  floatDecoratorMap::iterator iter = m_floatMap.find(vkey);
315 
316  if(iter != m_floatMap.end()) {
317  ATH_MSG_DEBUG("Remove the variable from the veto-list, name=" << vvar);
318  m_floatMap.erase(iter);
319  }
320  }
321 
322  for(const std::string &vvar: m_vetoDecoratorShortVars) {
323  const Def::Var vkey = m_vars->registerDynamicVar(vvar);
324 
325  if(vkey == Def::NONE) {
326  ATH_MSG_ERROR("Failed to create key for variable name=" << vvar);
327  return StatusCode::FAILURE;
328  }
329 
330  shortDecoratorMap::iterator iter = m_shortMap.find(vkey);
331 
332  if(iter != m_shortMap.end()) {
333  ATH_MSG_DEBUG("Remove the variable from the veto-list, name=" << vvar);
334  m_shortMap.erase(iter);
335  }
336  }
337 
338  // Print decorator counts
339  ATH_MSG_DEBUG("Added " << m_shortMap.size() << " short decorators");
340  ATH_MSG_DEBUG("Added " << m_floatMap.size() << " float decorators");
341 
342  // Instantiate MVA X bin
343  if(m_leptonPtBinsVector.size() < 2) {
344  ATH_MSG_ERROR("Invalid PtBins size=" << m_leptonPtBinsVector.size());
345  return StatusCode::FAILURE;
346  }
347 
348  std::unique_ptr<double []> PtBins = std::make_unique<double []>(m_leptonPtBinsVector.size());
349 
350  for(unsigned i = 0; i < m_leptonPtBinsVector.size(); i++) {
351  PtBins[i] = m_leptonPtBinsVector[i];
352  }
353 
354  m_leptonPtBinHist = std::make_unique<TH1D>("PtBin", "PtBin", m_leptonPtBinsVector.size() - 1, PtBins.get());
355 
356  return StatusCode::SUCCESS;
357 }

◆ initializeTMVAReader()

bool Prompt::DecoratePromptLeptonImproved::initializeTMVAReader ( )
private

Definition at line 189 of file DecoratePromptLeptonImproved.cxx.

190 {
191  //
192  // Make new instance of TMVA Reader and add variables
193  //
194  m_TMVAReader = std::make_unique<TMVA::Reader>();
195 
196  for(unsigned i = 0; i < m_allVars.size(); ++i) {
197  m_TMVAReader->AddVariable(m_vars->asStr(m_allVars.at(i)), &m_varTMVA[i]);
198  }
199 
200  //
201  // Get path to xml training file
202  //
203  std::string fullPathToFile = PathResolverFindCalibFile("JetTagNonPromptLepton/"
205  + "/TMVAClassification_" + m_methodTitleMVA + ".weights.xml");
206 
207  if(!m_configPathOverride.empty()) {
208  ATH_MSG_INFO("Override path resolver result");
209  fullPathToFile = m_configPathOverride;
210  }
211 
212  ATH_MSG_INFO("TMVA configuration file: " + fullPathToFile);
213  ATH_MSG_INFO("TMVA method name: " + m_methodTitleMVA);
214 
215  //
216  // Book an instance of BDT reader if path is available
217  //
218  if(fullPathToFile == "") {
219  ATH_MSG_ERROR("Could not find path to xml training file");
220  return false;
221  }
222  else {
223  m_TMVAReader->BookMVA(m_methodTitleMVA.toString(), fullPathToFile);
224  }
225 
226  return true;
227 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Algorithm >::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< Algorithm > >::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.

◆ 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< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

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

Member Data Documentation

◆ m_accessCalIsolation30

std::unique_ptr<AccessFloat> Prompt::DecoratePromptLeptonImproved::m_accessCalIsolation30
private

Definition at line 225 of file DecoratePromptLeptonImproved.h.

◆ m_accessDeepSecondaryVertex

std::unique_ptr<AccessVertex> Prompt::DecoratePromptLeptonImproved::m_accessDeepSecondaryVertex
private

Definition at line 230 of file DecoratePromptLeptonImproved.h.

◆ m_accessMuonCalE

std::unique_ptr<AccessFloat> Prompt::DecoratePromptLeptonImproved::m_accessMuonCalE
private

Definition at line 228 of file DecoratePromptLeptonImproved.h.

◆ m_accessMuonParamEnergyLoss

std::unique_ptr<AccessFloat> Prompt::DecoratePromptLeptonImproved::m_accessMuonParamEnergyLoss
private

Definition at line 229 of file DecoratePromptLeptonImproved.h.

◆ m_accessorRNNVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_accessorRNNVars {this, "accessorRNNVars", {}, "Name of the RNN accessor of the lepton"}
private

Definition at line 169 of file DecoratePromptLeptonImproved.h.

◆ m_accessRNNMap

floatAccessorMap Prompt::DecoratePromptLeptonImproved::m_accessRNNMap
private

Definition at line 232 of file DecoratePromptLeptonImproved.h.

◆ m_accessTrackIsolation30

std::unique_ptr<AccessFloat> Prompt::DecoratePromptLeptonImproved::m_accessTrackIsolation30
private

Definition at line 226 of file DecoratePromptLeptonImproved.h.

◆ m_accessTrackIsolation30TTVA

std::unique_ptr<AccessFloat> Prompt::DecoratePromptLeptonImproved::m_accessTrackIsolation30TTVA
private

Definition at line 227 of file DecoratePromptLeptonImproved.h.

◆ m_allVars

std::vector<Prompt::Def::Var> Prompt::DecoratePromptLeptonImproved::m_allVars
private

Definition at line 213 of file DecoratePromptLeptonImproved.h.

◆ m_BDTName

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_BDTName {this, "BDTName", "", "BDT name"}
private

Definition at line 166 of file DecoratePromptLeptonImproved.h.

◆ m_BDTVarKey

Prompt::Def::Var Prompt::DecoratePromptLeptonImproved::m_BDTVarKey
private

Definition at line 217 of file DecoratePromptLeptonImproved.h.

◆ m_clusterContainerKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> Prompt::DecoratePromptLeptonImproved::m_clusterContainerKey
private
Initial value:
{
this, "ClusterContainerName", "",
"Container name of the Clusters which are used to calculate the input variables for the PromptLeptonImproved"
}

Definition at line 195 of file DecoratePromptLeptonImproved.h.

◆ m_configFileVersion

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_configFileVersion {this, "ConfigFileVersion", "", "BDT weight file version"}
private

Definition at line 163 of file DecoratePromptLeptonImproved.h.

◆ m_configPathOverride

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_configPathOverride {this, "ConfigPathOverride", "", "Path of the local BDT weight file you want to study/test"}
private

Definition at line 164 of file DecoratePromptLeptonImproved.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_elecMinCalErelConeSize

Gaudi::Property<double> Prompt::DecoratePromptLeptonImproved::m_elecMinCalErelConeSize {this, "ElecMinCalErelConeSize", 0.15, "Cut of the cluster for calculating the core energy of the lepton"}
private

Definition at line 185 of file DecoratePromptLeptonImproved.h.

◆ m_electronsKey

SG::ReadHandleKey<xAOD::ElectronContainer> Prompt::DecoratePromptLeptonImproved::m_electronsKey
private
Initial value:
{
this, "ElectronContainerKey", "Electrons",
"Container's name of the electrons that you want to decorate"
}

Definition at line 200 of file DecoratePromptLeptonImproved.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_extraDecoratorFloatVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_extraDecoratorFloatVars {this, "extraDecoratorFloatVars", {}, "Extra float variables' names you want to compute and decorate into the lepton"}
private

Definition at line 172 of file DecoratePromptLeptonImproved.h.

◆ m_extraDecoratorShortVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_extraDecoratorShortVars {this, "extraDecoratorShortVars", {}, "Extra short variables' names you want to compute and decorate into the lepton"}
private

Definition at line 173 of file DecoratePromptLeptonImproved.h.

◆ m_floatMap

floatDecoratorMap Prompt::DecoratePromptLeptonImproved::m_floatMap
private

Definition at line 220 of file DecoratePromptLeptonImproved.h.

◆ m_floatVars

std::vector<Prompt::Def::Var> Prompt::DecoratePromptLeptonImproved::m_floatVars
private

Definition at line 212 of file DecoratePromptLeptonImproved.h.

◆ m_inputVarDecoratePrefix

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_inputVarDecoratePrefix {this, "InputVarDecoratePrefix", "", "Prefix of the variables that will be decorated into the lepton"}
private

Definition at line 165 of file DecoratePromptLeptonImproved.h.

◆ m_intVars

std::vector<Prompt::Def::Var> Prompt::DecoratePromptLeptonImproved::m_intVars
private

Definition at line 211 of file DecoratePromptLeptonImproved.h.

◆ m_leptonPtBinHist

std::unique_ptr<TH1D> Prompt::DecoratePromptLeptonImproved::m_leptonPtBinHist
private

Definition at line 234 of file DecoratePromptLeptonImproved.h.

◆ m_leptonPtBinsVector

Gaudi::Property<std::vector<double> > Prompt::DecoratePromptLeptonImproved::m_leptonPtBinsVector {this, "leptonPtBinsVector", {}, "pT bin edges that are used for MVABin calculation"}
private

Definition at line 176 of file DecoratePromptLeptonImproved.h.

◆ m_leptonsName

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_leptonsName
private
Initial value:
{
this, "LeptonContainerName", "",
"Container's name of the lepton that you want to decorate. Also need to set ElectronContainerKey or MuonContainerKey accordingly"
}

Definition at line 158 of file DecoratePromptLeptonImproved.h.

◆ m_maxLepTrackJetDR

Gaudi::Property<double> Prompt::DecoratePromptLeptonImproved::m_maxLepTrackJetDR {this, "maxLepTrackJetDR", 0.4, "Maximum distance between lepton and track jet for track jet matching"}
private

Definition at line 186 of file DecoratePromptLeptonImproved.h.

◆ m_methodTitleMVA

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_methodTitleMVA {this, "MethodTitleMVA", "BDT", "Help to config the path of the BDT xml file"}
private

Definition at line 167 of file DecoratePromptLeptonImproved.h.

◆ m_muonsKey

SG::ReadHandleKey<xAOD::MuonContainer> Prompt::DecoratePromptLeptonImproved::m_muonsKey
private
Initial value:
{
this, "MuonContainerKey", "Muons",
"Container's name of the muons that you want to decorate"
}

Definition at line 204 of file DecoratePromptLeptonImproved.h.

◆ m_primaryVertexKey

SG::ReadHandleKey<xAOD::VertexContainer> Prompt::DecoratePromptLeptonImproved::m_primaryVertexKey
private
Initial value:
{
this, "PrimaryVertexContainerName", "", "Primary vertex container name"
}

Definition at line 192 of file DecoratePromptLeptonImproved.h.

◆ m_printTime

Gaudi::Property<bool> Prompt::DecoratePromptLeptonImproved::m_printTime {this, "PrintTime", false, "Whether to print current time"}
private

Definition at line 178 of file DecoratePromptLeptonImproved.h.

◆ m_shortMap

shortDecoratorMap Prompt::DecoratePromptLeptonImproved::m_shortMap
private

Definition at line 219 of file DecoratePromptLeptonImproved.h.

◆ m_stringFloatVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_stringFloatVars {this, "stringFloatVars", {}, "Vector of the BDT float variables' names and they will be decorated into lepton if not in the veto list"}
private

Definition at line 171 of file DecoratePromptLeptonImproved.h.

◆ m_stringIntVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_stringIntVars {this, "stringIntVars", {}, "Vector of the BDT int variables' names and they will be decorated into lepton if not in the veto list"}
private

Definition at line 170 of file DecoratePromptLeptonImproved.h.

◆ m_timerAll

TStopwatch Prompt::DecoratePromptLeptonImproved::m_timerAll
private

Definition at line 236 of file DecoratePromptLeptonImproved.h.

◆ m_timerElec

TStopwatch Prompt::DecoratePromptLeptonImproved::m_timerElec
private

Definition at line 239 of file DecoratePromptLeptonImproved.h.

◆ m_timerExec

TStopwatch Prompt::DecoratePromptLeptonImproved::m_timerExec
private

Definition at line 237 of file DecoratePromptLeptonImproved.h.

◆ m_timerMuon

TStopwatch Prompt::DecoratePromptLeptonImproved::m_timerMuon
private

Definition at line 238 of file DecoratePromptLeptonImproved.h.

◆ m_TMVAReader

std::unique_ptr<TMVA::Reader> Prompt::DecoratePromptLeptonImproved::m_TMVAReader
private

Definition at line 222 of file DecoratePromptLeptonImproved.h.

◆ m_trackJetsKey

SG::ReadHandleKey<xAOD::JetContainer> Prompt::DecoratePromptLeptonImproved::m_trackJetsKey
private
Initial value:
{
this, "TrackJetContainerName", "", "Track Jet container name"
}

Definition at line 189 of file DecoratePromptLeptonImproved.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vars

std::unique_ptr<Prompt::VarHolder> Prompt::DecoratePromptLeptonImproved::m_vars
private

Definition at line 215 of file DecoratePromptLeptonImproved.h.

◆ m_varTMVA

std::vector<Float_t> Prompt::DecoratePromptLeptonImproved::m_varTMVA
private

Definition at line 223 of file DecoratePromptLeptonImproved.h.

◆ m_vertexBarrEcapAbsEtaAt

Gaudi::Property<double> Prompt::DecoratePromptLeptonImproved::m_vertexBarrEcapAbsEtaAt {this, "VertexBarrEcapAbsEtaAt", 1.37, "Relate to the vertex cut above, define the barrel and central electrons by abs(eta)"}
private

Definition at line 184 of file DecoratePromptLeptonImproved.h.

◆ m_vertexLinkName

Gaudi::Property<std::string> Prompt::DecoratePromptLeptonImproved::m_vertexLinkName {this, "VertexLinkName", "", "ElementLink name of the secondary vertices"}
private

Definition at line 180 of file DecoratePromptLeptonImproved.h.

◆ m_vertexMinChiSquaredProb

Gaudi::Property<double> Prompt::DecoratePromptLeptonImproved::m_vertexMinChiSquaredProb {this, "VertexMinChiSquaredProb", 0.03, "Vertex chi2 cut"}
private

Definition at line 181 of file DecoratePromptLeptonImproved.h.

◆ m_vertexMinThetaBarrElec

Gaudi::Property<double> Prompt::DecoratePromptLeptonImproved::m_vertexMinThetaBarrElec {this, "VertexMinThetaBarrElec", 0.002, "Vertex theta between lepton and the direction of sv-pv cut for barrel electrons"}
private

Definition at line 182 of file DecoratePromptLeptonImproved.h.

◆ m_vertexMinThetaEcapElec

Gaudi::Property<double> Prompt::DecoratePromptLeptonImproved::m_vertexMinThetaEcapElec {this, "VertexMinThetaEcapElec", 0.001, "Vertex theta between lepton and the direction of sv-pv cut for central electrons"}
private

Definition at line 183 of file DecoratePromptLeptonImproved.h.

◆ m_vetoDecoratorFloatVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_vetoDecoratorFloatVars {this, "vetoDecoratorFloatVars", {}, "Vector of the float variables' names you do not want to save"}
private

Definition at line 174 of file DecoratePromptLeptonImproved.h.

◆ m_vetoDecoratorShortVars

Gaudi::Property<std::vector<std::string> > Prompt::DecoratePromptLeptonImproved::m_vetoDecoratorShortVars {this, "vetoDecoratorShortVars", {}, "Vector of the short variables' names you do not want to save"}
private

Definition at line 175 of file DecoratePromptLeptonImproved.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Prompt::DecoratePromptLeptonImproved::m_primaryVertexKey
SG::ReadHandleKey< xAOD::VertexContainer > m_primaryVertexKey
Definition: DecoratePromptLeptonImproved.h:192
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
Prompt::Def::RawPt
@ RawPt
Definition: VarHolder.h:94
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
Prompt::DecoratePromptLeptonImproved::m_vetoDecoratorShortVars
Gaudi::Property< std::vector< std::string > > m_vetoDecoratorShortVars
Definition: DecoratePromptLeptonImproved.h:175
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
Prompt::DecoratePromptLeptonImproved::m_vetoDecoratorFloatVars
Gaudi::Property< std::vector< std::string > > m_vetoDecoratorFloatVars
Definition: DecoratePromptLeptonImproved.h:174
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Prompt::GetAuxVar
bool GetAuxVar(const T1 &obj, T2 &value, const std::string &var_name)
Definition: PromptUtils.h:93
Prompt::DecoratePromptLeptonImproved::m_elecMinCalErelConeSize
Gaudi::Property< double > m_elecMinCalErelConeSize
Definition: DecoratePromptLeptonImproved.h:185
Prompt::getVertexFitProb
double getVertexFitProb(const xAOD::Vertex *vtx)
Definition: PromptUtils.cxx:21
Prompt::Def::TrackJetNTrack
@ TrackJetNTrack
Definition: VarHolder.h:69
Prompt::DecoratePromptLeptonImproved::m_leptonPtBinsVector
Gaudi::Property< std::vector< double > > m_leptonPtBinsVector
Definition: DecoratePromptLeptonImproved.h:176
Prompt::DecoratePromptLeptonImproved::initializeTMVAReader
bool initializeTMVAReader()
Definition: DecoratePromptLeptonImproved.cxx:189
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Prompt::DecoratePromptLeptonImproved::m_intVars
std::vector< Prompt::Def::Var > m_intVars
Definition: DecoratePromptLeptonImproved.h:211
Prompt::VarHolder::addVar
bool addVar(unsigned key, double value)
Adds a variable to the VarHolder.
Definition: VarHolder.h:210
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
Prompt::VarHolder
Definition: VarHolder.h:112
Prompt::DecoratePromptLeptonImproved::m_allVars
std::vector< Prompt::Def::Var > m_allVars
Definition: DecoratePromptLeptonImproved.h:213
Prompt::DecoratePromptLeptonImproved::m_accessRNNMap
floatAccessorMap m_accessRNNMap
Definition: DecoratePromptLeptonImproved.h:232
Prompt::DecoratePromptLeptonImproved::m_BDTName
Gaudi::Property< std::string > m_BDTName
Definition: DecoratePromptLeptonImproved.h:166
Prompt::DecoratePromptLeptonImproved::initializeConstAccessors
void initializeConstAccessors()
Definition: DecoratePromptLeptonImproved.cxx:360
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::JetConstituentVector::size
size_t size() const
number of constituents
Definition: JetConstituentVector.cxx:102
Prompt::DecoratePromptLeptonImproved::decorateMuon
void decorateMuon(const xAOD::Muon &muon, const xAOD::JetContainer &trackJets, const xAOD::Vertex *primaryVertex)
Definition: DecoratePromptLeptonImproved.cxx:442
Prompt::DecoratePromptLeptonImproved::m_electronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
Definition: DecoratePromptLeptonImproved.h:200
Prompt::DecoratePromptLeptonImproved::findTrackJet
std::pair< double, const xAOD::Jet * > findTrackJet(const T &part, const xAOD::JetContainer &jets)
Definition: DecoratePromptLeptonImproved.cxx:828
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
Prompt::DecoratePromptLeptonImproved::AccessFloat
SG::AuxElement::ConstAccessor< float > AccessFloat
Definition: DecoratePromptLeptonImproved.h:152
Prompt::DecoratePromptLeptonImproved::m_vertexMinThetaEcapElec
Gaudi::Property< double > m_vertexMinThetaEcapElec
Definition: DecoratePromptLeptonImproved.h:183
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
Prompt::DecoratePromptLeptonImproved::m_stringFloatVars
Gaudi::Property< std::vector< std::string > > m_stringFloatVars
Definition: DecoratePromptLeptonImproved.h:171
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Prompt::DecoratePromptLeptonImproved::m_vertexBarrEcapAbsEtaAt
Gaudi::Property< double > m_vertexBarrEcapAbsEtaAt
Definition: DecoratePromptLeptonImproved.h:184
xAOD::Jet_v1::getConstituents
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Definition: Jet_v1.cxx:147
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
Prompt::PrintResetStopWatch
std::string PrintResetStopWatch(TStopwatch &watch)
Definition: PromptUtils.cxx:244
Prompt::DecoratePromptLeptonImproved::m_accessCalIsolation30
std::unique_ptr< AccessFloat > m_accessCalIsolation30
Definition: DecoratePromptLeptonImproved.h:225
Prompt::Def::DRlj
@ DRlj
Definition: VarHolder.h:70
Prompt::DecoratePromptLeptonImproved::getElectronAnpVariables
void getElectronAnpVariables(const xAOD::Electron &elec, const xAOD::CaloClusterContainer &clusters, Prompt::VarHolder &vars, const xAOD::Vertex *primaryVertex)
Definition: DecoratePromptLeptonImproved.cxx:489
Prompt::DecoratePromptLeptonImproved::m_muonsKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
Definition: DecoratePromptLeptonImproved.h:204
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:86
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Prompt::DecoratePromptLeptonImproved::m_timerExec
TStopwatch m_timerExec
Definition: DecoratePromptLeptonImproved.h:237
Prompt::Def::PtFrac
@ PtFrac
Definition: VarHolder.h:71
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Prompt::DecoratePromptLeptonImproved::m_TMVAReader
std::unique_ptr< TMVA::Reader > m_TMVAReader
Definition: DecoratePromptLeptonImproved.h:222
Prompt::Def::NONE
@ NONE
Definition: VarHolder.h:68
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Prompt::VarHolder::getVar
double getVar(const unsigned key) const
Definition: VarHolder.h:275
Prompt::DecoratePromptLeptonImproved::m_timerElec
TStopwatch m_timerElec
Definition: DecoratePromptLeptonImproved.h:239
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
Prompt::Def::Ptvarcone30rel
@ Ptvarcone30rel
Definition: VarHolder.h:91
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Prompt::DecoratePromptLeptonImproved::m_extraDecoratorShortVars
Gaudi::Property< std::vector< std::string > > m_extraDecoratorShortVars
Definition: DecoratePromptLeptonImproved.h:173
Prompt::Def::MVAXBin
@ MVAXBin
Definition: VarHolder.h:93
Prompt::DecoratePromptLeptonImproved::m_methodTitleMVA
Gaudi::Property< std::string > m_methodTitleMVA
Definition: DecoratePromptLeptonImproved.h:167
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:85
Prompt::DecoratePromptLeptonImproved::decorateAuxLepton
void decorateAuxLepton(const xAOD::IParticle &particle, Prompt::VarHolder &vars)
Definition: DecoratePromptLeptonImproved.cxx:789
xmin
double xmin
Definition: listroot.cxx:60
Prompt::DecoratePromptLeptonImproved::m_extraDecoratorFloatVars
Gaudi::Property< std::vector< std::string > > m_extraDecoratorFloatVars
Definition: DecoratePromptLeptonImproved.h:172
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
Prompt::DecoratePromptLeptonImproved::getMuonAnpVariables
void getMuonAnpVariables(const xAOD::Muon &muon, Prompt::VarHolder &vars, const xAOD::Vertex *primaryVertex)
Definition: DecoratePromptLeptonImproved.cxx:577
xAOD::Egamma_v1::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition: Egamma_v1.cxx:388
Prompt::DecoratePromptLeptonImproved::m_BDTVarKey
Prompt::Def::Var m_BDTVarKey
Definition: DecoratePromptLeptonImproved.h:217
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
Prompt::DecoratePromptLeptonImproved::m_accessTrackIsolation30TTVA
std::unique_ptr< AccessFloat > m_accessTrackIsolation30TTVA
Definition: DecoratePromptLeptonImproved.h:227
Prompt::DecoratePromptLeptonImproved::m_accessMuonParamEnergyLoss
std::unique_ptr< AccessFloat > m_accessMuonParamEnergyLoss
Definition: DecoratePromptLeptonImproved.h:229
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
Prompt::DecoratePromptLeptonImproved::m_inputVarDecoratePrefix
Gaudi::Property< std::string > m_inputVarDecoratePrefix
Definition: DecoratePromptLeptonImproved.h:165
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Prompt::DecoratePromptLeptonImproved::m_floatMap
floatDecoratorMap m_floatMap
Definition: DecoratePromptLeptonImproved.h:220
Prompt::DecoratePromptLeptonImproved::m_printTime
Gaudi::Property< bool > m_printTime
Definition: DecoratePromptLeptonImproved.h:178
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Prompt::DecoratePromptLeptonImproved::m_accessDeepSecondaryVertex
std::unique_ptr< AccessVertex > m_accessDeepSecondaryVertex
Definition: DecoratePromptLeptonImproved.h:230
Prompt::DecoratePromptLeptonImproved::m_floatVars
std::vector< Prompt::Def::Var > m_floatVars
Definition: DecoratePromptLeptonImproved.h:212
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
Prompt::DecoratePromptLeptonImproved::m_accessMuonCalE
std::unique_ptr< AccessFloat > m_accessMuonCalE
Definition: DecoratePromptLeptonImproved.h:228
Prompt::DecoratePromptLeptonImproved::getMutualVariables
void getMutualVariables(const xAOD::IParticle &particle, const xAOD::Jet &track_jet, const xAOD::TrackParticle *track, Prompt::VarHolder &vars)
Definition: DecoratePromptLeptonImproved.cxx:655
Prompt::Def::CandVertex_NPassVtx
@ CandVertex_NPassVtx
Definition: VarHolder.h:100
Prompt::DecoratePromptLeptonImproved::m_maxLepTrackJetDR
Gaudi::Property< double > m_maxLepTrackJetDR
Definition: DecoratePromptLeptonImproved.h:186
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Prompt::Def::CaloClusterSumEtRel
@ CaloClusterSumEtRel
Definition: VarHolder.h:96
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Prompt::DecoratePromptLeptonImproved::addVarsToTMVA
void addVarsToTMVA(Prompt::VarHolder &vars)
Definition: DecoratePromptLeptonImproved.cxx:747
Prompt::DecoratePromptLeptonImproved::m_leptonPtBinHist
std::unique_ptr< TH1D > m_leptonPtBinHist
Definition: DecoratePromptLeptonImproved.h:234
Prompt::DecoratePromptLeptonImproved::m_accessorRNNVars
Gaudi::Property< std::vector< std::string > > m_accessorRNNVars
Definition: DecoratePromptLeptonImproved.h:169
Prompt::DecoratePromptLeptonImproved::m_accessTrackIsolation30
std::unique_ptr< AccessFloat > m_accessTrackIsolation30
Definition: DecoratePromptLeptonImproved.h:226
xAOD::IParticle::p4
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
Prompt::DecoratePromptLeptonImproved::m_stringIntVars
Gaudi::Property< std::vector< std::string > > m_stringIntVars
Definition: DecoratePromptLeptonImproved.h:170
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
xAOD::Electron_v1
Definition: Electron_v1.h:34
Prompt::DecoratePromptLeptonImproved::m_clusterContainerKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterContainerKey
Definition: DecoratePromptLeptonImproved.h:195
Prompt::DecoratePromptLeptonImproved::fillVarDefault
void fillVarDefault(Prompt::VarHolder &vars) const
Definition: DecoratePromptLeptonImproved.cxx:774
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
Prompt::DecoratePromptLeptonImproved::m_configPathOverride
Gaudi::Property< std::string > m_configPathOverride
Definition: DecoratePromptLeptonImproved.h:164
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
Prompt::DecoratePromptLeptonImproved::m_varTMVA
std::vector< Float_t > m_varTMVA
Definition: DecoratePromptLeptonImproved.h:223
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
Prompt::DecoratePromptLeptonImproved::m_shortMap
shortDecoratorMap m_shortMap
Definition: DecoratePromptLeptonImproved.h:219
xAOD::Jet_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: Jet_v1.cxx:71
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Prompt::DecoratePromptLeptonImproved::m_timerAll
TStopwatch m_timerAll
Definition: DecoratePromptLeptonImproved.h:236
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
Prompt::Def::Ptvarcone30_TightTTVA_pt500rel
@ Ptvarcone30_TightTTVA_pt500rel
Definition: VarHolder.h:92
xmax
double xmax
Definition: listroot.cxx:61
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
Prompt::DecoratePromptLeptonImproved::accessIsolation
float accessIsolation(SG::AuxElement::ConstAccessor< float > &isoAccessor, const xAOD::IParticle &particle)
Definition: DecoratePromptLeptonImproved.cxx:726
Prompt::Def::CandVertex_normDistToPriVtxLongitudinalBest
@ CandVertex_normDistToPriVtxLongitudinalBest
Definition: VarHolder.h:98
Prompt::Def::PtRel
@ PtRel
Definition: VarHolder.h:72
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
xAOD::Egamma_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: Egamma_v1.cxx:70
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
Prompt::DecoratePromptLeptonImproved::m_vertexLinkName
Gaudi::Property< std::string > m_vertexLinkName
Definition: DecoratePromptLeptonImproved.h:180
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Prompt::DecoratePromptLeptonImproved::m_configFileVersion
Gaudi::Property< std::string > m_configFileVersion
Definition: DecoratePromptLeptonImproved.h:163
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Prompt::DecoratePromptLeptonImproved::m_timerMuon
TStopwatch m_timerMuon
Definition: DecoratePromptLeptonImproved.h:238
Prompt::DecoratePromptLeptonImproved::m_vertexMinThetaBarrElec
Gaudi::Property< double > m_vertexMinThetaBarrElec
Definition: DecoratePromptLeptonImproved.h:182
Prompt::DecoratePromptLeptonImproved::getVertexCosThetaWithLepDir
double getVertexCosThetaWithLepDir(const xAOD::IParticle &lepton, const xAOD::Vertex *secondaryVertex, const xAOD::Vertex *primaryVertex)
Definition: DecoratePromptLeptonImproved.cxx:885
Prompt::Def::Var
Var
Definition: VarHolder.h:57
Prompt::DecoratePromptLeptonImproved::m_vertexMinChiSquaredProb
Gaudi::Property< double > m_vertexMinChiSquaredProb
Definition: DecoratePromptLeptonImproved.h:181
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
Prompt::DecoratePromptLeptonImproved::getVertexLongitudinalNormDist
double getVertexLongitudinalNormDist(const xAOD::IParticle &lepton, const xAOD::Vertex *secondaryVertex, const xAOD::Vertex *primaryVertex)
Definition: DecoratePromptLeptonImproved.cxx:858
Prompt::DecoratePromptLeptonImproved::initializeDecorators
StatusCode initializeDecorators()
Definition: DecoratePromptLeptonImproved.cxx:231
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Prompt::Def::CandVertex_normDistToPriVtxLongitudinalBest_ThetaCutVtx
@ CandVertex_normDistToPriVtxLongitudinalBest_ThetaCutVtx
Definition: VarHolder.h:99
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
Prompt::Def::Topoetcone30rel
@ Topoetcone30rel
Definition: VarHolder.h:90
Prompt::Def::CaloClusterERel
@ CaloClusterERel
Definition: VarHolder.h:95
Prompt::DecoratePromptLeptonImproved::m_vars
std::unique_ptr< Prompt::VarHolder > m_vars
Definition: DecoratePromptLeptonImproved.h:215
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
Prompt::VarHolder::asStr
std::string asStr(const uint32_t key, const double val)
Definition: VarHolder.cxx:178
Prompt::DecoratePromptLeptonImproved::decorateElec
void decorateElec(const xAOD::Electron &electron, const xAOD::JetContainer &trackJets, const xAOD::CaloClusterContainer &clusters, const xAOD::Vertex *primaryVertex)
Definition: DecoratePromptLeptonImproved.cxx:393
Prompt::DecoratePromptLeptonImproved::m_trackJetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_trackJetsKey
Definition: DecoratePromptLeptonImproved.h:189
Prompt::DecoratePromptLeptonImproved::m_leptonsName
Gaudi::Property< std::string > m_leptonsName
Definition: DecoratePromptLeptonImproved.h:158