ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
met::METSystematicsTool Class Referenceabstract

#include <METSystematicsTool.h>

Inheritance diagram for met::METSystematicsTool:
Collaboration diagram for met::METSystematicsTool:

Public Member Functions

 METSystematicsTool (const std::string &name)
 
StatusCode softTrkSystInitialize ()
 
StatusCode softCaloSystInitialize ()
 
StatusCode jetTrkSystInitialize ()
 
StatusCode initialize ()
 Dummy implementation of the initialisation function. More...
 
CP::CorrectionCode applyCorrection (xAOD::MissingET &inputMet, const xAOD::MissingETAssociationHelper &helper) const
 
CP::CorrectionCode correctedCopy (const xAOD::MissingET &met, xAOD::MissingET *&outputmet, const xAOD::MissingETAssociationHelper &helper) const
 
bool isAffectedBySystematic (const CP::SystematicVariation &var) const
 returns: whether this tool is affected by the given systematic guarantee: no-fail More...
 
CP::SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II More...
 
CP::SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II More...
 
StatusCode applySystematicVariation (const CP::SystematicSet &set)
 effects: configure this tool for the given list of systematic variations. More...
 
StatusCode sysApplySystematicVariation (const CP::SystematicSet &)
 effects: configure this tool for the given list of systematic variations. More...
 
void setRandomSeed (unsigned long seed) const
 
virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &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
 
const SystematicSet & appliedSystematics () const
 returns: the list of systematics that have been applied to this tool. More...
 
std::string appliedSystematicsString () const
 returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II rationale: this is meant to be used when printing out the applied systematics for debugging purposes (or when embedding them in a string). More...
 
void testInvariant () const
 effects: test the invariance of this object guarantee: no-fail More...
 

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...
 
StatusCode addAffectingSystematic (const SystematicVariation &systematic, bool recommended)
 effects: add a systematic to the list of registered systematics. More...
 
StatusCode addRecommendedSystematic (const SystematicVariation &systematic)
 effects: add a systematic to the list of recommended systematics failures: unsupported systematic More...
 
void addAffectingSystematics (const SystematicSet &systematics)
 effects: add a SystematicSet to the registered systematics. More...
 
StatusCode addRecommendedSystematics (const SystematicSet &systematics)
 effects: add a SystematicSet to the recommended systematics. More...
 

Protected Attributes

SystematicSet m_affectingSystematics
 description: members directly corresponding to accessors More...
 
SystematicSet m_recommendedSystematics
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

 FRIEND_TEST (METSystTest, TestDefaultHistosFilled)
 
 FRIEND_TEST (METSystTest, TestJetTrkHistosFilled)
 
 FRIEND_TEST (METSystTest, TestAddAffectingSystematic)
 
 FRIEND_TEST (METSystTest, TestProjectST)
 
 FRIEND_TEST (METSystTest, TestProjectST2)
 
 METSystematicsTool ()
 
CP::CorrectionCode internalSoftTermApplyCorrection (xAOD::MissingET &softMet, xAOD::MissingETContainer const *METcont, xAOD::EventInfo const &eInfo) const
 
CP::CorrectionCode calcJetTrackMETWithSyst (xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
 
CP::CorrectionCode calcJetTrackMETWithSyst (xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper, const xAOD::Jet *jet) const
 
CP::CorrectionCode getCorrectedJetTrackMET (xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
 
TRandom3 * getTLSRandomGen () const
 
int getNPV () const
 
xAOD::EventInfo constgetDefaultEventInfo () const
 
StatusCode addMETAffectingSystematics ()
 
StatusCode extractHistoPath (std::string &histfile, std::string &systpath, std::string &configdir, std::string &suffix, SystType const &type)
 
missingEt calcPtHard (xAOD::MissingETContainer const *const cont) const
 
missingEt variedSoftTerm (missingEt const &softTerms, missingEt const &ptHard, double varPara, double varPerp) const
 
missingEt projectST (missingEt const &softTerms, missingEt const &ptHard) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SystApplied m_appliedSystEnum {NONE}
 
Gaudi::Property< std::string > m_configPrefix {this, "ConfigPrefix", "METUtilities/R22_PreRecs", ""}
 
Gaudi::Property< std::string > m_configSoftTrkFile {this, "ConfigSoftTrkFile", "TrackSoftTerms-pflow_Dec24.config", ""}
 
Gaudi::Property< std::string > m_configJetTrkFile {this, "ConfigJetTrkFile", "", ""}
 
Gaudi::Property< std::string > m_configSoftCaloFile {this, "ConfigSoftCaloFile", "", ""}
 
Gaudi::Property< bool > m_useDevArea {this, "UseDevArea", false, ""}
 
std::unique_ptr< TH3D > m_trk_shiftpara_pthard_njet_mu {}
 
std::unique_ptr< TH3D > m_trk_resopara_pthard_njet_mu {}
 
std::unique_ptr< TH3D > m_trk_resoperp_pthard_njet_mu {}
 
std::unique_ptr< TH3D > m_calo_shiftpara_pthard_njet_mu {}
 
std::unique_ptr< TH3D > m_calo_resopara_pthard_njet_mu {}
 
std::unique_ptr< TH3D > m_calo_resoperp_pthard_njet_mu {}
 
std::unique_ptr< TH2D > m_jet_systRpt_pt_eta {}
 
boost::thread_specific_ptr< TRandom3 > m_rand_tls
 
int m_units {-1}
 
SG::ReadHandleKey< xAOD::VertexContainerm_VertexContKey {this, "VertexContainer", "PrimaryVertices", ""}
 
SG::ReadHandleKey< xAOD::MissingETContainerm_TruthContKey {this, "TruthContainer", "MET_Truth", ""}
 
SG::ReadHandleKey< xAOD::EventInfom_EventInfoKey {this, "EventInfo", "EventInfo", ""}
 
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
 
SystematicSet * m_appliedSystematics
 description: pointer to currenty applied systematics More...
 
std::unordered_map< SystematicSet, SystematicSet > m_systFilterMap
 map of cached systematics filtering More...
 

Detailed Description

Definition at line 84 of file METSystematicsTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ METSystematicsTool() [1/2]

met::METSystematicsTool::METSystematicsTool ( const std::string &  name)

Definition at line 31 of file METSystematicsTool.cxx.

33  {
34  ATH_MSG_DEBUG (__PRETTY_FUNCTION__ );
35 
37  }

◆ METSystematicsTool() [2/2]

met::METSystematicsTool::METSystematicsTool ( )
private

Member Function Documentation

◆ addAffectingSystematic()

StatusCode CP::SystematicsTool::addAffectingSystematic ( const SystematicVariation systematic,
bool  recommended 
)
protectedinherited

effects: add a systematic to the list of registered systematics.

It will optionally also add this sytematic to the recommended set. side effects: this will add the systematic to the global list of systematics, if not already there guarantee: strong failures: out of memory II

Definition at line 111 of file SystematicsTool.cxx.

112  {
113 
114  RCU_READ_INVARIANT( this );
115 
116  SystematicRegistry& reg = SystematicRegistry::getInstance();
117  reg.registerSystematic( systematic );
118  m_affectingSystematics.insert( systematic );
119  if( recommended ) {
120  if( addRecommendedSystematic(systematic) != StatusCode::SUCCESS ) {
121  return StatusCode::FAILURE;
122  }
123  }
124  return StatusCode::SUCCESS;
125  }

◆ addAffectingSystematics()

void CP::SystematicsTool::addAffectingSystematics ( const SystematicSet systematics)
protectedinherited

effects: add a SystematicSet to the registered systematics.

Definition at line 141 of file SystematicsTool.cxx.

142  {
143 
144  RCU_READ_INVARIANT( this );
145 
146  SystematicRegistry& reg = SystematicRegistry::getInstance();
148  reg.registerSystematics( systematics );
149  }

◆ addMETAffectingSystematics()

StatusCode met::METSystematicsTool::addMETAffectingSystematics ( )
private

Definition at line 39 of file METSystematicsTool.cxx.

39  {
40  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
41 
42  if(!m_configSoftTrkFile.empty()){
43  if( !(addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ScaleUp , true /*recommended */ ) &&
44  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ScaleDown, true /*recommended */ ) &&
45  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoPara , true /*recommended */ ) &&
46  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoPerp , true /*recommended */ ) &&
47  addAffectingSystematic( softTrkAffSyst::MET_SoftTrk_ResoCorr , false /*not recommended */) ) ) {
48  ATH_MSG_ERROR("failed to properly add softTrk affecting systematics " );
49  return StatusCode::FAILURE;
50  }
51  }
52  if(!m_configSoftCaloFile.empty()){
53  if( !(addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ScaleUp , true ) &&
54  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ScaleDown, true ) &&
55  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ResoPara , true ) &&
56  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ResoPerp , true ) &&
57  addAffectingSystematic( softCaloAffSyst::MET_SoftCalo_ResoCorr , false )) ) {
58  ATH_MSG_ERROR("failed to properly add softCalo affecting systematics " );
59  return StatusCode::FAILURE;
60  }
61  }
62  if(!m_configJetTrkFile.empty()){
63  if( !(addAffectingSystematic( jetTrkAffSyst::MET_JetTrk_ScaleUp , true /*recommended */ ) &&
64  addAffectingSystematic( jetTrkAffSyst::MET_JetTrk_ScaleDown, true /*recommended */ ) ) ){
65  ATH_MSG_ERROR("failed to properly add jetTrk affecting systematics " );
66  return StatusCode::FAILURE;
67  }
68  }
69 
70  ATH_MSG_INFO( "AffectingSystematics are:" );
71  for(const auto& syst : m_affectingSystematics) {
72  ATH_MSG_INFO( syst.name() );
73  }
74 
75  ATH_MSG_DEBUG("These systematics are set based on your config files: " );
76  ATH_MSG_DEBUG("ConfigSoftTrkFile: " << m_configSoftTrkFile );
77  ATH_MSG_DEBUG("ConfigSoftCaloFile: "<< m_configSoftCaloFile);
78  ATH_MSG_DEBUG("ConfigSoftJetFile: " << m_configJetTrkFile );
79 
80  return StatusCode::SUCCESS;
81  }

