35main(
int argc,
char* argv[])
37 StatusCode::enableFailure();
38 using namespace asg::msgSelectorCheck;
40 setMsgLevel(MSG::INFO);
44 std::string fileName{};
45 std::string mapfileName{};
47 std::string recokey{};
49 std::string triggerkey{};
57 using namespace boost::program_options;
58 options_description desc{
"Options" };
59 desc.add_options()(
"help,h",
"Help screen")(
61 value<int>(&inputlevel)->default_value(
static_cast<int>(MSG::INFO)),
62 "message level")(
"file,f",
63 value<std::string>(&fileName)->default_value(
""),
65 "runno,r", value<int>(&runno)->required(),
"run number: Required")(
66 "eta,e", value<float>(&
eta)->required(),
"eta: Required")(
67 "pt,p", value<float>(&pt)->required(),
"pt: Required")(
69 value<std::string>(&
type)->required(),
70 "Simulation type: Required")(
72 value<std::string>(&model)->default_value(
"FULL"),
73 "Correlation Model FULL (default),SIMPLIFIED,TOTAL,COMBMCTOYS")(
75 value<std::string>(&recokey)->default_value(
""),
76 "Reco working point Key")(
78 value<std::string>(&mapfileName)->default_value(
""),
79 "Map file name")(
"keyid,d",
80 value<std::string>(&idkey)->default_value(
""),
81 "Identification working point Key")(
83 value<std::string>(&isokey)->default_value(
""),
84 "Isolation working point Key")(
86 value<std::string>(&triggerkey)->default_value(
""),
87 "Trigger working point Key");
90 store(parse_command_line(argc, argv, desc), vm);
91 if (vm.count(
"help")) {
96 }
catch (
const boost::program_options::error& ex) {
102 if (!(
type ==
"FullSim" ||
type ==
"AtlFast2")) {
110 if (!(model ==
"COMBMCTOYS" || model ==
"FULL" || model ==
"SIMPLIFIED" ||
120 MSG::Level mylevel =
static_cast<MSG::Level
>(inputlevel);
121 setMsgLevel(mylevel);
132 "AsgElectronEfficiencyCorrectionTool/ElEffCorrectionTool");
133 if (!fileName.empty()) {
134 std::vector<std::string> inputFiles{ fileName };
136 ElEffCorrectionTool.
setProperty(
"CorrectionFileNameList", inputFiles));
138 if (!mapfileName.empty()) {
141 if (!recokey.empty()) {
144 if (!idkey.empty()) {
147 if (!isokey.empty()) {
150 if (!triggerkey.empty()) {
157 if (mylevel < MSG::INFO) {
158 asg::ToolStore::dumpToolConfig();
165 std::vector<std::pair<double, double>> pt_eta{ { pt,
eta } };
168 ANA_CHECK(store.retrieve(electrons,
"MyElectrons").isSuccess());
175 int index = ElEffCorrectionTool->systUncorrVariationIndex(el);
180 bool isToys = model.find(
"TOY") != std::string::npos;
185 ElEffCorrectionTool, el, nominalSF, totalPos, totalNeg, isToys) ==
188 ANA_MSG_INFO(
"===> Model : " << model <<
"| electron : Pt = " << el.pt()
189 <<
" : eta = " << el.eta() <<
" : Bin index = "
190 <<
index <<
" : SF = " << nominalSF <<
" + "
191 << totalPos <<
" - " << totalNeg <<
" <===");
int result(asg::StandaloneToolHandle< IAsgElectronEfficiencyCorrectionTool > &tool, const xAOD::Electron &el, double &nominalSF, double &totalPos, double &totalNeg, const bool isToys)