ATLAS Offline Software
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CP::EfficiencyScaleFactor Class Reference

#include <EfficiencyScaleFactor.h>

Collaboration diagram for CP::EfficiencyScaleFactor:

Public Member Functions

 EfficiencyScaleFactor (const MuonEfficiencyScaleFactors &ref_tool, const std::string &file, const std::string &time_unit)
 Nominal constructor to use having the measurement (Reco/TTVA/Iso/BadMuon) path to the scale-factor map & the time unit to consider. More...
 
 EfficiencyScaleFactor (std::shared_ptr< EfficiencyScaleFactor > nominal, const MuonEfficiencyScaleFactors &ref_tool, const std::string &file, const std::string &time_unit, const std::string &syst_name, int syst_type_bitmap)
 Constructor to use for systematic evaluations the nominal scale-factor is given as a fallback map in case the user want to activate uncorrelated systematic – a shared ptr is used to ensure that the map is always defined allthough the nominal container has been deleted somehow – the name of the systematic encodes the systematic to retrieve from the file. More...
 
 EfficiencyScaleFactor (const EfficiencyScaleFactor &)=delete
 Do not allow for copy constructors and other assignments of the class. More...
 
EfficiencyScaleFactoroperator= (const EfficiencyScaleFactor &)=delete
 
bool CheckConsistency ()
 check the consistency of the scale-factor map. More...
 
int nBins () const
 How many bins does the scale-factor map have. More...
 
std::string GetBinName (int bin) const
 Returns the name of the bin using the axis title from the scale-factor map. More...
 
int nOverFlowBins () const
 Number of overflow bins in the map. More...
 
bool isOverFlowBin (int b) const
 Check whether the bin is overflow or not. More...
 
int FindBinSF (const xAOD::Muon &mu) const
 Finds the bin to which the muon corresponds to. More...
 
bool SetSystematicBin (int bin)
 This function will let the world implode since it allows to decorrelate the sysstematics bin by bin. More...
 
bool separateBinSyst () const
 
bool IsUpVariation () const
 
CorrectionCode ScaleFactor (const xAOD::Muon &mu, float &SF) const
 the important bits - extract SF info More...
 
CorrectionCode ScaleFactorReplicas (const xAOD::Muon &mu, std::vector< float > &SF)
 
CorrectionCode ApplyScaleFactor (const xAOD::Muon &mu) const
 or you can just decorate the scale-factor to the muon More...
 
CorrectionCode ApplyScaleFactorReplicas (const xAOD::Muon &mu, int n_replicas)
 
CorrectionCode DataEfficiency (const xAOD::Muon &mu, float &Eff) const
 ... and absolute efficiencies More...
 
CorrectionCode DataEfficiencyReplicas (const xAOD::Muon &mu, std::vector< float > &eff)
 
CorrectionCode ApplyDataEfficiency (const xAOD::Muon &mu) const
 You can decorate the data efficiecny as well. More...
 
CorrectionCode ApplyDataEfficiencyReplicas (const xAOD::Muon &mu, int n_replicas)
 
CorrectionCode MCEfficiency (const xAOD::Muon &mu, float &Eff) const
 ... mc efficiency More...
 
CorrectionCode MCEfficiencyReplicas (const xAOD::Muon &mu, std::vector< float > &eff)
 
CorrectionCode ApplyMCEfficiency (const xAOD::Muon &mu) const
 ... or decorate them directly More...
 
CorrectionCode ApplyMCEfficiencyReplicas (const xAOD::Muon &mu, int n_replicas)
 
void DebugPrint () const
 debug method More...
 
std::string sysname (bool with_direction=true) const
 A string having the full name of the systematic including the measurement. More...
 
unsigned int firstRun () const
 First run to which the map belongs to. More...
 
unsigned int lastRun () const
 Last run to which the map belongs to. The last run number is given exclusvely... More...
 
bool coversRunNumber (unsigned int run) const
 Check if a run of data-taking is covered by this map. More...
 
void setFirstLastRun (unsigned int first, unsigned int last)
 Set the run-number coverage. More...
 

Private Types

typedef std::vector< std::unique_ptr< HistHandler > > SFReplicaVec
 
typedef SG::AuxElement::Decorator< float > FloatDecorator
 Typedef to make the definition of the follow decorators a bit shorted. More...
 
typedef SG::AuxElement::Decorator< std::vector< float > > FloatVectorDecorator
 

Private Member Functions

bool ReadFromFile (const std::string &file, const std::string &time_unit)
 Read SF histrograms from a given input file. More...
 
std::unique_ptr< HistHandlerReadHistFromFile (const std::string &name, TFile *f, const std::string &time_unit)
 
CorrectionCode GetContentFromHist (const HistHandler *Hist, const xAOD::Muon &mu, float &SF, bool add_kine_syst) const
 read the content of the correct bin in one of my histos. MCefficiencies actually do not need a pt-dependet systematic More...
 
CorrectionCode GetContentReplicasFromHist (EfficiencyScaleFactor::SFReplicaVec &replicas, const xAOD::Muon &mu, std::vector< float > &SF, bool add_kine_syst)
 read a vector of replica contents in the correct bin in one of my histos More...
 
std::unique_ptr< HistHandlerpackage_histo (TH1 *h)
 
void GenerateReplicas (int nrep, int seed)
 
void GenerateReplicasFromHist (HistHandler *h, int nrep, int seed, EfficiencyScaleFactor::SFReplicaVec &repVector)
 

Private Attributes

CP::MuonEfficiencyType m_measurement
 Section of variables of the tool. More...
 
std::string m_syst_name
 
bool m_is_up
 Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not empty. More...
 
bool m_is_lowpt
 states that this SF should respond to low pt systematics rather than high pt ones More...
 
bool m_respond_to_kineDepSyst
 steers the pt dependent systematics More...
 
bool m_separateBinSyst
 Can the systematic be decorrelated. More...
 
std::unique_ptr< HistHandlerm_sf
 the histograms needed to run More...
 
std::unique_ptr< HistHandlerm_eff
 
std::unique_ptr< HistHandlerm_mc_eff
 
std::unique_ptr< FloatDecoratorm_sf_decor
 
std::unique_ptr< FloatDecoratorm_eff_decor
 
std::unique_ptr< FloatDecoratorm_mc_eff_decor
 
std::unique_ptr< FloatVectorDecoratorm_sf_rep_decor
 
std::unique_ptr< FloatVectorDecoratorm_eff_rep_decor
 
std::unique_ptr< FloatVectorDecoratorm_mc_eff_rep_decor
 
std::unique_ptr< IKinematicSystHandlerm_sf_KineDepsys
 
SFReplicaVec m_sf_replicas
 replicas, in case we use them More...
 
SFReplicaVec m_eff_replicas
 
SFReplicaVec m_mc_eff_replicas
 
std::shared_ptr< EfficiencyScaleFactorm_NominalFallBack
 Nominal fall-back scale-factor. More...
 
int m_SystematicBin
 
float m_default_eff
 default efficiency value (in case of OutOfValidityRange) More...
 
float m_default_eff_ttva
 default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5) More...
 
