ATLAS Offline Software
Loading...
Searching...
No Matches
CP::MuonTriggerScaleFactors Class Reference

#include <MuonTriggerScaleFactors.h>

Inheritance diagram for CP::MuonTriggerScaleFactors:

Public Member Functions

 MuonTriggerScaleFactors (const std::string &name)
virtual ~MuonTriggerScaleFactors ()
virtual StatusCode initialize (void)
virtual CorrectionCode getTriggerScaleFactor (const xAOD::MuonContainer &mucont, Double_t &triggersf, const std::string &trigger) const
virtual CorrectionCode getTriggerScaleFactor (const xAOD::Muon &muon, Double_t &triggersf, const std::string &trigger) const
virtual CorrectionCode getTriggerEfficiency (const xAOD::Muon &mu, Double_t &efficiency, const std::string &trigger, Bool_t dataType) const
virtual bool isAffectedBySystematic (const CP::SystematicVariation &systematic) const
 Declare the interface that this class provides.
virtual CP::SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by
virtual CP::SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use
virtual StatusCode applySystematicVariation (const CP::SystematicSet &systConfig)
 effects: configure this tool for the given list of systematic variations.
virtual int getBinNumber (const xAOD::Muon &muon, const std::string &trigger) const
virtual int getReplica_index (const std::string &sysBaseName, const std::string &trigStr) const
virtual bool isTriggerSupported (const std::string &trigger) const
 Returns whether the trigger is supported by the tool or not. The decision depends on the present (random)RunNumber.
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

