ATLAS Offline Software
TopxAODAlg.cxx
Go to the documentation of this file.
2 #include "EventLoop/IWorker.h"
3 #include "TopAnalysis/Tools.h"
9 #include "TopEvent/EventTools.h"
10 #include "TopEvent/TopEventMaker.h"
16 // for I/O performance monitoring
17 #include "xAODCore/tools/IOStats.h"
20 
21 namespace top {
22 TopxAODAlg::TopxAODAlg(const std::string &name, ISvcLocator *pSvcLocator)
23  : AnaAlgorithm(name, pSvcLocator) {
24  declareProperty("ConfigPath", m_configPath, "Path to config file to parse by top-el");
25  declareProperty("LibraryNames", m_libraryNames, "Names of loaded .so libraries");
26  declareProperty("DerivationStream", m_derivationStream, "DerivationStream of this sample");
27  declareProperty("CrashOnMetaDataFaile", m_crashOnMetaDataFail,
28  "Crash if metadata reading failed");
29  declareProperty("StreamName", m_streamName, "The name of the output stream");
30  declareProperty("FTAGMapIndex", m_FTAGMapIndex,
31  "Index of the showering algorithm for FTAG MC/MC SFs");
32  declareProperty("ShoweringAlgorithm", m_showeringAlgo,
33  "Name of the showering algorithm for FTAG MC/MC SFs");
34  declareProperty("DataTakingYear", m_year,
35  "Year of data taking (primarily for trigger configuration)");
36  declareProperty("SkipEvents", m_firstEvent, "From which event entry to start (skip before)");
37 }
38 
42 
44  m_settings->loadFromFile(m_configPath);
45 
46  m_config.reset(new top::TopConfig());
47  // read FileMetadata for our TopConfig class
48  const xAOD::FileMetaData *fmd = nullptr;
49  if (inputMetaStore()->contains<xAOD::FileMetaData>("FileMetaData")) {
50  ANA_CHECK(inputMetaStore()->retrieve(fmd, "FileMetaData"));
52  } else {
53  ATH_MSG_ERROR("Could not retrieve FileMetadata. We thus cannot reliably pre-determine DSID, "
54  "whether this is MC, and simulation type.");
56  return StatusCode::FAILURE;
57  }
58  }
59 
60  m_config->setConfigSettings(m_settings.get());
61 
62  if (m_config->isMC() && !m_config->isTruthDxAOD()) {
63  // at this point we should also configure showering algorithm for FTAG MC/MC SFs
64  m_config->setMapIndex(m_FTAGMapIndex);
65  m_config->setShoweringAlgorithm(m_showeringAlgo);
66  }
67 
68  // trigger configuration
69  m_config->SetYear(m_year);
70  m_config->SetTriggersToYear(m_config->isMC());
71 
72  m_firstEvent = m_config->numberOfEventsToSkip();
73 
74  // analysis tracking
75  {
76  bool useTracking = true;
77  m_settings->retrieve("WriteTrackingData", useTracking);
78  if (useTracking) {
80  }
81  }
82 
83  // I/O Performance stats?
84  // Summary gives a summary
85  // Full gives detailed info on each collection in the file
86  if (m_settings->value("PerfStats") == "Summary")
87  m_doPerfStats = 1;
88 
89  if (m_settings->value("PerfStats") == "Full")
90  m_doPerfStats = 2;
91 
92  // Setup all asg::AsgTools
93  m_topTools = new top::TopToolStore("top::TopToolStore");
94  top::check(m_topTools->setProperty("config", m_config), "Failed to setProperty of topTools");
95  top::check(m_topTools->initialize(), "Failed to initialize topTools");
96 
97  if (m_config->isMC() && !m_pmg_weightTool.retrieve()) {
98  ATH_MSG_ERROR("Cannot retrieve PMGTruthWeightTool");
99  return StatusCode::FAILURE;
100  }
101 
102  // EventCleaningSelection
103  // Decorates EventInfo with GRL decision (always true for MC)
104  // Evaluates all triggers requested from all selections
105  // Trigger matching
106  // Check for good Tile and LAr calorimeters
107  // Let's check this passes before running expensive calibrations
108  // If ANY selection does not request a trigger, we won't veto any events
109  m_eventCleaning = new top::EventCleaningSelection("top::EventCleaningSelection");
110  top::check(m_eventCleaning->setProperty("config", m_config),
111  "Failed to setProperty of triggerGRLSelection");
112  top::check(m_eventCleaning->initialize(), "Failed to initialize triggerGRLSelection");
113  m_eventCleaning->setEventSelections(m_settings->selections());
114 
115  // Systematic object collection making
116  m_systObjMaker = new top::ObjectCollectionMaker("top::ObjectCollectionMaker");
117  top::check(m_systObjMaker->setProperty("config", m_config),
118  "Failed to setProperty of systObjMaker");
119  if (!m_config->isTruthDxAOD())
120  top::check(m_systObjMaker->initialize(), "Failed to initialize systObjMaker");
121 
122  // object selection
125 
126  // setup event-level cuts
127  m_outputFile = wk()->getOutputFile(m_streamName);
129  m_settings->selections(), m_outputFile, m_libraryNames, m_config));
130 
131  // The loader tool for top::ParticleLevelEvent objects
133 
134  // The loader tool for Upgrade objects
135  // top::UpgradeObjectLoader upgradeLoader(m_config);
136 
137  // Fix the configuration - it now knows about:
138  // * all objects collections to work with
139  // * all systematic variations
140  m_config->fixConfiguration();
141 
142  // OK let's printout the TopConfig
143  ATH_MSG_INFO(*m_config << "\n");
144 
145  if (m_tracker)
146  m_tracker->setTopConfig(m_config);
147 
148  // Top parton history for MC events
149  // This is quite ugly and simple, it will be harmonized with in the future
150  // along with all other factory methods (it's not a factory method right now)
151  if (m_settings->value("TopPartonHistory") == "ttbar") {
152  m_topPartonHistory = new top::CalcTtbarPartonHistory("top::CalcTtbarPartonHistory");
153  top::check(m_topPartonHistory->setProperty("config", m_config),
154  "Failed to setProperty of top::CalcTtbarPartonHistory");
155  } else {
156  ATH_MSG_ERROR("Only ttbar TopPartonHistory is supported for the moment!");
157  return StatusCode::FAILURE;
158  }
159 
160  // LHAPDF SF calculation
161  m_PDF_SF = new top::PDFScaleFactorCalculator("top::PDFScaleFactorCalculator");
162  if (m_config->doLHAPDF()) {
163  top::check(m_PDF_SF->setProperty("config", m_config),
164  "Failed to set config for PDF SF Calculator");
165  top::check(m_PDF_SF->initialize(), "Failed to initialize PDF SF calculator");
166  }
167 
168  // make top::Event objects
169  m_topEventMaker = new top::TopEventMaker("top::TopEventMaker");
170  top::check(m_topEventMaker->setProperty("config", m_config),
171  "Failed to setProperty of top::TopEventMaker");
172  top::check(m_topEventMaker->initialize(), "Failed to initialize top::TopEventMaker");
173  // Debug messages?
174  // m_topEventMaker.msg().setLevel(MSG::DEBUG);
175 
176  m_topScaleFactors = new top::ScaleFactorCalculator("top::ScaleFactorCalculator");
177  top::check(m_topScaleFactors->setProperty("config", m_config),
178  "Failed to setProperty of top::ScaleFactorCalculator");
179  top::check(m_topScaleFactors->initialize(), "Failed to initialize top::ScaleFactorCalculator");
180 
181  // TODO asymptotic matrix method
182 
183  // A list of extra branches that we create in this code and want to save
184  std::vector<std::string> extraBranches;
185  m_eventSelectionManager->addExtraBranches(extraBranches);
186 
187  // output file format (and any user-modified code)
189  m_eventSaver->initialize(m_config, m_outputFile, extraBranches);
190 
191  // save sum of weights before derivations
192  m_outputFile->cd();
193  m_sumWeights = new TTree("sumWeights", "");
194  m_boostedTaggersSFSysNames = m_config->boostedTaggersSFSysNames();
195  m_DSID = m_config->getDSID();
196  m_isAFII = m_config->isAFII();
197 
198  m_sumWeights->Branch("dsid", &m_DSID);
199  m_sumWeights->Branch("isAFII", &m_isAFII);
200  m_sumWeights->Branch("totalEventsWeighted", &m_totalEventsWeighted);
201  if (m_config->doMCGeneratorWeights()) { // the main problem is that we don't have the list of
202  // names a priori
203  m_sumWeights->Branch("totalEventsWeighted_mc_generator_weights", &m_totalEventsWeighted_LHE3);
204  m_sumWeights->Branch("names_mc_generator_weights", &m_names_LHE3);
205  }
206  m_sumWeights->Branch("totalEvents", &m_totalEvents, "totalEvents/l");
207 
208  for (auto &it : m_boostedTaggersSFSysNames) {
209  m_sumWeights->Branch(("sysNames_" + it.first).c_str(), &it.second);
210  }
211 
212  unsigned int dsidPdf = m_config->getDSID();
213  if (m_config->doLHAPDF()) {
214  m_sumPdfWeights = new TTree("PDFsumWeights", "");
215  m_sumPdfWeights->Branch("dsid", &dsidPdf);
216  for (const auto &pdf_set : m_config->LHAPDFSets()) {
217  m_totalEventsPdfWeighted[pdf_set] = std::make_unique<std::vector<float>>();
218  m_sumPdfWeights->Branch(pdf_set.c_str(), m_totalEventsPdfWeighted[pdf_set].get());
219  }
220  }
221 
222  // the analysis loop
223  ATH_MSG_INFO("Starting event loop\n");
224 
225  // Performance stats
226  if (m_doPerfStats > 0)
227  xAOD::PerfStats::instance().start(); // start Perfstats timer
228 
229  return StatusCode::SUCCESS;
230 }
231 
233  // Sum of weights and raw number of entries before skimming in current file
234  double sumW_file = 0;
235  ULong64_t initialEvents = 0;
236 
237  // vector of MC generator weights and their names in current file
238  std::vector<float> LHE3_sumW_file;
239  std::vector<std::string> LHE3_names_file;
240  const xAOD::CutBookkeeperContainer *cutBookKeepers = nullptr;
241 
242  if (m_config->isTruthDxAOD()) {
243  ATH_MSG_INFO("Bookkeepers are not read for TRUTH derivations");
244  } else {
245  top::check(inputMetaStore()->retrieve(cutBookKeepers, "CutBookkeepers"),
246  "Cannot retrieve CutBookkeepers");
247  if (m_config->isMC()) {
248 
249  // here we attempt to name the CutBookkeepers based on the MC weight names
250  const std::vector<std::string> &weight_names = m_pmg_weightTool->getWeightNames();
251  // try to retrieve CutBookKeepers for LHE3Weights first
252  top::parseCutBookkeepers(*evtStore()->event(), weight_names.size(), LHE3_names_file,
253  LHE3_sumW_file);
254  // if we have MC generator weights, we rename the bookkeepers in sumWeights TTree to match the
255  // weight names from MetaData
256  top::renameCutBookkeepers(LHE3_names_file, weight_names);
257 
258  // raw number of events taken from "AllExecutedEvents" bookkeeper, which corresponds to 0th MC
259  // weight but these are raw entries, so doesn't matter if 0th MC weight is nominal or not
260  initialEvents = top::getRawEventsBookkeeper(cutBookKeepers);
261 
262  // determine the nominal sum of weight -- we already found the nominal weight in
263  // ScaleFactorCalculator
264  const size_t nominalWeightIndex = m_config->nominalWeightIndex();
265  sumW_file = LHE3_sumW_file.at(nominalWeightIndex);
266  } else {
267  initialEvents = top::getRawEventsBookkeeper(cutBookKeepers);
268  sumW_file = initialEvents; // this is data, it's the same number...
269  }
270  }
271 
272  m_totalEventsWeighted += sumW_file;
273  m_totalEvents += initialEvents;
274 
275  // now we must fill two vectors in sync for MCGeneratorWeights sum of weights
276  if (m_config->doMCGeneratorWeights() && m_config->isMC()) {
277  if (m_totalEventsWeighted_LHE3.size() != 0) {
278  if (m_totalEventsWeighted_LHE3.size() != LHE3_sumW_file.size() ||
279  m_names_LHE3.size() != LHE3_names_file.size() ||
280  m_names_LHE3.size() != m_totalEventsWeighted_LHE3.size()) {
281  ATH_MSG_ERROR("Strange inconsistency of vector sizes in sum of LHE3 weights calculation.");
282  return StatusCode::FAILURE;
283  }
284  for (unsigned int i_genweights = 0; i_genweights < LHE3_names_file.size(); i_genweights++) {
285  if (m_names_LHE3.at(i_genweights) != LHE3_names_file.at(i_genweights)) {
286  ATH_MSG_ERROR("Strange inconsistency in the vector of weight names in sum of LHE3 "
287  "weights calculation.");
288  return StatusCode::FAILURE;
289  } else {
290  m_totalEventsWeighted_LHE3.at(i_genweights) =
291  m_totalEventsWeighted_LHE3.at(i_genweights) + LHE3_sumW_file.at(i_genweights);
292  }
293  }
294  } else {
295  for (unsigned int i_genweights = 0; i_genweights < LHE3_names_file.size(); i_genweights++) {
296  m_names_LHE3.push_back(LHE3_names_file.at(i_genweights));
297  m_totalEventsWeighted_LHE3.push_back(LHE3_sumW_file.at(i_genweights));
298  }
299  }
300  if (!m_names_LHE3.empty()) {
301  ATH_MSG_INFO(
302  "The sum of weights for the following LHE3 weights were retrieved from the input file:");
303  MsgStream &msgInfo = msg(MSG::Level::INFO);
304  for (const std::string& s : m_names_LHE3)
305  msgInfo << s << " ";
306  msgInfo << std::endl;
307  msgInfo.doOutput();
308  } else {
309  ATH_MSG_INFO(
310  "No sum of LHE3 weights could be found in meta-data. Will try to recompute these sums.\n"
311  "This only works on un-skimmed derivations, and the names of these weights may be "
312  "unknown (but we'll try to read them from the PMG tool");
313  m_recalc_LHE3 = true;
314  }
315  }
316 
317  if (m_config->isTruthDxAOD())
319 
320  if (m_config->printCDIpathWarning()) {
322  "\n*************************************************************************\n"
323  << "YOU ARE USING A CUSTOM PATH TO THE CDI FILE WHICH IS NOT THE DEFAULT PATH\n"
324  << " YOU MANY NOT BE USING THE LATEST BTAGGING RECOMMENDATIONS \n"
325  << "*************************************************************************\n\n");
326  }
327  if (m_config->printEgammaCalibModelWarning()) {
329  "\n*************************************************************************\n"
330  << " YOU HAVE CHANGED DEFAULT EGAMMA CALIBRATION MODEL \n"
331  << " TO USE DEFAULT MODEL, REMOVE 'EGammaCalibrationModel' FROM CONFIG FILE \n"
332  << "*************************************************************************\n\n");
333  }
334 
335  if (m_config->printEIDFileWarning()) {
337  "\n*************************************************************************\n"
338  << " YOU ARE USING THIS CUSTOM PATH TO THE ELECTRON ID SF FILE: \n\n"
339  << m_config->electronIDSFFilePath() << "(Tight) \n\n"
340  << m_config->electronIDSFFileLoosePath() << "(Loose) \n\n"
341  << " INSTEAD OF THE MOST RECENT RECOMMENDED MAP \n"
342  << " YOU MANY NOT BE USING THE LATEST ELECTRON ID RECOMMENDATIONS \n"
343  << "*************************************************************************\n\n");
344  }
345 
346  return StatusCode::SUCCESS;
347 }
348 
350  ++m_entry;
352 
353  // Pile up and MC event weight - used to normalize the cut flows
354  float mcEventWeight(1.), pileupWeight(1.);
355  if (m_config->isMC())
356  mcEventWeight = m_topScaleFactors->mcEventWeight();
357 
358  if (m_config->doPileupReweighting() && !m_config->isTruthDxAOD()) {
359  top::check(m_topScaleFactors->executePileup(), "Failed to execute pileup reweighting");
360  pileupWeight = m_topScaleFactors->pileupWeight();
361  }
362 
363  if (m_config->isMC()) {
364  // if requested, pre-calculate TopPartons and PDF info
365  // Run topPartonHistory
366  if (m_config->doTopPartonHistory())
367  top::check(m_topPartonHistory->execute(), "Failed to execute m_topPartonHistory");
368 
369  // calculate PDF weights
370  if (m_config->doLHAPDF())
371  top::check(m_PDF_SF->execute(), "Failed to execute PDF SF");
372  }
373 
374  // perform any operation common to both reco and truth level
375  // currently we load the MC generator weights and PDFs if requested
376  m_eventSaver->execute();
377 
379  if (m_config->isMC()) {
380 
381  // Save, if requested, MC truth block, PDFInfo, TopPartons
382  m_eventSaver->saveTruthEvent();
383  if (m_config->doTopPartonLevel())
385 
386  // Particle level analysis, saved only for truth events passing fiducial selection
387 
388  // --------------------------------------------------
389  // If the truth loader is active, perform truth loading.
390  if (m_particleLevelLoader->active()) {
391  // --------------------------------------------------
392  // Get the top::TruthEvent for the current event
393  top::ParticleLevelEvent particleLevelEvent = m_particleLevelLoader->load();
394 
395  // event selection
396  const bool saveEventInOutputFile =
397  m_eventSelectionManager->applyParticleLevel(particleLevelEvent);
398 
399  if (saveEventInOutputFile) {
400  m_eventSaver->saveParticleLevelEvent(particleLevelEvent);
402  }
403  }
404  }
405  if (m_totalYieldSoFar == 0 && m_config->isMC() && m_config->doLHAPDF()) {
406  const xAOD::TruthEventContainer *truthEvent(nullptr);
407  top::check(evtStore()->retrieve(truthEvent, m_config->sgKeyTruthEvent()),
408  "Failed to retrieve TruthEvent container for LHAPDF");
409  top::check(truthEvent->size() == 1,
410  "TruthEvent container size != 1, not sure what to do with PDF reweighting");
411  for (const auto *tePtr : *truthEvent) {
412  for (auto &pdf : m_totalEventsPdfWeighted) {
413  if (tePtr->isAvailable<std::vector<float>>("AnalysisTop_" + pdf.first + "_Weights")) {
414  pdf.second->resize(
415  tePtr->auxdata<std::vector<float>>("AnalysisTop_" + pdf.first + "_Weights").size());
416  }
417  }
418  }
419  }
420  // on the first event, set the size of the vector of sum of LHE3 weights in case it needs to be
421  // calculated on the fly
422 
423  if (m_config->isMC()) {
424  const xAOD::EventInfo *ei(nullptr);
425  top::check(evtStore()->retrieve(ei, m_config->sgKeyEventInfo()),
426  "Failed to retrieve LHE3 weights from EventInfo");
427 
429  if (m_totalYieldSoFar == 0)
430  ATH_MSG_INFO("Trying to recalculate nominal weights sum for TRUTH derivation");
431  const size_t nominalWeightIndex = m_config->nominalWeightIndex();
432  m_totalEventsWeighted_temp += ei->mcEventWeights().at(nominalWeightIndex);
433  m_totalEvents++;
434  }
435 
436  if (m_config->doMCGeneratorWeights()) {
437  unsigned int weightsSize = ei->mcEventWeights().size();
438  if (m_recalc_LHE3) {
439  if (m_totalYieldSoFar == 0) {
440  m_totalEventsWeighted_LHE3_temp.resize(weightsSize);
441  for (unsigned int i_LHE3 = 0; i_LHE3 < weightsSize; i_LHE3++) {
442  m_totalEventsWeighted_LHE3_temp.at(i_LHE3) = ei->mcEventWeights().at(i_LHE3);
443  }
444  m_names_LHE3.resize(weightsSize);
445 
446  const std::vector<std::string> &weight_names = m_pmg_weightTool->getWeightNames();
447  if (weight_names.size() != weightsSize) {
448  ATH_MSG_INFO(
449  "In top-xaod, while calculating mc weights sums on the fly, names from PMG tools "
450  "have different size wrt weight vector, we'll not retrieve weight names");
451  std::fill(m_names_LHE3.begin(), m_names_LHE3.end(), "?");
452  } else {
453  for (unsigned int i_wgt = 0; i_wgt < weight_names.size(); i_wgt++)
454  m_names_LHE3[i_wgt] = weight_names[i_wgt];
455  }
456  } else {
457  for (unsigned int i_LHE3 = 0; i_LHE3 < weightsSize; i_LHE3++) {
459  m_totalEventsWeighted_LHE3_temp.at(i_LHE3) + ei->mcEventWeights().at(i_LHE3);
460  }
461  }
462  // if recalc sum of weights not requested, we still cross-check the size of the vectors
463  } else if (weightsSize != m_names_LHE3.size()) {
464  ATH_MSG_ERROR("Strange size inconsistency in the AllExecutedEvents* "
465  "sum of weights bookkeepers from the meta-data and the vector of "
466  "LHE3 weights in the EventInfo container.");
467  return StatusCode::FAILURE;
468  }
469  }
470  }
472  if (m_config->isTruthDxAOD())
473  return StatusCode::SUCCESS;
474 
479 
481  m_eventSelectionManager->countInitial(mcEventWeight, pileupWeight);
482 
485  bool passGRLVeto = m_eventCleaning->applyGRL();
486  if (!passGRLVeto) {
487  setFilterPassed(false);
488  return StatusCode::SUCCESS;
489  }
490  m_eventSelectionManager->countGRL(mcEventWeight, pileupWeight);
491 
494  bool passGoodCalo = m_eventCleaning->applyGoodCalo();
495  if (!passGoodCalo) {
496  setFilterPassed(false);
497  return StatusCode::SUCCESS;
498  }
499  m_eventSelectionManager->countGoodCalo(mcEventWeight, pileupWeight);
500 
503  bool passPriVtx = m_eventCleaning->applyPrimaryVertex();
504  if (!passPriVtx) {
505  setFilterPassed(false);
506  return StatusCode::SUCCESS;
507  }
508  m_eventSelectionManager->countPrimaryVertex(mcEventWeight, pileupWeight);
509 
512  // m_eventCleaning->printTriggers();
513 
517  bool passAnyTriggerVeto = m_eventCleaning->applyTrigger();
518  if (!passAnyTriggerVeto) {
519  setFilterPassed(false);
520  return StatusCode::SUCCESS;
521  }
522 
525  top::check(m_systObjMaker->execute(true), "Failed to execute systObjMaker");
526 
529  top::check(m_objectSelection->execute(true), "Failed to execute objectSelection");
530 
532  top::check(m_systObjMaker->recalculateMET(true), "Failed to recalculateMET with systObjMaker");
533 
536  top::check(m_systObjMaker->execute(false), "Failed to execute systObjMaker");
537 
540  top::check(m_objectSelection->execute(false), "Failed to execute objectSelection");
541 
543  top::check(m_systObjMaker->recalculateMET(false), "Failed to recalculateMET with systObjMaker");
544 
546  if (m_config->isMC())
547  top::check(m_topScaleFactors->execute(), "Failed to calculate scale factors");
548 
549  if (m_config->doTightEvents()) {
551  const xAOD::SystematicEventContainer *allSystematics =
552  m_topEventMaker->systematicEvents(m_config->sgKeyTopSystematicEvents());
553  for (const auto *currentSystematic : *allSystematics) {
554  if (!(currentSystematic->hashValue() == m_config->nominalHashValue() ||
555  m_config->doTightSysts()))
556  continue;
557 
559  top::Event topEvent = m_topEventMaker->makeTopEvent(currentSystematic);
561  const bool passAnyEventSelection =
562  m_eventSelectionManager->apply(topEvent, *currentSystematic);
563  // check if we are using actual mu for mc16d or mc16e
564  if (m_isFirst && m_config->isMC()) {
565  const int runNumber = topEvent.m_info->runNumber();
566  if (runNumber >= 300000) {
567  if ((!m_config->isAFII() && m_config->PileupActualMu_FS().size() == 0) ||
568  (m_config->isAFII() && m_config->PileupActualMu_AF().size() == 0)) {
570  "\n********************************************************************************"
571  "*******\nYou are running over MC campaigns which support actual mu rewighting, but you are not using it!"
572  "\nYou are strongly adviced to use it.\nCheck "
573  "https://twiki.cern.ch/twiki/bin/view/AtlasProtected/"
574  "TopxAODStartGuideR21#PRW_and_Lumicalc_files\n*************************************"
575  "**************************************************\n");
576  }
577  }
578  }
579  currentSystematic->auxdecor<char>(m_config->passEventSelectionDecoration()) =
580  passAnyEventSelection ? 1 : 0;
581  topEvent.m_saveEvent = passAnyEventSelection;
583  m_eventSaver->saveEvent(topEvent);
584 
586  if (passAnyEventSelection && currentSystematic->hashValue() == m_config->nominalHashValue())
588  }
590  }
592 
593  if (m_config->doLooseEvents()) {
595  const xAOD::SystematicEventContainer *allSystematicsLoose =
596  m_topEventMaker->systematicEvents(m_config->sgKeyTopSystematicEventsLoose());
597  for (const auto *currentSystematic : *allSystematicsLoose) {
598  if (!(currentSystematic->hashValue() == m_config->nominalHashValue() ||
599  m_config->doLooseSysts()))
600  continue;
601 
603  top::Event topEvent = m_topEventMaker->makeTopEvent(currentSystematic);
605  const bool passAnyEventSelection =
606  m_eventSelectionManager->apply(topEvent, *currentSystematic);
607 
608  // check if we are using actual mu for mc16d or mc16e
609  if (m_isFirst && m_config->isMC()) {
610  const int runNumber = topEvent.m_info->runNumber();
611  if (runNumber >= 300000) {
612  if ((!m_config->isAFII() && m_config->PileupActualMu_FS().size() == 0) ||
613  (m_config->isAFII() && m_config->PileupActualMu_AF().size() == 0)) {
615  "\n********************************************************************************"
616  "*******\nYou are running over mc16d or mc16e sample but you are not using actual "
617  "mu reweighting!\nYou are strongly adviced to use it.\nCheck "
618  "https://twiki.cern.ch/twiki/bin/view/AtlasProtected/"
619  "TopxAODStartGuideR21#PRW_and_Lumicalc_files\n*************************************"
620  "**************************************************\n");
621  }
622  }
623  }
624  currentSystematic->auxdecor<char>(m_config->passEventSelectionDecoration()) =
625  passAnyEventSelection ? 1 : 0;
626  topEvent.m_saveEvent = passAnyEventSelection;
628  if (!m_config->isMC() && m_config->doFakesMMWeightsIFF() &&
629  currentSystematic->hashValue() == m_config->nominalHashValue()) {
631  for (xAOD::Electron *t : topEvent.m_electrons)
632  lepton.push_back(static_cast<xAOD::Electron *>(t));
633  for (xAOD::Muon *t : topEvent.m_muons)
634  lepton.push_back(static_cast<xAOD::Muon *>(t));
635 
636  // TODO implement asymptotic matrix method
637  }
639  m_eventSaver->saveEvent(topEvent);
640 
642  if (passAnyEventSelection && currentSystematic->hashValue() == m_config->nominalHashValue())
644  }
646  }
648 
650  m_eventSaver->saveEventToxAOD();
651  m_isFirst = false;
652 
653  return StatusCode::SUCCESS;
654 }
655 
657 
658  // TODO this calculation may be incorrect if EL is instructed to skip some events
659  if (m_tracker)
660  m_tracker->addInputFile(wk()->inputFile()->GetName(), m_entry);
661 
662  // do it at the end, so we can get the DS id from the first event
663  // notice this is different from the normal sum of weights: all entries matter, not only the
664  // highest per file
665  if (m_config->doLHAPDF()) {
666  bool pdfInCBK = false;
667  const xAOD::CutBookkeeperContainer *cutBookKeepers = nullptr;
668  if (inputMetaStore()->retrieve(cutBookKeepers, "CutBookkeepers")) {
669  // try to get the first entry
670  std::string pdf_set = m_totalEventsPdfWeighted.begin()->first;
671  std::string p = pdf_set + "_0";
672  for (const xAOD::CutBookkeeper *cbk : *cutBookKeepers) {
673  std::string pdfName = cbk->name();
674  if (p != pdfName)
675  continue;
676  m_pdfMetadataExists = true;
677  pdfInCBK = true;
678  // reload to set iterator back to original state
679  if (!inputMetaStore()->retrieve(cutBookKeepers, "CutBookkeepers")) {
680  }
681  break;
682  }
683  }
684  // if the pdf info was in the CBK the PDFSumOfWeights retrieve never happens,
685  // and m_cutBookKeepers, will keep its reference to the main CBK
686  if (!pdfInCBK) { // only try this if the info is not in the CBK -- this is legacy stuff
687  if (!inputMetaStore()->retrieve(cutBookKeepers, "PDFSumOfWeights")) {
688  m_pdfMetadataExists = false;
689  }
690  }
691  if (m_pdfMetadataExists && m_config->saveLHAPDFEvent() && m_config->baseLHAPDF().empty()) {
692  // just make a copy of it, but not all derivations have it, so just ignore it if it is not
693  // there
694  for (auto &pdfentry : m_totalEventsPdfWeighted) {
695  std::string pdf_set = pdfentry.first;
696  for (size_t n = 0; n < m_totalEventsPdfWeighted[pdf_set]->size(); ++n) {
697  std::string p = pdf_set + "_" + std::to_string(n);
698  bool foundPdf = false;
699  for (const xAOD::CutBookkeeper *cbk : *cutBookKeepers) {
700  std::string pdfName = cbk->name();
701  if (p != pdfName)
702  continue;
703  m_totalEventsPdfWeighted[pdf_set]->at(n) = cbk->sumOfEventWeights();
704  foundPdf = true;
705  break;
706  }
707  if (!foundPdf) { // asked for PDF weighting, the PDF metadata exists, but this particular
708  // PDF is missing
709  // crash hard
710  ATH_MSG_ERROR("The force is not strong with us, young Padawan ...\n"
711  "You want to save weights to do PDF reweighting using '"
712  << pdf_set << "', which I figure has "
713  << m_totalEventsPdfWeighted[pdf_set]->size()
714  << " sets on it.\n"
715  "There is metadata information for the sum of MC*PDF weights in "
716  "PDFSumOfWeights, "
717  "but none seem to refer to '"
718  << p
719  << "' therefore I do not know how to estimate "
720  "the sum of weights before acceptance for this configuration.\n"
721  "May the force be with you in your next attempt.");
722  return StatusCode::FAILURE;
723  }
724  }
725  }
726  m_sumPdfWeights->Fill();
727  }
728  } // doLHAPDF
729 
730  return StatusCode::SUCCESS;
731 }
732 
734 
735  if (m_doPerfStats > 0)
736  xAOD::PerfStats::instance().stop(); // Stop the PerfStats timer
737 
738  if (m_config->doLHAPDF())
739  top::check(m_PDF_SF->finalize(), "Failed to finalize PDF SF");
740 
741  // this fills the sum of weights
742  // if the list of input files has more than
743  // one type of dataset (ie: the first file is ttbar and the second one
744  // is W+jets), then the Fill statement below needs to come in the end of
745  // each file's processing instead ... but why would you do that?!
746  if (m_recalc_LHE3) { // in case the sum of LHE3 weight has been re-calculated with double (but we
747  // need floats in the end)
748  for (double d : m_totalEventsWeighted_LHE3_temp)
749  m_totalEventsWeighted_LHE3.push_back(d);
750  }
753  }
754  m_sumWeights->Fill();
755  m_outputFile->cd();
756 
757  if (m_config->doLHAPDF()) {
758  // Save sum of weights of PDF variations
759  // Only do this if the metadata is not available
761  ATH_MSG_ERROR("These are not the droids you are looking for.\n"
762  "You are running over skimmed derivations. We cannot determine "
763  "the sum of MC*PDF weights before skimming "
764  "because no PDF metadata is available in the file!");
765  return StatusCode::FAILURE;
766  }
767  // save recomputed sum weights
768  if ((!m_config->baseLHAPDF().empty() || !m_pdfMetadataExists)) {
769  for (auto &pdf_result : m_config->getLHAPDFResults())
770  *(m_totalEventsPdfWeighted[pdf_result.first]) = pdf_result.second;
771  m_sumPdfWeights->Fill();
772  }
773  } // doLHAPDF
774 
775  m_outputFile->cd();
776  m_eventSelectionManager->finalise();
777  m_eventSaver->finalize();
778  m_outputFile->cd();
779  if (m_tracker)
780  m_tracker->writeTree("AnalysisTracking");
781 
782  if (!m_config->isTruthDxAOD()) {
783  if (m_config->doTightEvents())
784  ATH_MSG_INFO("Events saved to output file nominal reconstruction tree: " << m_eventSavedReco);
785  if (m_config->doLooseEvents())
786  ATH_MSG_INFO("Events saved to output file nominal loose reconstruction tree: "
788  }
789  if (m_config->isMC()) {
790  ATH_MSG_INFO("Events saved to output file truth tree : " << m_eventSavedTruth);
791  if (m_particleLevelLoader->active()) {
792  ATH_MSG_INFO("Events saved to output file particle level tree : " << m_eventSavedParticle);
793  }
794  }
795  ATH_MSG_INFO("Total sum-of-weights (for normalization) : " << m_totalEventsWeighted);
796 
797  // print some xAOD performance info
798  if (m_doPerfStats == 1)
799  xAOD::IOStats::instance().stats().Print("Summary");
800  if (m_doPerfStats == 2)
802 
803  return StatusCode::SUCCESS;
804 }
805 
806 } // namespace top
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
top::TopxAODAlg::m_eventSavedRecoLoose
unsigned int m_eventSavedRecoLoose
Definition: TopxAODAlg.h:86
top::Event::m_info
const xAOD::EventInfo * m_info
Pointer to the event info - nullptr if not loaded, but that's probably a bad idea.
Definition: Event.h:90
TopxAODAlg.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
top::TopxAODAlg::m_particleLevelLoader
ToolHandle< top::ParticleLevelLoader > m_particleLevelLoader
Definition: TopxAODAlg.h:57
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
top::TopxAODAlg::m_recalculateNominalWeightSum
bool m_recalculateNominalWeightSum
Definition: TopxAODAlg.h:76
xAOD::IOStats::stats
ReadStats & stats()
Access the object belonging to the current thread.
Definition: IOStats.cxx:17
xAOD::PerfStats::start
void start(bool clear=true)
Start the statistics collection.
top::TopxAODAlg::m_eventSavedParticle
unsigned int m_eventSavedParticle
Definition: TopxAODAlg.h:88
top::TopxAODAlg::initialize
StatusCode initialize() override
Definition: TopxAODAlg.cxx:39
top::EventSelectionManager
Maybe you want to run multiple selections (e+jets, mu+jets) on the same input files at the same time.
Definition: EventSelectionManager.h:40
xAOD::EventInfo_v1::mcEventWeights
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
top::TopxAODAlg::m_topScaleFactors
ToolHandle< top::ScaleFactorCalculator > m_topScaleFactors
Definition: TopxAODAlg.h:61
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
top::TopxAODAlg::m_systObjMaker
ToolHandle< top::ObjectCollectionMaker > m_systObjMaker
Definition: TopxAODAlg.h:53
Tools.h
hist_file_dump.d
d
Definition: hist_file_dump.py:137
top::TopxAODAlg::m_boostedTaggersSFSysNames
std::unordered_map< std::string, std::vector< std::string > > m_boostedTaggersSFSysNames
Definition: TopxAODAlg.h:93
xAOD::CutBookkeeper_v1
Description of the class that is used to keep track of event counts.
Definition: CutBookkeeper_v1.h:29
top::TopxAODAlg::m_totalYieldSoFar
unsigned int m_totalYieldSoFar
Definition: TopxAODAlg.h:84
EL::AnaAlgorithm::inputMetaStore
ConstMetaStorePtr_t inputMetaStore() const
Definition: AnaAlgorithm.cxx:72
TopObjectSelection.h
top::TopxAODAlg::beginInputFile
StatusCode beginInputFile() override
Definition: TopxAODAlg.cxx:232
xAOD::ReadStats::Print
void Print(::Option_t *option="") const
Print information about the collected statistics.
top::TopxAODAlg::m_totalEvents
ULong64_t m_totalEvents
Definition: TopxAODAlg.h:72
top::TopxAODAlg::m_tracker
std::unique_ptr< top::AnalysisTrackingHelper > m_tracker
Definition: TopxAODAlg.h:56
skel.it
it
Definition: skel.GENtoEVGEN.py:423
top::TopxAODAlg::m_showeringAlgo
SampleXsection::showering m_showeringAlgo
Definition: TopxAODAlg.h:102
top::TopxAODAlg::m_totalEventsPdfWeighted
std::unordered_map< std::string, std::unique_ptr< std::vector< float > > > m_totalEventsPdfWeighted
Definition: TopxAODAlg.h:68
top::TopxAODAlg::m_eventSavedReco
unsigned int m_eventSavedReco
Definition: TopxAODAlg.h:85
top::TopxAODAlg::m_totalEventsWeighted_LHE3
std::vector< double > m_totalEventsWeighted_LHE3
Definition: TopxAODAlg.h:78
top::TopxAODAlg::m_settings
std::shared_ptr< ConfigurationSettings > m_settings
Definition: TopxAODAlg.h:49
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
top::loadObjectSelection
top::TopObjectSelection * loadObjectSelection(const std::shared_ptr< top::TopConfig > &config)
Users may want to define (and load!) their own object selection.
Definition: Tools.cxx:291
top::TopxAODAlg::m_eventCleaning
ToolHandle< top::EventCleaningSelection > m_eventCleaning
Definition: TopxAODAlg.h:52
top::readMetaData
bool readMetaData(TFile *inputFile, const std::shared_ptr< top::TopConfig > &config)
This function will be used to load the metadata object and pull information from it.
Definition: Tools.cxx:331
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
IOStats.h
ObjectCollectionMaker.h
PerfStats.h
dumpFileToPlots.pdfName
string pdfName
Definition: dumpFileToPlots.py:21
top::TopxAODAlg::m_recalc_LHE3
bool m_recalc_LHE3
Definition: TopxAODAlg.h:75
top::TopxAODAlg::m_isAFII
int m_isAFII
Definition: TopxAODAlg.h:92
top::TopConfig
Definition: TopConfig.h:41
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
top::TopxAODAlg::m_topTools
ToolHandle< top::TopToolStore > m_topTools
Definition: TopxAODAlg.h:51
top::ParticleLevelLoader
Loading tool which creates a particle level event object.
Definition: ParticleLevelLoader.h:53
top::TopxAODAlg::m_year
std::string m_year
Definition: TopxAODAlg.h:103
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
top::TopxAODAlg::endInputFile
StatusCode endInputFile() override
Definition: TopxAODAlg.cxx:656
top::TopEventMaker
TopEventMaker produce top::Event objects from xAOD::SystematicEvent objects.
Definition: TopEventMaker.h:32
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
top::TopxAODAlg::m_sumWeights
TTree * m_sumWeights
Definition: TopxAODAlg.h:74
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
EventCleaningSelection.h
top::TopxAODAlg::m_totalEventsWeighted_LHE3_temp
std::vector< double > m_totalEventsWeighted_LHE3_temp
Definition: TopxAODAlg.h:80
TopToolStore.h
top::Event::m_muons
xAOD::MuonContainer m_muons
Container of muons (can be sorted)
Definition: Event.h:105
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ReadStats.h
top::TopxAODAlg::m_entry
unsigned int m_entry
Definition: TopxAODAlg.h:82
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
top::Event::m_electrons
xAOD::ElectronContainer m_electrons
Container of electrons (can be sorted)
Definition: Event.h:99
beamspotman.n
n
Definition: beamspotman.py:731
top::TopxAODAlg::m_FTAGMapIndex
unsigned int m_FTAGMapIndex
Definition: TopxAODAlg.h:101
top::TopxAODAlg::m_DSID
unsigned int m_DSID
Definition: TopxAODAlg.h:91
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
top::ConfigurationSettings::get
static ConfigurationSettings * get(bool reset=false)
Design patterns 101.
Definition: ConfigurationSettings.cxx:714
EL::AnaAlgorithm::requestBeginInputFile
::StatusCode requestBeginInputFile()
register this algorithm to have an implementation of beginInputFile
Definition: AnaAlgorithm.cxx:271
top::TopxAODAlg::m_streamName
std::string m_streamName
Definition: TopxAODAlg.h:100
top::AnalysisTrackingHelper
Helper for collecting data for analysis tracking.
Definition: AnalysisTrackingHelper.h:20
top::TopxAODAlg::TopxAODAlg
TopxAODAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TopxAODAlg.cxx:22
top::TopxAODAlg::m_firstEvent
unsigned int m_firstEvent
Definition: TopxAODAlg.h:83
ParticleLevelLoader.h
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
top::parseCutBookkeepers
void parseCutBookkeepers(xAOD::TEvent &xaodEvent, const std::size_t size, std::vector< std::string > &names, std::vector< float > &sumW)
Search bookkeepers for ones matching AllExecutedEvents, and which originate from AOD before skimming.
Definition: Tools.cxx:89
top::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
xAOD::CutBookkeeperContainer_v1
Container that holds the Container of all CutBookkeepers.
Definition: CutBookkeeperContainer_v1.h:27
TopEventMaker.h
top::TopxAODAlg::m_PDF_SF
ToolHandle< top::PDFScaleFactorCalculator > m_PDF_SF
Definition: TopxAODAlg.h:59
xAOD::IOStats::instance
static IOStats & instance()
Singleton object accessor.
Definition: IOStats.cxx:11
top::CalcTtbarPartonHistory
Definition: CalcTtbarPartonHistory.h:33
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::FileMetaData_v1
Class holding file-level metadata about an xAOD file.
Definition: FileMetaData_v1.h:34
top::TopxAODAlg::m_doPerfStats
unsigned int m_doPerfStats
Definition: TopxAODAlg.h:65
ConfigurationSettings.h
top::TopToolStore
Definition: TopToolStore.h:49
top::TopxAODAlg::m_names_LHE3
std::vector< std::string > m_names_LHE3
Definition: TopxAODAlg.h:77
top::getRawEventsBookkeeper
ULong64_t getRawEventsBookkeeper(const xAOD::CutBookkeeperContainer *cutBookKeepers)
Get raw number of events before skimming from "AllExecutedEvents" bookkeeper.
Definition: Tools.cxx:125
top::TopxAODAlg::execute
StatusCode execute() override
Definition: TopxAODAlg.cxx:349
top::TopxAODAlg::m_objectSelection
ToolHandle< top::TopObjectSelection > m_objectSelection
Definition: TopxAODAlg.h:54
top::TopxAODAlg::m_outputFile
TFile * m_outputFile
Definition: TopxAODAlg.h:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
top::TopxAODAlg::m_crashOnMetaDataFail
bool m_crashOnMetaDataFail
Definition: TopxAODAlg.h:99
EL::AnaAlgorithm::requestEndInputFile
::StatusCode requestEndInputFile()
register this algorithm to have an implementation of endInputFile
Definition: AnaAlgorithm.cxx:292
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
top::TopxAODAlg::m_totalEventsInFiles
ULong64_t m_totalEventsInFiles
Definition: TopxAODAlg.h:73
TopConfig.h
xAOD::PerfStats::instance
static PerfStats & instance()
Function accessing the singleton instance.
xAOD::Electron_v1
Definition: Electron_v1.h:34
top::TopxAODAlg::m_totalEventsWeighted_temp
double m_totalEventsWeighted_temp
Definition: TopxAODAlg.h:71
top::TopxAODAlg::m_eventSavedTruth
unsigned int m_eventSavedTruth
Definition: TopxAODAlg.h:87
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
top::TopxAODAlg::m_eventSelectionManager
std::unique_ptr< top::EventSelectionManager > m_eventSelectionManager
Definition: TopxAODAlg.h:55
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
top::TopxAODAlg::m_eventSaver
std::unique_ptr< top::EventSaverBase > m_eventSaver
Definition: TopxAODAlg.h:62
CalcTtbarPartonHistory.h
top::TopxAODAlg::finalize
StatusCode finalize() override
Definition: TopxAODAlg.cxx:733
lumiFormat.fill
fill
Definition: lumiFormat.py:111
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
top::TopxAODAlg::m_totalEventsWeighted
double m_totalEventsWeighted
Definition: TopxAODAlg.h:70
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
PDFScaleFactorCalculator.h
top::TopxAODAlg::m_derivationStream
std::string m_derivationStream
Definition: TopxAODAlg.h:98
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
top::TopxAODAlg::m_isFirst
bool m_isFirst
Definition: TopxAODAlg.h:89
top::TopxAODAlg::m_pmg_weightTool
ToolHandle< PMGTools::IPMGTruthWeightTool > m_pmg_weightTool
Definition: TopxAODAlg.h:63
PowhegPythia8EvtGen_jetjet.pdf
pdf
Definition: PowhegPythia8EvtGen_jetjet.py:4
top::ObjectCollectionMaker
Definition: ObjectCollectionMaker.h:45
ScaleFactorCalculator.h
top::TopxAODAlg::m_pdfMetadataExists
bool m_pdfMetadataExists
Definition: TopxAODAlg.h:69
top::renameCutBookkeepers
void renameCutBookkeepers(std::vector< std::string > &bookkeeper_names, const std::vector< std::string > &pmg_weight_names)
Rename CutBookkeeper names according to MC generator weight names reported by PMGTruthWeightTool.
Definition: Tools.cxx:143
xAOD::PerfStats::stop
void stop()
Stop the statistics collection.
top::TopxAODAlg::m_topEventMaker
ToolHandle< top::TopEventMaker > m_topEventMaker
Definition: TopxAODAlg.h:60
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::TopxAODAlg::m_topPartonHistory
ToolHandle< top::CalcTtbarPartonHistory > m_topPartonHistory
Definition: TopxAODAlg.h:58
top::TopxAODAlg::m_sumPdfWeights
TTree * m_sumPdfWeights
Definition: TopxAODAlg.h:67
top::TopxAODAlg::m_libraryNames
std::string m_libraryNames
Definition: TopxAODAlg.h:97
IWorker.h
top::ScaleFactorCalculator
Definition: ScaleFactorCalculator.h:44
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
top::loadEventSaver
top::EventSaverBase * loadEventSaver(const std::shared_ptr< top::TopConfig > &config)
Users may also want to write out custom ntuples / xAODs.
Definition: Tools.cxx:314
top::PDFScaleFactorCalculator
For testing PDF reweighting with LHAPDF6.
Definition: PDFScaleFactorCalculator.h:37
top::TopxAODAlg::m_configPath
std::string m_configPath
properties
Definition: TopxAODAlg.h:96
top::EventCleaningSelection
Definition: EventCleaningSelection.h:32
top::TopxAODAlg::m_config
std::shared_ptr< TopConfig > m_config
Definition: TopxAODAlg.h:50
top::Event::m_saveEvent
bool m_saveEvent
save the event?
Definition: Event.h:87