Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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...
 
bool uncorrEmpty (const PATCore::ParticleDataType::DataType dataType)
 Check if stat+uncorr has input. 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)
 
TH2 * buildSingleCombToyMC (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 437 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ 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 397 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ 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 484 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ 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 160 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ fillHistEdges()

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

Definition at line 930 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ getHistograms()

int TElectronEfficiencyCorrectionTool::getHistograms ( )
private

Load all histograms from the input file(s)

Definition at line 587 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ 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 546 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ 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 891 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ setupHistogramsInFolder()

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

setup obj arrays at specific indices

Definition at line 663 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ setupTempMapsHelper()

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

Definition at line 801 of file TElectronEfficiencyCorrectionTool.cxx.

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

◆ 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 859 of file TElectronEfficiencyCorrectionTool.cxx.

863 {
864  bool toysBooked = false;
865  if (!m_histList[mapkey::sf].empty()) {
866  if (objs.at(mapkey::eig).empty() || objs.at(mapkey::stat).empty() ||
867  objs.at(mapkey::uncorr).empty()) {
868 
869  if (objs.at(mapkey::stat).size() > 1 || objs.at(mapkey::sys).size() > 1) {
870 
871  uncorrToyMCSyst.push_back(buildToyMCTable(
872  objs.at(mapkey::sf), {}, objs.at(mapkey::stat), {}, sysObjs));
873  toysBooked = true;
874  }
875  } else {
876  uncorrToyMCSyst.push_back(buildToyMCTable(objs.at(mapkey::sf),
877  objs.at(mapkey::eig),
878  objs.at(mapkey::stat),
879  objs.at(mapkey::uncorr),
880  sysObjs));
881  toysBooked = true;
882  }
883  }
884  return toysBooked;
885 }

◆ uncorrEmpty()

bool TElectronEfficiencyCorrectionTool::uncorrEmpty ( const PATCore::ParticleDataType::DataType  dataType)

Check if stat+uncorr has input.

Definition at line 151 of file TElectronEfficiencyCorrectionTool.cxx.

152 {
154  const auto& currentmap = (isFastSim) ? m_fastHistList : m_histList;
155 
156  return currentmap.at(mapkey::stat).empty() && currentmap.at(mapkey::uncorr).empty();
157 }

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 186 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 191 of file TElectronEfficiencyCorrectionTool.h.

◆ m_corrFileNameList

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

The list of file name(s)

Definition at line 184 of file TElectronEfficiencyCorrectionTool.h.

◆ m_doCombToyMC

bool Root::TElectronEfficiencyCorrectionTool::m_doCombToyMC
private

Definition at line 173 of file TElectronEfficiencyCorrectionTool.h.

◆ m_doToyMC

bool Root::TElectronEfficiencyCorrectionTool::m_doToyMC
private

Flag to control Toys.

Definition at line 172 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 189 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 194 of file TElectronEfficiencyCorrectionTool.h.

◆ m_fastHistEdges

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

Definition at line 201 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 200 of file TElectronEfficiencyCorrectionTool.h.

◆ m_fastSysList

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

Definition at line 202 of file TElectronEfficiencyCorrectionTool.h.

◆ m_histEdges

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

Definition at line 197 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 196 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 179 of file TElectronEfficiencyCorrectionTool.h.

◆ m_nToyMC

int Root::TElectronEfficiencyCorrectionTool::m_nToyMC
private

The number of toys.

Definition at line 175 of file TElectronEfficiencyCorrectionTool.h.

◆ m_Rndm

TRandom3 Root::TElectronEfficiencyCorrectionTool::m_Rndm
private

Definition at line 204 of file TElectronEfficiencyCorrectionTool.h.

◆ m_seed

unsigned long int Root::TElectronEfficiencyCorrectionTool::m_seed
private

The Random seed.

Definition at line 177 of file TElectronEfficiencyCorrectionTool.h.

◆ m_sysList

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

Definition at line 198 of file TElectronEfficiencyCorrectionTool.h.

◆ m_uncorrToyMCSystFast

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

Definition at line 182 of file TElectronEfficiencyCorrectionTool.h.

◆ m_uncorrToyMCSystFull

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

Definition at line 181 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
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
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:204
Root::TElectronEfficiencyCorrectionTool::m_seed
unsigned long int m_seed
The Random seed.
Definition: TElectronEfficiencyCorrectionTool.h:177
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:859
mapkey::uncorr
@ uncorr
Definition: TElectronEfficiencyCorrectionTool.cxx:41
Root::TElectronEfficiencyCorrectionTool::m_histEdges
std::vector< std::vector< HistEdge > > m_histEdges
Definition: TElectronEfficiencyCorrectionTool.h:197
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:172
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:191
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
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:179
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:184
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Root::TElectronEfficiencyCorrectionTool::m_uncorrToyMCSystFast
std::vector< std::vector< HistArray > > m_uncorrToyMCSystFast
Definition: TElectronEfficiencyCorrectionTool.h:182
fitman.tmpHist
def tmpHist(what, wmin=-1e10, wmax=+1e10)
Definition: fitman.py:146
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:85
checkCorrelInHIST.objs
objs
Definition: checkCorrelInHIST.py:529
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:181
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:397
Root::TElectronEfficiencyCorrectionTool::getHistograms
int getHistograms()
Load all histograms from the input file(s)
Definition: TElectronEfficiencyCorrectionTool.cxx:587
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:194
jobOptions.isFastSim
string isFastSim
Definition: jobOptions.py:54
Root::TElectronEfficiencyCorrectionTool::m_fastSysList
std::vector< std::vector< HistArray > > m_fastSysList
Definition: TElectronEfficiencyCorrectionTool.h:202
mapkey::eig
@ eig
Definition: TElectronEfficiencyCorrectionTool.cxx:40
Root::TElectronEfficiencyCorrectionTool::m_begRunNumberList
std::vector< unsigned int > m_begRunNumberList
List of run numbers where histograms become valid for full simulation.
Definition: TElectronEfficiencyCorrectionTool.h:186
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:201
Root::TElectronEfficiencyCorrectionTool::m_doCombToyMC
bool m_doCombToyMC
Definition: TElectronEfficiencyCorrectionTool.h:173
Root::TElectronEfficiencyCorrectionTool::m_histList
std::vector< std::vector< HistArray > > m_histList
List of histograms for full Geant4 simulation.
Definition: TElectronEfficiencyCorrectionTool.h:196
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
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:200
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:891
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:484
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:930
mapkey::stat
@ stat
Definition: TElectronEfficiencyCorrectionTool.cxx:39
python.AthDsoLogger.fname
string fname
Definition: AthDsoLogger.py:67
DeMoScan.index
string index
Definition: DeMoScan.py:364
Root::TElectronEfficiencyCorrectionTool::setupTempMapsHelper
void setupTempMapsHelper(TH1 *obj, std::vector< std::vector< TH1 * >> &objs, std::vector< std::vector< TH1 * >> &sysObjs, int &seenSystematics)
Definition: TElectronEfficiencyCorrectionTool.cxx:801
columnar::empty
bool empty() const noexcept
Definition: ObjectRange.h:129
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
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:189
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Root::TElectronEfficiencyCorrectionTool::m_sysList
std::vector< std::vector< HistArray > > m_sysList
Definition: TElectronEfficiencyCorrectionTool.h:198
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:175
LArCellNtuple.ifile
string ifile
Definition: LArCellNtuple.py:133
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
Root::TElectronEfficiencyCorrectionTool::setupHistogramsInFolder
int setupHistogramsInFolder(const TObjArray &dirNameArray, int lastIdx)
Definition: TElectronEfficiencyCorrectionTool.cxx:663
python.PyAthena.obj
obj
Definition: PyAthena.py:132
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:437
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37