◆ addRecommendedSystematic()

StatusCode CP::SystematicsTool::addRecommendedSystematic ( const SystematicVariation systematic)
protectedinherited

effects: add a systematic to the list of recommended systematics failures: unsupported systematic

Definition at line 127 of file SystematicsTool.cxx.

128  {
129 
130  RCU_READ_INVARIANT( this );
131 
132  SystematicRegistry& reg = SystematicRegistry::getInstance();
133  m_recommendedSystematics.insert( systematic );
134  if( reg.addSystematicToRecommended( systematic ) !=
135  StatusCode::SUCCESS ) {
136  return StatusCode::FAILURE;
137  }
138  return StatusCode::SUCCESS;
139  }

◆ addRecommendedSystematics()

StatusCode CP::SystematicsTool::addRecommendedSystematics ( const SystematicSet systematics)
protectedinherited

effects: add a SystematicSet to the recommended systematics.

Definition at line 151 of file SystematicsTool.cxx.

152  {
153 
154  RCU_READ_INVARIANT( this );
155 
156  SystematicRegistry& reg = SystematicRegistry::getInstance();
158  if( reg.addSystematicsToRecommended( systematics ) !=
159  StatusCode::SUCCESS ) {
160  return StatusCode::FAILURE;
161  }
162  return StatusCode::SUCCESS;
163  }

◆ affectingSystematics()

CP::SystematicSet met::METSystematicsTool::affectingSystematics ( ) const
inlinevirtual

returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II

Reimplemented from CP::SystematicsTool.

Definition at line 125 of file METSystematicsTool.h.

◆ appliedSystematics()

const SystematicSet & CP::SystematicsTool::appliedSystematics ( ) const
inherited

returns: the list of systematics that have been applied to this tool.

this is not including systematics that were applied, but do not affect this tool guarantee: no-fail

Definition at line 54 of file SystematicsTool.cxx.

54  {
55 
56  RCU_READ_INVARIANT( this );
57  if(m_appliedSystematics == 0){
58  std::cerr << "SystematicsTool::appliedSystematics WARNING: "
59  << "no systematic configuration has been applied yet. "
60  << "Returning NULL" << std::endl;
61  static const SystematicSet dummy;
62  return dummy;
63  }
64  return *m_appliedSystematics;
65  }

◆ appliedSystematicsString()

std::string CP::SystematicsTool::appliedSystematicsString ( ) const
inherited

returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II rationale: this is meant to be used when printing out the applied systematics for debugging purposes (or when embedding them in a string).

Definition at line 67 of file SystematicsTool.cxx.

67  {
68 
69  RCU_READ_INVARIANT( this );
70  return m_appliedSystematics->name();
71  }

◆ applyCorrection()

CP::CorrectionCode met::METSystematicsTool::applyCorrection ( xAOD::MissingET inputMet,
const xAOD::MissingETAssociationHelper helper 
) const
virtual

Implements IMETSystematicsTool.

Definition at line 236 of file METSystematicsTool.cxx.

237  {
238 
239  //if asking for jet track systematics, the user needs to give a met association helper (with a map) as well
240  //if using a different jetContainer, you can give it as an option to applyCorrection
241  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
242 
243  if( getDefaultEventInfo() == nullptr) {
244  ATH_MSG_WARNING("event info is empty, returning without applying correction");
246  }
247 
249  ATH_MSG_WARNING("This tool should be applied to MC only. Return without changing the input MET object");
251  }
252 
253  if( MissingETBase::Source::isSoftTerm(inputMet.source())){
254 
255  xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(inputMet.container());
256  if(METcont == nullptr){
257  ATH_MSG_WARNING("MissingET object not owned by a container. Returning without applying correction" );
259  }
260 
261  return internalSoftTermApplyCorrection(inputMet, METcont, *getDefaultEventInfo());
262  }
263 
265  ){
266  if( helper.map() == nullptr) {
267  ATH_MSG_WARNING("The MissingETAssociationMap for the given MissingETAssociationHelper is null. Returning without applying correction ");
269  }
270 
271  return getCorrectedJetTrackMET(inputMet, helper);
272  }
273 
274  ATH_MSG_WARNING("METSystematicsTool received a MissingET object it can't correct. You should only pass soft MET terms or jet track MET terms.");
276  }

◆ applySystematicVariation()

StatusCode met::METSystematicsTool::applySystematicVariation ( const CP::SystematicSet systConfig)
inlinevirtual

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

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

Reimplemented from CP::SystematicsTool.

Definition at line 127 of file METSystematicsTool.h.

◆ calcJetTrackMETWithSyst() [1/2]

CP::CorrectionCode met::METSystematicsTool::calcJetTrackMETWithSyst ( xAOD::MissingET jettrkmet,
const xAOD::MissingETAssociationHelper helper 
) const
private

Definition at line 500 of file METSystematicsTool.cxx.