std::atomic< unsigned int > m_warnsPrinted
 
unsigned int m_firstRun
 
unsigned int m_lastRun
 

Static Private Attributes

static const unsigned int m_warningLimit = 10
 

Detailed Description

Definition at line 35 of file EfficiencyScaleFactor.h.

Member Typedef Documentation

◆ FloatDecorator

Typedef to make the definition of the follow decorators a bit shorted.

Definition at line 184 of file EfficiencyScaleFactor.h.

◆ FloatVectorDecorator

Definition at line 185 of file EfficiencyScaleFactor.h.

◆ SFReplicaVec

typedef std::vector<std::unique_ptr<HistHandler> > CP::EfficiencyScaleFactor::SFReplicaVec
private

Definition at line 141 of file EfficiencyScaleFactor.h.

Constructor & Destructor Documentation

◆ EfficiencyScaleFactor() [1/3]

EfficiencyScaleFactor::EfficiencyScaleFactor ( const MuonEfficiencyScaleFactors ref_tool,
const std::string &  file,
const std::string &  time_unit 
)

Nominal constructor to use having the measurement (Reco/TTVA/Iso/BadMuon) path to the scale-factor map & the time unit to consider.

Definition at line 173 of file EfficiencyScaleFactor.cxx.

175  :
176  EfficiencyScaleFactor(std::shared_ptr<EfficiencyScaleFactor>(),
177  ref_tool,file, time_unit, "",0){}

◆ EfficiencyScaleFactor() [2/3]

EfficiencyScaleFactor::EfficiencyScaleFactor ( std::shared_ptr< EfficiencyScaleFactor nominal,
const MuonEfficiencyScaleFactors ref_tool,
const std::string &  file,
const std::string &  time_unit,
const std::string &  syst_name,
int  syst_type_bitmap 
)

Constructor to use for systematic evaluations the nominal scale-factor is given as a fallback map in case the user want to activate uncorrelated systematic – a shared ptr is used to ensure that the map is always defined allthough the nominal container has been deleted somehow – the name of the systematic encodes the systematic to retrieve from the file.

To ensure backwards compability with older files the names "STAT" and "SYS" refer to the total systematic

Nominal set loaded nothing needs to be done further

Asking for the total systematic... May be the current file does not support the asymmetric break-down yet. Let's try the good old approach and load the total sys histogram

Not even the old approach lead to something fruitful... Lets forget it and reset everything

Stat error can be retrieved from the nominal histogram itself

This systematic name is reserved for the kinematic histhandler

Some other systematic is asked for... Failure

Apply the systematic variations

Thus far there're no kinematic dependent systematics for low-pt

As well as for the high-eta range.

Load the pt_dependent systematics if needed

Old format of the pt-dependent systematic loaded

Now it comes to the new format

That one needs to be named properly in the future

Use the approach from the old sacle-factor file

Definition at line 12 of file EfficiencyScaleFactor.cxx.

17  :
18  m_measurement(ref_tool.measurement()),
19  m_syst_name(syst_name),
20  m_is_up(syst_type_bitmap & EffiCollection::UpVariation),
21  m_is_lowpt(syst_type_bitmap & EffiCollection::JPsiAnalysis),
24  m_sf(),
25  m_eff(),
26  m_mc_eff(),
27 
28  m_sf_decor(std::make_unique<FloatDecorator>(ref_tool.sf_decoration()+ (m_syst_name.empty()? "" :"_"+ m_syst_name + (m_is_up? "_1UP": "_1DN")))),
29  m_eff_decor(std::make_unique<FloatDecorator>(ref_tool.data_effi_decoration()+ (m_syst_name.empty()? "" :"_"+ m_syst_name + (m_is_up? "_1UP": "_1DN")))),
30  m_mc_eff_decor(std::make_unique<FloatDecorator>(ref_tool.mc_effi_decoration()+ (m_syst_name.empty()? "" :"_"+ m_syst_name + (m_is_up? "_1UP": "_1DN")))),
31  m_sf_rep_decor(std::make_unique<FloatVectorDecorator>(ref_tool.sf_replica_decoration()+ (m_syst_name.empty()? "" :"_"+ m_syst_name + (m_is_up? "_1UP": "_1DN")))),
32  m_eff_rep_decor(std::make_unique<FloatVectorDecorator>(ref_tool.data_effi_replica_decoration()+ (m_syst_name.empty()? "" :"_"+ m_syst_name + (m_is_up? "_1UP": "_1DN")))),
33  m_mc_eff_rep_decor(std::make_unique<FloatVectorDecorator>(ref_tool.mc_effi_replica_deocration()+ (m_syst_name.empty()? "" :"_"+ m_syst_name + (m_is_up? "_1UP": "_1DN")))),
34 
36  m_sf_replicas(),
39  m_NominalFallBack(nominal),
40  m_SystematicBin(-1),
41  m_default_eff(1.),
43  m_warnsPrinted(0),
44  m_firstRun(1),
45  m_lastRun(999999){
46 
47  if (ref_tool.measurement() == CP::MuonEfficiencyType::Iso){
48  dRJetAxisHandler::set_close_jet_decorator(ref_tool.close_by_jet_decoration());
49  dRJetAxisHandler::set_use_2D_sf(ref_tool.use_2D_iso_corrections());
50  }
51  // open the file
52  std::unique_ptr<TFile> f (TFile::Open(file.c_str(), "READ"));
53  if (!f || !f->IsOpen()) {
54  Error("EfficiencyScaleFactor", "Unable to open file %s", file.c_str());
55  return;
56  }
57  // now we can read our three mean histograms Histos
58  m_eff = ReadHistFromFile("Eff", f.get(), time_unit);
59  m_mc_eff = ReadHistFromFile("MC_Eff", f.get(), time_unit);
60  m_sf = ReadHistFromFile("SF", f.get(), time_unit);
62  if (syst_name.empty()) return;
63 
64 
65  if (IsUpVariation()){
66  m_default_eff = 2.;
67  m_default_eff_ttva = 1. + 1.e-9;
68  } else {
69  m_default_eff = 0.;
70  m_default_eff_ttva = 1. - 1.e-9;
71  }
72  std::function<void(std::unique_ptr<HistHandler>&, const std::string& )> syst_loader = [this, &f, &time_unit, &syst_type_bitmap] (std::unique_ptr<HistHandler>& nominal, const std::string& hist_type) {
73  if(!nominal) return;
74  std::unique_ptr<HistHandler> sys = ReadHistFromFile(Form("%s_%s_%s", hist_type.c_str() ,
75  m_syst_name.c_str(),
76  (syst_type_bitmap & EffiCollection::Symmetric ? "SYM" : (m_is_up ? "1UP" : "1DN")) ),
77  f.get(), time_unit);
78  if (sys) {
79  for (int i = 1; i <= nominal->nBins(); ++i) {
80  double content = nominal->GetBinContent(i);
81  double variation = (IsUpVariation() ? 1. : -1.)*sys->GetBinContent(i);
82  nominal->SetBinContent(i,content + variation);
83  }
84  return;
85  }
89  if (m_syst_name == "SYS"){
90  std::unique_ptr<HistHandler> old_sys = ReadHistFromFile(hist_type +"_sys", f.get(), time_unit);
92  if (!old_sys){
93  nominal.reset();
94  return;
95  }
96 
97  for (int i = 1; i<= nominal->nBins(); ++i) {
98  nominal->SetBinContent(i, nominal->GetBinContent(i) + (IsUpVariation() ? 1. : -1.)*old_sys->GetBinContent(i));
99  }
100  }
102  else if (m_syst_name == "STAT") {
103  for (int i = 1; i<= nominal->nBins(); ++i) {
104  nominal->SetBinContent(i, nominal->GetBinContent(i) + (IsUpVariation() ? 1. : -1.)*nominal->GetBinError(i));
105  }
106  }
108  else if (m_syst_name == "PTDEPENDENCY"){
109  return;
110  }
112  else{
113  Error("EfficiencyScaleFactor()", "Failed to load sytstematic variation %s for measurement %s and histo-type %s", sysname(true).c_str(),
114  EfficiencyTypeName(m_measurement).c_str(),
115  hist_type.c_str());
116  nominal.reset();
117  }
118  };
120  syst_loader(m_sf,"SF");
121  syst_loader(m_eff,"Eff");
122  syst_loader(m_mc_eff,"MC_Eff");
123 
125  if (m_is_lowpt || (file == ref_tool.filename_HighEta() && ref_tool.filename_HighEta() != ref_tool.filename_Central()) ||
126  (file == ref_tool.filename_Calo() && ref_tool.filename_Calo() != ref_tool.filename_Central())) m_respond_to_kineDepSyst =false;
128 
131  return;
132  }
133  // Load the systematic of the bad veto
135  TDirectory* SystDir = nullptr;
136  f->GetObject(("KinematicSystHandler_" + time_unit).c_str(), SystDir);
138  if (SystDir) {
139  m_sf_KineDepsys = std::make_unique<BadMuonVetoSystHandler>(SystDir);
140  } else {
142  f->GetObject("BadMuonVetoSyst_3Stations", SystDir);
143  TDirectory* SystDir_2Stat = nullptr;
144  f->GetObject("BadMuonVetoSyst_2Stations", SystDir_2Stat);
145  m_sf_KineDepsys = std::make_unique<BadMuonVetoSystHandler>(SystDir, SystDir_2Stat);
146  }
147  m_sf_KineDepsys->SetSystematicWeight( IsUpVariation() ? 1 : -1);
148  if (!m_sf_KineDepsys->initialize()){
149  Error("EfficiencyScaleFactor()", "Pt dependent systematic could not be loaded");
150  m_sf_KineDepsys.reset();
151  }
152  return;
154  m_sf_KineDepsys = std::make_unique<TTVAClosureSysHandler>(ReadHistFromFile("SF_NonClosure_sys",f.get(),time_unit));
155  if (!m_sf_KineDepsys->initialize()){
156  Error("EfficiencyScaleFactor()", "TTVA non closure systematic could not be loaded.");
157  m_sf_KineDepsys.reset();
158  }
159  else
160  m_sf_KineDepsys->SetSystematicWeight( IsUpVariation() ? 1 : -1);
161  return;
162 
163  }
165  m_sf_KineDepsys = std::make_unique<PtKinematicSystHandler>(ReadHistFromFile(Form("SF_PtFlatness_1%s", m_is_up?"UP" :"DN"), f.get(), time_unit), ReadHistFromFile("SF_PtDep_sys", f.get(), time_unit));
166 
168  if(!m_sf_KineDepsys->initialize()){
169  m_sf_KineDepsys = std::make_unique<PrimodialPtSystematic>(ReadHistFromFile("SF_PtDep_sys", f.get(), time_unit));
170  }
171  m_sf_KineDepsys->SetSystematicWeight( IsUpVariation() ? 1 : -1);
172  }

