ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Root::TElectronEfficiencyCorrectionTool Class Reference

#include <TElectronEfficiencyCorrectionTool.h>

Inheritance diagram for Root::TElectronEfficiencyCorrectionTool:
Collaboration diagram for Root::TElectronEfficiencyCorrectionTool:

Classes

struct  HistEdge
 
struct  Result
 

Public Types

using HistArray = std::vector< std::unique_ptr< TH1 > >
 

Public Member Functions

 TElectronEfficiencyCorrectionTool (const char *name="TElectronEfficiencyCorrectionTool")
 Standard constructor. More...
 
 ~TElectronEfficiencyCorrectionTool ()=default
 Standard destructor. More...
 
void addFileName (const std::string &val)
 This is more of an utility so the initialize is different wrt to an athena component. More...
 
void bookToyMCScaleFactors (const int nToyMC)
 Running these before the initialize will setup the booking of toys. More...
 
void bookCombToyMCScaleFactors (const int nToyMC)
 
int initialize ()
 Initialize this class. More...
 
int calculate (const PATCore::ParticleDataType::DataType dataType, const unsigned int runnumber, const double cluster_eta, const double et, Result &result, const bool onlyTotal=false) const
 The main calculate method: dataType PATCore::ParticleDataType::DataType (e.g DATA,FULL etc) @ runnumber the run number. More...
 
int getNbins (std::map< float, std::vector< float >> &ptEta) const
 Helpers to get the binning of the uncertainties in a std::map (pt, eta) More...
 
int getNSyst () const
 get number of systematics More...
 
void setSeed (const unsigned long int seed)
 Set the Random Seed. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Member Functions

int getHistograms ()
 Load all histograms from the input file(s) More...
 
int setupHistogramsInFolder (const TObjArray &dirNameArray, int lastIdx)
 
bool setupUncorrToySyst (std::vector< std::vector< TH1 * >> &objs, std::vector< std::vector< TH1 * >> &sysObjs, std::vector< std::vector< HistArray >> &uncorrToyMCSyst)
 
std::vector< HistArraybuildToyMCTable (const std::vector< TH1 * > &sf, const std::vector< TH1 * > &eig, const std::vector< TH1 * > &stat, const std::vector< TH1 * > &uncorr, const std::vector< std::vector< TH1 * >> &corr)
 
std::vector< TH2 * > buildSingleToyMC (const TH2 *sf, const TH2 *stat, const TH2 *uncorr, const std::vector< TH1 * > &corr, int &randomCounter)
 
TH2buildSingleCombToyMC (const TH2 *sf, const TH2 *stat, const TH2 *uncorr, const std::vector< TH1 * > &corr, const int nSys, int &randomCounter)
 
void setupTempMapsHelper (TH1 *obj, std::vector< std::vector< TH1 * >> &objs, std::vector< std::vector< TH1 * >> &sysObjs, int &seenSystematics)
 
int setup (const std::vector< TH1 * > &hists, std::vector< HistArray > &histList, std::vector< unsigned int > &beginRunNumberList, std::vector< unsigned int > &endRunNumberList, const int runNumBegin, const int runNumEnd) const
 Fill and interpret the setup, depending on which histograms are found in the input file(s) More...
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Static Private Member Functions

static void fillHistEdges (const std::vector< HistArray > &sfPerPeriodHist, std::vector< std::vector< HistEdge >> &sfPerPeriodEdges)
 

Private Attributes

bool m_doToyMC
 Flag to control Toys. More...
 
bool m_doCombToyMC
 
int m_nToyMC
 The number of toys. More...
 
unsigned long int m_seed
 The Random seed. More...
 
int m_nSysMax
 Maximum number of systematics. More...
 
std::vector< std::vector< HistArray > > m_uncorrToyMCSystFull
 
std::vector< std::vector< HistArray > > m_uncorrToyMCSystFast
 
std::vector< std::string > m_corrFileNameList
 The list of file name(s) More...
 
std::vector< unsigned int > m_begRunNumberList
 List of run numbers where histograms become valid for full simulation. More...
 
std::vector< unsigned int > m_endRunNumberList
 List of run numbers where histograms stop being valid for full simulation. More...
 
std::vector< unsigned int > m_begRunNumberListFastSim
 List of run numbers where histograms become valid for fast simulation. More...
 
std::vector< unsigned int > m_endRunNumberListFastSim
 List of run numbers where histograms stop being valid for fast simulation. More...
 
std::vector< std::vector< HistArray > > m_histList
 List of histograms for full Geant4 simulation. More...
 
std::vector< std::vector< HistEdge > > m_histEdges
 
std::vector< std::vector< HistArray > > m_sysList
 
std::vector< std::vector< HistArray > > m_fastHistList
 List of histograms for fast simulation. More...
 
std::vector< std::vector< HistEdge > > m_fastHistEdges
 
std::vector< std::vector< HistArray > > m_fastSysList
 
TRandom3 m_Rndm
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 35 of file TElectronEfficiencyCorrectionTool.h.

Member Typedef Documentation

◆ HistArray

using Root::TElectronEfficiencyCorrectionTool::HistArray = std::vector<std::unique_ptr<TH1> >

Definition at line 39 of file TElectronEfficiencyCorrectionTool.h.

Constructor & Destructor Documentation

◆ TElectronEfficiencyCorrectionTool()

TElectronEfficiencyCorrectionTool::TElectronEfficiencyCorrectionTool ( const char *  name = "TElectronEfficiencyCorrectionTool")

Standard constructor.

Definition at line 72 of file TElectronEfficiencyCorrectionTool.cxx.

74  : asg::AsgMessaging(std::string(name))
75  , m_doToyMC(false)
76  , m_doCombToyMC(false)
77  , m_nToyMC(0)
78  , m_seed(0)
79  , m_nSysMax(0)
82  , m_Rndm()
83 {
84 }

◆ ~TElectronEfficiencyCorrectionTool()

Root::TElectronEfficiencyCorrectionTool::~TElectronEfficiencyCorrectionTool ( )
default

Standard destructor.

Member Function Documentation

◆ addFileName()

void Root::TElectronEfficiencyCorrectionTool::addFileName ( const std::string &  val)
inline

This is more of an utility so the initialize is different wrt to an athena component.

Add an input file with the auxiliary measurement needed before we call initialize

Definition at line 66 of file TElectronEfficiencyCorrectionTool.h.

66  {
67  m_corrFileNameList.push_back(val);
68  }

◆ bookCombToyMCScaleFactors()

void Root::TElectronEfficiencyCorrectionTool::bookCombToyMCScaleFactors ( const int  nToyMC)
inline

Definition at line 75 of file TElectronEfficiencyCorrectionTool.h.

75  {
76  m_doCombToyMC = true;
77  m_nToyMC = nToyMC;
78  }

◆ bookToyMCScaleFactors()

