34{
35
37
39
40 using namespace asg::testEgEfficiencyCorr;
42 MSG::Level mylevel = MSG::INFO;
43 setMsgLevel(mylevel);
45
46
47 if (argc < 2) {
51 << " Usage: <<APP_NAME << [xAOD file name] [Num of events to use]");
52 return 1;
53 }
54
55
57
58
61 std::unique_ptr<TFile>
ifile(TFile::Open(fileName,
"READ"));
63
64
67
68
70 ElEffCorrectionTool(
71 "AsgElectronEfficiencyCorrectionTool/ElEffCorrectionTool");
72 ANA_CHECK(ElEffCorrectionTool.setProperty(
"IdKey",
"Medium"));
73 ANA_CHECK(ElEffCorrectionTool.setProperty(
"ForceDataType", 1));
74 ANA_CHECK(ElEffCorrectionTool.setProperty(
"OutputLevel", mylevel));
75 ANA_CHECK(ElEffCorrectionTool.setProperty(
"CorrelationModel",
"FULL"));
76 ANA_CHECK(ElEffCorrectionTool.setProperty(
"UseRandomRunNumber",
false));
77 ANA_CHECK(ElEffCorrectionTool.initialize());
78
79
82 <<
static_cast<long long int>(
event.getEntries()));
83
84
85 long long int entries =
event.getEntries();
86 if (argc > 2) {
87 const long long int e = atoll(argv[2]);
90 }
91 }
93
94
96 event.getEntry(entry);
98
101
104 if (!cluster) {
105 ANA_MSG_ERROR(
"ERROR no cluster associated to the Electron \n");
107 }
109 continue;
110 if (std::abs(cluster->
etaBE(2)) >= 2.47) {
111 continue;
112 }
113
114 int index = ElEffCorrectionTool->systUncorrVariationIndex(*el);
115
116
117
118 bool isToys = false;
119 double nominalSF{};
120 double totalNeg{};
121 double totalPos{};
124 ElEffCorrectionTool, *el, nominalSF, totalPos, totalNeg, isToys) ==
125 0);
126
128 <<
el->pt() <<
" : eta = " <<
el->eta()
129 <<
" : Bin index = " <<
index <<
" : SF = " << nominalSF
130 << " + " << totalPos << " - " << totalNeg << " <===");
131 }
132 }
133
135 return 0;
136}
@ Error
Some error happened during the object correction.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Tool for accessing xAOD files outside of Athena.
static void enableDataSubmission(::Bool_t value)
Function for turning data submission on/off.
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".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Electron_v1 Electron
Definition of the current "egamma version".