◆ EfficiencyScaleFactor() [3/3]

CP::EfficiencyScaleFactor::EfficiencyScaleFactor ( const EfficiencyScaleFactor )
delete

Do not allow for copy constructors and other assignments of the class.

Member Function Documentation

◆ ApplyDataEfficiency()

CorrectionCode EfficiencyScaleFactor::ApplyDataEfficiency ( const xAOD::Muon mu) const

You can decorate the data efficiecny as well.

Definition at line 379 of file EfficiencyScaleFactor.cxx.

379  {
380  float effi = 0;
381  CorrectionCode result = DataEfficiency(mu, effi);
382  (*m_eff_decor)(mu) = effi;
383  return result;
384  }

◆ ApplyDataEfficiencyReplicas()

CorrectionCode EfficiencyScaleFactor::ApplyDataEfficiencyReplicas ( const xAOD::Muon mu,
int  n_replicas 
)

Definition at line 385 of file EfficiencyScaleFactor.cxx.

385  {
386  std::vector<float> replicas(n_replicas);
387  CorrectionCode result = DataEfficiencyReplicas(mu, replicas);
388  (*m_eff_rep_decor)(mu) = replicas;
389  return result;
390  }

◆ ApplyMCEfficiency()

CorrectionCode EfficiencyScaleFactor::ApplyMCEfficiency ( const xAOD::Muon mu) const

... or decorate them directly

Definition at line 391 of file EfficiencyScaleFactor.cxx.

391  {
392  float effi = 0;
393  CorrectionCode result = MCEfficiency(mu, effi);
394  (*m_mc_eff_decor)(mu) = effi;
395  return result;
396  }

◆ ApplyMCEfficiencyReplicas()

CorrectionCode EfficiencyScaleFactor::ApplyMCEfficiencyReplicas ( const xAOD::Muon mu,
int  n_replicas 
)

Definition at line 397 of file EfficiencyScaleFactor.cxx.

397  {
398  std::vector<float> replicas(n_replicas);
399  CorrectionCode result = MCEfficiencyReplicas(mu, replicas);
400  (*m_mc_eff_rep_decor)(mu) = replicas;
401  return result;
402  }

◆ ApplyScaleFactor()

CorrectionCode EfficiencyScaleFactor::ApplyScaleFactor ( const xAOD::Muon mu) const

or you can just decorate the scale-factor to the muon

Definition at line 366 of file EfficiencyScaleFactor.cxx.

366  {
367  float sf = 0;
368  CorrectionCode result = ScaleFactor(mu, sf);
369  (*m_sf_decor)(mu) = sf;
370  return result;
371  }

◆ ApplyScaleFactorReplicas()

CorrectionCode EfficiencyScaleFactor::ApplyScaleFactorReplicas ( const xAOD::Muon mu,
int  n_replicas 
)

Definition at line 372 of file EfficiencyScaleFactor.cxx.

372  {
373  std::vector<float> replicas(n_replicas);
374  CorrectionCode result = ScaleFactorReplicas(mu, replicas);
375  (*m_sf_rep_decor)(mu)= replicas;
376  return result;
377  }

◆ CheckConsistency()

bool EfficiencyScaleFactor::CheckConsistency ( )

check the consistency of the scale-factor map.

Needed histograms should be defined and the nominal fall back map is assigned properly as well as the map has a valid run number range

The histogram is simply not loaded which is fine since only the scale-factor is required

