36{
37 StatusCode::enableFailure();
38 using namespace asg::msgSelectorCheck;
40 setMsgLevel(MSG::INFO);
41
42
43
45 std::string mapfileName{};
46 std::string idkey{};
47 std::string recokey{};
48 std::string isokey{};
49 std::string triggerkey{};
55 int inputlevel{};
56
57 using namespace boost::program_options;
58 options_description
desc{
"Options" };
59 desc.add_options()(
"help,h",
"Help screen")(
60 "msgLevel,l",
61 value<int>(&inputlevel)->default_value(static_cast<int>(MSG::INFO)),
62 "message level")("file,f",
63 value<std::string>(&fileName)->default_value(""),
64 "scale factor file")(
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")(
68 "type,t",
69 value<std::string>(&
type)->required(),
70 "Simulation type: Required")(
71 "correlation,c",
72 value<std::string>(&model)->default_value("FULL"),
73 "Correlation Model FULL (default),SIMPLIFIED,TOTAL,COMBMCTOYS")(
74 "keyreco,k",
75 value<std::string>(&recokey)->default_value(""),
76 "Reco working point Key")(
77 "mapfile,m",
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")(
82 "keyiso,i",
83 value<std::string>(&isokey)->default_value(""),
84 "Isolation working point Key")(
85 "keytrigger,g",
86 value<std::string>(&triggerkey)->default_value(""),
87 "Trigger working point Key");
88 variables_map vm;
89 try {
90 store(parse_command_line(argc, argv, desc), vm);
91 if (vm.count("help")) {
93 return 0;
94 }
95 notify(vm);
96 } catch (const boost::program_options::error& ex) {
99 return 0;
100 }
101
102 if (!(
type ==
"FullSim" ||
type ==
"AtlFast2")) {
105 return 0;
106 }
110 if (!(model == "COMBMCTOYS" || model == "FULL" || model == "SIMPLIFIED" ||
111 model == "TOTAL")) {
114 return 0;
115 }
116
117
120 MSG::Level mylevel = static_cast<MSG::Level>(inputlevel);
121 setMsgLevel(mylevel);
124
125
128
129
131 ElEffCorrectionTool(
132 "AsgElectronEfficiencyCorrectionTool/ElEffCorrectionTool");
136 ElEffCorrectionTool.setProperty("CorrectionFileNameList", inputFiles));
137 }
138 if (!mapfileName.empty()) {
139 ANA_CHECK(ElEffCorrectionTool.setProperty(
"MapFilePath", mapfileName));
140 }
141 if (!recokey.empty()) {
142 ANA_CHECK(ElEffCorrectionTool.setProperty(
"RecoKey", recokey));
143 }
144 if (!idkey.empty()) {
145 ANA_CHECK(ElEffCorrectionTool.setProperty(
"IdKey", idkey));
146 }
147 if (!isokey.empty()) {
148 ANA_CHECK(ElEffCorrectionTool.setProperty(
"IsoKey", isokey));
149 }
150 if (!triggerkey.empty()) {
151 ANA_CHECK(ElEffCorrectionTool.setProperty(
"TriggerKey", triggerkey));
152 }
153 ANA_CHECK(ElEffCorrectionTool.setProperty(
"ForceDataType", (
int)SimType));
154 ANA_CHECK(ElEffCorrectionTool.setProperty(
"OutputLevel", mylevel));
155 ANA_CHECK(ElEffCorrectionTool.setProperty(
"CorrelationModel", model));
156 ANA_CHECK(ElEffCorrectionTool.initialize());
157 if (mylevel < MSG::INFO) {
158 asg::ToolStore::dumpToolConfig();
159 }
160
161
162
163
164
165 std::vector<std::pair<double, double>> pt_eta{ {
pt,
eta } };
169
171
172
173
174
175 int index = ElEffCorrectionTool->systUncorrVariationIndex(el);
176
177
178
179
180 bool isToys =
model.find(
"TOY") != std::string::npos;
181 double nominalSF{};
182 double totalNeg{};
183 double totalPos{};
185 ElEffCorrectionTool, el, nominalSF, totalPos, totalNeg, isToys) ==
186 0);
187
188 ANA_MSG_INFO(
"===> Model : " << model <<
"| electron : Pt = " <<
el.pt()
189 <<
" : eta = " <<
el.eta() <<
" : Bin index = "
190 <<
index <<
" : SF = " << nominalSF <<
" + "
191 << totalPos << " - " << totalNeg << " <===");
192
193 return 0;
194}
Scalar eta() const
pseudorapidity method
StatusCode getElectrons(const std::vector< std::pair< double, double > > &pt_eta, int runNumber, xAOD::TStore &store)
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
A relatively simple transient store for objects created in analysis.
int result(asg::StandaloneToolHandle< IAsgElectronEfficiencyCorrectionTool > &tool, const xAOD::Electron &el, double &nominalSF, double &totalPos, double &totalNeg, const bool isToys)
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
Electron_v1 Electron
Definition of the current "egamma version".