virtual std::shared_ptr< TH1 > getEfficiencyHistogram (unsigned int year, const std::string &period, const std::string &trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
virtual std::shared_ptr< TH1 > getEfficiencyHistogram (const std::string &trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
const std::string & getDataPeriod () const
unsigned int getRunNumber () const
unsigned int getYear (unsigned int run) const
const std::string & getDataPeriod (unsigned int run) const
const std::string & getDataPeriod (unsigned int runNumber, unsigned int year) const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef std::pair< unsigned int, std::string > YearPeriod
typedef std::pair< YearPeriod, unsigned int > EffiHistoIdent
typedef std::map< EffiHistoIdent, TH1_Ptr > EfficiencyMap
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

virtual CorrectionCode getMuonEfficiency (Double_t &eff, const TrigMuonEff::Configuration &configuration, const xAOD::Muon &muon, const std::string &trigger, const std::string &systematic) const
virtual CorrectionCode GetTriggerSF_dimu (Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &trigger) const
virtual CorrectionCode GetTriggerSF (Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &trigger) const
virtual CorrectionCode GetTriggerSF (Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::Muon &muon, const std::string &trigger) const
virtual CorrectionCode getDimuonEfficiency (Double_t &eff, const TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &chain, const std::string &systematic) const
const CP::SystematicSet & appliedSystematics () const
StatusCode registerSystematics ()
StatusCode LoadTriggerMap (unsigned int year)
unsigned int encodeHistoName (const std::string &period, const std::string &Trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
unsigned int encodeHistoName (const std::string &Trigger, const TrigMuonEff::Configuration &configuration, const std::string &Systematic, bool isBarrel=true) const
CorrectionCode getThreshold (Int_t &threshold, const std::string &trigger) const
std::string getTriggerCorrespondingToDimuonTrigger (const std::string &trigger) const
TDirectory * getTemporaryDirectory (void) const
std::vector< TH1_Ptr > generateReplicas (TH1_Ptr h, int nrep, int seed) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo {this, "EventInfoContName", "EventInfo", "event info key"}
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
CP::SystematicSet * m_appliedSystematics {}
EfficiencyMap m_efficiencyMap
std::map< EffiHistoIdent, std::vector< TH1_Ptr > > m_efficiencyMapReplicaArray
Gaudi::Property< std::string > m_muonQuality {this, "MuonQuality", "Medium", "the muon quality to get the scale factors for"}
Gaudi::Property< std::string > m_campaign {this, "Campaign", "", "the MC campaign to get the scale factors for"}
Gaudi::Property< std::string > m_calibrationVersion {this, "CalibrationVersion", "261003_FallUpdate", "the calibration version to use"}
Gaudi::Property< std::string > m_customInputFolder {this, "CustomInputFolder", "", "the custom input folder to use (debugging only)"}
Gaudi::Property< std::map< unsigned int, std::string > > m_customInputFilePerYear {this, "CustomInputFilePerYear", {}, "the custom input file to use per year (debugging only)"}
Gaudi::Property< std::string > m_binning {this, "Binning", "fine", "the binning to use"}
Gaudi::Property< bool > m_allowZeroSF {this, "AllowZeroSF", false, "if a trigger is not available will return 0 instead of throwing an error. More difficult to spot configuration issues. Use at own risk"}
Gaudi::Property< bool > m_experimental {this, "UseExperimental", false, "enable experimental features like single muon SF"}
Gaudi::Property< int > m_forceYear {this, "ForceYear", -1, "Only for developers. Never use this in any analysis!!!!!!"}
Gaudi::Property< std::string > m_forcePeriod {this, "ForcePeriod", "", "Only for developers. Never use this in any analysis!!!!!!"}
Gaudi::Property< std::vector< std::string > > m_replicaTriggerList {this, "ReplicaTriggerList", {}, "List of triggers on which we want to generate stat. uncertainty toy replicas."}
std::set< std::string > m_replicaSet
Gaudi::Property< int > m_nReplicas {this, "NReplicas", 100, "Number of generated toy replicas, if replicas are required."}
Gaudi::Property< int > m_ReplicaRandomSeed {this, "ReplicaRandomSeed", 12345, "Random seed for toy replica generation."}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const std::map< unsigned int, int > m_runNumber_year
static const std::map< unsigned short int, std::vector< std::tuple< unsigned int, unsigned int, std::string > > > m_year_periods

Detailed Description

Definition at line 26 of file MuonTriggerScaleFactors.h.

Member Typedef Documentation

◆ EfficiencyMap

Definition at line 88 of file MuonTriggerScaleFactors.h.

◆ EffiHistoIdent

Definition at line 87 of file MuonTriggerScaleFactors.h.

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

◆ YearPeriod

typedef std::pair<unsigned int, std::string> CP::MuonTriggerScaleFactors::YearPeriod
private

Definition at line 86 of file MuonTriggerScaleFactors.h.

Constructor & Destructor Documentation

◆ MuonTriggerScaleFactors()

CP::MuonTriggerScaleFactors::MuonTriggerScaleFactors ( const std::string & name)

Definition at line 125 of file MuonTriggerScaleFactors.cxx.

125 :
126 asg::AsgTool(name) {}

◆ ~MuonTriggerScaleFactors()

CP::MuonTriggerScaleFactors::~MuonTriggerScaleFactors ( )
virtual

Definition at line 128 of file MuonTriggerScaleFactors.cxx.

128{ }

Member Function Documentation

◆ affectingSystematics()

CP::SystematicSet CP::MuonTriggerScaleFactors::affectingSystematics ( ) const
virtual

returns: the list of all systematics this tool can be affected by

Implements CP::IReentrantSystematicsTool.

Definition at line 898 of file MuonTriggerScaleFactors.cxx.

898 {
899 CP::SystematicSet mySysSet;
900
901 mySysSet.insert(CP::SystematicVariation("MUON_EFF_TrigSystUncertainty", 1));
902 mySysSet.insert(CP::SystematicVariation("MUON_EFF_TrigSystUncertainty", -1));
903
904 //Consider full statUncertainty if TOY replicas are not used
905 if (m_replicaTriggerList.size() == 0) {
906 mySysSet.insert(CP::SystematicVariation("MUON_EFF_TrigStatUncertainty", 1));
907 mySysSet.insert(CP::SystematicVariation("MUON_EFF_TrigStatUncertainty", -1));
908 } else {
909 for (int i = 0; i < m_nReplicas; ++i) { //TOFIX Hack with just up variations! needs ASG reserved words for a clean handling//+++++++
910 mySysSet.insert(CP::SystematicVariation(Form("MUON_EFF_Trig_MCTOY%03d", i), 1));
911 }
912 }
913
914 return mySysSet;
915 }
Gaudi::Property< std::vector< std::string > > m_replicaTriggerList
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set

◆ appliedSystematics()

const CP::SystematicSet & CP::MuonTriggerScaleFactors::appliedSystematics ( ) const
inlineprivate

Definition at line 70 of file MuonTriggerScaleFactors.h.

70 {
72 }

◆ applySystematicVariation()

StatusCode CP::MuonTriggerScaleFactors::applySystematicVariation ( const CP::SystematicSet & systConfig)
virtual

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

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

Implements CP::ISystematicsTool.

Definition at line 932 of file MuonTriggerScaleFactors.cxx.

932 {
933 // First, check if we already know this systematic configuration
934 auto itr = m_systFilter.find(systConfig);
935
936 // If it's a new input set, we need to filter it
937 if (itr == m_systFilter.end()) {
938
939 // New systematic. We need to parse it.
940 static const CP::SystematicSet affectingSys = affectingSystematics();
941 CP::SystematicSet filteredSys;
942 if (!CP::SystematicSet::filterForAffectingSystematics(systConfig, affectingSys, filteredSys)) {
943 ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool!");
944 return StatusCode::FAILURE;
945 }
946
947 // Insert filtered set into the map
948 itr = m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
949 }
950
951 CP::SystematicSet& mySysConf = itr->second;
952
953 // Check to see if the set of variations tries to add in the uncertainty up and down. Since the errors
954 // are symetric this would result in 0 and so should not be done.
955 static const CP::SystematicVariation stat_up("MUON_EFF_TrigStatUncertainty", 1);
956 static const CP::SystematicVariation stat_down("MUON_EFF_TrigStatUncertainty", -1);
957 static const CP::SystematicVariation syst_up("MUON_EFF_TrigSystUncertainty", 1);
958 static const CP::SystematicVariation syst_down("MUON_EFF_TrigSystUncertainty", -1);
959
960 if ((mySysConf.matchSystematic(stat_up) && mySysConf.matchSystematic(stat_down)) || (mySysConf.matchSystematic(syst_up) && mySysConf.matchSystematic(syst_down))) {
961 return StatusCode::FAILURE;
962 }
963
964 m_appliedSystematics = &mySysConf;
965 return StatusCode::SUCCESS;
966 }
#define ATH_MSG_ERROR(x,...)
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
virtual CP::SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
bool matchSystematic(const SystematicVariation &systematic, MATCHTYPE type=FULL) const
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

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

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

◆ encodeHistoName() [1/2]

unsigned int CP::MuonTriggerScaleFactors::encodeHistoName ( const std::string & period,
const std::string & Trigger,
bool isData,
const std::string & Systematic,
bool isBarrel = true ) const
private

Definition at line 471 of file MuonTriggerScaleFactors.cxx.

471 {
472 //keep the string as short as possible
473 const std::string histName = period + "_" + Trigger + "_" + (isBarrel ? "b" : "e") + "_" + (isData ? "data" : "mc") + Systematic;
474 return std::hash<std::string>()(histName);
475 }

◆ encodeHistoName() [2/2]

unsigned int CP::MuonTriggerScaleFactors::encodeHistoName ( const std::string & Trigger,
const TrigMuonEff::Configuration & configuration,
const std::string & Systematic,
bool isBarrel = true ) const
private

Definition at line 477 of file MuonTriggerScaleFactors.cxx.

477 {
478 //keep the string as short as possible
479 return encodeHistoName(getDataPeriod(), Trigger, configuration.isData, Systematic, isBarrel);
480
481 }
unsigned int encodeHistoName(const std::string &period, const std::string &Trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
const std::string & getDataPeriod() const

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ generateReplicas()

std::vector< TH1_Ptr > CP::MuonTriggerScaleFactors::generateReplicas ( TH1_Ptr h,
int nrep,
int seed ) const
private

Definition at line 426 of file MuonTriggerScaleFactors.cxx.

426 {
427 TRandom3 Rndm(seed);
428 std::vector<TH1_Ptr> replica_v;
429 const int xbins = h->GetNbinsX(), ybins = h->GetNbinsY();
430
431 for (int t = 0; t < nrep; ++t) {
432 TH2* replica = dynamic_cast<TH2*>(h->Clone(Form("rep%d_%s", t, h->GetName())));
433
434 for (int x_i = 0; x_i <= xbins; ++x_i) {
435 for (int y_i = 0; y_i <= ybins; ++y_i) {
436 replica->SetBinContent(x_i, y_i, Rndm.Gaus(h->GetBinContent(x_i, y_i), h->GetBinError(x_i, y_i)));
437 }
438 }
439 replica_v.push_back(TH1_Ptr(replica));
440 }
441 return replica_v;
442 }
std::shared_ptr< TH1 > TH1_Ptr

◆ getBinNumber()

int CP::MuonTriggerScaleFactors::getBinNumber ( const xAOD::Muon & muon,
const std::string & trigger ) const
virtual

Implements CP::IMuonTriggerScaleFactors.

Definition at line 449 of file MuonTriggerScaleFactors.cxx.

449 {
450 if(!m_experimental){
451 ATH_MSG_ERROR("MuonTriggerScaleFactors::getTriggerScaleFactor This is an experimental function. If you really know what you are doing set UseExperimental property.");
453 }
454
455 const double mu_eta = muon.eta();
456 const double mu_phi = muon.phi();
457 bool isBarrel = std::abs(mu_eta) < muon_barrel_endcap_boundary;
458 TH1_Ptr cit = getEfficiencyHistogram(trigger, true, "nominal", isBarrel);
459 if(!cit.get()){
460 if(!m_allowZeroSF)
461 ATH_MSG_ERROR("Could not find efficiency map for muon with eta: " << mu_eta << " and phi: " << mu_phi << ". Something is inconsistent. Please check your settings for year, mc and trigger." );
462 return -1;
463 }
464 auto eff_h2 = cit;
465 double mu_phi_corr = mu_phi;
466 if (mu_phi_corr < eff_h2->GetYaxis()->GetXmin()) mu_phi_corr += 2.0 * M_PI;
467 if (mu_phi_corr > eff_h2->GetYaxis()->GetXmax()) mu_phi_corr -= 2.0 * M_PI;
468 return eff_h2->FindFixBin(mu_eta, mu_phi_corr);
469 }
#define M_PI
@ Error
Some error happened during the object correction.
virtual std::shared_ptr< TH1 > getEfficiencyHistogram(unsigned int year, const std::string &period, const std::string &trigger, bool isData, const std::string &Systematic, bool isBarrel=true) const
Gaudi::Property< bool > m_allowZeroSF
Gaudi::Property< bool > m_experimental
constexpr double muon_barrel_endcap_boundary

◆ getDataPeriod() [1/3]

const std::string & CP::MuonTriggerScaleFactors::getDataPeriod ( ) const
protected

Definition at line 816 of file MuonTriggerScaleFactors.cxx.

816 {
817 return getDataPeriod(getRunNumber());
818 }

◆ getDataPeriod() [2/3]

const std::string & CP::MuonTriggerScaleFactors::getDataPeriod ( unsigned int run) const
protected

Definition at line 820 of file MuonTriggerScaleFactors.cxx.

820 {
821 return getDataPeriod(run, getYear(run));
822 }
unsigned int getYear(unsigned int run) const
int run(int argc, char *argv[])

◆ getDataPeriod() [3/3]

const std::string & CP::MuonTriggerScaleFactors::getDataPeriod ( unsigned int runNumber,
unsigned int year ) const
protected

◆ getDimuonEfficiency()

CorrectionCode CP::MuonTriggerScaleFactors::getDimuonEfficiency ( Double_t & eff,
const TrigMuonEff::Configuration & configuration,
const xAOD::MuonContainer & mucont,
const std::string & chain,
const std::string & systematic ) const
privatevirtual

Definition at line 757 of file MuonTriggerScaleFactors.cxx.

757 {
758
759 std::string trigger = getTriggerCorrespondingToDimuonTrigger(chain);
760 Int_t threshold;
761 CorrectionCode result = getThreshold(threshold, trigger);
762 if (result != CorrectionCode::Ok) return result;
763
766
767 Double_t eff1 = 0;
768 if ((**mu1).pt() > threshold) {
769 CorrectionCode result1 = getMuonEfficiency(eff1, configuration, (**mu1), trigger, systematic);
770 if (result1 != CorrectionCode::Ok) return result1;
771 }
772 Double_t eff2 = 0;
773 if ((**mu2).pt() > threshold) {
774 CorrectionCode result2 = getMuonEfficiency(eff2, configuration, (**mu2), trigger, systematic);
775 if (result2 != CorrectionCode::Ok) return result2;
776 }
777
778 eff = eff1 * eff2;
779 return CorrectionCode::Ok;
780 }
@ Ok
The correction was done successfully.
virtual CorrectionCode getMuonEfficiency(Double_t &eff, const TrigMuonEff::Configuration &configuration, const xAOD::Muon &muon, const std::string &trigger, const std::string &systematic) const
std::string getTriggerCorrespondingToDimuonTrigger(const std::string &trigger) const
CorrectionCode getThreshold(Int_t &threshold, const std::string &trigger) const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:861
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.

◆ getEfficiencyHistogram() [1/2]

TH1_Ptr CP::MuonTriggerScaleFactors::getEfficiencyHistogram ( const std::string & trigger,
bool isData,
const std::string & Systematic,
bool isBarrel = true ) const
protectedvirtual

Definition at line 491 of file MuonTriggerScaleFactors.cxx.

491 {
492 unsigned int run = getRunNumber();
493 return getEfficiencyHistogram(getYear(run), getDataPeriod(run), trigger, isData, Systematic, isBarrel);
494 }

◆ getEfficiencyHistogram() [2/2]

TH1_Ptr CP::MuonTriggerScaleFactors::getEfficiencyHistogram ( unsigned int year,
const std::string & period,
const std::string & trigger,
bool isData,
const std::string & Systematic,
bool isBarrel = true ) const
protectedvirtual

Definition at line 482 of file MuonTriggerScaleFactors.cxx.

482 {
483 EffiHistoIdent Ident = EffiHistoIdent(YearPeriod(year, period), encodeHistoName(period, trigger, isData, Systematic, isBarrel));
484 EfficiencyMap::const_iterator Itr = m_efficiencyMap.find(Ident);
485
486 if (Itr == m_efficiencyMap.end()) {
487 return TH1_Ptr();
488 }
489 return Itr->second;
490 }
std::pair< YearPeriod, unsigned int > EffiHistoIdent
std::pair< unsigned int, std::string > YearPeriod

◆ 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::Event 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::Event, 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 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getMuonEfficiency()

CorrectionCode CP::MuonTriggerScaleFactors::getMuonEfficiency ( Double_t & eff,
const TrigMuonEff::Configuration & configuration,
const xAOD::Muon & muon,
const std::string & trigger,
const std::string & systematic ) const
privatevirtual

Definition at line 496 of file MuonTriggerScaleFactors.cxx.

496 {
497 const double mu_eta = muon.eta();
498 const double mu_phi = muon.phi();
499 bool isBarrel = std::abs(mu_eta) < muon_barrel_endcap_boundary;
500
501 TH1_Ptr eff_h2 = nullptr;
502 if (configuration.replicaIndex >= 0) { //Only look into the replicas if asking for them
503
504 unsigned int run = getRunNumber();
505 EffiHistoIdent Ident = EffiHistoIdent(YearPeriod(getYear(run), getDataPeriod(run)), encodeHistoName(getDataPeriod(run), trigger, configuration.isData, "repl", isBarrel));
506 std::map<EffiHistoIdent, std::vector<TH1_Ptr> >::const_iterator cit = m_efficiencyMapReplicaArray.find(Ident);
507 if (cit == m_efficiencyMapReplicaArray.end()) {
508 if (m_allowZeroSF) {
509 ATH_MSG_WARNING("Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Returning efficiency = 0.");
510 eff = 0.;
511 return CorrectionCode::Ok;
512 }
513
514 else {
515 ATH_MSG_ERROR("Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Please check how you set up the tool.");
517 }
518 }
519
520 if (configuration.replicaIndex >= (int) cit->second.size()) {
521 ATH_MSG_ERROR("MuonTriggerScaleFactors::getMuonEfficiency ; index for replicated histograms is out of range.");
523 }
524
525 eff_h2 = cit->second[configuration.replicaIndex];
526 } else { //Standard case, look into the usual eff map
527 TH1_Ptr cit = getEfficiencyHistogram(trigger, configuration.isData, systematic, isBarrel);
528 if (cit.get() == nullptr) {
529 if (m_allowZeroSF) {
530 ATH_MSG_WARNING("Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Returning efficiency = 0.");
531 eff = 0.;
532 return CorrectionCode::Ok;
533 } else {
534 ATH_MSG_ERROR("Could not find what you are looking for in the efficiency map. The trigger you are looking for, year and mc are not consistent, or the trigger is unavailable in this data period. Please check how you set up the tool.");
536 }
537 }
538 eff_h2 = cit;
539 }
540
541 double mu_phi_corr = mu_phi;
542 if (mu_phi_corr < eff_h2->GetYaxis()->GetXmin()) mu_phi_corr += 2.0 * M_PI;
543 if (mu_phi_corr > eff_h2->GetYaxis()->GetXmax()) mu_phi_corr -= 2.0 * M_PI;
544
545 const int bin = eff_h2->FindFixBin(mu_eta, mu_phi_corr);
546 const double efficiency = eff_h2->GetBinContent(bin);
547
548 eff = efficiency;
549
550 ATH_MSG_DEBUG("getMuonEfficiency [eta,phi,phi_corr]=[" << mu_eta << "," << mu_phi << "," << mu_phi_corr << "], ibin=" << bin << " eff=" << eff);
551
552 return CorrectionCode::Ok;
553
554 }
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
@ OutOfValidityRange
Input object is out of validity range.
std::map< EffiHistoIdent, std::vector< TH1_Ptr > > m_efficiencyMapReplicaArray
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
int replicaIndex
index of replicated histograms to access

◆ 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::Event 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::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

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

Get one of the tool's properties.

◆ getReplica_index()

int CP::MuonTriggerScaleFactors::getReplica_index ( const std::string & sysBaseName,
const std::string & trigStr ) const
virtual

Definition at line 362 of file MuonTriggerScaleFactors.cxx.

362 {
363 if (m_replicaSet.find(trigStr) == m_replicaSet.end()) return -1; //No toys for this trigger
364 std::size_t pos = sysBaseName.find("MCTOY");
365 if (pos == std::string::npos) return -1; //sys variation not affected by TOYS
366 return atoi(sysBaseName.substr(pos + 5, pos + 8).c_str()); //toys for this trigger are around get the 3-digit number
367 }
std::set< std::string > m_replicaSet
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...

◆ getRunNumber()

unsigned int CP::MuonTriggerScaleFactors::getRunNumber ( ) const
protected

Definition at line 843 of file MuonTriggerScaleFactors.cxx.

843 {
844 static const SG::ConstAccessor<unsigned int> acc_rnd("RandomRunNumber");
845 SG::ReadHandle<xAOD::EventInfo> info(m_eventInfo);
846 if (info.operator->()==nullptr) {
847 ATH_MSG_FATAL("Could not retrieve the xAOD::EventInfo with name: " << m_eventInfo.key() << ". Exiting the code.");
848 throw std::invalid_argument{""};
849 }
850 if (!info->eventType(xAOD::EventInfo::IS_SIMULATION)) {
851 ATH_MSG_DEBUG("The current event is a data event. Return runNumber instead.");
852 return info->runNumber();
853 }
854 if (!acc_rnd.isAvailable(*info)) {
855 if(m_forceYear == -1 && m_forcePeriod == "")
856 ATH_MSG_FATAL("Failed to find the RandomRunNumber decoration. Please call the apply() method from the PileupReweightingTool beforehand in order to get period dependent SFs");
857 throw std::invalid_argument{""};
858 } else if (acc_rnd(*info) == 0) {
859 ATH_MSG_FATAL("Pile up tool has given runNumber 0. Exiting the code.");
860 throw std::invalid_argument{""};
861 }
862
863 // standard behaviour for MC, get the random RunNumber
864 return acc_rnd(*info);
865 }
#define ATH_MSG_FATAL(x,...)
Gaudi::Property< std::string > m_forcePeriod
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
@ IS_SIMULATION
true: simulation, false: data

◆ getTemporaryDirectory()

TDirectory * CP::MuonTriggerScaleFactors::getTemporaryDirectory ( void ) const
private

Definition at line 867 of file MuonTriggerScaleFactors.cxx.

867 {
868 gROOT->cd();
869 TDirectory* tempDir = 0;
870 int counter = 0;
871 while (not tempDir) {
872 std::stringstream dirname;
873 dirname << "MuonTriggerScaleFactorsTempDir_%i" << counter;
874 if (gROOT->GetDirectory((dirname.str()).c_str())) {
875 ++counter;
876 continue;
877 }
878 tempDir = gROOT->mkdir((dirname.str()).c_str());
879 if (not tempDir) {
880 ATH_MSG_ERROR("getTemporaryDirectory::Temporary directory could not be created");
881 }
882 }
883 return tempDir;
884 }
std::string dirname(std::string name)
Definition utils.cxx:200

◆ getThreshold()

CorrectionCode CP::MuonTriggerScaleFactors::getThreshold ( Int_t & threshold,
const std::string & trigger ) const
private

Definition at line 788 of file MuonTriggerScaleFactors.cxx.

788 {
789 std::size_t index = trigger.find("HLT_mu");
790 if (index != std::string::npos) {
791 std::string rawNumber = trigger.substr(index + 6);
792 if (!rawNumber.empty() && isdigit(rawNumber[0])) {
793 std::stringstream(rawNumber) >> threshold;
794 if (threshold < 10) threshold = 10000;
795 else threshold = (threshold + 1) * 1000;
796 return CorrectionCode::Ok;
797 }
798 }
799 ATH_MSG_ERROR("MuonTriggerScaleFactors::getThreshold Could not extract threshold for trigger " << trigger);
801 }
str index
Definition DeMoScan.py:362

◆ getTriggerCorrespondingToDimuonTrigger()

std::string CP::MuonTriggerScaleFactors::getTriggerCorrespondingToDimuonTrigger ( const std::string & trigger) const
private

Definition at line 782 of file MuonTriggerScaleFactors.cxx.

782 {
783 if (trigger.find("2mu10") != std::string::npos) return "HLT_mu10";
784 if (trigger.find("2mu14") != std::string::npos) return "HLT_mu14";
785 throw std::runtime_error("Unknown dimuon trigger");
786 }

◆ getTriggerEfficiency()

CorrectionCode CP::MuonTriggerScaleFactors::getTriggerEfficiency ( const xAOD::Muon & mu,
Double_t & efficiency,
const std::string & trigger,
Bool_t dataType ) const
virtual

Implements CP::IMuonTriggerScaleFactors.

Definition at line 369 of file MuonTriggerScaleFactors.cxx.

369 {
370 if (trigger.empty()) {
371 ATH_MSG_ERROR("MuonTriggerScaleFactors::getTriggerEfficiency Trigger must have value.");
373 }
374 TrigMuonEff::Configuration configuration;
375 configuration.isData = dataType;
376 configuration.replicaIndex = -1;
377 Int_t threshold;
378 CorrectionCode result = getThreshold(threshold, trigger);
379 if (result != CorrectionCode::Ok) return result;
380 if (mu.pt() < threshold) {
381 efficiency = 0;
382 return CorrectionCode::Ok;
383 }
384
385 // Pre-define uncertainty variations
386 static const CP::SystematicVariation stat_up("MUON_EFF_TrigStatUncertainty", 1);
387 static const CP::SystematicVariation stat_down("MUON_EFF_TrigStatUncertainty", -1);
388 static const CP::SystematicVariation syst_up("MUON_EFF_TrigSystUncertainty", 1);
389 static const CP::SystematicVariation syst_down("MUON_EFF_TrigSystUncertainty", -1);
390
391 std::string systype = "";
392 if (appliedSystematics().matchSystematic(syst_down) && !dataType) {
393 systype = "syst_down";
394 } else if (appliedSystematics().matchSystematic(syst_up) && !dataType) {
395 systype = "syst_up";
396 } else if (appliedSystematics().matchSystematic(stat_down)) {
397 systype = "stat_down";
398 } else if (appliedSystematics().matchSystematic(stat_up)) {
399 systype = "stat_up";
400 } else {
401 systype = "nominal";
402 }
403
404 // Toys, if found, will overwrite the data hists stat with the generated toy
405 //+++++++++++++
406 // The best way is the use of filterByName with the 000MCTOY at the end. See:
407 // if( !(appliedSystematics().filterByBaseName("MUON_EFF_Trig_MCTOY000")).empty()){//The following is a hack!!!
408 //++++++++++THE FOLLOWING IS A PARTIAL HACK!!!
409 if (!appliedSystematics().empty() && configuration.isData == true) {
410 configuration.replicaIndex = getReplica_index(appliedSystematics().begin()->basename(), trigger);
411 if (configuration.replicaIndex != -1) systype = "replicas";
412 }
413 CorrectionCode cc = getMuonEfficiency(efficiency, configuration, mu, trigger, systype);
414 return cc;
415 }
static const Attributes_t empty
virtual int getReplica_index(const std::string &sysBaseName, const std::string &trigStr) const
const CP::SystematicSet & appliedSystematics() const
std::string basename(std::string name)
Definition utils.cxx:207

◆ getTriggerScaleFactor() [1/2]

CorrectionCode CP::MuonTriggerScaleFactors::getTriggerScaleFactor ( const xAOD::Muon & muon,
Double_t & triggersf,
const std::string & trigger ) const
virtual

Implements CP::IMuonTriggerScaleFactors.

Definition at line 314 of file MuonTriggerScaleFactors.cxx.

314 {
315 if(!m_experimental){
316 ATH_MSG_ERROR("MuonTriggerScaleFactors::getTriggerScaleFactor This is an experimental function. If you really know what you are doing set UseExperimental property.");
318 }
319
320 if (trigger.empty()) {
321 ATH_MSG_ERROR("MuonTriggerScaleFactors::getTriggerScaleFactor Trigger must have value.");
323 }
324
325 TrigMuonEff::Configuration configuration;
326
327 if (trigger == "HLT_mu8noL1")
328 ATH_MSG_WARNING("What you are trying to do is not correct. For di-muon triggers you should get the efficiency with getTriggerEfficiency and compute the SF by yourself.");
329 else if (trigger.find("HLT_2mu10") != std::string::npos || trigger.find("HLT_2mu14") != std::string::npos)
330 ATH_MSG_WARNING("Di-muon trigger scale factors for single reco muons are not supported!");
331 else
332 return GetTriggerSF(triggersf, configuration, muon, trigger);
333 return CorrectionCode::Ok;
334 }
virtual CorrectionCode GetTriggerSF(Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &trigger) const

◆ getTriggerScaleFactor() [2/2]

CorrectionCode CP::MuonTriggerScaleFactors::getTriggerScaleFactor ( const xAOD::MuonContainer & mucont,
Double_t & triggersf,
const std::string & trigger ) const
virtual

Implements CP::IMuonTriggerScaleFactors.

Definition at line 336 of file MuonTriggerScaleFactors.cxx.

336 {
337 if (trigger.empty()) {
338 ATH_MSG_ERROR("MuonTriggerScaleFactors::getTriggerScaleFactor Trigger must have value.");
340 }
341
342 TrigMuonEff::Configuration configuration;
343
344 if (trigger == "HLT_mu8noL1") {
345 ATH_MSG_WARNING("What you are trying to do is not correct. For di-muon triggers you should get the efficiency with getTriggerEfficiency and compute the SF by yourself.");
346 } else if (trigger.find("HLT_2mu10") != std::string::npos || trigger.find("HLT_2mu14") != std::string::npos) {
347 CorrectionCode cc = GetTriggerSF_dimu(triggersf, configuration, mucont, trigger);
348 return cc;
349 } else {
350 CorrectionCode cc = GetTriggerSF(triggersf, configuration, mucont, trigger);
351 return cc;
352 }
353 return CorrectionCode::Ok;
354 }
virtual CorrectionCode GetTriggerSF_dimu(Double_t &TriggerSF, TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &trigger) const

◆ GetTriggerSF() [1/2]

CorrectionCode CP::MuonTriggerScaleFactors::GetTriggerSF ( Double_t & TriggerSF,
TrigMuonEff::Configuration & configuration,
const xAOD::Muon & muon,
const std::string & trigger ) const
privatevirtual

Definition at line 694 of file MuonTriggerScaleFactors.cxx.

694 {
695 Int_t threshold;
696 CorrectionCode result = getThreshold(threshold, trigger);
697 if (result != CorrectionCode::Ok)
698 return result;
699
700 double eff_data = 0., eff_mc = 0.;
701
702 if (mu.pt() < threshold) {
703 eff_data = 0.;
704 eff_mc = 0.;
705 TriggerSF = 1.;
706 return CorrectionCode::Ok;
707 }
708
709 std::string muon_trigger_name = trigger;
710 std::string data_err = "";
711 std::string mc_err = "";
712
713 // Pre-define uncertainty variations
714 static const CP::SystematicVariation stat_up("MUON_EFF_TrigStatUncertainty", 1);
715 static const CP::SystematicVariation stat_down("MUON_EFF_TrigStatUncertainty", -1);
716 static const CP::SystematicVariation syst_up("MUON_EFF_TrigSystUncertainty", 1);
717 static const CP::SystematicVariation syst_down("MUON_EFF_TrigSystUncertainty", -1);
718
719 if (appliedSystematics().matchSystematic(syst_down)) {
720 data_err = "nominal";
721 mc_err = "syst_up";
722 } else if (appliedSystematics().matchSystematic(syst_up)) {
723 data_err = "nominal";
724 mc_err = "syst_down";
725 } else if (appliedSystematics().matchSystematic(stat_down)) {
726 data_err = "stat_down";
727 mc_err = "nominal";
728 } else if (appliedSystematics().matchSystematic(stat_up)) {
729 data_err = "stat_up";
730 mc_err = "nominal";
731 } else {
732 data_err = "nominal";
733 mc_err = "nominal";
734 }
735
736 if (!appliedSystematics().empty()) {
737 configuration.replicaIndex = getReplica_index(appliedSystematics().begin()->basename(), trigger);
738 if (configuration.replicaIndex != -1) data_err = "replicas";
739 }
740
741 configuration.isData = true;
742 CorrectionCode result_data = getMuonEfficiency(eff_data, configuration, mu, muon_trigger_name, data_err);
743 if (result_data != CorrectionCode::Ok)
744 return result_data;
745 configuration.isData = false;
746 configuration.replicaIndex = -1;
747 CorrectionCode result_mc = getMuonEfficiency(eff_mc, configuration, mu, muon_trigger_name, mc_err);
748 if (result_mc != CorrectionCode::Ok)
749 return result_mc;
750 if (eff_data == 0)
751 TriggerSF = 0;
752 if (std::abs(eff_mc) > 0.0001)
753 TriggerSF = eff_data / eff_mc;
754 return CorrectionCode::Ok;
755 }

◆ GetTriggerSF() [2/2]

CorrectionCode CP::MuonTriggerScaleFactors::GetTriggerSF ( Double_t & TriggerSF,
TrigMuonEff::Configuration & configuration,
const xAOD::MuonContainer & mucont,
const std::string & trigger ) const
privatevirtual

Definition at line 615 of file MuonTriggerScaleFactors.cxx.

615 {
616 Int_t threshold;
617 CorrectionCode result = getThreshold(threshold, trigger);
618 if (result != CorrectionCode::Ok) return result;
619
620 double rate_not_fired_data = 1.;
621 double rate_not_fired_mc = 1.;
622
623 for (const auto mu : mucont) {
624
625 double eff_data = 0., eff_mc = 0.;
626
627 if (mu->pt() < threshold) {
628
629 eff_data = 0.;
630 eff_mc = 0.;
631
632 } else {
633
634 std::string muon_trigger_name = trigger;
635 std::string data_err = "";
636 std::string mc_err = "";
637
638 // Pre-define uncertainty variations
639 static const CP::SystematicVariation stat_up("MUON_EFF_TrigStatUncertainty", 1);
640 static const CP::SystematicVariation stat_down("MUON_EFF_TrigStatUncertainty", -1);
641 static const CP::SystematicVariation syst_up("MUON_EFF_TrigSystUncertainty", 1);
642 static const CP::SystematicVariation syst_down("MUON_EFF_TrigSystUncertainty", -1);
643
644 if (appliedSystematics().matchSystematic(syst_down)) {
645 data_err = "nominal";
646 mc_err = "syst_up";
647 } else if (appliedSystematics().matchSystematic(syst_up)) {
648 data_err = "nominal";
649 mc_err = "syst_down";
650 } else if (appliedSystematics().matchSystematic(stat_down)) {
651 data_err = "stat_down";
652 mc_err = "nominal";
653 } else if (appliedSystematics().matchSystematic(stat_up)) {
654 data_err = "stat_up";
655 mc_err = "nominal";
656 } else {
657 data_err = "nominal";
658 mc_err = "nominal";
659 }
660
661 //Toys, if found, will overwrite the data hists, on which toys for stat uncertainty have been generated
662 //+++++++++++++
663 //The best way is the use of filterByName with the 000MCTOY at the end. See:
664 // if( !(appliedSystematics().filterByBaseName("MUON_EFF_Trig_MCTOY000")).empty()){//The following is a hack!!!
665 //++++++++++The following is a hack!!!
666 if (!appliedSystematics().empty()) {
667 configuration.replicaIndex = getReplica_index(appliedSystematics().begin()->basename(), trigger);
668 if (configuration.replicaIndex != -1) data_err = "replicas";
669 }
670
671 configuration.isData = true;
672 CorrectionCode result_data = getMuonEfficiency(eff_data, configuration, *mu, muon_trigger_name, data_err);
673 if (result_data != CorrectionCode::Ok) return result_data;
674 configuration.isData = false;
675 configuration.replicaIndex = -1;
676 CorrectionCode result_mc = getMuonEfficiency(eff_mc, configuration, *mu, muon_trigger_name, mc_err);
677 if (result_mc != CorrectionCode::Ok) return result_mc;
678 }
679 rate_not_fired_data *= (1. - eff_data);
680 rate_not_fired_mc *= (1. - eff_mc);
681 }
682
683 double event_SF = 1.;
684 if (1 - rate_not_fired_data == 0) event_SF = 0;
685 if ((mucont.size()) and (std::abs(1. - rate_not_fired_mc) > 0.0001)) {
686
687 event_SF = (1. - rate_not_fired_data) / (1. - rate_not_fired_mc);
688 }
689 TriggerSF = event_SF;
690
691 return CorrectionCode::Ok;
692 }

◆ GetTriggerSF_dimu()

CorrectionCode CP::MuonTriggerScaleFactors::GetTriggerSF_dimu ( Double_t & TriggerSF,
TrigMuonEff::Configuration & configuration,
const xAOD::MuonContainer & mucont,
const std::string & trigger ) const
privatevirtual

Definition at line 556 of file MuonTriggerScaleFactors.cxx.

556 {
557
558 if (mucont.size() != 2) {
559 ATH_MSG_FATAL("MuonTriggerScaleFactors::GetTriggerSF;Currently dimuon trigger chains only implemented for events with exactly 2 muons.");
560 }
561 ATH_MSG_DEBUG("The trigger that you choose : " << trigger);
562
563 Double_t eff_data = 0;
564 Double_t eff_mc = 0;
565
566 std::string data_err = "";
567 std::string mc_err = "";
568
569 if (appliedSystematics().matchSystematic(CP::SystematicVariation("MUON_EFF_TrigSystUncertainty", -1))) {
570 data_err = "nominal";
571 mc_err = "syst_up";
572 } else if (appliedSystematics().matchSystematic(CP::SystematicVariation("MUON_EFF_TrigSystUncertainty", 1))) {
573 data_err = "nominal";
574 mc_err = "syst_down";
575 } else if (appliedSystematics().matchSystematic(CP::SystematicVariation("MUON_EFF_TrigStatUncertainty", -1))) {
576 data_err = "stat_down";
577 mc_err = "nominal";
578 } else if (appliedSystematics().matchSystematic(CP::SystematicVariation("MUON_EFF_TrigStatUncertainty", 1))) {
579 data_err = "stat_up";
580 mc_err = "nominal";
581 } else {
582 data_err = "nominal";
583 mc_err = "nominal";
584 }
585
586 //Toys, if found, will overwrite the data hists with the sys generated with one toy
587 //+++++++++++++
588 //The best way is the use of filterByName with the 000MCTOY at the end. See:
589 // if( !(appliedSystematics().filterByBaseName("MUON_EFF_Trig_MCTOY000")).empty()){//The following is a hack!!!
590 //++++++++++THE FOLLOWING IS A PARTIAL HACK!!!
591 if (!appliedSystematics().empty()) {
592 configuration.replicaIndex = getReplica_index(appliedSystematics().begin()->basename(), trigger);
593 if (configuration.replicaIndex != -1) data_err = "replicas";
594 }
595
596 configuration.isData = true;
597 CorrectionCode result = getDimuonEfficiency(eff_data, configuration, mucont, trigger, data_err);
598 if (result != CorrectionCode::Ok) return result;
599
600 configuration.isData = false;
601 configuration.replicaIndex = -1;
602 result = getDimuonEfficiency(eff_mc, configuration, mucont, trigger, mc_err);
603 if (result != CorrectionCode::Ok) return result;
604
605 double event_SF = 1.;
606
607 if (std::abs(1. - eff_mc) > 0.0001) {
608 event_SF = eff_data / eff_mc;
609 }
610
611 TriggerSF = event_SF;
612 return CorrectionCode::Ok;
613 }
virtual CorrectionCode getDimuonEfficiency(Double_t &eff, const TrigMuonEff::Configuration &configuration, const xAOD::MuonContainer &mucont, const std::string &chain, const std::string &systematic) const
size_type size() const noexcept
Returns the number of elements in the collection.

◆ getYear()

unsigned int CP::MuonTriggerScaleFactors::getYear ( unsigned int run) const
protected

Definition at line 803 of file MuonTriggerScaleFactors.cxx.

803 {
804 if(m_forceYear != -1){
805 return m_forceYear;
806 }
807
808 int year=2050;
809 auto lower = m_runNumber_year.lower_bound(run);
810 if (lower != m_runNumber_year.end()){
811 year=lower->second;
812 }
813 return year;
814 }
static const std::map< unsigned int, int > m_runNumber_year

◆ initialize()

StatusCode CP::MuonTriggerScaleFactors::initialize ( void )
virtual

Implements CP::IMuonTriggerScaleFactors.

Definition at line 263 of file MuonTriggerScaleFactors.cxx.

263 {
264
265 ATH_MSG_INFO("MuonQuality = '" << m_muonQuality.value() << "'");
266 ATH_MSG_INFO("Binning = '" << m_binning << "'");
267 ATH_MSG_INFO("Campaign = '" << m_campaign << "'");
268 ATH_MSG_INFO("CalibrationRelease = '" << m_calibrationVersion.value() << "'");
269 ATH_MSG_INFO("CustomInputFolder = '" << m_customInputFolder.value() << "'");
270 ATH_MSG_INFO("AllowZeroSF = " << m_allowZeroSF);
271 ATH_MSG_INFO("experimental = " << m_experimental);
272
273 ATH_CHECK(m_eventInfo.initialize());
274
275 if (registerSystematics() != StatusCode::SUCCESS) {
276 return StatusCode::FAILURE;
277 }
278
279 if (applySystematicVariation(CP::SystematicSet()) != StatusCode::SUCCESS) {
280 ATH_MSG_ERROR("Could not configure for nominal settings");
281 return StatusCode::FAILURE;
282 }
283 // Initialize indexes of replicas for trigges which are asked
284 for (auto trigToy : m_replicaTriggerList)
285 m_replicaSet.insert(trigToy);
286
287
288 if (m_campaign.empty()) {
289 constexpr auto years_to_run = std::to_array<int>({2015, 2016, 2017, 2018, 2022, 2023, 2024, 2025});
290 for (const int &year: years_to_run) {
292 }
293 } else if (m_campaign.value() == "mc20a") {
296 } else if (m_campaign.value() == "mc20d") {
298 } else if (m_campaign.value() == "mc20e") {
300 } else if (m_campaign.value() == "mc23a") {
302 } else if (m_campaign.value() == "mc23d") {
304 } else if (m_campaign.value() == "mc23e") {
306 } else if (m_campaign.value() == "mc23g") {
308 } else {
309 ATH_MSG_ERROR("Campaign " << m_campaign.value() << " is not supported. Please choose a valid campaign or leave empty to load all years.");
310 }
311 return StatusCode::SUCCESS;
312 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x,...)
StatusCode LoadTriggerMap(unsigned int year)
Gaudi::Property< std::string > m_campaign
Gaudi::Property< std::string > m_calibrationVersion
Gaudi::Property< std::string > m_binning
virtual StatusCode applySystematicVariation(const CP::SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
Gaudi::Property< std::string > m_customInputFolder
Gaudi::Property< std::string > m_muonQuality

◆ inputHandles()

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

Return this algorithm's input handles.

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

◆ isAffectedBySystematic()

bool CP::MuonTriggerScaleFactors::isAffectedBySystematic ( const CP::SystematicVariation & systematic) const
virtual

Declare the interface that this class provides.

returns: whether this tool is affected by the given systematics

Implements CP::ISystematicsTool.

Definition at line 889 of file MuonTriggerScaleFactors.cxx.

889 {
890 if (!systematic.empty()) {
891 CP::SystematicSet sys = affectingSystematics();
892 return sys.find(systematic) != sys.end();
893 }
894 return true;
895 }
bool empty() const
returns: whether this is an empty systematic, i.e.

◆ isTriggerSupported()

bool CP::MuonTriggerScaleFactors::isTriggerSupported ( const std::string & trigger) const
virtual

Returns whether the trigger is supported by the tool or not. The decision depends on the present (random)RunNumber.

Implements CP::IMuonTriggerScaleFactors.

Definition at line 444 of file MuonTriggerScaleFactors.cxx.

444 {
445 TH1_Ptr H1 = getEfficiencyHistogram(trigger, true, "nominal");
446 return H1.get() != nullptr;
447 }

◆ LoadTriggerMap()

StatusCode CP::MuonTriggerScaleFactors::LoadTriggerMap ( unsigned int year)
private

Definition at line 130 of file MuonTriggerScaleFactors.cxx.

130 {
131 std::string fileName;
132 if (m_customInputFilePerYear.value().contains(year)) {
133 fileName = m_customInputFilePerYear.value().at(year);
134 if (fileName.empty()) {
135 ANA_MSG_INFO("Skipping loading trigger SF for year " << year << " since the provided file name is empty");
136 return StatusCode::SUCCESS;
137 } else {
138 ATH_MSG_INFO("Loading trigger SF from user specified file " << fileName << " for year " << year);
139 }
140 }
141
142 if (fileName.empty()) {
143 if (year == 2015) fileName = "muontrigger_sf_2015_mc20a_v3.root";
144 else if (year == 2016) fileName = "muontrigger_sf_2016_mc20a_v3.root";
145 else if (year == 2017) fileName = "muontrigger_sf_2017_mc20d_v3.root";
146 else if (year == 2018) fileName = "muontrigger_sf_2018_mc20e_v3.root";
147 else if (year == 2022) fileName = "muontrigger_sf_2022_mc23a_v4.root";
148 else if (year == 2023) fileName = "muontrigger_sf_2023_mc23d_v4.root";
149 else if (year == 2024) fileName = "muontrigger_sf_2024_mc23e_v4.root";
150 else if (year == 2025) fileName = "muontrigger_sf_2025_mc23g_v1.root";
151 else {
152 ATH_MSG_WARNING("There is no SF file for year " << year << " yet");
153 return StatusCode::SUCCESS;
154 }
155 }
156
157 TDirectory* origDir = gDirectory;
158
159 std::string filePath;
160
161 if (m_customInputFolder.empty()) {
162 filePath = PathResolverFindCalibFile(Form("MuonEfficiencyCorrections/%s/%s", m_calibrationVersion.value().c_str(), fileName.c_str()));
163 if (filePath.empty()) {
164 ATH_MSG_ERROR("Unable to resolve the input file " << fileName << " via PathResolver.");
165 }
166 }
167 else {
168 ATH_MSG_INFO("Note: setting up with user specified input file location " << m_customInputFolder.value() << " - this is not encouraged!");
169 filePath = PathResolverFindCalibFile(Form("%s/%s", m_customInputFolder.value().c_str(), fileName.c_str()));
170 }
171
172 TFile* file = TFile::Open(filePath.c_str());
173
174 if (file == nullptr || !file->IsOpen()) {
175 ATH_MSG_FATAL("MuonTriggerScaleFactors::initialize Couldn't open file " << filePath);
176 return StatusCode::FAILURE;
177 }
178 TDirectory* tempDir = getTemporaryDirectory();
179 tempDir->cd();
180
181 static const std::vector<std::string> type { "data", "mc" };
182 static const std::vector<std::string> region { "barrel", "endcap" };
183 static const std::vector<std::string> systematic { "nominal", "stat_up", "stat_down", "syst_up", "syst_down" };
184 if (m_muonQuality.value().compare("LowPt") == 0) {
185 m_muonQuality = "Medium";
186 }
187 TDirectory* qualityDirectory = file->GetDirectory(m_muonQuality.value().c_str());
188 if (qualityDirectory == nullptr) {
189 ATH_MSG_FATAL("MuonTriggerScaleFactors::initialize cannot find directory with selected quality");
190 return StatusCode::FAILURE;
191 }
192 TKey* periodKey;
193 TIter nextPeriod(qualityDirectory->GetListOfKeys());
194 while ((periodKey = (TKey*) nextPeriod())) {
195 if (not periodKey->IsFolder()) continue;
196 TDirectory* periodDirectory = qualityDirectory->GetDirectory(periodKey->GetName());
197 std::string periodName = std::string(periodKey->GetName());
198 std::string periodName_InMap = periodName.substr(std::string("Period").size(), periodName.size());
199 YearPeriod period = YearPeriod(year, periodName_InMap);
200 TKey* triggerKey;
201 TIter nextTrigger(periodDirectory->GetListOfKeys());
202 while ((triggerKey = (TKey*) nextTrigger())) {
203 if (not triggerKey->IsFolder()) continue;
204 TDirectory* triggerDirectory = periodDirectory->GetDirectory(triggerKey->GetName());
205 std::string triggerName = std::string(triggerKey->GetName());
206 if(!std::set<std::string>{"HLT_mu26_ivarmedium", "HLT_mu50", "HLT_mu26_ivarmedium_OR_HLT_mu50"}.count(triggerName) && m_binning == "coarse"){
207 ATH_MSG_DEBUG("Coarse binning not supported for di-muon trigger legs at the moment");
208 continue;
209 }
210 for (const auto& iregion : region) {
211 bool isBarrel = iregion.find("barrel") != std::string::npos;
212 for (const auto& itype : type) {
213 bool isData = itype.find("data") != std::string::npos;
214 std::string histname = ("_MuonTrigEff_" + periodName + "_" + triggerName + "_" + m_muonQuality.value() + "_" + "_EtaPhi_" + m_binning + "_" + iregion + "_" + itype);
215 for (const auto& isys : systematic) {
216 if (itype.find("data") != std::string::npos && isys.find("syst") != std::string::npos) continue;
217 std::string path = "eff_etaphi_" + m_binning + "_" + iregion + "_" + itype + "_" + isys;
218 TH2* hist = dynamic_cast<TH2*>(triggerDirectory->Get(path.c_str()));
219 if (not hist) {
220
221 ATH_MSG_FATAL("MuonTriggerScaleFactors::initialize " << path << " not found under trigger " << triggerName << " and period " << periodName << " for year: " << year);
222 continue;
223 }
224 hist->SetDirectory(0);
225
226 EffiHistoIdent HistoId = EffiHistoIdent(period, encodeHistoName(periodName_InMap, triggerName, isData, isys, isBarrel));
227 if (m_efficiencyMap.find(HistoId) != m_efficiencyMap.end()) {
228 ATH_MSG_FATAL("MuonTriggerScaleFactors::initialize(): histogram " << path << " is duplicated for year" << year << " in period " << periodName);
229 return StatusCode::FAILURE;
230 }
231 m_efficiencyMap.insert(std::pair<EffiHistoIdent, TH1_Ptr>(HistoId, std::shared_ptr < TH1 > (hist)));
232
233 }
234 //If the trigger is chosen for toy evaluation, generate all the replicas from
235 // NOMINAL with STAT variations stored in the data hist, load them in corresponding vector
236 if (m_replicaSet.find(triggerName) != m_replicaSet.end() && itype.find("data") != std::string::npos) {
237
238 TH1_Ptr Nominal_H = getEfficiencyHistogram(year, periodName, triggerName, isData, "nominal", isBarrel);
239 TH1_Ptr StatUp_H = getEfficiencyHistogram(year, periodName, triggerName, isData, "stat_up", isBarrel);
240
241 TH1_Ptr tmp_h2 = TH1_Ptr(dynamic_cast<TH2F*>(Nominal_H->Clone(Form("tmp_h2_%s", Nominal_H->GetName()))));
242 const int xbins = tmp_h2->GetNbinsX(), ybins = tmp_h2->GetNbinsY();
243 for (int x_i = 0; x_i <= xbins; ++x_i) {
244 for (int y_i = 0; y_i <= ybins; ++y_i) {
245 double statErr = std::abs(tmp_h2->GetBinContent(x_i, y_i) - StatUp_H->GetBinContent(x_i, y_i));
246 tmp_h2->SetBinError(x_i, y_i, statErr);
247 }
248 }
249 m_efficiencyMapReplicaArray[EffiHistoIdent(period, encodeHistoName(periodName, triggerName, isData, "repl", isBarrel))] = generateReplicas(tmp_h2, m_nReplicas, m_ReplicaRandomSeed);
250 }
251 }
252 }
253 }
254 }
255 file->Close();
256 delete file;
257 origDir->cd();
258 return StatusCode::SUCCESS;
259 }
#define ANA_MSG_INFO(xmsg,...)
Macro printing info messages.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
size_t size() const
Number of registered mappings.
Gaudi::Property< int > m_ReplicaRandomSeed
TDirectory * getTemporaryDirectory(void) const
std::vector< TH1_Ptr > generateReplicas(TH1_Ptr h, int nrep, int seed) const
Gaudi::Property< std::map< unsigned int, std::string > > m_customInputFilePerYear
path
python interpreter configuration --------------------------------------—
Definition athena.py:130
str filePath
Definition hancool.py:27
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
TFile * file

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg_level_name()

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

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

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

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

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

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

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ print()

◆ recommendedSystematics()

CP::SystematicSet CP::MuonTriggerScaleFactors::recommendedSystematics ( ) const
virtual

returns: the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 928 of file MuonTriggerScaleFactors.cxx.

928 {
929 return affectingSystematics();
930 }

◆ registerSystematics()

StatusCode CP::MuonTriggerScaleFactors::registerSystematics ( )
private

Definition at line 918 of file MuonTriggerScaleFactors.cxx.

918 {
919 CP::SystematicRegistry& registry = CP::SystematicRegistry::getInstance();
920 if (registry.registerSystematics(*this) != StatusCode::SUCCESS) {
921 ATH_MSG_ERROR("Failed to add systematic to list of recommended systematics.");
922 return StatusCode::FAILURE;
923 }
924 return StatusCode::SUCCESS;
925 }
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.

◆ 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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ sysInitialize()

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

Perform system initialization for an algorithm.

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

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

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

◆ updateVHKA()

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

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_allowZeroSF

Gaudi::Property<bool> CP::MuonTriggerScaleFactors::m_allowZeroSF {this, "AllowZeroSF", false, "if a trigger is not available will return 0 instead of throwing an error. More difficult to spot configuration issues. Use at own risk"}
private

Definition at line 124 of file MuonTriggerScaleFactors.h.

124{this, "AllowZeroSF", false, "if a trigger is not available will return 0 instead of throwing an error. More difficult to spot configuration issues. Use at own risk"};

◆ m_appliedSystematics

CP::SystematicSet* CP::MuonTriggerScaleFactors::m_appliedSystematics {}
private

Definition at line 111 of file MuonTriggerScaleFactors.h.

111{};

◆ m_binning

Gaudi::Property<std::string> CP::MuonTriggerScaleFactors::m_binning {this, "Binning", "fine", "the binning to use"}
private

Definition at line 122 of file MuonTriggerScaleFactors.h.

122{this, "Binning", "fine", "the binning to use"};

◆ m_calibrationVersion

Gaudi::Property<std::string> CP::MuonTriggerScaleFactors::m_calibrationVersion {this, "CalibrationVersion", "261003_FallUpdate", "the calibration version to use"}
private

Definition at line 119 of file MuonTriggerScaleFactors.h.

119{this, "CalibrationVersion", "261003_FallUpdate", "the calibration version to use"};

◆ m_campaign

Gaudi::Property<std::string> CP::MuonTriggerScaleFactors::m_campaign {this, "Campaign", "", "the MC campaign to get the scale factors for"}
private

Definition at line 116 of file MuonTriggerScaleFactors.h.

116{this, "Campaign", "", "the MC campaign to get the scale factors for"};

◆ m_customInputFilePerYear

Gaudi::Property<std::map<unsigned int, std::string> > CP::MuonTriggerScaleFactors::m_customInputFilePerYear {this, "CustomInputFilePerYear", {}, "the custom input file to use per year (debugging only)"}
private

Definition at line 121 of file MuonTriggerScaleFactors.h.

121{this, "CustomInputFilePerYear", {}, "the custom input file to use per year (debugging only)"};

◆ m_customInputFolder

Gaudi::Property<std::string> CP::MuonTriggerScaleFactors::m_customInputFolder {this, "CustomInputFolder", "", "the custom input folder to use (debugging only)"}
private

Definition at line 120 of file MuonTriggerScaleFactors.h.

120{this, "CustomInputFolder", "", "the custom input folder to use (debugging only)"};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_efficiencyMap

EfficiencyMap CP::MuonTriggerScaleFactors::m_efficiencyMap
private

Definition at line 112 of file MuonTriggerScaleFactors.h.

◆ m_efficiencyMapReplicaArray

std::map<EffiHistoIdent, std::vector<TH1_Ptr> > CP::MuonTriggerScaleFactors::m_efficiencyMapReplicaArray
private

Definition at line 113 of file MuonTriggerScaleFactors.h.

◆ m_eventInfo

SG::ReadHandleKey<xAOD::EventInfo> CP::MuonTriggerScaleFactors::m_eventInfo {this, "EventInfoContName", "EventInfo", "event info key"}
private

Definition at line 101 of file MuonTriggerScaleFactors.h.

101{this, "EventInfoContName", "EventInfo", "event info key"};

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_experimental

Gaudi::Property<bool> CP::MuonTriggerScaleFactors::m_experimental {this, "UseExperimental", false, "enable experimental features like single muon SF"}
private

Definition at line 125 of file MuonTriggerScaleFactors.h.

125{this, "UseExperimental", false, "enable experimental features like single muon SF"};

◆ m_forcePeriod

Gaudi::Property<std::string> CP::MuonTriggerScaleFactors::m_forcePeriod {this, "ForcePeriod", "", "Only for developers. Never use this in any analysis!!!!!!"}
private

Definition at line 127 of file MuonTriggerScaleFactors.h.

127{this, "ForcePeriod", "", "Only for developers. Never use this in any analysis!!!!!!"};

◆ m_forceYear

Gaudi::Property<int> CP::MuonTriggerScaleFactors::m_forceYear {this, "ForceYear", -1, "Only for developers. Never use this in any analysis!!!!!!"}
private

Definition at line 126 of file MuonTriggerScaleFactors.h.

126{this, "ForceYear", -1, "Only for developers. Never use this in any analysis!!!!!!"};

◆ m_muonQuality

Gaudi::Property<std::string> CP::MuonTriggerScaleFactors::m_muonQuality {this, "MuonQuality", "Medium", "the muon quality to get the scale factors for"}
private

Definition at line 115 of file MuonTriggerScaleFactors.h.

115{this, "MuonQuality", "Medium", "the muon quality to get the scale factors for"};

◆ m_nReplicas

Gaudi::Property<int> CP::MuonTriggerScaleFactors::m_nReplicas {this, "NReplicas", 100, "Number of generated toy replicas, if replicas are required."}
private

Definition at line 132 of file MuonTriggerScaleFactors.h.

132{this, "NReplicas", 100, "Number of generated toy replicas, if replicas are required."};

◆ m_ReplicaRandomSeed

Gaudi::Property<int> CP::MuonTriggerScaleFactors::m_ReplicaRandomSeed {this, "ReplicaRandomSeed", 12345, "Random seed for toy replica generation."}
private

Definition at line 133 of file MuonTriggerScaleFactors.h.

133{this, "ReplicaRandomSeed", 12345, "Random seed for toy replica generation."};

◆ m_replicaSet

std::set<std::string> CP::MuonTriggerScaleFactors::m_replicaSet
private

Definition at line 131 of file MuonTriggerScaleFactors.h.

◆ m_replicaTriggerList

Gaudi::Property<std::vector<std::string> > CP::MuonTriggerScaleFactors::m_replicaTriggerList {this, "ReplicaTriggerList", {}, "List of triggers on which we want to generate stat. uncertainty toy replicas."}
private

Definition at line 130 of file MuonTriggerScaleFactors.h.

130{this, "ReplicaTriggerList", {}, "List of triggers on which we want to generate stat. uncertainty toy replicas."};

◆ m_runNumber_year

const std::map< unsigned int, int > CP::MuonTriggerScaleFactors::m_runNumber_year
staticprivate
Initial value:
= {
{284484,2015},
{311481,2016},
{340453,2017},
{364292,2018},
{440613,2022},
{456749,2023},
{486706,2024},
{509849,2025}
}

Definition at line 136 of file MuonTriggerScaleFactors.h.

◆ m_systFilter

std::unordered_map<CP::SystematicSet, CP::SystematicSet> CP::MuonTriggerScaleFactors::m_systFilter
private

Definition at line 109 of file MuonTriggerScaleFactors.h.

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.

◆ m_year_periods

const std::map< unsigned short int, std::vector< std::tuple< unsigned int, unsigned int, std::string > > > CP::MuonTriggerScaleFactors::m_year_periods
staticprivate

Definition at line 137 of file MuonTriggerScaleFactors.h.


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