Definition at line 201 of file EfficiencyScaleFactor.cxx.

201  {
202  //Check whether the SFs could be successfully loaded
203  if (!m_sf) {
204  Error("EfficiencyScaleFactor()", "Could not load the SF for measurement %s and systematic %s",EfficiencyTypeName(m_measurement).c_str(), sysname().c_str());
205  return false;
206  }
207  if (m_respond_to_kineDepSyst && !m_sf_KineDepsys->initialize()) {
208  Error("EfficiencyScaleFactor()", "Could not load the SF pt-dependent systematic for %s and systematic %s", EfficiencyTypeName(m_measurement).c_str(), sysname().c_str() );
209  return false;
210  }
211  if (m_NominalFallBack.get() == this) {
212  Error("EfficiencyScaleFactor()", "The EfficiencyScaleFactor %s has itself as Nominal Fall back.", EfficiencyTypeName(m_measurement).c_str());
213  m_NominalFallBack.reset();
214  return false;
215  }
216  if (m_NominalFallBack) {
217  if (!m_NominalFallBack->sysname().empty() || sysname().empty()){
218  Error("EfficiencyScaleFactor()", "Either nominal is assigned with a fall back (%s) or the nominal fall back is invald(%s).", sysname().c_str(), m_NominalFallBack->sysname().c_str() );
219  return false;
220  }
221  }
222  if (firstRun() > lastRun()){
223  Error("EfficiencyScaleFactor()", "Invalid run number range. Since the map is ranging from %u to %u.", firstRun(), lastRun());
224  return false;
225  }
226  std::function<bool(const std::unique_ptr<HistHandler>&)> consistent_histo = [](const std::unique_ptr<HistHandler>& histo)->bool{
229  if (!histo) return true;
230  for ( int i = 1; i <= histo->nBins(); ++i){
231  if (std::isnan(histo->GetBinContent(i)) || std::isinf(histo->GetBinContent(i))){
232  Error("EfficiencyScaleFactor()", "The %d-th bin %s has not a number (%f)",i, histo->GetBinName(i).c_str(), histo->GetBinContent(i));
233  return false;
234  }
235  }
236  return true;
237  };
238  if (!consistent_histo(m_sf)){
239  Error("EfficiencyScaleFactor()", "Invalid scalefactor in %s", sysname().c_str());
240  return false;
241  }
242  if (!consistent_histo(m_eff)){
243  Error("EfficiencyScaleFactor()", "Invalid data-efficiency in %s", sysname().c_str());
244  return false;
245  }
246  if (!consistent_histo(m_mc_eff)){
247  Error("EfficiencyScaleFactor()", "Invalid MC-efficiency in %s", sysname().c_str());
248  return false;
249  }
250  return true;
251  }

◆ coversRunNumber()

bool EfficiencyScaleFactor::coversRunNumber ( unsigned int  run) const

Check if a run of data-taking is covered by this map.

Definition at line 194 of file EfficiencyScaleFactor.cxx.

194  {
195  return m_firstRun <= run && run <= m_lastRun;
196  }

◆ DataEfficiency()

CorrectionCode EfficiencyScaleFactor::DataEfficiency ( const xAOD::Muon mu,
float &  Eff 
) const

... and absolute efficiencies

Definition at line 308 of file EfficiencyScaleFactor.cxx.

308  {
310  int bin = -1;
311  CorrectionCode cc = m_eff->FindBin(mu, bin);
312  if (cc == CP::CorrectionCode::Error) {
313  return cc;
314  }
315  if (bin != m_SystematicBin) {
316  return m_NominalFallBack->DataEfficiency(mu, Eff);
317  }
318  }
319  CorrectionCode cc = GetContentFromHist(m_eff.get(), mu, Eff, true);
320  if (cc == CorrectionCode::Error) Error("EfficiencyScaleFactor", "Could not apply the data efficiency");
321  return cc;
322  }

◆ DataEfficiencyReplicas()

CorrectionCode EfficiencyScaleFactor::DataEfficiencyReplicas ( const xAOD::Muon mu,
std::vector< float > &  eff 
)

Definition at line 406 of file EfficiencyScaleFactor.cxx.

406  {
408  }

◆ DebugPrint()

void CP::EfficiencyScaleFactor::DebugPrint ( ) const

debug method

◆ FindBinSF()

int EfficiencyScaleFactor::FindBinSF ( const xAOD::Muon mu) const

Finds the bin to which the muon corresponds to.

Definition at line 481 of file EfficiencyScaleFactor.cxx.

481  {
482  int bin = -1;
483  CorrectionCode cc = m_sf->FindBin(mu, bin);
484  if (cc == CP::CorrectionCode::Error) {
485  return -1;
486  }
487  return bin;
488  }

◆ firstRun()

unsigned int EfficiencyScaleFactor::firstRun ( ) const

First run to which the map belongs to.

If the measurement is not carried out in time then it's usally 1

Definition at line 188 of file EfficiencyScaleFactor.cxx.

188  {
189  return m_firstRun;
190  }

◆ GenerateReplicas()

void EfficiencyScaleFactor::GenerateReplicas ( int  nrep,
int  seed 
)
private

Definition at line 440 of file EfficiencyScaleFactor.cxx.

440  {
441  GenerateReplicasFromHist(m_eff.get(), nrep, seed, m_eff_replicas);
442  GenerateReplicasFromHist(m_sf.get(), nrep, seed, m_sf_replicas);
444  }

◆ GenerateReplicasFromHist()

void EfficiencyScaleFactor::GenerateReplicasFromHist ( HistHandler h,
int  nrep,
int  seed,
EfficiencyScaleFactor::SFReplicaVec repVector 
)
private

Definition at line 445 of file EfficiencyScaleFactor.cxx.

445  {
446  if (!h) return;
447  TRandom3 Rndm(seed);
448  replicas.clear();
449  replicas.reserve(nrep);
450  int nBins = h->nBins();
451  for (int t = 0; t < nrep; t++) {
452  replicas.push_back(package_histo(h->GetHist()));
453  HistHandler* replica = replicas.back().get();
454  for (int bin = 0; bin < nBins; bin++) {
455  replica->SetBinContent(bin, Rndm.Gaus(h->GetBinContent(bin), h->GetBinError(bin)));
456  }
457  }
458  }

◆ GetBinName()

std::string EfficiencyScaleFactor::GetBinName ( int  bin) const

Returns the name of the bin using the axis title from the scale-factor map.

Definition at line 473 of file EfficiencyScaleFactor.cxx.

473  {
474  if (bin < 1 || bin > nBins()) {
475  Error("EfficiencyScaleFactor::GetBinName()", "The current bin %i is out of the maximum range %u ", bin, nBins());
476  return "Out of range";
477  }
478  return m_sf->GetBinName(bin);
479  }

◆ GetContentFromHist()

CorrectionCode EfficiencyScaleFactor::GetContentFromHist ( const HistHandler Hist,
const xAOD::Muon mu,
float &  SF,
bool  add_kine_syst 
) const
private

read the content of the correct bin in one of my histos. MCefficiencies actually do not need a pt-dependet systematic

