28 using namespace TopAnalysis;
31 EventSelectionManager::EventSelectionManager(
const std::vector<SelectionConfigurationData>& selectionConfigData,
32 TFile*
outputFile,
const std::string& toolLoaderNames,
34 std::vector<std::string>
tokens;
36 std::stringstream
ss(toolLoaderNames);
39 while (std::getline(
ss,
item, delim))
42 std::vector<std::unique_ptr<top::ToolLoaderBase> > toolLoaders;
43 for (
const auto& toolLoaderName :
tokens) {
45 std::string
className =
"top::" + toolLoaderName.substr(3) +
"Loader";
48 TClass*
c = ::TClass::GetClass(
className.c_str());
53 className = toolLoaderName.substr(3) +
"Loader";
65 toolLoaders.push_back(std::unique_ptr<top::ToolLoaderBase>(bc));
66 }
else ATH_MSG_ERROR(
" Failure converting to ToolLoaderBase");
68 " not found - this is only a problem if you wrote one in your library");
71 ATH_MSG_INFO(
"Telling you how I'm configured, before I do anything:");
72 for (
const auto& currentConfig : selectionConfigData)
73 m_selections.emplace_back(currentConfig.m_name, currentConfig.m_cutnames,
outputFile, toolLoaders,
config, wk);
77 m_selections(std::move(
other.m_selections)) {
82 currentSelection.countInitial(mcEventWeight, pileupWeight);
87 currentSelection.countGRL(mcEventWeight, pileupWeight);
92 currentSelection.countGoodCalo(mcEventWeight, pileupWeight);
97 currentSelection.countPrimaryVertex(mcEventWeight, pileupWeight);
104 const bool passedThisSelection = currentSelection.apply(
event);
107 event.m_info->auxdecor<
int>(currentSelection.name()) = passedThisSelection;
109 currentSystematic.
auxdecor<
int>(currentSelection.name()) = passedThisSelection ? 1 : 0;
112 save |= (passedThisSelection && currentSelection.ToBeSaved());
122 const bool passedThisSelection = currentSelection.applyParticleLevel(plEvent);
128 save |= (passedThisSelection && currentSelection.ToBeSaved());
137 currentSelection.finalise();
142 extraBranchList.push_back(currentSelection.name());
147 if (currentSelection.name() ==
selection)
return currentSelection.GetFakesMMConfigs();
150 <<
"\n This is nonense - returning empty list");
151 std::vector<std::string>
empty;