501  {
502  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
503 
504  if( m_jet_systRpt_pt_eta == nullptr ) {
505  ATH_MSG_ERROR("jet track systematics histogram not initialized properly.") ;
507  }
508 
510  return CP::CorrectionCode::Ok;
511 
512  double uncert = 0.;
513  int jetCount=0;
514 
515  std::vector<const xAOD::Jet*> jets;
516  for(const iplink_t& jetlink : acc_constitObjLinks(jettrkmet)) {
517  if((*jetlink)->type()!=xAOD::Type::Jet) {
518  ATH_MSG_ERROR("Invalid object of type " << (*jetlink)->type() << " in jet term");
520  }
521  jets.push_back(static_cast<const xAOD::Jet*>(*jetlink));
522  }
523  bool originalInputs = jets.empty() ? false : !acc_originalObject.isAvailable(*jets.front());
524  for(const xAOD::Jet *jet : jets) {
525  const MissingETAssociation* assoc = nullptr;
526  const MissingETAssociationMap* map = helper.map();
527  if(originalInputs) {
529  } else {
530  const IParticle* orig = *acc_originalObject(*jet);
531  assoc = MissingETComposition::getAssociation(map,static_cast<const xAOD::Jet*>(orig));
532  }
534  if(std::abs(jet->eta())<=2.5){
535  jetCount++;
536  int phbin = std::as_const(m_jet_systRpt_pt_eta)->GetXaxis()->FindBin(jet->pt()/1e3);
537  if(phbin>m_jet_systRpt_pt_eta->GetNbinsX()) phbin = m_jet_systRpt_pt_eta->GetNbinsX();
538 
539  int etabin = std::as_const(m_jet_systRpt_pt_eta)->GetYaxis()->FindBin(std::abs( jet->eta() ));
540  if(etabin>m_jet_systRpt_pt_eta->GetNbinsY()) etabin = m_jet_systRpt_pt_eta->GetNbinsY();
541  float uncert_frac=(trkvec.sumpt())*(m_jet_systRpt_pt_eta->GetBinContent(phbin, etabin));
542 
543  ATH_MSG_VERBOSE("Sumpt: "<< trkvec.sumpt());
544  ATH_MSG_VERBOSE("jet uncert: "<< m_jet_systRpt_pt_eta->GetBinContent(phbin, etabin));
545  uncert = std::sqrt(uncert*uncert+uncert_frac*uncert_frac);
546  }
547  }
548 
549  ATH_MSG_VERBOSE("Uncertainty: "<< uncert);
550  ATH_MSG_VERBOSE("Jet Counting: "<< jetCount);
551 
552  // Flip sign for down variation
553  if(m_appliedSystEnum == MET_JETTRK_SCALEDOWN) uncert *= -1.;
554 
555  jettrkmet.setMpx ( jettrkmet.mpx()*(1 + uncert/(std::abs(jettrkmet.mpx())*std::sqrt(2))));
556  jettrkmet.setMpy ( jettrkmet.mpy()*(1 + uncert/(std::abs(jettrkmet.mpy())*std::sqrt(2))));
557  jettrkmet.setSumet( jettrkmet.sumet() + uncert);
558 
559  return CP::CorrectionCode::Ok;
560  }

◆ calcJetTrackMETWithSyst() [2/2]

CP::CorrectionCode met::METSystematicsTool::calcJetTrackMETWithSyst ( xAOD::MissingET jettrkmet,
const xAOD::MissingETAssociationHelper helper,
const xAOD::Jet jet 
) const
private

Definition at line 457 of file METSystematicsTool.cxx.

459  {
460  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__);
461 
462  if( m_jet_systRpt_pt_eta == nullptr ) {
463  ATH_MSG_ERROR("jet track systematics histogram not initialized properly.") ;
465  }
466 
470 
471  int phbin = std::as_const(m_jet_systRpt_pt_eta)->GetXaxis()->FindBin(jet->pt()/1e3);
472  if(phbin>m_jet_systRpt_pt_eta->GetNbinsX()) phbin = m_jet_systRpt_pt_eta->GetNbinsX();
473 
474  int etabin = std::as_const(m_jet_systRpt_pt_eta)->GetYaxis()->FindBin(std::abs( jet->eta() ));
475  if(etabin>m_jet_systRpt_pt_eta->GetNbinsY()) etabin = m_jet_systRpt_pt_eta->GetNbinsY();
476 
477  double uncert = 0.;
478  switch( m_appliedSystEnum ){
479  case MET_JETTRK_SCALEUP : {
480  uncert = m_jet_systRpt_pt_eta->GetBinContent(phbin,etabin);
481  break;
482  }
483  case MET_JETTRK_SCALEDOWN : {
484  uncert = -1.*m_jet_systRpt_pt_eta->GetBinContent(phbin,etabin);
485  break;
486  }
487  default:
488  break;
489  }
490 
491  ATH_MSG_VERBOSE("Uncertainty on this jet is " << uncert);
492 
493  jettrkmet.setMpx ( jettrkmet.mpx() - trkvec.cpx() * uncert);
494  jettrkmet.setMpy ( jettrkmet.mpy() - trkvec.cpy() * uncert);
495  } else { ATH_MSG_VERBOSE("No jet track systematics applied"); }
496 
497  return CP::CorrectionCode::Ok;
498  }

◆ calcPtHard()

missingEt met::METSystematicsTool::calcPtHard ( xAOD::MissingETContainer const *const  cont) const
private

Definition at line 606 of file METSystematicsTool.cxx.

607  {
608  ATH_MSG_VERBOSE(__PRETTY_FUNCTION__ );
609 
610  //get truth container
612  if (!truthCont.isValid()) {
613 
614  ATH_MSG_ERROR( m_TruthContKey.key() << " container empty or doesn't exist, calcPtHard returning zero.");
615  return {};
616  }
617 
619  if(truthiter == truthCont->end()){
620  ATH_MSG_ERROR( "NonInt is not in " << m_TruthContKey.key() << ". calcPtHard returing zero." );
621  return {};
622  }
623  const xAOD::MissingET& truthmet = **truthiter;
624 
625  missingEt ptHard;
626  ptHard.mpx = truthmet.mpx();
627  ptHard.mpy = truthmet.mpy();
628  ptHard.sumet = truthmet.sumet();
629  ptHard.name = truthmet.name();
630  ptHard.source = truthmet.source();
631 
632  //loop over all non soft or total terms
633  for(xAOD::MissingETContainer::const_iterator iMET=cont->begin();iMET!=cont->end(); ++iMET ) {
634  if( !( MissingETBase::Source::isSoftTerm( (*iMET)->source() ) ||
635  MissingETBase::Source::isTotalTerm( (*iMET)->source() ) ) ) {
636  ptHard.mpx -= (*iMET)->mpx();
637  ptHard.mpy -= (*iMET)->mpy();
638  ptHard.sumet += (*iMET)->sumet();
639  }
640  }
641 
642  if( ptHard.sumet < 0 ) {
643  ATH_MSG_ERROR("PtHard has a negative sumet, returning ptHart = 0");
644  return {};
645  }
646 
647  ptHard.mpx *= 1./(double(m_units)) ;
648  ptHard.mpy *= 1./(double(m_units)) ;
649  ptHard.sumet*= 1./(double(m_units)) ;
650 
651  // protect from zero pthard. protects against an empty pthard for the soft term systematic
652  if(ptHard.sumet<1.0e-6){
653  ptHard.sumet=1.0e-6;
654  ptHard.mpx=1.0e-6;
655  ptHard.mpy=0.0;
656  }
657 
658  return ptHard;
659  }

◆ correctedCopy()

CP::CorrectionCode met::METSystematicsTool::correctedCopy ( const xAOD::MissingET met,
xAOD::MissingET *&  outputmet,
const xAOD::MissingETAssociationHelper helper 
) const
virtual

Implements IMETSystematicsTool.

Definition at line 279 of file METSystematicsTool.cxx.

281  { ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
282  xAOD::MissingET * copy = nullptr;
283 
284  if(outputmet != nullptr ){
285  ATH_MSG_WARNING("Please pass a nullptr to the 2nd argument of correctedCopy to fill the output pointer");
286  ATH_MSG_WARNING("Returning without making a correctedCopy");
288  }
289 
290  if( getDefaultEventInfo() == nullptr) {
291  ATH_MSG_WARNING("event info is empty, return a nullptr");
292  outputmet = nullptr;
294  }
295 
297  ATH_MSG_WARNING("This tool should be applied to MC only. Return without changing the input MET object");
298  outputmet = nullptr;
300  }
301 
302  if( MissingETBase::Source::isSoftTerm(met.source())){
303  xAOD::MissingETContainer const * METcont = dynamic_cast<xAOD::MissingETContainer const*>(met.container());
304  if(METcont == nullptr){
305  ATH_MSG_WARNING("MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" );
306  outputmet = nullptr;
308  }
309  copy = new xAOD::MissingET(met);
310 
312  outputmet = nullptr; delete copy;
314  }
315  }//soft term source
316  if( //MissingETBase::Source::isTrackTerm(met.source()) &&
318  if( helper.map() == nullptr) {
319  ATH_MSG_WARNING("MissingETAssociationHelper contained a null MissingETAssociationMap pointer");
320  outputmet = nullptr; delete copy;
322  }
323  delete copy;
324  copy = new xAOD::MissingET(met);
326  outputmet = nullptr; delete copy;
328  }
329  }//jet track term source
330 
331  outputmet = copy;
332  return CP::CorrectionCode::Ok;
333  }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

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

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

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extractHistoPath()

StatusCode met::METSystematicsTool::extractHistoPath ( std::string &  histfile,
std::string &  systpath,
std::string &  configdir,
std::string &  suffix,
SystType const type 
)
private

Definition at line 661 of file METSystematicsTool.cxx.