Definition at line 339 of file EfficiencyScaleFactor.cxx.

339  {
340  Eff = m_default_eff;
341  if (!Hist) {
343  Warning("EfficiencyScaleFactor", "Could not find histogram for variation %s and muon with pt=%.4f, eta=%.2f and phi=%.2f, returning %.1f", sysname().c_str(), mu.pt(), mu.eta(), mu.phi(), m_default_eff);
344  ++m_warnsPrinted;
345  }
347  }
348  if (m_measurement == CP::MuonEfficiencyType::TTVA && std::abs(mu.eta()) > 2.5 && std::abs(mu.eta()) <= 2.7 && mu.muonType() == xAOD::Muon::MuonType::MuonStandAlone) {
350  Info("EfficiencyScaleFactor", "No TTVA sf/efficiency provided for standalone muons with 2.5<|eta|<2.7 for variation %s and muon with pt=%.4f, eta=%.2f and phi=%.2f, returning %.1f", sysname().c_str(), mu.pt(), mu.eta(), mu.phi(), m_default_eff_ttva);
351  ++m_warnsPrinted;
352  }
353  Eff = m_default_eff_ttva;
354  return CorrectionCode::Ok;
355  }
356  int bin = -1;
357  CorrectionCode cc = Hist->FindBin(mu, bin);
358  if (cc != CorrectionCode::Ok) return cc;
359  else Eff = Hist->GetBinContent(bin);
360 
361  if (add_kine_syst && m_respond_to_kineDepSyst) {
362  return m_sf_KineDepsys->GetKineDependent(mu, Eff);
363  }
364  return CorrectionCode::Ok;
365  }

◆ GetContentReplicasFromHist()

CorrectionCode EfficiencyScaleFactor::GetContentReplicasFromHist ( EfficiencyScaleFactor::SFReplicaVec replicas,
const xAOD::Muon mu,
std::vector< float > &  SF,
bool  add_kine_syst 
)
private

read a vector of replica contents in the correct bin in one of my histos

Definition at line 412 of file EfficiencyScaleFactor.cxx.

412  {
413  if (replicas.size() != SF.size()) GenerateReplicas(SF.size(), 1000. * mu.phi() + mu.eta());
414  if (replicas.empty()) return CorrectionCode::OutOfValidityRange;
415  if (m_measurement == CP::MuonEfficiencyType::TTVA && std::abs(mu.eta()) > 2.5 && std::abs(mu.eta()) <= 2.7 && mu.muonType() == xAOD::Muon::MuonType::MuonStandAlone) {
417  Info("EfficiencyScaleFactor", "No TTVA sf/efficiency provided for standalone muons with 2.5<|eta|<2.7 for variation %s and muon with pt=%.4f, eta=%.2f and phi=%.2f, returning %.1f", sysname().c_str(), mu.pt(), mu.eta(), mu.phi(), m_default_eff_ttva);
418  ++m_warnsPrinted;
419  }
420  for (auto& r : SF)
422  return CorrectionCode::Ok;
423  }
424  int bin = -1;
425  float extra_sys = 1;
426  if (add_kine_syst && m_respond_to_kineDepSyst) {
427  CorrectionCode cc = m_sf_KineDepsys->GetKineDependent(mu, extra_sys);
428  if (cc != CorrectionCode::Ok) {}
429  }
430 
431  CorrectionCode res = (*replicas.begin())->FindBin(mu, bin);
432  if (res != CorrectionCode::Ok) return res;
433  else {
434  for (size_t k = 0; k < SF.size(); k++) {
435  SF[k] = replicas.at(k)->GetBinContent(bin) * extra_sys;
436  }
437  }
438  return res;
439  }

◆ isOverFlowBin()

bool EfficiencyScaleFactor::isOverFlowBin ( int  b) const

Check whether the bin is overflow or not.

Definition at line 289 of file EfficiencyScaleFactor.cxx.

289  {
290  return m_sf ? m_sf->isOverFlowBin(b) : true;
291  }

◆ IsUpVariation()

bool EfficiencyScaleFactor::IsUpVariation ( ) const

Definition at line 185 of file EfficiencyScaleFactor.cxx.

185  {
186  return m_is_up;
187  }

◆ lastRun()

unsigned int EfficiencyScaleFactor::lastRun ( ) const

Last run to which the map belongs to. The last run number is given exclusvely...

Definition at line 191 of file EfficiencyScaleFactor.cxx.

191  {
192  return m_lastRun;
193  }

◆ MCEfficiency()

CorrectionCode EfficiencyScaleFactor::MCEfficiency ( const xAOD::Muon mu,
float &  Eff 
) const

... mc efficiency

Definition at line 323 of file EfficiencyScaleFactor.cxx.

323  {
325  int bin = -1;
326  CorrectionCode cc = m_mc_eff->FindBin(mu, bin);
327  if (cc == CP::CorrectionCode::Error) {
328  return cc;
329  }
330  if (bin != m_SystematicBin) {
331  return m_NominalFallBack->MCEfficiency(mu, Eff);
332  }
333  }
334  CorrectionCode cc = GetContentFromHist(m_mc_eff.get(), mu, Eff, false);
335  if (cc == CorrectionCode::Error) Error("EfficiencyScaleFactor", "Could not apply the Monte Carlo efficiency");
336  return cc;
337  }

◆ MCEfficiencyReplicas()

CorrectionCode EfficiencyScaleFactor::MCEfficiencyReplicas ( const xAOD::Muon mu,
std::vector< float > &  eff 
)

Definition at line 409 of file EfficiencyScaleFactor.cxx.

409  {
411  }

◆ nBins()

int EfficiencyScaleFactor::nBins ( ) const

How many bins does the scale-factor map have.

Only the bins of the primary map are counted. If the map has an extra kinematic systematic on top, these bins cannot be resolved at the moment

Definition at line 283 of file EfficiencyScaleFactor.cxx.

283  {
284  return m_sf ? m_sf->nBins() : -1;
285  }

◆ nOverFlowBins()

int EfficiencyScaleFactor::nOverFlowBins ( ) const

Number of overflow bins in the map.

Definition at line 286 of file EfficiencyScaleFactor.cxx.

286  {
287  return m_sf ? m_sf->nOverFlowBins() : -1;
288  }

◆ operator=()

EfficiencyScaleFactor& CP::EfficiencyScaleFactor::operator= ( const EfficiencyScaleFactor )
delete

◆ package_histo()

std::unique_ptr< HistHandler > EfficiencyScaleFactor::package_histo ( TH1 *  h)
private

Definition at line 267 of file EfficiencyScaleFactor.cxx.

267  {
268  // make sure that the correct type of histo is used
269  // Dynamic cast for TH2 Poly otherwise we can rely on the GetDimension() ,ethod
270  if (!h) return std::unique_ptr<HistHandler>();
271  if (dynamic_cast<TH2Poly*>(h)) {
272  return std::make_unique<HistHandler_TH2Poly>(dynamic_cast<TH2Poly*>(h));
273  }else if (h->GetDimension() == 3) {
274  return std::make_unique<HistHandler_TH3>(h);
275  }else if (h->GetDimension() == 2) {
276  return std::make_unique<HistHandler_TH2>(h);
277  } else if (h->GetDimension() == 1) {
278  return std::make_unique<HistHandler_TH1>(h);
279  }
280  Error("EfficiencyScaleFactor", "Unable to package histo %s (%s) in a known HistHandler", h->GetName(), h->IsA()->GetName());
281  return std::unique_ptr<HistHandler>();
282  }