void Root::TElectronEfficiencyCorrectionTool::bookToyMCScaleFactors ( const int  nToyMC)
inline

Running these before the initialize will setup the booking of toys.

Definition at line 71 of file TElectronEfficiencyCorrectionTool.h.

71  {
72  m_doToyMC = true;
73  m_nToyMC = nToyMC;
74  }

◆ buildSingleCombToyMC()

TH2 * TElectronEfficiencyCorrectionTool::buildSingleCombToyMC ( const TH2 sf,
const TH2 stat,
const TH2 uncorr,
const std::vector< TH1 * > &  corr,
const int  nSys,
int &  randomCounter 
)
private

Definition at line 429 of file TElectronEfficiencyCorrectionTool.cxx.

436 {
437 
438  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
439  << "Entering function buildSingleCombToyMC");
440 
441  TH2* tmpHist;
442  const int nBins = (stat->GetNbinsX() + 2) * (stat->GetNbinsY() + 2);
443  tmpHist = (TH2*)corr.at(0)->Clone();
444  // Create random numbers for the corr. uncertainties
445  std::vector<double> rnd(nSys, 0);
446  for (int s = 0; s < nSys; ++s) {
447  rnd[s] = m_Rndm.Gaus(0, 1);
448  randomCounter++;
449  }
450  // Loop over all bins
451  for (int bin = 0; bin < nBins; ++bin) {
452  double val = stat->GetBinContent(bin);
453 
454  // Add uncorrelated systematics
455  if (uncorr != nullptr) {
456  double valAdd = uncorr->GetBinContent(bin);
457  val = sqrt(val * val + valAdd * valAdd);
458  }
459  val = val * m_Rndm.Gaus(0, 1);
460  randomCounter++;
461  // Add larger correlated systematics
462  for (int s = 0; s < nSys; ++s) {
463  if (corr.at(s) != nullptr) {
464  val += static_cast<TH2*>(corr.at(s))->GetBinContent(bin) * rnd[s];
465  }
466  }
467  tmpHist->SetBinContent(bin, val + sf->GetBinContent(bin));
468  }
469  tmpHist->SetDirectory(nullptr);
470  return tmpHist;
471 }

◆ buildSingleToyMC()

std::vector< TH2 * > TElectronEfficiencyCorrectionTool::buildSingleToyMC ( const TH2 sf,
const TH2 stat,
const TH2 uncorr,
const std::vector< TH1 * > &  corr,
int &  randomCounter 
)
private

Definition at line 389 of file TElectronEfficiencyCorrectionTool.cxx.

395 {
396  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")! "
397  << "Entering function buildSingleToyMC");
398  std::vector<TH2*> tmpHists;
399  int nBins = (stat->GetNbinsX() + 2) * (stat->GetNbinsY() + 2);
400  tmpHists.reserve(m_nToyMC);
401  for (int toy = 0; toy < m_nToyMC; toy++) {
402  tmpHists.push_back((TH2*)corr.at(0)->Clone());
403  }
404  // Loop over all bins
405  for (int bin = 0; bin < nBins; bin++) {
406  double val = stat->GetBinContent(bin);
407 
408  // Add uncorrelated systematics
409  if (uncorr != nullptr) {
410  double valAdd = uncorr->GetBinContent(bin);
411  val = sqrt(val * val + valAdd * valAdd);
412  }
413  for (int toy = 0; toy < m_nToyMC; toy++) {
414  tmpHists.at(toy)->SetBinContent(
415  bin, (val * m_Rndm.Gaus(0, 1)) + sf->GetBinContent(bin));
416  randomCounter++;
417  tmpHists.at(toy)->SetDirectory(nullptr);
418  }
419  }
420  return tmpHists;
421 }

◆ buildToyMCTable()

std::vector< Root::TElectronEfficiencyCorrectionTool::HistArray > TElectronEfficiencyCorrectionTool::buildToyMCTable ( const std::vector< TH1 * > &  sf,
const std::vector< TH1 * > &  eig,
const std::vector< TH1 * > &  stat,
const std::vector< TH1 * > &  uncorr,
const std::vector< std::vector< TH1 * >> &  corr 
)
private

Definition at line 476 of file TElectronEfficiencyCorrectionTool.cxx.

482 {
483 
484  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
485  << "Entering function buildToyMCTable");
486 
487  int nSys{};
488  int randomCounter(0);
489  std::vector<HistArray> tmpVec;
490  const int stat_entries = stat.size();
491  if (m_doCombToyMC) {
492  for (int toyMC = 0; toyMC < m_nToyMC; toyMC++) {
493  HistArray tmpArray;
494  for (int i = 0; i < stat_entries; ++i) {
495  if (!eig.empty() && !uncorr.empty()) {
496  nSys = ((TH1*)eig.at(i))->GetNbinsX() - 1;
497  tmpArray.emplace_back(buildSingleCombToyMC((TH2*)sf.at(i),
498  (TH2*)stat.at(i),
499  (TH2*)uncorr.at(i),
500  corr.at(i),
501  nSys,
502  randomCounter));
503  } else {
504  tmpArray.emplace_back(buildSingleCombToyMC((TH2*)sf.at(i),
505  (TH2*)stat.at(i),
506  nullptr,
507  corr.at(i),
508  nSys,
509  randomCounter));
510  }
511  }
512  tmpVec.emplace_back(std::move(tmpArray));
513  }
514  } else {
515  std::vector<std::vector<TH2*>> tmpVec2;
516  for (int i = 0; i < stat_entries; ++i) {
517  nSys = ((TH1*)eig.at(i))->GetNbinsX() - 1;
518  tmpVec2.push_back(buildSingleToyMC((TH2*)sf.at(i),
519  (TH2*)stat.at(i),
520  (TH2*)uncorr.at(i),
521  corr.at(i),
522  randomCounter));
523  }
524  for (int toy = 0; toy < m_nToyMC; toy++) {
525  HistArray tmpArray;
526  for (auto& i : tmpVec2) {
527  tmpArray.emplace_back(i.at(toy));
528  }
529  tmpVec.emplace_back(std::move(tmpArray));
530  }
531  }
532  return tmpVec;
533 }

◆ calculate()

int TElectronEfficiencyCorrectionTool::calculate ( const PATCore::ParticleDataType::DataType  dataType,
const unsigned int  runnumber,
const double  cluster_eta,
const double  et,
Result result,
const bool  onlyTotal = false 
) const

The main calculate method: dataType PATCore::ParticleDataType::DataType (e.g DATA,FULL etc) @ runnumber the run number.

1st dimension of the stored measurements @ cluster_eta the cluster eta. 2nd dimension of the stored measurements @ electron et. third dimension of the stored measurments @ result struct filled with SF, Total uncertainty, Stat uncertainty, Uncorr uncertainty @ onlyTotal do only the "total" systematic returns 0 in failure

Toy production is controlled by internal flags set by the Asg Tool. As toys are special.