666  {
667  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__);
668  TEnv reader;
669 
670  std::string configpath = "";
671  std::string configfile = "";
672  if(m_useDevArea) { configpath += "dev/"; }
673 
674  switch(type){
675  case SOFTCALO : configfile += m_configSoftCaloFile.value();
676  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configSoftCaloFile.value());
677  break;
678  case SOFTTRK : configfile += m_configSoftTrkFile.value();
679  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configSoftTrkFile.value());
680  break;
681  case JETTRK : configfile += m_configJetTrkFile.value();
682  configpath = PathResolverFindCalibFile(m_configPrefix.value()+m_configJetTrkFile.value());
683  break;
684  default : configpath = "";
685  }
686 
687  ATH_MSG_INFO( "Searching for configFile: " << configfile);
688  ATH_MSG_DEBUG( "PWD: " << gSystem->Getenv("PWD") ) ;
689  ATH_MSG_DEBUG( "CALIBPATH: " << gSystem->Getenv("CALIBPATH") );
690 
691  if(configpath.empty() || configfile.empty() ){
692  ATH_MSG_ERROR( "Path Resolver couldn't find config file");
693  return StatusCode::FAILURE;
694  }
695 
696  if( reader.ReadFile(configpath.c_str(),EEnvLevel(0)) < 0) {
697  ATH_MSG_ERROR( "Couldn't read the track config file!" );
698  return StatusCode::FAILURE;
699  }
700 
701  ATH_MSG_INFO( "Configuring from file : " << configpath );
702 
703 
704  switch(type){
705  case SOFTCALO:
706  histfile = reader.GetValue( "Conf.InputFile" , "");
707  systpath = reader.GetValue( "GlobalSyst.sourcedir" , "" );
708  break;
709  case SOFTTRK:
710  histfile = reader.GetValue( "Conf.InputFile" , "");
711  systpath = reader.GetValue( "PtHardSyst.sourcedir" , "" );
712  suffix = reader.GetValue( "PtHardSyst.suffix" , "" );
713  break;
714  case JETTRK:
715  histfile = reader.GetValue( "JetTrkSyst.InputFile" , "");
717  systpath = "/";
718  break;
719  default:
720  break;
721  }
722  if(m_useDevArea) histfile = "dev/"+histfile;
723 
724  std::string const units_string = reader.GetValue( "Units", "" );
725 
726  //check if we already set the units in another config file
727  if(m_units == 1000){
728  if(units_string != "GeV"){
729  ATH_MSG_ERROR("initialized the different systematics using two config files that conflict on units");
730  return StatusCode::FAILURE;
731  }
732  }
733  if(m_units == 1){
734  if( (!units_string.empty()) && (units_string != "MeV")){
735  ATH_MSG_ERROR("initialized the different systematics using two config files that conflict on units");
736  return StatusCode::FAILURE;
737  }
738  }
739 
740  //set the units again
741  if( (units_string.empty()) || (units_string == "MeV") ){
742  m_units = 1;
743  }else if(units_string == "GeV"){
744  m_units = 1000;
745  }else{
746  ATH_MSG_ERROR("You specified an incorrect 'Units' value. Please specify MeV , GeV , or leave it blank for MeV");
747  return StatusCode::FAILURE;
748  }
749 
750  ATH_MSG_INFO( "Will read histograms from : " << histfile );
751  ATH_MSG_DEBUG( "Systpath :" << systpath ) ;
753  ATH_MSG_INFO("Extracted histogram path : " << histpath);
754 
755  if(histfile.empty() || systpath.empty() || histpath.empty() ){
756  ATH_MSG_ERROR("Failed to correctly set histfile path, or path to histograms inside of the histfile" );
757  return StatusCode::FAILURE;
758  }
759 
760 
761  if( (m_units != 1) && (m_units != 1000) && (m_units != -1)){
762  ATH_MSG_ERROR("Something is wrong with your units initialization. Please contact the developers (you should never get here).");
763  return StatusCode::FAILURE;
764  }
765 
766  return StatusCode::SUCCESS;
767  }

◆ 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

◆ FRIEND_TEST() [1/5]

met::METSystematicsTool::FRIEND_TEST ( METSystTest  ,
TestAddAffectingSystematic   
)
private

◆ FRIEND_TEST() [2/5]

met::METSystematicsTool::FRIEND_TEST ( METSystTest  ,
TestDefaultHistosFilled   
)
private

◆ FRIEND_TEST() [3/5]

met::METSystematicsTool::FRIEND_TEST ( METSystTest  ,
TestJetTrkHistosFilled   
)
private

◆ FRIEND_TEST() [4/5]

met::METSystematicsTool::FRIEND_TEST ( METSystTest  ,
TestProjectST   
)
private

◆ FRIEND_TEST() [5/5]

met::METSystematicsTool::FRIEND_TEST ( METSystTest  ,
TestProjectST2   
)
private

◆ getCorrectedJetTrackMET()

CP::CorrectionCode met::METSystematicsTool::getCorrectedJetTrackMET ( xAOD::MissingET jettrkmet,
const xAOD::MissingETAssociationHelper helper 
) const
private

Definition at line 562 of file METSystematicsTool.cxx.

564  {
565 
566  const MissingETAssociationMap* map = helper.map();
567  if(!map) {
568  ATH_MSG_ERROR("MissingETAssociationMap null, error calculating jet track systematics.");
570  }
571 
573  ATH_MSG_ERROR("Failed to calculate jet track systematics.");
575  }
576  return CP::CorrectionCode::Ok;
577  }

◆ getDefaultEventInfo()

xAOD::EventInfo const * met::METSystematicsTool::getDefaultEventInfo ( ) const
private

Definition at line 771 of file METSystematicsTool.cxx.

772  {
773 
775  if (!eInfoConst.isValid()) {
776 
777  ATH_MSG_ERROR("Failed to retrieve default EventInfo object");
778  }
779  return &*eInfoConst;
780  }

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

◆ getNPV()

int met::METSystematicsTool::getNPV ( ) const
private

Definition at line 782 of file METSystematicsTool.cxx.

782  {
784 
785  if (!vertices.isValid()) {
786 
787  ATH_MSG_ERROR("Failed to retrieve default NPV value from PrimaryVertices");
788  return 0;
789  }
790 
791  int NPV = 0;
793  for (itr = vertices->begin(); itr != vertices->end(); ++itr)
794  if ( (*itr)->vertexType() != xAOD::VxType::NoVtx) NPV++;
795 
796  return NPV;
797  }

◆ getProperty()

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

Get one of the tool's properties.

◆ getTLSRandomGen()

TRandom3 * met::METSystematicsTool::getTLSRandomGen ( ) const
private

Definition at line 799 of file METSystematicsTool.cxx.

799  {
800  TRandom3* random = m_rand_tls.get();
801  if (!random) {
802  random = new TRandom3();
803  m_rand_tls.reset(random);
804  }
805  return random;
806  }

◆ initialize()

StatusCode met::METSystematicsTool::initialize ( )
virtual

Dummy implementation of the initialisation function.

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

Reimplemented from asg::AsgTool.

Definition at line 83 of file METSystematicsTool.cxx.

84  {
85  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
86  // ReadHandleKey(s)
87 
88  ATH_CHECK( m_VertexContKey.initialize() );
89  ATH_CHECK( m_TruthContKey.initialize() );
91 
92  const char lastchar = m_configPrefix.value().back();
93  if (lastchar != '/') {
94  m_configPrefix = m_configPrefix.value() + "/";
95  }
96 
97  if(m_configSoftTrkFile.empty() &&
98  m_configSoftCaloFile.empty() &&
99  m_configJetTrkFile.empty() ) ATH_MSG_WARNING("you have initialized the METSystematicsTool with no configuration file. The tool will do nothing. Please set the configuration file properties.");
100 
104 
106  }

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

◆ internalSoftTermApplyCorrection()

CP::CorrectionCode met::METSystematicsTool::internalSoftTermApplyCorrection ( xAOD::MissingET softMet,
xAOD::MissingETContainer const METcont,
xAOD::EventInfo const eInfo 
) const
private

Definition at line 335 of file METSystematicsTool.cxx.