◆ ReadFromFile()

bool CP::EfficiencyScaleFactor::ReadFromFile ( const std::string &  file,
const std::string &  time_unit 
)
private

Read SF histrograms from a given input file.

◆ ReadHistFromFile()

std::unique_ptr< HistHandler > EfficiencyScaleFactor::ReadHistFromFile ( const std::string &  name,
TFile *  f,
const std::string &  time_unit 
)
private

Definition at line 252 of file EfficiencyScaleFactor.cxx.

252  {
253 
254  TH1* hist_from_file = nullptr;
255 
256  f->GetObject((name + std::string("_") + time_unit).c_str(), hist_from_file);
257  // if no period weighting, the histo may also not have a time period in the name at all
258 
259  if (!hist_from_file && time_unit == "All") {
260  f->GetObject(name.c_str(), hist_from_file);
261  }
262  if (!hist_from_file) {
263  return std::unique_ptr<HistHandler>();
264  }
265  return package_histo(hist_from_file);
266  }

◆ ScaleFactor()

CorrectionCode EfficiencyScaleFactor::ScaleFactor ( const xAOD::Muon mu,
float &  SF 
) const

the important bits - extract SF info

scale factors...

Definition at line 292 of file EfficiencyScaleFactor.cxx.

292  {
294  int bin = -1;
295  CorrectionCode cc = m_sf->FindBin(mu, bin);
296  if (cc == CP::CorrectionCode::Error) {
297  return cc;
298  }
299  if (bin != m_SystematicBin) {
300  return m_NominalFallBack->ScaleFactor(mu, SF);
301  }
302  }
303  CorrectionCode cc = GetContentFromHist(m_sf.get(), mu, SF, true);
304  if (cc == CorrectionCode::Error) Error("EfficiencyScaleFactor", "Could not apply the scale factor");
305  return cc;
306  }

◆ ScaleFactorReplicas()

CorrectionCode EfficiencyScaleFactor::ScaleFactorReplicas ( const xAOD::Muon mu,
std::vector< float > &  SF 
)

Definition at line 403 of file EfficiencyScaleFactor.cxx.

403  {
405  }

◆ separateBinSyst()

bool EfficiencyScaleFactor::separateBinSyst ( ) const

Definition at line 182 of file EfficiencyScaleFactor.cxx.

182  {
183  return m_separateBinSyst;
184  }

◆ setFirstLastRun()

void EfficiencyScaleFactor::setFirstLastRun ( unsigned int  first,
unsigned int  last 
)

Set the run-number coverage.

Definition at line 197 of file EfficiencyScaleFactor.cxx.

197  {
198  m_firstRun = first;
199  m_lastRun = last;
200  }

◆ SetSystematicBin()

bool EfficiencyScaleFactor::SetSystematicBin ( int  bin)

This function will let the world implode since it allows to decorrelate the sysstematics bin by bin.

Definition at line 460 of file EfficiencyScaleFactor.cxx.

460  {
461  if (m_syst_name.empty()) return true;
462  if (!m_NominalFallBack) {
463  Error("EfficiencyScaleFactor::SetSystematicBin()", "No fallback has been given for %s", sysname().c_str());
464  return false;
465  }
467  Error("EfficiencyScaleFactor::SetSystematicBin()", "The current bin %i is out of the maximum range %u ", bin, nBins());
468  return false;
469  }
471  return true;
472  }

◆ sysname()

std::string EfficiencyScaleFactor::sysname ( bool  with_direction = true) const

A string having the full name of the systematic including the measurement.

If the systematic string is empty then an empty string is returned. The flag controls whether the suffix __1UP or __1DN is appended after the string.

Definition at line 179 of file EfficiencyScaleFactor.cxx.

179  {
180  return m_syst_name.empty() ? "" : EfficiencyTypeName(m_measurement) + "_" + m_syst_name +(m_is_lowpt ? "_LOWPT" : "") + (with_direction ? (m_is_up ?"__1UP" : "__1DN") :"");
181  }

Member Data Documentation

◆ m_default_eff

float CP::EfficiencyScaleFactor::m_default_eff
private

default efficiency value (in case of OutOfValidityRange)

Definition at line 211 of file EfficiencyScaleFactor.h.

◆ m_default_eff_ttva

float CP::EfficiencyScaleFactor::m_default_eff_ttva
private

default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5)

Definition at line 213 of file EfficiencyScaleFactor.h.

◆ m_eff

std::unique_ptr<HistHandler> CP::EfficiencyScaleFactor::m_eff
private

Definition at line 180 of file EfficiencyScaleFactor.h.

◆ m_eff_decor

std::unique_ptr<FloatDecorator> CP::EfficiencyScaleFactor::m_eff_decor
private

Definition at line 188 of file EfficiencyScaleFactor.h.

◆ m_eff_rep_decor

std::unique_ptr<FloatVectorDecorator> CP::EfficiencyScaleFactor::m_eff_rep_decor
private

Definition at line 192 of file EfficiencyScaleFactor.h.

◆ m_eff_replicas

SFReplicaVec CP::EfficiencyScaleFactor::m_eff_replicas
private

Definition at line 202 of file EfficiencyScaleFactor.h.

◆ m_firstRun

unsigned int CP::EfficiencyScaleFactor::m_firstRun
private

Definition at line 218 of file EfficiencyScaleFactor.h.

◆ m_is_lowpt

bool CP::EfficiencyScaleFactor::m_is_lowpt
private

states that this SF should respond to low pt systematics rather than high pt ones

Definition at line 173 of file EfficiencyScaleFactor.h.

◆ m_is_up

bool CP::EfficiencyScaleFactor::m_is_up
private

Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not empty.

Definition at line 171 of file EfficiencyScaleFactor.h.

◆ m_lastRun

unsigned int CP::EfficiencyScaleFactor::m_lastRun
private

Definition at line 219 of file EfficiencyScaleFactor.h.

◆ m_mc_eff

std::unique_ptr<HistHandler> CP::EfficiencyScaleFactor::m_mc_eff
private

Definition at line 181 of file EfficiencyScaleFactor.h.

◆ m_mc_eff_decor

std::unique_ptr<FloatDecorator> CP::EfficiencyScaleFactor::m_mc_eff_decor
private

Definition at line 189 of file EfficiencyScaleFactor.h.

◆ m_mc_eff_rep_decor

std::unique_ptr<FloatVectorDecorator> CP::EfficiencyScaleFactor::m_mc_eff_rep_decor
private

Definition at line 193 of file EfficiencyScaleFactor.h.

◆ m_mc_eff_replicas

SFReplicaVec CP::EfficiencyScaleFactor::m_mc_eff_replicas
private

Definition at line 203 of file EfficiencyScaleFactor.h.

◆ m_measurement