Definition at line 152 of file TElectronEfficiencyCorrectionTool.cxx.

159 {
160  // Set up the non-0 defaults
161  result.SF = -999;
162  result.Total = 1;
163  /*
164  * Determine Simulation flavour and find the run period
165  */
167  int runnumberIndex = -1;
168  if (isFastSim) {
169  for (unsigned int i = 0; i < m_begRunNumberListFastSim.size(); ++i) {
172  runnumberIndex = i;
173  break;
174  }
175  }
176  } else {
177  for (unsigned int i = 0; i < m_begRunNumberList.size(); ++i) {
178  if (m_begRunNumberList[i] <= runnumber &&
180  runnumberIndex = i;
181  break;
182  }
183  }
184  }
185  if (runnumberIndex < 0) {
186  return 0;
187  }
188  /* What we have is a vector<vector<HistArray>> acting as a map:
189  * Key/Index is SF,Stat,Eigen,UnCorr
190  * The Entry in this index is a vector<HistArray>
191  * Each vector<HistArray> has as many entries as supported Run periods.
192  * Each HistArray has 2D histos (could be standard, low-et, or forward
193  * electrons) The 2D Histo then has the number we want. What follows is the
194  * logic to get to this number.
195  */
196  const auto& currentmap = (isFastSim) ? m_fastHistList : m_histList;
197  const std::vector<HistArray>& sfVector = currentmap.at(mapkey::sf);
198  /*
199  * See if we can find a vector for key SF in the map
200  * and then if we can get the corresponding HisArray
201  * for the run period.
202  */
203  if (sfVector.empty() || runnumberIndex >= static_cast<int>(sfVector.size())) {
204  return 0;
205  }
206  /*
207  * At this stage we have found the relevant period
208  * So we need to locate the right histogram.
209  */
210  const HistArray& sfObjectArray = sfVector[runnumberIndex];
211  const auto& edges = (isFastSim) ? m_fastHistEdges[runnumberIndex]
212  : m_histEdges[runnumberIndex];
213  const int entries = edges.size();
214  /*
215  * Now the logic of finding the histogram
216  * Some parts of the code can be perhaps improved ...
217  */
218  double xValue(et);
219  double yValue(cluster_eta);
220  int smallEt(0);
221  int etaCov(0);
222  int nSF(0);
223  bool invalid = false;
224  bool changedEt = false;
225  int index = -1;
226 
227  for (int i = 0; i < entries; ++i) {
228  invalid = false;
229  const HistEdge& histEdge = edges[i];
230  // invalid if we are below minimum et
231  if (et < histEdge.etMin) {
232  smallEt++;
233  invalid = true;
234  }
235  // invalid if we are above max eta
236  if (std::abs(yValue) >= histEdge.etaMax) {
237  etaCov++;
238  invalid = true;
239  }
240  // invalid if we are less than minimum eta (forward electrons)
241  if (std::abs(yValue) < histEdge.etaMin) {
242  etaCov++;
243  invalid = true;
244  }
245  /*
246  * Invalid if above max et and is a low Et histogram.
247  * If not low Et histogram then change the xValue to the maximum
248  * availabe Et of ths histogram. As we assume that the SF stays the same
249  * for very high Et
250  */
251  if (et > histEdge.etMax) {
252  if (histEdge.isLowPt) {
253  invalid = true;
254  } else {
255  xValue = histEdge.etMax - 1000 ; //1000 is 1 GeV
256  changedEt = true;
257  }
258  }
259  /*
260  * Get the histogram index in the TObjArray
261  * Also mark how many times we found something
262  * as SF should be unique
263  */
264  if (!invalid) {
265  index = i;
266  if (!changedEt) {
267  nSF++;
268  }
269  }
270  }
271  if (smallEt == entries) {
272  return 0;
273  }
274  if (etaCov == entries) {
275  return 0;
276  }
277  if (nSF > 1) {
278  ATH_MSG_WARNING("More than 1 SF found for eta="
279  << yValue << " , et = " << et << " , run number = "
280  << runnumber << ". Please check your input files!");
281  }
282  if (index < 0) {
283  return 0;
284  }
285 
286  /*
287  * Now we have the index of the histogram
288  */
289  const HistEdge& currentEdge = edges[index];
290  /*
291  * If SF is only given in Abs(eta) convert eta input to std::abs()
292  */
293  constexpr double epsilon = 1e-6;
294  if (currentEdge.etaMin >= (0 - epsilon)) {
295  yValue = std::abs(yValue);
296  }
297 
298  const TH2* currentHist = static_cast<TH2*>(sfObjectArray[index].get()) ;
299  const int globalBinNumber = currentHist->FindFixBin(xValue, yValue);
300  const double scaleFactor = currentHist->GetBinContent(globalBinNumber);
301  const double scaleFactorErr = currentHist->GetBinError(globalBinNumber);
302  /*
303  * Write the retrieved values to the output
304  */
305  result.SF= scaleFactor;
306  result.Total = scaleFactorErr;
307  result.histIndex = index;
308  result.histBinNum = globalBinNumber;
309  /*
310  * if we only wanted the Total we can exit here
311  */
312  if (onlyTotal) {
313  return 1;
314  }
315  /*
316  * Do the stat error using the available info from the above (SF)
317  */
318  double statErr = -999;
319  const std::vector<HistArray>& statVector = currentmap.at(mapkey::stat);
320  if (!statVector.empty()) {
321  if (!statVector[runnumberIndex].empty()) {
322  statErr = static_cast<TH1*>(statVector[runnumberIndex][index].get())
323  ->GetBinContent(globalBinNumber);
324  result.Stat = statErr;
325  }
326  }
327  /*
328  * Do the Uncorr uncertainty
329  */
330  double val = statErr;
331  const std::vector<HistArray>& uncorrVector = currentmap.at(mapkey::uncorr);
332  if (!uncorrVector.empty()) {
333  if (!uncorrVector.at(runnumberIndex).empty()) {
334  const double valAdd =
335  static_cast<TH1*>(uncorrVector[runnumberIndex][index].get())
336  ->GetBinContent(globalBinNumber);
337  val = sqrt(val * val + valAdd * valAdd);
338  }
339  }
340  result.UnCorr = val;
341  /*
342  * Do the correlated part
343  * For the N~16 systematic variations
344  * we keep them in a vector of vector of HistArray
345  * The first vector index being the runnumber
346  * The second the systematic
347  * And them the HistArray for high low etc.
348  */
349  result.Corr.resize(m_nSysMax);
350  const std::vector<std::vector<HistArray>>& sysList =
352  if (sysList.size() > static_cast<unsigned int>(index)) {
353  if (sysList.at(index).size() > static_cast<unsigned int>(runnumberIndex)) {
354  const int sys_entries = sysList.at(index).at(runnumberIndex).size();
355  for (int sys = 0; sys < sys_entries; ++sys) {
356  double sysVal =
357  static_cast<TH2*>(sysList[index][runnumberIndex][sys].get())
358  ->GetBinContent(globalBinNumber);
359  result.Corr[sys] = sysVal;
360  }
361  }
362  }
363  /*
364  * Do the toys if requested
365  */
366  if (m_doToyMC || m_doCombToyMC) {
367  result.toys.resize(static_cast<size_t>(m_nToyMC));
368  const std::vector<std::vector<HistArray>>& toyMCList =
370  if (toyMCList.size() > (unsigned int)runnumberIndex) {
371  for (int toy = 0; toy < m_nToyMC; ++toy) {
372  if (toyMCList[runnumberIndex][toy].size() >
373  static_cast<unsigned int>(index)) {
374  result.toys[toy] =
375  static_cast<TH2*>(toyMCList[runnumberIndex][toy][index].get())
376  ->GetBinContent(globalBinNumber);
377  }
378  }
379  }
380  }
381  return 1;
382 }