338  { //this is equivalent of "getSoftTerms"
339 
340  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ );
341 
342 
343  if( ! MissingETBase::Source::isSoftTerm(softMet.source()) ){
344  ATH_MSG_ERROR("not soft met, cannot apply soft term correction to this MET");
346  }
347 
348  bool doSyst = false;
349  if( MissingETBase::Source::isTrackTerm(softMet.source()) ) {
351  ATH_MSG_VERBOSE("Track soft term " << softMet.name()
352  << ", met = " << softMet.met()
353  << ", applied systematic is " << m_appliedSystEnum
354  << ", do syst? " << doSyst);
355  } else {
357  ATH_MSG_VERBOSE("Calo soft term " << softMet.name()
358  << ", met = " << softMet.met()
359  << ", applied systematic is " << m_appliedSystEnum
360  << ", do syst? " << doSyst);
361  }
362 
363  if(!doSyst) {
364  ATH_MSG_DEBUG("Ignore irrelevant systematic.");
365  return CP::CorrectionCode::Ok;
366  }
367 
368  //this is for speed
369  //we avoid creating met private stores here
370  missingEt softMetStruct;
371  softMetStruct.mpx = softMet.mpx();
372  softMetStruct.mpy = softMet.mpy();
373  softMetStruct.sumet = softMet.sumet();
374  softMetStruct.name = softMet.name();
375  softMetStruct.source = softMet.source();
376 
377  if(METcont == nullptr){
378  ATH_MSG_WARNING("failed to retrieve MET container from passed object");
380  }
381 
382  missingEt const ptHard = calcPtHard(METcont);
383  double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
384  ptHard.mpy * ptHard.mpy ) ;
385 
386  const xAOD::MissingET* jetterm = *METcont->find( MissingETBase::Source::jet() );
387  size_t njet = (jetterm==nullptr) ? 0 : acc_constitObjLinks(*jetterm ).size();
388 
389  const std::unique_ptr<TH3D>* shiftHist = (MissingETBase::Source::isTrackTerm(softMetStruct.source) ? &m_trk_shiftpara_pthard_njet_mu : &m_calo_shiftpara_pthard_njet_mu);
390 
391  int phbin = std::as_const(*shiftHist)->GetXaxis()->FindBin( ptHardMet ) ;
392  if(phbin>(*shiftHist)->GetNbinsX()) phbin = (*shiftHist)->GetNbinsX();
393 
394  int const jetbin = std::as_const(*shiftHist)->GetYaxis()->FindBin(njet);
395  int const mubin = std::as_const(*shiftHist)->GetZaxis()->FindBin(eInfo.actualInteractionsPerCrossing() );
396  double const scalePara = (*shiftHist)->GetBinContent(phbin,jetbin,mubin);
397 
398  double const randGaus = getTLSRandomGen()->Gaus(0.,1.);
399  double smearPara(0), smearPerp(0);
400 
401  ATH_MSG_DEBUG("About to apply systematic " << appliedSystematicsString() );
402 
403  //now we need to know what soft term systematics we are doing
404  //m_appliedSystEnum was cached by the applySystematicVariation method
405  switch( m_appliedSystEnum ){
406  case MET_SOFTTRK_SCALEUP:
408  softMetStruct = variedSoftTerm(softMetStruct, ptHard, scalePara, 0.);
409  break;
412  softMetStruct = variedSoftTerm(softMetStruct, ptHard, -1.*scalePara, 0.);
413  break;
415  smearPara = m_trk_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
416  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, 0.);
417  break;
419  smearPerp = m_trk_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
420  softMetStruct = variedSoftTerm(softMetStruct, ptHard, 0., smearPerp);
421  break;
423  smearPara = m_trk_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
424  smearPerp = m_trk_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
425  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, smearPerp);
426  break;
428  smearPara = m_calo_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
429  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, 0.);
430  break;
432  smearPerp = m_calo_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
433  softMetStruct = variedSoftTerm(softMetStruct, ptHard, 0., smearPerp);
434  break;
436  smearPara = m_calo_resopara_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
437  smearPerp = m_calo_resoperp_pthard_njet_mu->GetBinContent(phbin,jetbin,mubin)*randGaus;
438  softMetStruct = variedSoftTerm(softMetStruct, ptHard, smearPara, smearPerp);
439  break;
440  default:
441  ATH_MSG_DEBUG("No systematic applied, returning nominal MET term");
442  }
443 
444  //fill the softMet back with the struct values to return
445  softMet.setMpx( softMetStruct.mpx);
446  softMet.setMpy( softMetStruct.mpy);
447  softMet.setSumet( softMetStruct.sumet);
448  softMet.setName( softMetStruct.name);
449  softMet.setSource( softMetStruct.source);
450 
451  ATH_MSG_VERBOSE("Output soft term " << softMet.name()
452  << ", met = " << softMet.met() );
453 
454  return CP::CorrectionCode::Ok;
455  }

◆ isAffectedBySystematic()

bool met::METSystematicsTool::isAffectedBySystematic ( const CP::SystematicVariation systematic) const
inlinevirtual

returns: whether this tool is affected by the given systematic guarantee: no-fail

Reimplemented from CP::SystematicsTool.

Definition at line 124 of file METSystematicsTool.h.

◆ jetTrkSystInitialize()

StatusCode met::METSystematicsTool::jetTrkSystInitialize ( )

Definition at line 141 of file METSystematicsTool.cxx.

142  {
143  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__);
144 
145  std::string histfile = "";
146  std::string gsystpath = "";
147  std::string configdir = "";
148  std::string blank = "";
149 
150  ATH_CHECK( extractHistoPath(histfile,gsystpath, configdir,blank , JETTRK) );//properly sets the paths
151 
152  TFile infile((configdir).c_str());
153 
154  m_jet_systRpt_pt_eta.reset(dynamic_cast<TH2D*>( infile.Get("jet_systRpt_pt_eta")));
155 
156  if( !m_jet_systRpt_pt_eta) {
157  ATH_MSG_ERROR("Could not get jet track histo from the config file:" << histfile);
158  return StatusCode::FAILURE;
159  }
160 
161  m_jet_systRpt_pt_eta->SetDirectory(nullptr);
162 
163  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ << " DONE!!");
164  return StatusCode::SUCCESS;
165  }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msg_level_name()

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

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

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

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

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

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

Definition at line 101 of file AsgTool.cxx.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ print() [1/2]

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

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ projectST()

missingEt met::METSystematicsTool::projectST ( missingEt const softTerms,
missingEt const ptHard 
) const
private

Definition at line 591 of file METSystematicsTool.cxx.

592  {
593  double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
594  ptHard.mpy * ptHard.mpy );
595 
596  double const ux = ptHard.mpx/ptHardMet;
597  double const uy = ptHard.mpy/ptHardMet;
598  double const projL = ux*softTerms.mpx + uy*softTerms.mpy;
599  double const projT = uy*softTerms.mpx - ux*softTerms.mpy;
600  missingEt proj(projL,projT,softTerms.sumet,
601  softTerms.name,softTerms.source);
602 
603  return proj;
604  }

◆ recommendedSystematics()

CP::SystematicSet met::METSystematicsTool::recommendedSystematics ( ) const
inlinevirtual

returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II

Reimplemented from CP::SystematicsTool.

Definition at line 126 of file METSystematicsTool.h.

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

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

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setRandomSeed()

void met::METSystematicsTool::setRandomSeed ( unsigned long  seed) const
virtual

Implements IMETSystematicsTool.

Definition at line 808 of file METSystematicsTool.cxx.

808  {
809  getTLSRandomGen()->SetSeed(seed);
810  }

◆ softCaloSystInitialize()

StatusCode met::METSystematicsTool::softCaloSystInitialize ( )

Definition at line 108 of file METSystematicsTool.cxx.

