34{
35
37
39 using namespace asg::testEgEfficiencyCorrFwd;
41 MSG::Level mylevel = MSG::INFO;
42 setMsgLevel(mylevel);
44
45
46 if (argc < 2) {
50 << " Usage: <<APP_NAME << [xAOD file name] [Num of events to use]");
51 return 1;
52 }
53
54
56
57
60 std::unique_ptr<TFile>
ifile(TFile::Open(fileName,
"READ"));
62
63
65
66
67 std::vector<std::string> id_configFiles{
68 "ElectronEfficiencyCorrection/2012/offline/"
69 "efficiencySF.offline.FwdTight.2012.8TeV.rel17p2.GEO21.v02.root"
70 };
71
73 "AsgElectronEfficiencyCorrectionTool/ElEffCorrectionTool");
75 ElEffCorrectionTool.setProperty("CorrectionFileNameList", id_configFiles));
76 ANA_CHECK(ElEffCorrectionTool.setProperty(
"ForceDataType", 1));
77 ANA_CHECK(ElEffCorrectionTool.setProperty(
"OutputLevel", mylevel));
78 ANA_CHECK(ElEffCorrectionTool.setProperty(
"CorrelationModel",
"FULL"));
79 ANA_CHECK(ElEffCorrectionTool.setProperty(
"UseRandomRunNumber",
false));
80 ANA_CHECK(ElEffCorrectionTool.initialize());
81
82
85 <<
static_cast<long long int>(
event.getEntries()));
86
87
88 long long int entries =
event.getEntries();
89 if (argc > 2) {
90 const long long int e = atoll(argv[2]);
93 }
94 }
96
97
99 event.getEntry(entry);
101
104
106 if (
el->pt() < 20000)
107 continue;
108 if (fabs(
el->caloCluster()->eta()) < 2.5)
109 continue;
110 int index = ElEffCorrectionTool->systUncorrVariationIndex(*el);
111
112
113
114 bool isToys = false;
115 double nominalSF{};
116 double totalNeg{};
117 double totalPos{};
120 ElEffCorrectionTool, *el, nominalSF, totalPos, totalNeg, isToys) ==
121 0);
122
124 <<
el->pt() <<
" : eta = " <<
el->eta()
125 <<
" : Bin index = " <<
index <<
" : SF = " << nominalSF
126 << " + " << totalPos << " - " << totalNeg << " <===");
127 }
128 }
129
131 return 0;
132}
Tool for accessing xAOD files outside of Athena.
static void enableDataSubmission(::Bool_t value)
Function for turning data submission on/off.
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".