ATLAS Offline Software
EffiCollection.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
9 #include <TTree.h>
10 namespace CP {
11  namespace {
12  static const std::vector<std::string> ToRemove { "GeV", "MeV", "[", "]", "{", "}", "(", ")", "#", " " };
13  typedef std::pair<std::string,std::string> stringpair;
14  static const std::vector<stringpair> ToReplace { stringpair("-","minus"), stringpair(".","p")};
15 
16  }
18  m_ref_tool(ref_tool),
19  m_central_eff(),
20  m_calo_eff(),
21  m_forward_eff(),
22  m_lowpt_central_eff(),
23  m_lowpt_calo_eff(),
24  m_lrt_central_eff(),
25  m_lrt_lowpt_central_eff(),
26  m_syst_set(std::make_unique<SystematicSet>()){
27 
28  m_central_eff = std::make_shared<CollectionContainer>(m_ref_tool, CollectionType::Central);
30  m_calo_eff = std::make_shared<CollectionContainer>(m_ref_tool,CollectionType::Calo);
31  } else m_calo_eff = m_central_eff;
32 
34  m_forward_eff = std::make_shared<CollectionContainer>(m_ref_tool,CollectionType::Forward);
36 
38  m_lowpt_central_eff = std::make_shared<CollectionContainer>(m_ref_tool,CollectionType::CentralLowPt);
40 
42  m_lowpt_calo_eff = std::make_shared<CollectionContainer>(m_ref_tool, CollectionType::CaloLowPt);
44 
45  if(m_ref_tool.use_lrt()) {
47  m_lrt_central_eff = std::make_shared<CollectionContainer>(m_ref_tool,CollectionType::Central);
48  }
49  else {
51  }
52  if (m_ref_tool.lowPtTransition() > 0 ) {
55  }
58  }
59  else {
60  m_lrt_lowpt_central_eff = std::make_shared<CollectionContainer>(m_ref_tool,CollectionType::CentralLowPt);
61  }
62  }
63  else {
65  }
66  }
67  }
68 
69  EffiCollection::EffiCollection(const EffiCollection* Nominal, const MuonEfficiencyScaleFactors& ref_tool, const std::string& syst, int syst_bit_map, bool is_up):
70  m_ref_tool(ref_tool),
71  m_central_eff(),
72  m_calo_eff(),
73  m_forward_eff(),
74  m_lowpt_central_eff(),
75  m_lowpt_calo_eff(),
76  m_lrt_central_eff(),
77  m_lrt_lowpt_central_eff(),
78  m_syst_set() {
79 
80  if (is_up) syst_bit_map |= EffiCollection::UpVariation;
82  std::function< std::shared_ptr<CollectionContainer>(CollectionType)> make_variation = [this,&ref_tool, Nominal, syst_bit_map, syst](CollectionType type){
83  if (syst_bit_map & type) {
84  return std::make_shared<CollectionContainer>(ref_tool,
85  Nominal->retrieveContainer(type).get(),
86  syst, syst_bit_map); }
88  if (ref_tool.measurement() != MuonEfficiencyType::Reco) return m_central_eff;
89  return Nominal->retrieveContainer(type);
90  };
91  m_central_eff = make_variation(CollectionType::Central);
92  m_forward_eff = make_variation(CollectionType::Forward);
93  m_calo_eff = make_variation(CollectionType::Calo);
94  m_lowpt_central_eff = make_variation(CollectionType::CentralLowPt);
95  m_lowpt_calo_eff = make_variation(CollectionType::CaloLowPt);
96  if (m_ref_tool.use_lrt()) {
97  m_lrt_central_eff = make_variation(CollectionType::Central);
98  m_lrt_lowpt_central_eff = make_variation(CollectionType::CentralLowPt);
99  }
100 
101 
102  }
103 
104  std::shared_ptr<CollectionContainer> EffiCollection::retrieveContainer(CollectionType Type) const {
105  if (Type == CollectionType::Central) return m_central_eff;
106  if (Type == CollectionType::Forward) return m_forward_eff;
107  if (Type == CollectionType::Calo) return m_calo_eff;
108  if (Type == CollectionType::CentralLowPt) return m_lowpt_central_eff;
109  if (Type == CollectionType::CaloLowPt) return m_lowpt_calo_eff;
110  return std::shared_ptr<CollectionContainer>();
111  }
113  if (!m_central_eff || !m_central_eff->CheckConsistency()) {
114  Error("EffiCollection()", "Consistency check for central file failed");
115  return false;
116  }
117  if (!m_calo_eff || !m_calo_eff->CheckConsistency()) {
118  Error("EffiCollection()", "Consistency check for calo file failed");
119  return false;
120  }
121  if (!m_forward_eff || !m_forward_eff->CheckConsistency()) {
122  Error("EffiCollection()", "Consistency check for forward file failed");
123  return false;
124  }
125  if (!m_lowpt_central_eff || !m_lowpt_central_eff->CheckConsistency()) {
126  Error("EffiCollection()", "Consistency check for low-pt file failed");
127  return false;
128  }
129  if (!m_lowpt_calo_eff || !m_lowpt_calo_eff->CheckConsistency()) {
130  Error("EffiCollection()", "Consistency check for low-pt calo file failed");
131  return false;
132  }
133  if (m_ref_tool.use_lrt()) {
134  if (!m_lrt_central_eff || !m_lrt_central_eff->CheckConsistency()) {
135  Error("EffiCollection()", "Consistency check for LRT central file failed");
136  return false;
137  }
138  if (!m_lrt_lowpt_central_eff || !m_lrt_lowpt_central_eff->CheckConsistency()) {
139  Error("EffiCollection()", "Consistency check for LRT low-pt file failed");
140  return false;
141  }
142  }
146  unsigned int n = m_central_eff->nBins();
147  std::function<void (CollectionContainer*)> assign_mapping = [this, &n](CollectionContainer* container){
148  if (container != m_central_eff.get() && container->separateBinSyst()){
149  container->SetGlobalOffSet(n);
150  n += container->nBins();
151  };
152  };
153  assign_mapping(m_calo_eff.get());
154  assign_mapping(m_calo_eff.get());
155  assign_mapping(m_lowpt_central_eff.get());
156  assign_mapping(m_lowpt_calo_eff.get());
157 
158  assign_mapping(m_forward_eff.get());
159 
160  if (m_ref_tool.use_lrt()) {
161  assign_mapping(m_lrt_central_eff.get());
162  assign_mapping(m_lrt_lowpt_central_eff.get());
163  }
166  if (!m_syst_set){
167  m_syst_set = std::make_unique<CP::SystematicSet>();
168  size_t glob_sys = m_ref_tool.getPosition(this);
169  if (glob_sys > m_ref_tool.getNCollections()){
170  Error("EffiCollection()", "Invalid position in the list of systematics. It seems that I'm not part of the referring ScaleFactorTool.");
171  return false;
172  }
175 
176  std::shared_ptr<CollectionContainer> container = retrieveContainer(file_type);
177  if (container->isNominal()) continue;
178  if (container->separateBinSyst()){
181  for (unsigned int b = container->nBins() - 1; b > 0 ; --b){
182  unsigned int bin = b + container->globalOffSet();
183  if (container->isOverFlowBin(bin)) continue;
184  m_syst_set->insert(CP::SystematicVariation::makeToyVariation("MUON_EFF_" + container->sysname() + GetBinName(bin) , bin, glob_sys));
185  }
186  } else {
187  m_syst_set->insert( SystematicVariation("MUON_EFF_" + container->sysname(), container->isUpVariation() ? 1 : -1));
188  }
189  }
190  }
191  return true;
192  }
193 
195  if (m_ref_tool.use_lrt()) {
196  static const SG::AuxElement::Accessor<char> isLRTmuon("isLRT");
197  if (isLRTmuon.isAvailable(mu)) {
198  if (isLRTmuon(mu)) return FindLRTContainer(mu);
199  }
200  else {
201  static const SG::AuxElement::Accessor<uint64_t> patternAcc("patternRecoInfo");
202  const xAOD::TrackParticle* idtrack = mu.trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
203  if(idtrack) {
204  if(!patternAcc.isAvailable(*idtrack)) {
205  Error("CollectionContainer", "No information available to tell if the muon is LRT or standard. Either run MuonLRTMergingAlg to decorate with `isLRT` flag, or supply the patternRecoInfo for the original ID track.");
206  }
207  std::bitset<xAOD::NumberOfTrackRecoInfo> patternBitSet(patternAcc(*idtrack));
208  if (patternBitSet.test(xAOD::SiSpacePointsSeedMaker_LargeD0)) return FindLRTContainer(mu);
209  }
210  }
211  }
212  if (mu.pt() < m_ref_tool.lowPtTransition()) {
213  if (std::abs(mu.eta()) >= 2.5) {
214  return m_forward_eff.get();
215  }
216  if (mu.muonType() == xAOD::Muon::CaloTagged) {
217  return m_lowpt_calo_eff.get();
218  }
219  return m_lowpt_central_eff.get();
220  }
221  if (mu.muonType() == xAOD::Muon::CaloTagged) {
222  return m_calo_eff.get();
223  } else if (std::abs(mu.eta()) < 2.5) {
224  return m_central_eff.get();
225  } else {
226  return m_forward_eff.get();
227  }
228  }
230  if (m_central_eff->isBinInMap(bin)) return m_central_eff.get();
231  if (m_forward_eff->isBinInMap(bin)) return m_forward_eff.get();
232  if (m_calo_eff->isBinInMap(bin)) return m_calo_eff.get();
233  if (m_lowpt_central_eff->isBinInMap(bin)) return m_lowpt_central_eff.get();
234  if (m_lowpt_calo_eff->isBinInMap(bin)) return m_lowpt_calo_eff.get();
235  if (m_ref_tool.use_lrt()) {
236  if (m_lrt_central_eff->isBinInMap(bin)) return m_lrt_central_eff.get();
237  if (m_lrt_lowpt_central_eff->isBinInMap(bin)) return m_lrt_lowpt_central_eff.get();
238  }
239  return nullptr;
240  }
242  if (mu.pt() < m_ref_tool.lowPtTransition()) return m_lrt_lowpt_central_eff.get();
243  else return m_lrt_central_eff.get();
244  }
247  if (Cont != nullptr) return Cont->retrieve(RunNumber);
248  Warning("EffiCollection::retrieveSF()", "Invalid muon");
249  return nullptr;
250  }
251  unsigned int EffiCollection::nBins() const {
252  unsigned int Nbins = 0;
253  if (m_central_eff) {
254  Nbins += m_central_eff->nBins();
255  }
256  if (m_central_eff != m_calo_eff) {
257  Nbins += m_calo_eff->nBins();
258  }
259  if (m_forward_eff != m_central_eff) {
260  Nbins += m_forward_eff->nBins();
261  }
263  Nbins += m_lowpt_central_eff->nBins();
264  }
266  Nbins += m_lowpt_calo_eff->nBins();
267  }
268  if (m_ref_tool.use_lrt()) {
269  if (m_lrt_central_eff) {
270  Nbins += m_lrt_central_eff->nBins();
271  }
273  Nbins += m_lrt_lowpt_central_eff->nBins();
274  }
275  }
276  return Nbins;
277  }
278  bool EffiCollection::SetSystematicBin(unsigned int Bin) {
279  CollectionContainer* Cont = FindContainer(Bin);
280  if (!Cont) return false;
281  return Cont->SetSystematicBin(Bin);
282  }
283  bool EffiCollection::IsLowPtBin(unsigned int Bin) const {
284  return (m_central_eff != m_lowpt_central_eff && m_lowpt_central_eff->isBinInMap(Bin)) ||
285  (m_central_eff != m_lowpt_calo_eff && m_lowpt_calo_eff->isBinInMap(Bin));
286  }
287  bool EffiCollection::IsForwardBin(unsigned int Bin) const {
288  return m_forward_eff != m_central_eff && m_forward_eff->isBinInMap(Bin);
289  }
290 
292  if (T == CollectionType::Central) return "Central";
293  if (T == CollectionType::Calo) return "Calo";
294  if (T == CollectionType::Forward) return "Forward";
295  if (T == CollectionType::CentralLowPt) return "CentralLowPt";
296  if (T == CollectionType::CaloLowPt) return "CaloLowPt";
297  return "EffiCollection::FileTypeName() - WARNING: Unknown EffiCollection::CollectionType!";
298  }
299 
300  std::string EffiCollection::GetBinName(unsigned int bin) const {
302  if (Cont) {
303  std::string BinName = FileTypeName(Cont->type()) +"_"+ Cont->GetBinName(bin);
304  for (const std::string& R : ToRemove) {
305  BinName = ReplaceExpInString(BinName, R, "");
306  }
307  for (const stringpair& R : ToReplace) {
308  BinName = ReplaceExpInString(BinName, R.first, R.second);
309  }
310  return BinName;
311  }
312  Warning("EffiCollection::GetBinName()", "Unknown bin %u", bin);
313 
314  return "UNKNOWN_BIN";
315  }
317  CollectionContainer* container = FindContainer(mu);
318  if (container) return container->FindBinSF(mu);
319  return -1;
320  }
322  return m_syst_set.get();
323  }
325  return m_syst_set->find(variation) != m_syst_set->end();
326  }
328  if (set.empty()) return m_syst_set->empty();
329  for (const SystematicVariation& variation: set){
330  if (isAffectedBySystematic(variation)) return true;
331  }
332  return false;
333  }
334 
335 
336  //################################################################################
337  // CollectionContainer
338  //################################################################################
340  m_SF(),
341  m_currentSF(nullptr),
342  m_FileType(FileType),
343  m_binOffSet(0){
344 
345  std::map<std::string, std::pair<unsigned int, unsigned int>> map = findPeriods(ref_tool);
346  for (auto& period : map) {
347  m_SF.push_back(std::make_shared<EfficiencyScaleFactor>(ref_tool, fileName(ref_tool), period.first));
348  m_SF.back()->setFirstLastRun(period.second.first, period.second.second);
349  }
350  }
351  CollectionContainer::CollectionContainer(const MuonEfficiencyScaleFactors& ref_tool, CollectionContainer* Nominal, const std::string& syst_name, unsigned int syst_bit_map):
352  m_SF(),
353  m_currentSF(nullptr),
354  m_FileType(Nominal->type()),
355  m_binOffSet(0) {
356  std::map<std::string, std::pair<unsigned int, unsigned int>> map = findPeriods(ref_tool);
357  for (auto& period : map) {
358  std::vector< std::shared_ptr<EfficiencyScaleFactor>>::const_iterator itr = std::find_if( Nominal->m_SF.begin(),
359  Nominal->m_SF.end(),
360  [&period](const std::shared_ptr<EfficiencyScaleFactor>& a){
361  return a->coversRunNumber(period.second.first);
362  });
363  m_SF.push_back(std::make_shared<EfficiencyScaleFactor>(*itr, ref_tool, fileName(ref_tool), period.first, syst_name, syst_bit_map));
364  m_SF.back()->setFirstLastRun(period.second.first, period.second.second);
365  }
366  }
367  std::map<std::string, std::pair<unsigned int, unsigned int>> CollectionContainer::findPeriods(const MuonEfficiencyScaleFactors& ref_tool) const{
368 
369  std::string file_name = fileName(ref_tool);
370  std::map<std::string, std::pair<unsigned int, unsigned int>> map;
371 
372  std::unique_ptr<TFile> fin (TFile::Open(file_name.c_str()));
373  if (!fin || !fin->IsOpen()) {
374  Error("CollectionContainer","Unable to open file %s", file_name.c_str());
375  return map;
376  }
377  TTree* intree = 0;
378  fin->GetObject("LumiData", intree);
379 
380  // if no Lumi tree is found, we assume that the SF are not binned in time
381  if (!intree) {
382  map["All"] = std::pair<unsigned int,unsigned int>(1, 999999);
383  } else {
384  std::string *period = 0;
385  unsigned int firstRun = 0;
386  unsigned int lastRun = 0;
387  intree->SetBranchAddress("Period", &period);
388  intree->SetBranchAddress("FirstRun", &firstRun);
389  intree->SetBranchAddress("LastRun", &lastRun);
390  for (int t = 0; intree->GetEntry(t); t++) {
391  map[*period] = std::pair<unsigned int, unsigned int>(firstRun, lastRun);
392  }
393  }
394  return map;
395  }
396  std::string CollectionContainer::fileName(const MuonEfficiencyScaleFactors& ref_tool) const{
397  if (type() == EffiCollection::CollectionType::Central) return ref_tool.filename_Central();
398  if (type() == EffiCollection::CollectionType::Calo) return ref_tool.filename_Calo();
399  if (type() == EffiCollection::CollectionType::CentralLowPt) return ref_tool.filename_LowPt();
400  if (type() == EffiCollection::CollectionType::CaloLowPt) return ref_tool.filename_LowPtCalo();
401  return ref_tool.filename_HighEta();
402  }
403 
405  if (m_SF.empty()) {
406  Error("CollectionContainer", "Could not retrieve any SFs from the input file");
407  return false;
408  }
410  for (std::vector< std::shared_ptr<EfficiencyScaleFactor>>::const_iterator first_sf = m_SF.begin() ; first_sf != m_SF.end(); ++first_sf) {
411  if (!(*first_sf)->CheckConsistency()) return false;
412  for (std::vector< std::shared_ptr<EfficiencyScaleFactor>>::const_iterator second_sf = m_SF.begin(); second_sf != first_sf; ++second_sf) {
413  if ( (*first_sf)->coversRunNumber( (*second_sf)->firstRun()) || (*first_sf)->coversRunNumber((*second_sf)->lastRun()) ||
414  (*second_sf)->coversRunNumber( (*first_sf)->firstRun()) || (*second_sf)->coversRunNumber((*first_sf)->lastRun())){
415  Error("CollectionContainer", "Overlapping periods observed in file type %s. As run %i is in period %i - %i. Please check your SF file!",
416  EffiCollection::FileTypeName(m_FileType).c_str(), (*first_sf)->firstRun(), (*second_sf)->firstRun(), (*second_sf)->lastRun());
417  return false;
418  }
419  }
420  }
421 
422  std::sort(m_SF.begin(), m_SF.end(), [](const std::shared_ptr<EfficiencyScaleFactor>& a, const std::shared_ptr<EfficiencyScaleFactor>& b){
423  return a->firstRun() < b->firstRun();});
424  return true;
425  }
428  for (auto& period : m_SF) {
429  if (period->coversRunNumber(RunNumber)) {
430  m_currentSF = period.get();
431  return true;
432  }
433  }
434  } else return true;
435  Warning("CollectionContainer", "Could not find any SF period in %s matching the run number %u", EffiCollection::FileTypeName(type()).c_str(), RunNumber);
436  return false;
437  }
439  if (!LoadPeriod(RunNumber)) {
440  return (*m_SF.begin()).get();
441  }
442  return m_currentSF;
443  }
444  bool CollectionContainer::SetSystematicBin(unsigned int Bin) {
445  for ( std::shared_ptr<EfficiencyScaleFactor>& Period : m_SF) {
446  if (!Period->SetSystematicBin(Bin- m_binOffSet)) {
447  return false;
448  }
449  }
450  return true;
451  }
452  unsigned int CollectionContainer::nBins() const {
453  return m_SF.empty() ? 0 : (*m_SF.begin())->nBins();
454  }
455  unsigned int CollectionContainer::nOverFlowBins() const {
456  return m_SF.empty() ? 0 : (*m_SF.begin())->nOverFlowBins();
457  }
459  return m_SF.empty() ? true : (*m_SF.begin())->isOverFlowBin(b-m_binOffSet);
460  }
461  bool CollectionContainer::isBinInMap(unsigned int bin) const{
462  return m_binOffSet <= bin && bin < m_binOffSet + nBins();
463  }
465  return m_FileType;
466  }
467  std::string CollectionContainer::GetBinName(unsigned int Bin) const {
468  return (*m_SF.begin())->GetBinName(Bin- m_binOffSet);
469  }
471  if (m_SF.empty() ) return -1;
472  int bin = (*m_SF.begin())->FindBinSF(mu);
473  return bin > 0 ? m_binOffSet + bin : bin;
474  }
475  void CollectionContainer::SetGlobalOffSet(unsigned int OffSet){
476  m_binOffSet = OffSet;
477  }
478  unsigned int CollectionContainer::globalOffSet() const{
479  return m_binOffSet;
480  }
482  if (m_SF.empty()) return false;
483  return (*m_SF.begin())->sysname(false).empty();
484  }
486  if (m_SF.empty()) return false;
487  return (*m_SF.begin())->IsUpVariation();
488  }
490  if (m_SF.empty()) return false;
491  return (*m_SF.begin())->separateBinSyst();
492  }
493  std::string CollectionContainer::sysname() const{
494  if (m_SF.empty()) return "UNKNOWN SYST";
495  return (*m_SF.begin())->sysname(false);
496  }
497 
498 }
CP::MuonEfficiencyScaleFactors::filename_Calo
std::string filename_Calo() const
Reconstruction scale-factors have a dedicated map for calo-tag muons around |\eta|<0....
Definition: MuonEfficiencyScaleFactors.cxx:378
CP::MuonEfficiencyScaleFactors::filename_Central
std::string filename_Central() const
The following methods are meant to propagate information from the central tool to the subtool managin...
Definition: MuonEfficiencyScaleFactors.cxx:347
CP::MuonEfficiencyScaleFactors::filename_LRTLowPt
std::string filename_LRTLowPt() const
Definition: MuonEfficiencyScaleFactors.cxx:400
python.AtlRunQueryAMI.period
period
Definition: AtlRunQueryAMI.py:225
CP::EffiCollection
The EffiCollection class handles the 5 different scale-factor maps binned in time.
Definition: EffiCollection.h:29
CP::EffiCollection::CentralLowPt
@ CentralLowPt
Definition: EffiCollection.h:42
CP::EffiCollection::IsForwardBin
bool IsForwardBin(unsigned int Bin) const
Checks whether the i-th bin belongs to the forward map.
Definition: EffiCollection.cxx:287
CP::MuonEfficiencyScaleFactors::lowPtTransition
float lowPtTransition() const
If the pt of the muon is below that threshold the J/Psi or Upsilon map is used given that it's availa...
Definition: MuonEfficiencyScaleFactors.cxx:89
CP::SystematicVariation::makeToyVariation
static SystematicVariation makeToyVariation(const std::string &basename, unsigned toyIndex, float toyScale)
constructor for toy systematics
Definition: SystematicVariation.cxx:238
CP::CollectionContainer::LoadPeriod
bool LoadPeriod(unsigned int RunNumber)
Definition: EffiCollection.cxx:426
CP::EffiCollection::getSystSet
SystematicSet * getSystSet() const
Returns the systematic set affecting this collection.
Definition: EffiCollection.cxx:321
athena_checkUpload.Period
int Period
--> Execution phase:
Definition: athena_checkUpload.py:179
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
MuonEfficiencyScaleFactors.h
CP::EffiCollection::IsLowPtBin
bool IsLowPtBin(unsigned int Bin) const
Checks whether the i-th bin belongs to the low-pt map...
Definition: EffiCollection.cxx:283
CP::EffiCollection::m_lowpt_central_eff
std::shared_ptr< CollectionContainer > m_lowpt_central_eff
Definition: EffiCollection.h:114
CP::EffiCollection::Central
@ Central
The five different scale-factor maps.
Definition: EffiCollection.h:39
CP::CollectionContainer::separateBinSyst
bool separateBinSyst() const
Definition: EffiCollection.cxx:489
CP::MuonEfficiencyScaleFactors
Definition: MuonEfficiencyScaleFactors.h:23
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
bin
Definition: BinsDiffFromStripMedian.h:43
CP::CollectionContainer::isBinInMap
bool isBinInMap(unsigned int bin) const
Checks if the global bin number belongs to this map.
Definition: EffiCollection.cxx:461
CP::EffiCollection::Calo
@ Calo
Definition: EffiCollection.h:40
CP::CollectionContainer::isNominal
bool isNominal() const
Definition: EffiCollection.cxx:481
CP::CollectionContainer::globalOffSet
unsigned int globalOffSet() const
Global offset of the bin numbers.
Definition: EffiCollection.cxx:478
CP::EffiCollection::EffiCollection
EffiCollection(const MuonEfficiencyScaleFactors &ref_tool)
Definition: EffiCollection.cxx:17
CP::CollectionContainer::isOverFlowBin
bool isOverFlowBin(int b) const
Check whether the bin is overflow or not.
Definition: EffiCollection.cxx:458
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
CP::CollectionContainer::retrieve
EfficiencyScaleFactor * retrieve(unsigned int RunNumer)
Retrieve the scale-factor map belonging to that particular run of data-taking.
Definition: EffiCollection.cxx:438
CP::SystematicVariation
Definition: SystematicVariation.h:47
CP::CollectionContainer
The collection container manages the time binning of a particular scale-factor map.
Definition: EffiCollection.h:126
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::EffiCollection::m_lrt_central_eff
std::shared_ptr< CollectionContainer > m_lrt_central_eff
Definition: EffiCollection.h:116
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
CP::EffiCollection::Forward
@ Forward
Definition: EffiCollection.h:41
CP::MuonEfficiencyScaleFactors::filename_LRTCentral
std::string filename_LRTCentral() const
LRT muons have their own efficiency maps.
Definition: MuonEfficiencyScaleFactors.cxx:361
CP::EfficiencyScaleFactor::coversRunNumber
bool coversRunNumber(unsigned int run) const
Check if a run of data-taking is covered by this map.
Definition: EfficiencyScaleFactor.cxx:194
physics_parameters.file_name
string file_name
Definition: physics_parameters.py:32
CP::EffiCollection::m_lowpt_calo_eff
std::shared_ptr< CollectionContainer > m_lowpt_calo_eff
Definition: EffiCollection.h:115
CP::MuonEfficiencyScaleFactors::getPosition
size_t getPosition(const EffiCollection *coll) const
Returns the position of the collection in the syst set vector.
Definition: MuonEfficiencyScaleFactors.cxx:114
CP::MuonEfficiencyScaleFactors::filename_LowPt
std::string filename_LowPt() const
Returns the scale-factor maps from a complementary scale-factor measurement using the J/Psi or Upsilo...
Definition: MuonEfficiencyScaleFactors.cxx:392
CP::EffiCollection::nBins
unsigned int nBins() const
Get the number of all bins in the scale-factor maps including the overflow & underflow bins.
Definition: EffiCollection.cxx:251
CP::EffiCollection::CollectionType
CollectionType
Definition: EffiCollection.h:37
CP::EffiCollection::retrieveContainer
std::shared_ptr< CollectionContainer > retrieveContainer(CollectionType Type) const
Method to retrieve a container from the class ordered by a collection type This method is mainly used...
Definition: EffiCollection.cxx:104
CP::EffiCollection::UpVariation
@ UpVariation
Definition: EffiCollection.h:56
CP::CollectionContainer::GetBinName
std::string GetBinName(unsigned int Bin) const
Name of the i-th bin.
Definition: EffiCollection.cxx:467
jet::CombMassComp::Calo
@ Calo
Definition: UncertaintyEnum.h:197
beamspotman.n
n
Definition: beamspotman.py:731
CP::CollectionContainer::SetSystematicBin
bool SetSystematicBin(unsigned int Bin)
Activate this bin to run in the uncorrelated systematic mode.
Definition: EffiCollection.cxx:444
CP::Reco
@ Reco
Definition: MuonEfficiencyType.h:14
CP::EffiCollection::FindLRTContainer
CollectionContainer * FindLRTContainer(const xAOD::Muon &mu) const
Definition: EffiCollection.cxx:241
CP::CollectionContainer::nBins
unsigned int nBins() const
Number of bins of the map itself.
Definition: EffiCollection.cxx:452
EfficiencyScaleFactor.h
CP::EffiCollection::GetBinName
std::string GetBinName(unsigned int bin) const
Returns the global bin name conststucted from the axis titles and the bin borders.
Definition: EffiCollection.cxx:300
CP::CollectionContainer::isUpVariation
bool isUpVariation() const
Definition: EffiCollection.cxx:485
CP::EfficiencyScaleFactor
Definition: EfficiencyScaleFactor.h:35
CP::CollectionContainer::CollectionContainer
CollectionContainer(const MuonEfficiencyScaleFactors &ref_tool, EffiCollection::CollectionType FileType)
Nominal constructor... Only needs to know about it's type and the file to load.
Definition: EffiCollection.cxx:339
xAODType
Definition: ObjectType.h:13
xAOD::SiSpacePointsSeedMaker_LargeD0
@ SiSpacePointsSeedMaker_LargeD0
Definition: TrackingPrimitives.h:183
CP::MuonEfficiencyScaleFactors::filename_HighEta
std::string filename_HighEta() const
High-eta reconstruction scale-factors are not obtained by the means of are not obtained by the means ...
Definition: MuonEfficiencyScaleFactors.cxx:385
CP::CollectionContainer::FindBinSF
int FindBinSF(const xAOD::Muon &mu) const
Returns the global bin number corresponding to the muon kinematics.
Definition: EffiCollection.cxx:470
CP::EffiCollection::m_ref_tool
const MuonEfficiencyScaleFactors & m_ref_tool
Definition: EffiCollection.h:106
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
CP::EffiCollection::retrieveSF
EfficiencyScaleFactor * retrieveSF(const xAOD::Muon &mu, unsigned int RunNumber) const
return the correct SF type to provide, depending on eta and the author
Definition: EffiCollection.cxx:245
CP::EffiCollection::m_forward_eff
std::shared_ptr< CollectionContainer > m_forward_eff
Definition: EffiCollection.h:113
EventInfoWrite.RunNumber
RunNumber
Definition: EventInfoWrite.py:50
CP::CollectionContainer::type
EffiCollection::CollectionType type() const
File type of the map.
Definition: EffiCollection.cxx:464
CP::CollectionContainer::sysname
std::string sysname() const
Returns MUON_EFF_<sysname()>
Definition: EffiCollection.cxx:493
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
CP::MuonEfficiencyScaleFactors::getNCollections
size_t getNCollections() const
Returns the number of EffiCollections stored in this class.
Definition: MuonEfficiencyScaleFactors.cxx:122
CP::EffiCollection::m_calo_eff
std::shared_ptr< CollectionContainer > m_calo_eff
Definition: EffiCollection.h:112
CP::EffiCollection::FileTypeName
static std::string FileTypeName(EffiCollection::CollectionType T)
Definition: EffiCollection.cxx:291
CP::EffiCollection::CaloLowPt
@ CaloLowPt
Definition: EffiCollection.h:43
UtilFunctions.h
CP::CollectionContainer::SetGlobalOffSet
void SetGlobalOffSet(unsigned int OffSet)
Sets the global offset to align the order in the map into a global numbering scheme.
Definition: EffiCollection.cxx:475
CP::EffiCollection::FindContainer
CollectionContainer * FindContainer(unsigned int bin) const
Definition: EffiCollection.cxx:229
CP::ReplaceExpInString
std::string ReplaceExpInString(std::string str, const std::string &exp, const std::string &rep)
Replaces all expressions an string by something else.
Definition: PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonEfficiencyCorrections/Root/UtilFunctions.cxx:24
a
TList * a
Definition: liststreamerinfos.cxx:10
CP::CollectionContainer::findPeriods
std::map< std::string, std::pair< unsigned int, unsigned int > > findPeriods(const MuonEfficiencyScaleFactors &ref_tool) const
Definition: EffiCollection.cxx:367
CP::EffiCollection::m_lrt_lowpt_central_eff
std::shared_ptr< CollectionContainer > m_lrt_lowpt_central_eff
Definition: EffiCollection.h:117
CP::MuonEfficiencyScaleFactors::use_lrt
bool use_lrt() const
option to set if we want to use LRT muons
Definition: MuonEfficiencyScaleFactors.cxx:125
CP::CollectionContainer::m_SF
std::vector< std::shared_ptr< EfficiencyScaleFactor > > m_SF
Definition: EffiCollection.h:181
CP::CollectionContainer::CheckConsistency
bool CheckConsistency()
Consistency check of all scale-factor maps managed by the container instance.
Definition: EffiCollection.cxx:404
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CP::CollectionContainer::nOverFlowBins
unsigned int nOverFlowBins() const
Number of overflow bins in the map.
Definition: EffiCollection.cxx:455
ReadBchFromCool.lastRun
lastRun
Definition: ReadBchFromCool.py:278
CP::EffiCollection::CheckConsistency
bool CheckConsistency()
a consistency check of the scale-factor maps.
Definition: EffiCollection.cxx:112
CP::EffiCollection::m_syst_set
std::unique_ptr< SystematicSet > m_syst_set
The systematic set is returned back to the MuonEfficiencyScaleFactors instance to register The known ...
Definition: EffiCollection.h:121
compute_lumi.fin
fin
Definition: compute_lumi.py:19
CP::EffiCollection::isAffectedBySystematic
bool isAffectedBySystematic(const SystematicVariation &variation) const
Returns whether the given set has variations affecting this Collection.
Definition: EffiCollection.cxx:324
CP::CollectionContainer::m_currentSF
EfficiencyScaleFactor * m_currentSF
Definition: EffiCollection.h:182
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
CP::CollectionContainer::m_binOffSet
unsigned int m_binOffSet
Offset to translate between the bin-numbers in the bin numbers of each file against the global bin-nu...
Definition: EffiCollection.h:187
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
CP::MuonEfficiencyScaleFactors::filename_LowPtCalo
std::string filename_LowPtCalo() const
Definition: MuonEfficiencyScaleFactors.cxx:406
CP::EffiCollection::getUnCorrelatedSystBin
int getUnCorrelatedSystBin(const xAOD::Muon &mu) const
Returns the bin number from which the scale-factor of the muon is going to be retrieved....
Definition: EffiCollection.cxx:316
CP::CollectionContainer::m_FileType
EffiCollection::CollectionType m_FileType
Definition: EffiCollection.h:184
CP::CollectionContainer::fileName
std::string fileName(const MuonEfficiencyScaleFactors &ref_tool) const
Definition: EffiCollection.cxx:396
CP::EffiCollection::m_central_eff
std::shared_ptr< CollectionContainer > m_central_eff
Make the collection container shared ptr to allow that a systematic EffiCollection can use the same c...
Definition: EffiCollection.h:111
CP::EffiCollection::SetSystematicBin
bool SetSystematicBin(unsigned int Bin)
If systematic decorrelation is activated then the user needs to loop manually over the syst bins.
Definition: EffiCollection.cxx:278
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
CP::MuonEfficiencyScaleFactors::measurement
CP::MuonEfficiencyType measurement() const
Returns the type of the measurement to be carried out... E.g. Reco/TTVA/Iso.
Definition: MuonEfficiencyScaleFactors.cxx:93
EffiCollection.h