109  {
110  ATH_MSG_INFO("Doing SoftCalo systematics initialization. THIS IS FOR SOFTWARE DEVELOPMENT ONLY.");
111  ATH_MSG_INFO("CST IS NOT YET RECOMMENDED OR SUPPORTED BY THE MET GROUP.");
112 
113  std::string histfile = "";
114  std::string systpath = "";
115  std::string histpath = "";
116  std::string suffix = "";
117 
118  ATH_CHECK( extractHistoPath(histfile,systpath,histpath,suffix,SOFTCALO) );//properly sets the paths
119 
120  TFile infile(histpath.c_str());
121  m_calo_resoperp_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((systpath+"/resoperp_"+suffix).c_str()) ));
122  m_calo_resopara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((systpath+"/resopara_"+suffix).c_str()) ));
123  m_calo_shiftpara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((systpath+"/shiftpara_"+suffix).c_str())));
124 
128  ATH_MSG_ERROR("Could not get all calo histos from the config file:" << histfile );
129  return StatusCode::FAILURE;
130  }
131 
132  m_calo_resoperp_pthard_njet_mu ->SetDirectory(nullptr);
133  m_calo_resopara_pthard_njet_mu ->SetDirectory(nullptr);
134  m_calo_shiftpara_pthard_njet_mu->SetDirectory(nullptr);
135 
136  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ << " DONE!!" );
137  return StatusCode::SUCCESS;
138  }

◆ softTrkSystInitialize()

StatusCode met::METSystematicsTool::softTrkSystInitialize ( )

Definition at line 168 of file METSystematicsTool.cxx.

169  {
170 
171  std::string histfile = "";
172  std::string psystpath = "";
173  std::string histpath = "";
174  std::string suffix = "";
175 
176  ATH_CHECK( extractHistoPath(histfile,psystpath,histpath, suffix, SOFTTRK) );//properly sets the paths
177 
178  TFile infile(histpath.c_str());
179 
180  m_trk_resoperp_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/resoperp_"+suffix).c_str()) ));
181  m_trk_resopara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/resopara_"+suffix).c_str()) ));
182  m_trk_shiftpara_pthard_njet_mu.reset(dynamic_cast<TH3D*>( infile.Get((psystpath+"/shiftpara_"+suffix).c_str())));
183 
187  ATH_MSG_ERROR("Could not get all track histos from the config file:" << histfile );
188  return StatusCode::FAILURE;
189  }
190 
191  m_trk_resoperp_pthard_njet_mu ->SetDirectory(nullptr);
192  m_trk_resopara_pthard_njet_mu ->SetDirectory(nullptr);
193  m_trk_shiftpara_pthard_njet_mu->SetDirectory(nullptr);
194 
195  ATH_MSG_VERBOSE( __PRETTY_FUNCTION__ <<" DONE!!");
196  return StatusCode::SUCCESS;
197  }

◆ sysApplySystematicVariation()

StatusCode met::METSystematicsTool::sysApplySystematicVariation ( const CP::SystematicSet systConfig)
virtual

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

systConfig is guaranteed to contain only supported systematics. guarantee: basic failures: out of memory II failures: unsupported combination of supported systematics failures: other tool specific errors

Implements CP::SystematicsTool.

Definition at line 199 of file METSystematicsTool.cxx.

199  {//this should already be filtered for MET systematics
200  ATH_MSG_VERBOSE (__PRETTY_FUNCTION__ );
201  // Only a single systematic can be applied at a time:
202  // If at some point we can deal with multiple systematics, we will check here that the combination we are given will work
203 
205  if( systSet.empty() ) {
206  ATH_MSG_DEBUG("No affecting systematics received.");
207  return StatusCode::SUCCESS;
208  } else if( systSet.size() > 1 ) {
209  ATH_MSG_WARNING("Tool does not support multiple systematics, returning unsupported" );
210  return StatusCode::FAILURE;
211  }
212  CP::SystematicVariation systVar = *systSet.begin();
213  if ( systVar == CP::SystematicVariation("") ) m_appliedSystEnum = NONE ;
214  else if( systVar == softTrkAffSyst::MET_SoftTrk_ScaleUp) m_appliedSystEnum = MET_SOFTTRK_SCALEUP ;
215  else if( systVar == softTrkAffSyst::MET_SoftTrk_ScaleDown) m_appliedSystEnum = MET_SOFTTRK_SCALEDOWN ;
216  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoPara) m_appliedSystEnum = MET_SOFTTRK_RESOPARA ;
217  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoPerp) m_appliedSystEnum = MET_SOFTTRK_RESOPERP ;
218  else if( systVar == softTrkAffSyst::MET_SoftTrk_ResoCorr) m_appliedSystEnum = MET_SOFTTRK_RESOCORR ;
219  else if( systVar == softCaloAffSyst::MET_SoftCalo_ScaleUp) m_appliedSystEnum = MET_SOFTCALO_SCALEUP ;
220  else if( systVar == softCaloAffSyst::MET_SoftCalo_ScaleDown) m_appliedSystEnum = MET_SOFTCALO_SCALEDOWN;
221  else if( systVar == softCaloAffSyst::MET_SoftCalo_ResoPara) m_appliedSystEnum = MET_SOFTCALO_RESOPARA ;
222  else if( systVar == softCaloAffSyst::MET_SoftCalo_ResoPerp) m_appliedSystEnum = MET_SOFTCALO_RESOPERP ;
223  else if( systVar == softCaloAffSyst::MET_SoftCalo_ResoCorr) m_appliedSystEnum = MET_SOFTCALO_RESOCORR ;
224  else if( systVar == jetTrkAffSyst::MET_JetTrk_ScaleUp) m_appliedSystEnum = MET_JETTRK_SCALEUP ;
225  else if( systVar == jetTrkAffSyst::MET_JetTrk_ScaleDown) m_appliedSystEnum = MET_JETTRK_SCALEDOWN ;
226  else{
227  ATH_MSG_WARNING("unsupported systematic applied " );
228  return StatusCode::FAILURE;
229  }
230 
231  ATH_MSG_DEBUG("applied systematic is " << m_appliedSystEnum );
232 
233  return StatusCode::SUCCESS;
234  }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

◆ sysStart()

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

Handle START transition.

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

◆ testInvariant()

void CP::SystematicsTool::testInvariant ( ) const
inherited

effects: test the invariance of this object guarantee: no-fail

Definition at line 165 of file SystematicsTool.cxx.