◆ fillHistEdges()

void TElectronEfficiencyCorrectionTool::fillHistEdges ( const std::vector< HistArray > &  sfPerPeriodHist,
std::vector< std::vector< HistEdge >> &  sfPerPeriodEdges 
)
staticprivate

Definition at line 922 of file TElectronEfficiencyCorrectionTool.cxx.

924  {
925 
926  for (const auto& vec : sfPerPeriodHist) {
927  const size_t vecSize = vec.size();
928  std::vector<HistEdge> periodVec;
929  periodVec.reserve(vecSize);
930  for (size_t i = 0; i < vecSize; ++i) {
931  const auto* tmpHist = static_cast<TH2*>(vec[i].get());
932  const auto* const xAxis = tmpHist->GetXaxis();
933  const auto* yAxis = tmpHist->GetYaxis();
934  HistEdge histEdge;
935  histEdge.etaMax = yAxis->GetXmax();
936  histEdge.etaMin = yAxis->GetXmin();
937  histEdge.etMax = xAxis->GetXmax();
938  histEdge.etMin = xAxis->GetXmin();
939  histEdge.isLowPt =
940  (std::strstr(tmpHist->GetName(), LowPt_string) != nullptr);
941 
942  periodVec.emplace_back(histEdge);
943  }
944  sfPerPeriodEdges.emplace_back(std::move(periodVec));
945  }
946 }

◆ getHistograms()

int TElectronEfficiencyCorrectionTool::getHistograms ( )
private

Load all histograms from the input file(s)

Definition at line 579 of file TElectronEfficiencyCorrectionTool.cxx.

580 {
581 
582  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
583  << "Entering function getHistograms");
584  // Cache the current directory in the root file
585  TDirectory* origDir = gDirectory;
586  /*
587  * Get the name of the first input ROOT file and
588  * interpret from that what we have:
589  * efficiency vs. efficiencySF; offline vs. trigger; medium, loose,...
590  */
591  if (!m_corrFileNameList.empty()) {
592  TString firstFileNameAndPath = m_corrFileNameList[0].c_str();
593  std::unique_ptr<TObjArray> myStringList(firstFileNameAndPath.Tokenize("/"));
594  int lastIdx = myStringList->GetLast();
595  TString fileName = ((TObjString*)myStringList->At(lastIdx))->GetString();
596  std::unique_ptr<TObjArray> myFileNameTokensList(fileName.Tokenize("."));
597 
598  if (myFileNameTokensList->GetLast() < 3) {
599  ATH_MSG_ERROR("input file name has wrong format!");
600  return 0;
601  }
602  }
603  /*
604  * Get all ROOT files and histograms
605  */
606  for (auto& ifile : m_corrFileNameList) {
607  // Load the ROOT file
608  const std::unique_ptr<char[]> fname(gSystem->ExpandPathName(ifile.c_str()));
609  std::unique_ptr<TFile> rootFile(TFile::Open(fname.get(), "READ"));
610  if (!rootFile) {
611  ATH_MSG_ERROR("No ROOT file found here: " << ifile);
612  return 0;
613  }
614  // Loop over all directories inside the root file (correspond to the run
615  // number ranges
616  TIter nextdir(rootFile->GetListOfKeys());
617  TKey* dir = nullptr;
618  TObject* obj = nullptr;
619  while ((dir = (TKey*)nextdir())) {
620  obj = dir->ReadObj();
621  if (obj->IsA()->InheritsFrom("TDirectory")) {
622  // splits string by delimiter --> e.g RunNumber1_RunNumber2
623  std::unique_ptr<TObjArray> dirNameArray(
624  TString(obj->GetName()).Tokenize("_"));
625  // returns index of last string --> if one, the directory name does not
626  // contain any run numbers
627  int lastIdx = dirNameArray->GetLast();
628  if (lastIdx != 1) {
630  "The folder name seems to have the wrong format! Directory name:"
631  << obj->GetName());
632  return 0;
633  }
634  rootFile->cd(obj->GetName());
635  if (0 == this->setupHistogramsInFolder(*dirNameArray, lastIdx)) {
636  ATH_MSG_ERROR("Unable to setup the histograms in directory "
637  << dir->GetName() << "in file " << ifile);
638  return 0;
639  }
640  } else {
641  ATH_MSG_ERROR("Wrong file content! Expected only Directories "
642  << gDirectory->cd());
643  return 0;
644  }
645  // Return to the original ROOT directory
647  } // End: directory loop
648  } // End: file loop
649  return 1;
650 }

◆ getNbins()

int TElectronEfficiencyCorrectionTool::getNbins ( std::map< float, std::vector< float >> &  ptEta) const

Helpers to get the binning of the uncertainties in a std::map (pt, eta)

Definition at line 538 of file TElectronEfficiencyCorrectionTool.cxx.

540 {
541  // Get sf histograms
542  const std::vector<HistArray>& tmpVec = (!m_histList[mapkey::sf].empty())
545 
546  int nbinsTotal = 0;
547  pt_eta1.clear();
548  std::vector<float> eta1;
549  eta1.clear();
550 
551  // Loop over the different Run range (one TObjeArray for each)
552  for (const auto& ikey : tmpVec) {
553  // Loop over the histograms for a given run numbers
554  for (const auto& entries : ikey) {
555  eta1.clear();
556  // Get number of bins
557  TH2* h_tmp = ((TH2*)entries.get());
558  int nbinsX = h_tmp->GetNbinsX();
559  int nbinsY = h_tmp->GetNbinsY();
560  // fill in the eta pushing back
561  for (int biny = 1; biny <= nbinsY; ++biny) {
562  eta1.push_back(h_tmp->GetYaxis()->GetBinLowEdge(biny));
563  }
564  // associate each pt (bin) with the corresponding/available eta ones
565  for (int binx = 1; binx <= nbinsX; ++binx) {
566  pt_eta1[h_tmp->GetXaxis()->GetBinLowEdge(binx)] = eta1;
567  }
568  }
569  }
570  for (auto& i : pt_eta1) {
571  nbinsTotal += i.second.size();
572  }
573  return nbinsTotal;
574 }