CP::MuonEfficiencyType CP::EfficiencyScaleFactor::m_measurement
private

Section of variables of the tool.

Definition at line 166 of file EfficiencyScaleFactor.h.

◆ m_NominalFallBack

std::shared_ptr<EfficiencyScaleFactor> CP::EfficiencyScaleFactor::m_NominalFallBack
private

Nominal fall-back scale-factor.

Definition at line 206 of file EfficiencyScaleFactor.h.

◆ m_respond_to_kineDepSyst

bool CP::EfficiencyScaleFactor::m_respond_to_kineDepSyst
private

steers the pt dependent systematics

Definition at line 175 of file EfficiencyScaleFactor.h.

◆ m_separateBinSyst

bool CP::EfficiencyScaleFactor::m_separateBinSyst
private

Can the systematic be decorrelated.

Definition at line 177 of file EfficiencyScaleFactor.h.

◆ m_sf

std::unique_ptr<HistHandler> CP::EfficiencyScaleFactor::m_sf
private

the histograms needed to run

Definition at line 179 of file EfficiencyScaleFactor.h.

◆ m_sf_decor

std::unique_ptr<FloatDecorator> CP::EfficiencyScaleFactor::m_sf_decor
private

Definition at line 187 of file EfficiencyScaleFactor.h.

◆ m_sf_KineDepsys

std::unique_ptr<IKinematicSystHandler> CP::EfficiencyScaleFactor::m_sf_KineDepsys
private

Definition at line 197 of file EfficiencyScaleFactor.h.

◆ m_sf_rep_decor

std::unique_ptr<FloatVectorDecorator> CP::EfficiencyScaleFactor::m_sf_rep_decor
private

Definition at line 191 of file EfficiencyScaleFactor.h.

◆ m_sf_replicas

SFReplicaVec CP::EfficiencyScaleFactor::m_sf_replicas
private

replicas, in case we use them

Definition at line 201 of file EfficiencyScaleFactor.h.

◆ m_syst_name

std::string CP::EfficiencyScaleFactor::m_syst_name
private

Definition at line 167 of file EfficiencyScaleFactor.h.

◆ m_SystematicBin

int CP::EfficiencyScaleFactor::m_SystematicBin
private

Definition at line 207 of file EfficiencyScaleFactor.h.

◆ m_warningLimit

const unsigned int EfficiencyScaleFactor::m_warningLimit = 10
staticprivate

Definition at line 216 of file EfficiencyScaleFactor.h.

◆ m_warnsPrinted

std::atomic<unsigned int> CP::EfficiencyScaleFactor::m_warnsPrinted
mutableprivate

Definition at line 215 of file EfficiencyScaleFactor.h.