165  {
166 
167  //RCU_INVARIANT( this != 0 );
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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ variedSoftTerm()

missingEt met::METSystematicsTool::variedSoftTerm ( missingEt const softTerms,
missingEt const ptHard,
double  varPara,
double  varPerp 
) const
private

Definition at line 579 of file METSystematicsTool.cxx.

582  {
583 
584  missingEt projection = projectST(softTerms,ptHard);
585  projection.mpx += varPara;
586  projection.mpy += varPerp;
587 
588  return projectST(projection, ptHard);
589  }

Member Data Documentation

◆ m_affectingSystematics

SystematicSet CP::SystematicsTool::m_affectingSystematics
protectedinherited

description: members directly corresponding to accessors

Definition at line 146 of file SystematicsTool.h.

◆ m_appliedSystematics

SystematicSet* CP::SystematicsTool::m_appliedSystematics
privateinherited

description: pointer to currenty applied systematics

Definition at line 151 of file SystematicsTool.h.

◆ m_appliedSystEnum

SystApplied met::METSystematicsTool::m_appliedSystEnum {NONE}
private

Definition at line 138 of file METSystematicsTool.h.

◆ m_calo_resopara_pthard_njet_mu

std::unique_ptr<TH3D> met::METSystematicsTool::m_calo_resopara_pthard_njet_mu {}
private

Definition at line 161 of file METSystematicsTool.h.

◆ m_calo_resoperp_pthard_njet_mu

std::unique_ptr<TH3D> met::METSystematicsTool::m_calo_resoperp_pthard_njet_mu {}
private

Definition at line 162 of file METSystematicsTool.h.

◆ m_calo_shiftpara_pthard_njet_mu

std::unique_ptr<TH3D> met::METSystematicsTool::m_calo_shiftpara_pthard_njet_mu {}
private

Definition at line 160 of file METSystematicsTool.h.

◆ m_configJetTrkFile

Gaudi::Property<std::string> met::METSystematicsTool::m_configJetTrkFile {this, "ConfigJetTrkFile", "", ""}
private

Definition at line 153 of file METSystematicsTool.h.

◆ m_configPrefix

Gaudi::Property<std::string> met::METSystematicsTool::m_configPrefix {this, "ConfigPrefix", "METUtilities/R22_PreRecs", ""}
private

Definition at line 151 of file METSystematicsTool.h.

◆ m_configSoftCaloFile

Gaudi::Property<std::string> met::METSystematicsTool::m_configSoftCaloFile {this, "ConfigSoftCaloFile", "", ""}
private

Definition at line 154 of file METSystematicsTool.h.

◆ m_configSoftTrkFile

Gaudi::Property<std::string> met::METSystematicsTool::m_configSoftTrkFile {this, "ConfigSoftTrkFile", "TrackSoftTerms-pflow_Dec24.config", ""}
private

Definition at line 152 of file METSystematicsTool.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_EventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> met::METSystematicsTool::m_EventInfoKey {this, "EventInfo", "EventInfo", ""}
private

Definition at line 177 of file METSystematicsTool.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_jet_systRpt_pt_eta

std::unique_ptr<TH2D> met::METSystematicsTool::m_jet_systRpt_pt_eta {}
private

Definition at line 163 of file METSystematicsTool.h.

◆ m_rand_tls

boost::thread_specific_ptr<TRandom3> met::METSystematicsTool::m_rand_tls
mutableprivate

Definition at line 165 of file METSystematicsTool.h.

◆ m_recommendedSystematics

SystematicSet CP::SystematicsTool::m_recommendedSystematics
protectedinherited

Definition at line 147 of file SystematicsTool.h.

◆ m_systFilterMap

std::unordered_map<SystematicSet, SystematicSet> CP::SystematicsTool::m_systFilterMap
privateinherited

map of cached systematics filtering

Definition at line 154 of file SystematicsTool.h.

◆ m_trk_resopara_pthard_njet_mu

std::unique_ptr<TH3D> met::METSystematicsTool::m_trk_resopara_pthard_njet_mu {}
private

Definition at line 158 of file METSystematicsTool.h.

◆ m_trk_resoperp_pthard_njet_mu

std::unique_ptr<TH3D> met::METSystematicsTool::m_trk_resoperp_pthard_njet_mu {}
private

Definition at line 159 of file METSystematicsTool.h.

◆ m_trk_shiftpara_pthard_njet_mu

std::unique_ptr<TH3D> met::METSystematicsTool::m_trk_shiftpara_pthard_njet_mu {}
private

Definition at line 157 of file METSystematicsTool.h.

◆ m_TruthContKey

SG::ReadHandleKey<xAOD::MissingETContainer> met::METSystematicsTool::m_TruthContKey {this, "TruthContainer", "MET_Truth", ""}
private

Definition at line 176 of file METSystematicsTool.h.

◆ m_units

int met::METSystematicsTool::m_units {-1}
private

Definition at line 168 of file METSystematicsTool.h.

◆ m_useDevArea

Gaudi::Property<bool> met::METSystematicsTool::m_useDevArea {this, "UseDevArea", false, ""}
private

Definition at line 155 of file METSystematicsTool.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_VertexContKey

SG::ReadHandleKey<xAOD::VertexContainer> met::METSystematicsTool::m_VertexContKey {this, "VertexContainer", "PrimaryVertices", ""}
private

Definition at line 175 of file METSystematicsTool.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
met::METSystematicsTool::internalSoftTermApplyCorrection
CP::CorrectionCode internalSoftTermApplyCorrection(xAOD::MissingET &softMet, xAOD::MissingETContainer const *METcont, xAOD::EventInfo const &eInfo) const
Definition: METSystematicsTool.cxx:335
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
met::METSystematicsTool::m_configJetTrkFile
Gaudi::Property< std::string > m_configJetTrkFile
Definition: METSystematicsTool.h:153
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:185
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:407
checkCorrelInHIST.histpath
histpath
Definition: checkCorrelInHIST.py:400
run.infile
string infile
Definition: run.py:13
xAOD::MissingET_v1::setSumet
void setSumet(float value)
Set .
met::MET_SOFTCALO_RESOPERP
@ MET_SOFTCALO_RESOPERP
Definition: METSystematicsTool.h:78
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
met::METSystematicsTool::jetTrkSystInitialize
StatusCode jetTrkSystInitialize()
Definition: METSystematicsTool.cxx:141
CP::SystematicsTool::m_appliedSystematics
SystematicSet * m_appliedSystematics
description: pointer to currenty applied systematics
Definition: SystematicsTool.h:151
xAOD::MissingETAssociation_v1
MET association descriptor contains object links and corresponding parameters.
Definition: MissingETAssociation_v1.h:25
met::METSystematicsTool::m_calo_resopara_pthard_njet_mu
std::unique_ptr< TH3D > m_calo_resopara_pthard_njet_mu
Definition: METSystematicsTool.h:161
met::METSystematicsTool::applySystematicVariation
StatusCode applySystematicVariation(const CP::SystematicSet &set)
effects: configure this tool for the given list of systematic variations.
Definition: METSystematicsTool.h:127
xAOD::MissingET_v1::sumet
float sumet() const
Returns.
met::MET_SOFTCALO_RESOPARA
@ MET_SOFTCALO_RESOPARA
Definition: METSystematicsTool.h:77
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
met::METSystematicsTool::softTrkSystInitialize
StatusCode softTrkSystInitialize()
Definition: METSystematicsTool.cxx:168
xAOD::MissingET_v1::setMpy
void setMpy(float value)
Set the component.
met::METSystematicsTool::getTLSRandomGen
TRandom3 * getTLSRandomGen() const
Definition: METSystematicsTool.cxx:799
CheckAppliedSFs.systematics
systematics
Definition: CheckAppliedSFs.py:231
MissingETBase::Source::isTotalTerm
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:405
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
CP::SystematicsTool::affectingSystematics
virtual SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of ...
Definition: SystematicsTool.cxx:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::MissingET
MissingET_v1 MissingET
Version control by type defintion.
Definition: Event/xAOD/xAODMissingET/xAODMissingET/MissingET.h:15
CP::SystematicSet::name
std::string name() const
returns: the systematics joined into a single string.
Definition: SystematicSet.cxx:277
met::METSystematicsTool::m_configPrefix
Gaudi::Property< std::string > m_configPrefix
Definition: METSystematicsTool.h:151
met::MET_JETTRK_SCALEDOWN
@ MET_JETTRK_SCALEDOWN
Definition: METSystematicsTool.h:81
CP::SystematicsTool::m_affectingSystematics
SystematicSet m_affectingSystematics
description: members directly corresponding to accessors
Definition: SystematicsTool.h:146
met::METSystematicsTool::m_trk_resopara_pthard_njet_mu
std::unique_ptr< TH3D > m_trk_resopara_pthard_njet_mu
Definition: METSystematicsTool.h:158
met::JETTRK
@ JETTRK
Definition: IMETSystematicsTool.h:52
CP::SystematicsTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
Definition: SystematicsTool.cxx:74
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
CP::SystematicVariation
Definition: SystematicVariation.h:47
met::METSystematicsTool::m_trk_shiftpara_pthard_njet_mu
std::unique_ptr< TH3D > m_trk_shiftpara_pthard_njet_mu
Definition: METSystematicsTool.h:157
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MissingETBase::Source::isTrackTerm
static bool isTrackTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:404
xAOD::EventInfo_v1::IS_SIMULATION
@ IS_SIMULATION
true: simulation, false: data
Definition: EventInfo_v1.h:151
xAOD::MissingET_v1::setSource
void setSource(MissingETBase::Types::bitmask_t src)
Set the source of the MET object.
met::METSystematicsTool::variedSoftTerm
missingEt variedSoftTerm(missingEt const &softTerms, missingEt const &ptHard, double varPara, double varPerp) const
Definition: METSystematicsTool.cxx:579
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:571
MissingETBase::Source::isJetTerm
static bool isJetTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:402
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
xAOD::MissingETAssociation_v1::ConstVec
Vector sum of constituents for subtractive overlap removal.
Definition: MissingETAssociation_v1.h:32
xAOD::MissingETAssociationMap_v1
Definition: MissingETAssociationMap_v1.h:29
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:115
met::METSystematicsTool::m_configSoftCaloFile
Gaudi::Property< std::string > m_configSoftCaloFile
Definition: METSystematicsTool.h:154
met::NONE
@ NONE
Definition: METSystematicsTool.h:69
met::METSystematicsTool::m_appliedSystEnum
SystApplied m_appliedSystEnum
Definition: METSystematicsTool.h:138
met::METSystematicsTool::addMETAffectingSystematics
StatusCode addMETAffectingSystematics()
Definition: METSystematicsTool.cxx:39
xAOD::MissingET_v1::setName
void setName(const std::string &name)
Set the name of the MET object.
met::MET_SOFTCALO_SCALEUP
@ MET_SOFTCALO_SCALEUP
Definition: METSystematicsTool.h:75
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
met::MET_SOFTTRK_RESOPARA
@ MET_SOFTTRK_RESOPARA
Definition: METSystematicsTool.h:72
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition: AsgTool.cxx:58
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
met::METSystematicsTool::m_rand_tls
boost::thread_specific_ptr< TRandom3 > m_rand_tls
Definition: METSystematicsTool.h:165
met
Definition: IMETSignificance.h:24
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
CP::SystematicsTool::recommendedSystematics
virtual SystematicSet recommendedSystematics() const
returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of ...
Definition: SystematicsTool.cxx:47
CP::SystematicsTool::isAffectedBySystematic
virtual bool isAffectedBySystematic(const SystematicVariation &systematic) const
returns: whether this tool is affected by the given systematic guarantee: no-fail
Definition: SystematicsTool.cxx:32
met::MET_SOFTTRK_RESOCORR
@ MET_SOFTTRK_RESOCORR
Definition: METSystematicsTool.h:74
met::METSystematicsTool::m_calo_shiftpara_pthard_njet_mu
std::unique_ptr< TH3D > m_calo_shiftpara_pthard_njet_mu
Definition: METSystematicsTool.h:160
met::METSystematicsTool::calcPtHard
missingEt calcPtHard(xAOD::MissingETContainer const *const cont) const
Definition: METSystematicsTool.cxx:606
MissingETBase::Source::jet
static Types::bitmask_t jet(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed jets.
Definition: MissingETBase.h:257
CP::SystematicsTool::addRecommendedSystematic
StatusCode addRecommendedSystematic(const SystematicVariation &systematic)
effects: add a systematic to the list of recommended systematics failures: unsupported systematic
Definition: SystematicsTool.cxx:128
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
xAOD::MissingETAssociation_v1::ConstVec::cpy
float cpy() const
Returns .
xAOD::MissingETAssociation_v1::ConstVec::sumpt
float sumpt() const
Returns sum of component pt.
met::METSystematicsTool::m_units
int m_units
Definition: METSystematicsTool.h:168
CalibDbCompareRT.dummy
dummy
Definition: CalibDbCompareRT.py:59
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
xAOD::MissingET_v1::mpx
float mpx() const
Returns .
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
met::METSystematicsTool::getDefaultEventInfo
xAOD::EventInfo const * getDefaultEventInfo() const
Definition: METSystematicsTool.cxx:771
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
CP::SystematicsTool::appliedSystematicsString
std::string appliedSystematicsString() const
returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II...
Definition: SystematicsTool.cxx:67
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
met::METSystematicsTool::m_useDevArea
Gaudi::Property< bool > m_useDevArea
Definition: METSystematicsTool.h:155
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
met::METSystematicsTool::m_trk_resoperp_pthard_njet_mu
std::unique_ptr< TH3D > m_trk_resoperp_pthard_njet_mu
Definition: METSystematicsTool.h:159
met::METSystematicsTool::calcJetTrackMETWithSyst
CP::CorrectionCode calcJetTrackMETWithSyst(xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:500
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
xAOD::MissingET_v1::name
const std::string & name() const
Identifier getters.
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
xAOD::MissingET_v1::setMpx
void setMpx(float value)
Set the component.
xAOD::MissingETAssociation_v1::jetTrkVec
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
Definition: MissingETAssociation_v1.cxx:568
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
met::SOFTTRK
@ SOFTTRK
Definition: IMETSystematicsTool.h:51
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
met::MET_SOFTCALO_SCALEDOWN
@ MET_SOFTCALO_SCALEDOWN
Definition: METSystematicsTool.h:76
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:87
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
met::MET_SOFTCALO_RESOCORR
@ MET_SOFTCALO_RESOCORR
Definition: METSystematicsTool.h:79
xAOD::MissingET_v1::source
MissingETBase::Types::bitmask_t source() const
MET object source tag.
xAOD::MissingETComposition::getAssociation
static const MissingETAssociation * getAssociation(const MissingETAssociationMap *pMap, const Jet *pJet)
Definition: Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx:415
met::SOFTCALO
@ SOFTCALO
Definition: IMETSystematicsTool.h:50
xAOD::MissingETAssociation_v1::overlapTrkVec
ConstVec overlapTrkVec(const MissingETAssociationHelper &helper) const
Retrieve total track-based vector to be subtracted from the jet.
Definition: MissingETAssociation_v1.cxx:780
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:321
met::MET_SOFTTRK_RESOPERP
@ MET_SOFTTRK_RESOPERP
Definition: METSystematicsTool.h:73
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
met::METSystematicsTool::m_jet_systRpt_pt_eta
std::unique_ptr< TH2D > m_jet_systRpt_pt_eta
Definition: METSystematicsTool.h:163
met::METSystematicsTool::projectST
missingEt projectST(missingEt const &softTerms, missingEt const &ptHard) const
Definition: METSystematicsTool.cxx:591
python.CaloAddPedShiftConfig.default
default
Definition: CaloAddPedShiftConfig.py:43
a
TList * a
Definition: liststreamerinfos.cxx:10
h
MissingETBase::Source::truthNonInt
static Types::bitmask_t truthNonInt()
Standard bit pattern indicating genuine true MET.
Definition: MissingETBase.h:321
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CP::SystematicsTool::m_recommendedSystematics
SystematicSet m_recommendedSystematics
Definition: SystematicsTool.h:147
met::METSystematicsTool::m_VertexContKey
SG::ReadHandleKey< xAOD::VertexContainer > m_VertexContKey
Definition: METSystematicsTool.h:175
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
met::METSystematicsTool::m_configSoftTrkFile
Gaudi::Property< std::string > m_configSoftTrkFile
Definition: METSystematicsTool.h:152
CP::SystematicsTool::addAffectingSystematic
StatusCode addAffectingSystematic(const SystematicVariation &systematic, bool recommended)
effects: add a systematic to the list of registered systematics.
Definition: SystematicsTool.cxx:112
met::METSystematicsTool::m_TruthContKey
SG::ReadHandleKey< xAOD::MissingETContainer > m_TruthContKey
Definition: METSystematicsTool.h:176
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
met::MET_SOFTTRK_SCALEUP
@ MET_SOFTTRK_SCALEUP
Definition: METSystematicsTool.h:70
met::MET_JETTRK_SCALEUP
@ MET_JETTRK_SCALEUP
Definition: METSystematicsTool.h:80
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
met::METSystematicsTool::getCorrectedJetTrackMET
CP::CorrectionCode getCorrectedJetTrackMET(xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const
Definition: METSystematicsTool.cxx:562
calibdata.copy
bool copy
Definition: calibdata.py:26
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
xAOD::MissingETAssociation_v1::ConstVec::cpx
float cpx() const
Returns .
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
xAOD::MissingET_v1::mpy
float mpy() const
Returns .
met::METSystematicsTool::extractHistoPath
StatusCode extractHistoPath(std::string &histfile, std::string &systpath, std::string &configdir, std::string &suffix, SystType const &type)
Definition: METSystematicsTool.cxx:661
SG::DataProxy
Definition: DataProxy.h:45
module_driven_slicing.histfile
histfile
Definition: module_driven_slicing.py:570
MissingETBase::Source::isSoftTerm
static bool isSoftTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Definition: MissingETBase.h:403
met::METSystematicsTool::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition: METSystematicsTool.h:177
RCU_READ_INVARIANT
#define RCU_READ_INVARIANT(x)
Definition: Assert.h:229
met::METSystematicsTool::softCaloSystInitialize
StatusCode softCaloSystInitialize()
Definition: METSystematicsTool.cxx:108
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition: Event/xAOD/xAODJet/xAODJet/Jet.h:17
met::MET_SOFTTRK_SCALEDOWN
@ MET_SOFTTRK_SCALEDOWN
Definition: METSystematicsTool.h:71
xAOD::MissingET_v1::met
float met() const
Returns .
fitman.k
k
Definition: fitman.py:528
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
met::METSystematicsTool::m_calo_resoperp_pthard_njet_mu
std::unique_ptr< TH3D > m_calo_resoperp_pthard_njet_mu
Definition: METSystematicsTool.h:162