◆ getNSyst()

int Root::TElectronEfficiencyCorrectionTool::getNSyst ( ) const
inline

get number of systematics

Definition at line 107 of file TElectronEfficiencyCorrectionTool.h.

107 { return m_nSysMax; }

◆ initialize()

int TElectronEfficiencyCorrectionTool::initialize ( )

Initialize this class.

Definition at line 87 of file TElectronEfficiencyCorrectionTool.cxx.

88 {
89  // use an int as a StatusCode
90  int sc(1);
91  // Check if files are present
92  if (m_corrFileNameList.empty()) {
93  ATH_MSG_ERROR(" No file added!");
94  return 0;
95  }
96  ATH_MSG_DEBUG("Initializing tool with " << m_corrFileNameList.size()
97  << " configuration file(s)");
98 
99  if (m_doToyMC && m_doCombToyMC) {
100  ATH_MSG_ERROR(" Both regular and combined toy MCs booked!"
101  << " Only use one!");
102  return 0;
103  }
104  /*
105  * initialize the random number generator if toyMC propagation booked
106  * Use the 1st 4 bytes of the CheckSum of the reccomendation file as seed
107  */
108  if (m_doToyMC || m_doCombToyMC) {
109  if (m_seed == 0) {
110  // Use the name of the correction for auto-setting of the seed based on
111  // the md5-sum of the file
112  const std::unique_ptr<char[]> fname(
113  gSystem->ExpandPathName(m_corrFileNameList[0].c_str()));
114  std::unique_ptr<TMD5> tmd = std::make_unique<TMD5>();
115  const char* tmd_as_string = tmd->FileChecksum(fname.get())->AsString();
116  m_seed = *(reinterpret_cast<const unsigned long int*>(tmd_as_string));
117  ATH_MSG_DEBUG("Seed (automatically) set to " << m_seed);
118  } else {
119  ATH_MSG_DEBUG("Seed set to " << m_seed);
120  }
121  m_Rndm = TRandom3(m_seed);
122  }
123  /*
124  * Load the needed histograms
125  */
126  if (0 == getHistograms()) {
127  ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
128  << "! Problem when calling getHistograms()");
129  return 0;
130  }
131  const unsigned int nRunNumbersFull = m_begRunNumberList.size();
132  const unsigned int nRunNumbersFast = m_begRunNumberListFastSim.size();
133 
134  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
135  << "Found " << nRunNumbersFast
136  << " run number ranges for fast sim with a total of "
138  << " scale factor histograms.");
139 
140  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
141  << "Found " << nRunNumbersFull
142  << " run number ranges for full sim with a total of "
144  << " scale factor histograms.");
145 
146  ATH_MSG_DEBUG("Tool succesfully initialized!");
147 
148  return sc;
149 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 49 of file AsgMessaging.cxx.

49  {
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
53  return m_msg;
54 #endif // not XAOD_STANDALONE
55  }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level  lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 57 of file AsgMessaging.cxx.

57  {
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
61  m_msg << lvl;
62  return m_msg;
63 #endif // not XAOD_STANDALONE
64  }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level  lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 41 of file AsgMessaging.cxx.

41  {
42 #ifndef XAOD_STANDALONE
43  return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45  return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
47  }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setSeed()

void Root::TElectronEfficiencyCorrectionTool::setSeed ( const unsigned long int  seed)
inline

Set the Random Seed.

Definition at line 110 of file TElectronEfficiencyCorrectionTool.h.

110 { m_seed = seed; }

◆ setup()

int TElectronEfficiencyCorrectionTool::setup ( const std::vector< TH1 * > &  hists,
std::vector< HistArray > &  histList,
std::vector< unsigned int > &  beginRunNumberList,
std::vector< unsigned int > &  endRunNumberList,
const int  runNumBegin,
const int  runNumEnd 
) const
private

Fill and interpret the setup, depending on which histograms are found in the input file(s)

Definition at line 883 of file TElectronEfficiencyCorrectionTool.cxx.

890 {
891  if (hists.empty()) {
892  ATH_MSG_ERROR("! Could NOT find histogram with name *_sf in folder");
893  return 0;
894  }
895  TH1* tmpHist(nullptr);
896  HistArray tmpArray;
897  for (const auto& hist : hists) {
898  tmpHist = static_cast<TH1*>(hist);
899  tmpHist->SetDirectory(nullptr);
900  tmpArray.emplace_back(tmpHist);
901  }
902  histList.emplace_back(std::move(tmpArray));
903  // Now, we have all the needed info. Fill the vectors accordingly
904  if (!beginRunNumberList.empty()) {
905  if (runNumBegin != (int)beginRunNumberList.back()) {
906  beginRunNumberList.push_back(runNumBegin);
907  }
908  } else {
909  beginRunNumberList.push_back(runNumBegin);
910  }
911  if (!endRunNumberList.empty()) {
912  if (runNumEnd != (int)endRunNumberList.back()) {
913  endRunNumberList.push_back(runNumEnd);
914  }
915  } else {
916  endRunNumberList.push_back(runNumEnd);
917  }
918  return 1;
919 }

◆ setupHistogramsInFolder()

int TElectronEfficiencyCorrectionTool::setupHistogramsInFolder ( const TObjArray &  dirNameArray,
int  lastIdx 
)
private

setup obj arrays at specific indices

Definition at line 655 of file TElectronEfficiencyCorrectionTool.cxx.