The documentation for this class was generated from the following files:
CP::EfficiencyScaleFactor::m_syst_name
std::string m_syst_name
Definition: EfficiencyScaleFactor.h:167
CP::EfficiencyScaleFactor::m_eff_decor
std::unique_ptr< FloatDecorator > m_eff_decor
Definition: EfficiencyScaleFactor.h:188
beamspotman.r
def r
Definition: beamspotman.py:676
CP::EfficiencyScaleFactor::DataEfficiency
CorrectionCode DataEfficiency(const xAOD::Muon &mu, float &Eff) const
... and absolute efficiencies
Definition: EfficiencyScaleFactor.cxx:308
CP::EfficiencyScaleFactor::m_warnsPrinted
std::atomic< unsigned int > m_warnsPrinted
Definition: EfficiencyScaleFactor.h:215
CP::EfficiencyScaleFactor::ScaleFactorReplicas
CorrectionCode ScaleFactorReplicas(const xAOD::Muon &mu, std::vector< float > &SF)
Definition: EfficiencyScaleFactor.cxx:403
CP::EfficiencyScaleFactor::package_histo
std::unique_ptr< HistHandler > package_histo(TH1 *h)
Definition: EfficiencyScaleFactor.cxx:267
CP::EfficiencyScaleFactor::MCEfficiencyReplicas
CorrectionCode MCEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
Definition: EfficiencyScaleFactor.cxx:409
CP::EfficiencyScaleFactor::ReadHistFromFile
std::unique_ptr< HistHandler > ReadHistFromFile(const std::string &name, TFile *f, const std::string &time_unit)
Definition: EfficiencyScaleFactor.cxx:252
CP::EfficiencyScaleFactor::GetContentReplicasFromHist
CorrectionCode GetContentReplicasFromHist(EfficiencyScaleFactor::SFReplicaVec &replicas, const xAOD::Muon &mu, std::vector< float > &SF, bool add_kine_syst)
read a vector of replica contents in the correct bin in one of my histos
Definition: EfficiencyScaleFactor.cxx:412
get_generator_info.result
result
Definition: get_generator_info.py:21
CP::EfficiencyScaleFactor::m_mc_eff
std::unique_ptr< HistHandler > m_mc_eff
Definition: EfficiencyScaleFactor.h:181
CP::EfficiencyScaleFactor::m_firstRun
unsigned int m_firstRun
Definition: EfficiencyScaleFactor.h:218
CP::BadMuonVeto
@ BadMuonVeto
Definition: MuonEfficiencyType.h:17
RootHelpers::FindBin
Int_t FindBin(const TAxis *axis, const double x)
Definition: RootHelpers.cxx:14
CP::EffiCollection::UnCorrelated
@ UnCorrelated
Definition: EffiCollection.h:55
CP::EfficiencyScaleFactor::m_sf_KineDepsys
std::unique_ptr< IKinematicSystHandler > m_sf_KineDepsys
Definition: EfficiencyScaleFactor.h:197
CP::EfficiencyScaleFactor::IsUpVariation
bool IsUpVariation() const
Definition: EfficiencyScaleFactor.cxx:185
CP::EfficiencyScaleFactor::m_eff
std::unique_ptr< HistHandler > m_eff
Definition: EfficiencyScaleFactor.h:180
CP::EfficiencyScaleFactor::m_is_lowpt
bool m_is_lowpt
states that this SF should respond to low pt systematics rather than high pt ones
Definition: EfficiencyScaleFactor.h:173
CP::EfficiencyScaleFactor::m_NominalFallBack
std::shared_ptr< EfficiencyScaleFactor > m_NominalFallBack
Nominal fall-back scale-factor.
Definition: EfficiencyScaleFactor.h:206
TRT_PAI_gasdata::SF
const float SF[NF]
Cross sections for Fluor.
Definition: TRT_PAI_gasdata.h:285
bin
Definition: BinsDiffFromStripMedian.h:43
CP::EfficiencyScaleFactor::GetContentFromHist
CorrectionCode GetContentFromHist(const HistHandler *Hist, const xAOD::Muon &mu, float &SF, bool add_kine_syst) const
read the content of the correct bin in one of my histos. MCefficiencies actually do not need a pt-dep...
Definition: EfficiencyScaleFactor.cxx:339
CP::EfficiencyScaleFactor::m_sf_rep_decor
std::unique_ptr< FloatVectorDecorator > m_sf_rep_decor
Definition: EfficiencyScaleFactor.h:191
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ZDCMsg::Info
@ Info
Definition: ZDCMsg.h:20
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::EfficiencyScaleFactor::m_warningLimit
static const unsigned int m_warningLimit
Definition: EfficiencyScaleFactor.h:216
CP::EfficiencyScaleFactor::DataEfficiencyReplicas
CorrectionCode DataEfficiencyReplicas(const xAOD::Muon &mu, std::vector< float > &eff)
Definition: EfficiencyScaleFactor.cxx:406
CP::EfficiencyScaleFactor::m_measurement
CP::MuonEfficiencyType m_measurement
Section of variables of the tool.
Definition: EfficiencyScaleFactor.h:166
CP::EfficiencyScaleFactor::m_default_eff
float m_default_eff
default efficiency value (in case of OutOfValidityRange)
Definition: EfficiencyScaleFactor.h:211
sTgcDigitEffiDump.effi
list effi
Definition: sTgcDigitEffiDump.py:38
grepfile.content
string content
Definition: grepfile.py:56
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
CP::EfficiencyScaleFactor::m_lastRun
unsigned int m_lastRun
Definition: EfficiencyScaleFactor.h:219
CP::Iso
@ Iso
Definition: MuonEfficiencyType.h:16
CP::EfficiencyScaleFactor::m_separateBinSyst
bool m_separateBinSyst
Can the systematic be decorrelated.
Definition: EfficiencyScaleFactor.h:177
lumiFormat.i
int i
Definition: lumiFormat.py:85
CP::EffiCollection::UpVariation
@ UpVariation
Definition: EffiCollection.h:56
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
CP::EffiCollection::PtDependent
@ PtDependent
Definition: EffiCollection.h:54
CP::EfficiencyScaleFactor::m_sf_decor
std::unique_ptr< FloatDecorator > m_sf_decor
Definition: EfficiencyScaleFactor.h:187
CP::EfficiencyScaleFactor::m_sf_replicas
SFReplicaVec m_sf_replicas
replicas, in case we use them
Definition: EfficiencyScaleFactor.h:201
file
TFile * file
Definition: tile_monitor.h:29
CP::EfficiencyScaleFactor::MCEfficiency
CorrectionCode MCEfficiency(const xAOD::Muon &mu, float &Eff) const
... mc efficiency
Definition: EfficiencyScaleFactor.cxx:323
HistHandler
utility class to avoid having to determine the input histo at every single call to the tool Remembers...
hist_file_dump.f
f
Definition: hist_file_dump.py:135
run
Definition: run.py:1
CP::dRJetAxisHandler::set_use_2D_sf
static void set_use_2D_sf(const bool)
Definition: HistHandler.cxx:73
CP::EfficiencyScaleFactor::m_default_eff_ttva
float m_default_eff_ttva
default TTVA efficiency value (in case of MuonStandAlone for |eta|>2.5)
Definition: EfficiencyScaleFactor.h:213
CP::EfficiencyScaleFactor::lastRun
unsigned int lastRun() const
Last run to which the map belongs to. The last run number is given exclusvely...
Definition: EfficiencyScaleFactor.cxx:191
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
CP::TTVA
@ TTVA
Definition: MuonEfficiencyType.h:15
CP::EfficiencyScaleFactor::m_mc_eff_replicas
SFReplicaVec m_mc_eff_replicas
Definition: EfficiencyScaleFactor.h:203
CP::EffiCollection::Symmetric
@ Symmetric
Definition: EffiCollection.h:53
CP::EfficiencyScaleFactor::GenerateReplicas
void GenerateReplicas(int nrep, int seed)
Definition: EfficiencyScaleFactor.cxx:440
CP::EfficiencyScaleFactor::GenerateReplicasFromHist
void GenerateReplicasFromHist(HistHandler *h, int nrep, int seed, EfficiencyScaleFactor::SFReplicaVec &repVector)
Definition: EfficiencyScaleFactor.cxx:445
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
h
CP::EffiCollection::JPsiAnalysis
@ JPsiAnalysis
Distinguish these two because the systematics are named with an extra LOWPT.
Definition: EffiCollection.h:48
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
CP::dRJetAxisHandler::set_close_jet_decorator
static void set_close_jet_decorator(const std::string &decor_name)
Definition: HistHandler.cxx:69
CP::EfficiencyScaleFactor::sysname
std::string sysname(bool with_direction=true) const
A string having the full name of the systematic including the measurement.
Definition: EfficiencyScaleFactor.cxx:179
DeMoScan.first
bool first
Definition: DeMoScan.py:536
CP::EfficiencyScaleFactor::ScaleFactor
CorrectionCode ScaleFactor(const xAOD::Muon &mu, float &SF) const
the important bits - extract SF info
Definition: EfficiencyScaleFactor.cxx:292
CP::EfficiencyScaleFactor::m_mc_eff_decor
std::unique_ptr< FloatDecorator > m_mc_eff_decor
Definition: EfficiencyScaleFactor.h:189
CP::EfficiencyScaleFactor::m_SystematicBin
int m_SystematicBin
Definition: EfficiencyScaleFactor.h:207
CP::EfficiencyScaleFactor::m_is_up
bool m_is_up
Boolean whether the scale-factor is varying upwards or downwards Only relevant if the systname is not...
Definition: EfficiencyScaleFactor.h:171
dqt_zlumi_alleff_HIST.eff
int eff
Definition: dqt_zlumi_alleff_HIST.py:113
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
CP::EfficiencyScaleFactor::nBins
int nBins() const
How many bins does the scale-factor map have.
Definition: EfficiencyScaleFactor.cxx:283
CP::EfficiencyScaleFactor::EfficiencyScaleFactor
EfficiencyScaleFactor(const MuonEfficiencyScaleFactors &ref_tool, const std::string &file, const std::string &time_unit)
Nominal constructor to use having the measurement (Reco/TTVA/Iso/BadMuon) path to the scale-factor ma...
Definition: EfficiencyScaleFactor.cxx:173
CP::EfficiencyScaleFactor::firstRun
unsigned int firstRun() const
First run to which the map belongs to.
Definition: EfficiencyScaleFactor.cxx:188
CP::EfficiencyScaleFactor::m_respond_to_kineDepSyst
bool m_respond_to_kineDepSyst
steers the pt dependent systematics
Definition: EfficiencyScaleFactor.h:175
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
CP::EfficiencyScaleFactor::m_sf
std::unique_ptr< HistHandler > m_sf
the histograms needed to run
Definition: EfficiencyScaleFactor.h:179
CP::EfficiencyScaleFactor::m_mc_eff_rep_decor
std::unique_ptr< FloatVectorDecorator > m_mc_eff_rep_decor
Definition: EfficiencyScaleFactor.h:193
CP::EfficiencyScaleFactor::m_eff_rep_decor
std::unique_ptr< FloatVectorDecorator > m_eff_rep_decor
Definition: EfficiencyScaleFactor.h:192
fitman.k
k
Definition: fitman.py:528
python.handimod.cc
int cc
Definition: handimod.py:523
CP::EfficiencyScaleFactor::m_eff_replicas
SFReplicaVec m_eff_replicas
Definition: EfficiencyScaleFactor.h:202