658 {
659 
660  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
661  << "Entering funtion setupHistogramsInFolder");
662 
663  int runNumBegin(-1);
664  TString myBegRunNumString =
665  ((TObjString*)dirNameArray.At(lastIdx - 1))->GetString();
666  if (myBegRunNumString.IsDigit()) {
667  runNumBegin = myBegRunNumString.Atoi();
668  }
669  int runNumEnd(-1);
670  TString myEndRunNumString =
671  ((TObjString*)dirNameArray.At(lastIdx))->GetString();
672  if (myEndRunNumString.IsDigit()) {
673  runNumEnd = myEndRunNumString.Atoi();
674  }
675  if (runNumBegin < 0 || runNumEnd < 0 || runNumEnd < runNumBegin) {
676  ATH_MSG_ERROR(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
677  << "Could NOT interpret the run number range: "
678  << runNumBegin << " - " << runNumEnd);
679  return 0;
680  }
682  //--> e.g. "sf" index 0 ,
683  std::vector<std::vector<TH1*>> objsFull(mapkey::end);
684  std::vector<std::vector<TH1*>> objsFast(mapkey::end);
685  // Vector to hold the N~16 systematic variations
686  std::vector<std::vector<TH1*>> sysObjsFull;
687  std::vector<std::vector<TH1*>> sysObjsFast;
688  TIter nextkey(gDirectory->GetListOfKeys());
689  TKey* key = nullptr;
690  TObject* obj = nullptr;
691  int seenSystematics = 0;
692  // Loop of the keys
693  while ((key = (TKey*)nextkey())) {
694  obj = key->ReadObj();
695  if (obj->IsA()->InheritsFrom("TH1")) {
696  // The histogram containing the scale factors need to end with _sf and
697  // need to contain either the string "FullSim" or "AtlFast"!
698  if (std::strstr(obj->GetName(), "FullSim") != nullptr) {
700  static_cast<TH1*>(obj), objsFull, sysObjsFull, seenSystematics);
701  } else if (std::strstr(obj->GetName(), "AtlFast") != nullptr) {
703  static_cast<TH1*>(obj), objsFast, sysObjsFast, seenSystematics);
704  } else {
705  ATH_MSG_ERROR("Could NOT interpret if the histogram: "
706  << obj->GetName() << " is full or fast simulation!");
707  return 0;
708  }
709  }
710  }
711  ATH_MSG_DEBUG(" (file: " << __FILE__ << ", line: " << __LINE__ << ")\n"
712  << "Setting up histograms for Run range "
713  << runNumEnd);
714  // Copy from the temporaries to the actual member variables
715  // via the setup function
716  for (int key : s_keys) {
717  if (!objsFull.at(key).empty()) {
718  if (0 == setup(objsFull.at(key),
719  m_histList[key],
722  runNumBegin,
723  runNumEnd)) {
724  ATH_MSG_ERROR("! Could NOT setup histogram " << key
725  << " for full sim!");
726  return 0;
727  }
728  }
729  if (!objsFast.at(key).empty()) {
730  if (0 == setup(objsFast.at(key),
734  runNumBegin,
735  runNumEnd)) {
736  ATH_MSG_ERROR("! Could NOT setup histogram " << key << " for fast sim");
737  return 0;
738  }
739  }
740  }
741  m_fastSysList.resize(sysObjsFast.size());
742  for (unsigned int sys = 0; sys < sysObjsFast.size(); sys++) {
743  if (0 == setup(sysObjsFast.at(sys),
747  runNumBegin,
748  runNumEnd)) {
749  ATH_MSG_ERROR("! Could NOT setup systematic histograms for fast sim");
750  return 0;
751  }
752  }
753  m_sysList.resize(sysObjsFull.size());
754  for (unsigned int sys = 0; sys < sysObjsFull.size(); sys++) {
755  if (0 == setup(sysObjsFull.at(sys),
756  m_sysList[sys],
759  runNumBegin,
760  runNumEnd)) {
761  ATH_MSG_ERROR("! Could NOT setup systematic histograms for fast sim");
762  return 0;
763  }
764  }
765  //Histogram edges
768 
769  // Toys
770  if (m_doToyMC || m_doCombToyMC) {
771  bool fullToysBooked =
772  setupUncorrToySyst(objsFull, sysObjsFull, m_uncorrToyMCSystFull);
773  bool fastToysBooked =
774  setupUncorrToySyst(objsFast, sysObjsFast, m_uncorrToyMCSystFast);
775  if (fullToysBooked || fastToysBooked) {
776  if (m_doToyMC) {
777  ATH_MSG_DEBUG("Created tables for " << m_nToyMC
778  << " ToyMC systematics ");
779  }
780  if (m_doCombToyMC) {
781  ATH_MSG_DEBUG("Created tables for " << m_nToyMC
782  << " combined ToyMC systematics ");
783  }
784  }
785  }
786  return 1;
787 }

◆ setupTempMapsHelper()

void TElectronEfficiencyCorrectionTool::setupTempMapsHelper ( TH1 obj,
std::vector< std::vector< TH1 * >> &  objs,
std::vector< std::vector< TH1 * >> &  sysObjs,
int &  seenSystematics 
)
private

Definition at line 793 of file TElectronEfficiencyCorrectionTool.cxx.

798 {
799  // Add all except the correlated
800  for (int key : s_keys) {
801  if (TString(obj->GetName())
802  .EndsWith("_" + TString(mapkey::keytostring(key)))) {
803  objs.at(key).emplace_back(obj);
804  }
805  }
806 
807  const TString tmpName(obj->GetName());
808  // Special treatment , this is only for photons
809  if (tmpName.EndsWith("_sys")) {
810  objs.at(mapkey::sys).emplace_back(obj);
811  std::vector<TH1*> tmpArray;
812  // clone
813  tmpArray.emplace_back(static_cast<TH1*>(obj->Clone()));
814  sysObjs.emplace_back(tmpArray);
815  seenSystematics++;
816  }
817  // See if we are dealing with correlated
818  if (tmpName.Contains("_corr")) {
819  /*
820  * corr0 in the name triggers a few things
821  * We assume that 0 is the 1st
822  * histogram in a series of corr(i) that
823  * we see for each of the vector entries that
824  * can be one for LowPt,Standard,Forward etc
825  */
826  if (tmpName.EndsWith("corr0")) {
827  // 1st create a TObjectArray
828  std::vector<TH1*> tmpArray;
829  // Register it to the vector
830  sysObjs.emplace_back(tmpArray);
831  // Reset the counter here
832  seenSystematics = 0;
833  }
834  /*
835  * Now we can add to the TObjeArray
836  * This can be Low Pt or high Pt
837  */
838  sysObjs.back().emplace_back(obj);
839  //Increase the counter
840  seenSystematics++;
841  }
842 
843  if (seenSystematics > m_nSysMax) {
844  m_nSysMax = seenSystematics;
845  }
846 }

◆ setupUncorrToySyst()

bool TElectronEfficiencyCorrectionTool::setupUncorrToySyst ( std::vector< std::vector< TH1 * >> &  objs,
std::vector< std::vector< TH1 * >> &  sysObjs,
std::vector< std::vector< HistArray >> &  uncorrToyMCSyst 
)
private

Definition at line 851 of file TElectronEfficiencyCorrectionTool.cxx.

855 {
856  bool toysBooked = false;
857  if (!m_histList[mapkey::sf].empty()) {
858  if (objs.at(mapkey::eig).empty() || objs.at(mapkey::stat).empty() ||
859  objs.at(mapkey::uncorr).empty()) {
860 
861  if (objs.at(mapkey::stat).size() > 1 || objs.at(mapkey::sys).size() > 1) {
862 
863  uncorrToyMCSyst.push_back(buildToyMCTable(
864  objs.at(mapkey::sf), {}, objs.at(mapkey::stat), {}, sysObjs));
865  toysBooked = true;
866  }
867  } else {
868  uncorrToyMCSyst.push_back(buildToyMCTable(objs.at(mapkey::sf),
869  objs.at(mapkey::eig),
870  objs.at(mapkey::stat),
871  objs.at(mapkey::uncorr),
872  sysObjs));
873  toysBooked = true;
874  }
875  }
876  return toysBooked;
877 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_begRunNumberList

std::vector<unsigned int> Root::TElectronEfficiencyCorrectionTool::m_begRunNumberList
private

List of run numbers where histograms become valid for full simulation.

Definition at line 183 of file TElectronEfficiencyCorrectionTool.h.

◆ m_begRunNumberListFastSim

std::vector<unsigned int> Root::TElectronEfficiencyCorrectionTool::m_begRunNumberListFastSim
private

List of run numbers where histograms become valid for fast simulation.

Definition at line 188 of file TElectronEfficiencyCorrectionTool.h.

◆ m_corrFileNameList

std::vector<std::string> Root::TElectronEfficiencyCorrectionTool::m_corrFileNameList
private

The list of file name(s)

Definition at line 181 of file TElectronEfficiencyCorrectionTool.h.

◆ m_doCombToyMC

bool Root::TElectronEfficiencyCorrectionTool::m_doCombToyMC
private

Definition at line 170 of file TElectronEfficiencyCorrectionTool.h.

◆ m_doToyMC

bool Root::TElectronEfficiencyCorrectionTool::m_doToyMC
private

Flag to control Toys.

Definition at line 169 of file TElectronEfficiencyCorrectionTool.h.

◆ m_endRunNumberList

std::vector<unsigned int> Root::TElectronEfficiencyCorrectionTool::m_endRunNumberList
private

List of run numbers where histograms stop being valid for full simulation.

Definition at line 186 of file TElectronEfficiencyCorrectionTool.h.

◆ m_endRunNumberListFastSim

std::vector<unsigned int> Root::TElectronEfficiencyCorrectionTool::m_endRunNumberListFastSim
private

List of run numbers where histograms stop being valid for fast simulation.

Definition at line 191 of file TElectronEfficiencyCorrectionTool.h.

◆ m_fastHistEdges

std::vector<std::vector<HistEdge> > Root::TElectronEfficiencyCorrectionTool::m_fastHistEdges
private

Definition at line 198 of file TElectronEfficiencyCorrectionTool.h.

◆ m_fastHistList

std::vector<std::vector<HistArray> > Root::TElectronEfficiencyCorrectionTool::m_fastHistList
private

List of histograms for fast simulation.

Definition at line 197 of file TElectronEfficiencyCorrectionTool.h.

◆ m_fastSysList

std::vector<std::vector<HistArray> > Root::TElectronEfficiencyCorrectionTool::m_fastSysList
private

Definition at line 199 of file TElectronEfficiencyCorrectionTool.h.

◆ m_histEdges

std::vector<std::vector<HistEdge> > Root::TElectronEfficiencyCorrectionTool::m_histEdges
private

Definition at line 194 of file TElectronEfficiencyCorrectionTool.h.

◆ m_histList

std::vector<std::vector<HistArray> > Root::TElectronEfficiencyCorrectionTool::m_histList
private

List of histograms for full Geant4 simulation.

Definition at line 193 of file TElectronEfficiencyCorrectionTool.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_nSysMax

int Root::TElectronEfficiencyCorrectionTool::m_nSysMax
private

Maximum number of systematics.

Definition at line 176 of file TElectronEfficiencyCorrectionTool.h.

◆ m_nToyMC

int Root::TElectronEfficiencyCorrectionTool::m_nToyMC
private

The number of toys.

Definition at line 172 of file TElectronEfficiencyCorrectionTool.h.

◆ m_Rndm

TRandom3 Root::TElectronEfficiencyCorrectionTool::m_Rndm
private

Definition at line 201 of file TElectronEfficiencyCorrectionTool.h.

◆ m_seed

unsigned long int Root::TElectronEfficiencyCorrectionTool::m_seed
private

The Random seed.

Definition at line 174 of file TElectronEfficiencyCorrectionTool.h.

◆ m_sysList

std::vector<std::vector<HistArray> > Root::TElectronEfficiencyCorrectionTool::m_sysList
private

Definition at line 195 of file TElectronEfficiencyCorrectionTool.h.

◆ m_uncorrToyMCSystFast

std::vector<std::vector<HistArray> > Root::TElectronEfficiencyCorrectionTool::m_uncorrToyMCSystFast
private

Definition at line 179 of file TElectronEfficiencyCorrectionTool.h.

◆ m_uncorrToyMCSystFull

std::vector<std::vector<HistArray> > Root::TElectronEfficiencyCorrectionTool::m_uncorrToyMCSystFull
private

Definition at line 178 of file TElectronEfficiencyCorrectionTool.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
TestSUSYToolsAlg.ifile
ifile
Definition: TestSUSYToolsAlg.py:92
et
Extra patterns decribing particle interation process.
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
get_generator_info.result
result
Definition: get_generator_info.py:21
mapkey::keytostring
const char * keytostring(int input)
Definition: TElectronEfficiencyCorrectionTool.cxx:46
Root::TElectronEfficiencyCorrectionTool::m_Rndm
TRandom3 m_Rndm
Definition: TElectronEfficiencyCorrectionTool.h:201
Root::TElectronEfficiencyCorrectionTool::m_seed
unsigned long int m_seed
The Random seed.
Definition: TElectronEfficiencyCorrectionTool.h:174
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Root::TElectronEfficiencyCorrectionTool::setupUncorrToySyst
bool setupUncorrToySyst(std::vector< std::vector< TH1 * >> &objs, std::vector< std::vector< TH1 * >> &sysObjs, std::vector< std::vector< HistArray >> &uncorrToyMCSyst)
Definition: TElectronEfficiencyCorrectionTool.cxx:851
mapkey::uncorr
@ uncorr
Definition: TElectronEfficiencyCorrectionTool.cxx:41
Root::TElectronEfficiencyCorrectionTool::m_histEdges
std::vector< std::vector< HistEdge > > m_histEdges
Definition: TElectronEfficiencyCorrectionTool.h:194
index
Definition: index.py:1
plotmaker.hist
hist
Definition: plotmaker.py:148
Root::TElectronEfficiencyCorrectionTool::m_doToyMC
bool m_doToyMC
Flag to control Toys.
Definition: TElectronEfficiencyCorrectionTool.h:169
PATCore::ParticleDataType::Fast
@ Fast
Definition: PATCoreEnums.h:22
bin
Definition: BinsDiffFromStripMedian.h:43
downloadSingle.dataType
string dataType
Definition: downloadSingle.py:18
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
Root::TElectronEfficiencyCorrectionTool::m_begRunNumberListFastSim
std::vector< unsigned int > m_begRunNumberListFastSim
List of run numbers where histograms become valid for fast simulation.
Definition: TElectronEfficiencyCorrectionTool.h:188
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
Root::TElectronEfficiencyCorrectionTool::m_nSysMax
int m_nSysMax
Maximum number of systematics.
Definition: TElectronEfficiencyCorrectionTool.h:176
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Root::TElectronEfficiencyCorrectionTool::m_corrFileNameList
std::vector< std::string > m_corrFileNameList
The list of file name(s)
Definition: TElectronEfficiencyCorrectionTool.h:181
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Root::TElectronEfficiencyCorrectionTool::m_uncorrToyMCSystFast
std::vector< std::vector< HistArray > > m_uncorrToyMCSystFast
Definition: TElectronEfficiencyCorrectionTool.h:179
fitman.tmpHist
def tmpHist(what, wmin=-1e10, wmax=+1e10)
Definition: fitman.py:146
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParseInputs.gDirectory
gDirectory
Definition: Final2012/ParseInputs.py:133
lumiFormat.i
int i
Definition: lumiFormat.py:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
mergePhysValFiles.origDir
origDir
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:24
Root::TElectronEfficiencyCorrectionTool::m_uncorrToyMCSystFull
std::vector< std::vector< HistArray > > m_uncorrToyMCSystFull
Definition: TElectronEfficiencyCorrectionTool.h:178
checkFileSG.objs
list objs
Definition: checkFileSG.py:93
Root::TElectronEfficiencyCorrectionTool::buildSingleToyMC
std::vector< TH2 * > buildSingleToyMC(const TH2 *sf, const TH2 *stat, const TH2 *uncorr, const std::vector< TH1 * > &corr, int &randomCounter)
Definition: TElectronEfficiencyCorrectionTool.cxx:389
Root::TElectronEfficiencyCorrectionTool::getHistograms
int getHistograms()
Load all histograms from the input file(s)
Definition: TElectronEfficiencyCorrectionTool.cxx:579
mapkey::end
@ end
Definition: TElectronEfficiencyCorrectionTool.cxx:43
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
Root::TElectronEfficiencyCorrectionTool::m_endRunNumberListFastSim
std::vector< unsigned int > m_endRunNumberListFastSim
List of run numbers where histograms stop being valid for fast simulation.
Definition: TElectronEfficiencyCorrectionTool.h:191
jobOptions.isFastSim
string isFastSim
Definition: jobOptions.py:54
Root::TElectronEfficiencyCorrectionTool::m_fastSysList
std::vector< std::vector< HistArray > > m_fastSysList
Definition: TElectronEfficiencyCorrectionTool.h:199
mapkey::eig
@ eig
Definition: TElectronEfficiencyCorrectionTool.cxx:40
TH2
Definition: rootspy.cxx:373
Root::TElectronEfficiencyCorrectionTool::m_begRunNumberList
std::vector< unsigned int > m_begRunNumberList
List of run numbers where histograms become valid for full simulation.
Definition: TElectronEfficiencyCorrectionTool.h:183
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
beamspotman.dir
string dir
Definition: beamspotman.py:623
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
Root::TElectronEfficiencyCorrectionTool::m_fastHistEdges
std::vector< std::vector< HistEdge > > m_fastHistEdges
Definition: TElectronEfficiencyCorrectionTool.h:198
Root::TElectronEfficiencyCorrectionTool::m_doCombToyMC
bool m_doCombToyMC
Definition: TElectronEfficiencyCorrectionTool.h:170
Root::TElectronEfficiencyCorrectionTool::m_histList
std::vector< std::vector< HistArray > > m_histList
List of histograms for full Geant4 simulation.
Definition: TElectronEfficiencyCorrectionTool.h:193
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
Root::TElectronEfficiencyCorrectionTool::m_fastHistList
std::vector< std::vector< HistArray > > m_fastHistList
List of histograms for fast simulation.
Definition: TElectronEfficiencyCorrectionTool.h:197
Root::TElectronEfficiencyCorrectionTool::setup
int setup(const std::vector< TH1 * > &hists, std::vector< HistArray > &histList, std::vector< unsigned int > &beginRunNumberList, std::vector< unsigned int > &endRunNumberList, const int runNumBegin, const int runNumEnd) const
Fill and interpret the setup, depending on which histograms are found in the input file(s)
Definition: TElectronEfficiencyCorrectionTool.cxx:883
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
Root::TElectronEfficiencyCorrectionTool::buildToyMCTable
std::vector< HistArray > buildToyMCTable(const std::vector< TH1 * > &sf, const std::vector< TH1 * > &eig, const std::vector< TH1 * > &stat, const std::vector< TH1 * > &uncorr, const std::vector< std::vector< TH1 * >> &corr)
Definition: TElectronEfficiencyCorrectionTool.cxx:476
Root::TElectronEfficiencyCorrectionTool::HistArray
std::vector< std::unique_ptr< TH1 > > HistArray
Definition: TElectronEfficiencyCorrectionTool.h:39
Root::TElectronEfficiencyCorrectionTool::fillHistEdges
static void fillHistEdges(const std::vector< HistArray > &sfPerPeriodHist, std::vector< std::vector< HistEdge >> &sfPerPeriodEdges)
Definition: TElectronEfficiencyCorrectionTool.cxx:922
mapkey::stat
@ stat
Definition: TElectronEfficiencyCorrectionTool.cxx:39
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
DeMoScan.index
string index
Definition: DeMoScan.py:362
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Root::TElectronEfficiencyCorrectionTool::setupTempMapsHelper
void setupTempMapsHelper(TH1 *obj, std::vector< std::vector< TH1 * >> &objs, std::vector< std::vector< TH1 * >> &sysObjs, int &seenSystematics)
Definition: TElectronEfficiencyCorrectionTool.cxx:793
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Root::TElectronEfficiencyCorrectionTool::m_endRunNumberList
std::vector< unsigned int > m_endRunNumberList
List of run numbers where histograms stop being valid for full simulation.
Definition: TElectronEfficiencyCorrectionTool.h:186
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
TH1
Definition: rootspy.cxx:268
Root::TElectronEfficiencyCorrectionTool::m_sysList
std::vector< std::vector< HistArray > > m_sysList
Definition: TElectronEfficiencyCorrectionTool.h:195
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
entries
double entries
Definition: listroot.cxx:49
Root::TElectronEfficiencyCorrectionTool::m_nToyMC
int m_nToyMC
The number of toys.
Definition: TElectronEfficiencyCorrectionTool.h:172
Root::TElectronEfficiencyCorrectionTool::setupHistogramsInFolder
int setupHistogramsInFolder(const TObjArray &dirNameArray, int lastIdx)
Definition: TElectronEfficiencyCorrectionTool.cxx:655
python.PyAthena.obj
obj
Definition: PyAthena.py:135
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Root::TElectronEfficiencyCorrectionTool::buildSingleCombToyMC
TH2 * buildSingleCombToyMC(const TH2 *sf, const TH2 *stat, const TH2 *uncorr, const std::vector< TH1 * > &corr, const int nSys, int &randomCounter)
Definition: TElectronEfficiencyCorrectionTool.cxx:429
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37