90 {
93
95 if( argc < 3 ) {
98 return EXIT_FAILURE;
99 }
101 auto start = std::time(
nullptr);
103
104 TString outputTree = "testIsoCloseByTool_out.root";
106
107
110 std::unique_ptr< TFile >
ifile( TFile::Open( fileName,
"READ" ) );
111 if( !
ifile.get() )
return EXIT_FAILURE;
112
115
116
119 ANA_MSG_INFO(
"Number of events in the file " <<
static_cast<int>(
event.getEntries()));
120
121
123
124 ANA_MSG_INFO(
"Initialize instance of the IsolationSelectionTool");
126
130 ANA_CHECK( IsoSelectionTool.setProperty(
"OutputLevel", MSG::FATAL) );
131 ANA_CHECK( IsoSelectionTool.retrieve() );
132
133 ANA_MSG_INFO(
"Initialize instance of the IsolationCloseByCorrectionTool");
135
136 ANA_CHECK( IsoCloseByTool.setProperty(
"IsolationSelectionTool", IsoSelectionTool.getHandle()) );
137 ANA_CHECK( IsoCloseByTool.setProperty(
"SelectionDecorator",
"isCloseByObject") );
138
139
140 ANA_CHECK( IsoCloseByTool.setProperty(
"IsolationSelectionDecorator",
"correctedIsol") );
141
142
143
144
145
146
147
148
149 ANA_CHECK( IsoCloseByTool.setProperty(
"OutputLevel", MSG::DEBUG) );
150 ANA_CHECK( IsoCloseByTool.setProperty(
"BackupPrefix",
"default") );
152
153
155 ofile = TFile::Open(outputTree,
"RECREATE");
156
157 TTree *
tree =
new TTree(
"otree",
"otree");
161
162 Long64_t maxEVT = atoll( argv[ 3 ] );
163 Long64_t
entries =
event.getEntries();
164 if ((
entries < maxEVT) || (maxEVT <= 0)) {
166 }
168
169 const int INTERVAL = maxEVT > 20000 ? 10000 : maxEVT / 10;
170
172
176
179
181 event.getEntry(entry);
182
185
186 if (entry % INTERVAL == 0)
187 ANA_MSG_INFO(Form(
"--> Event %lld \t EventNumber: %llu RunNumber: %u", entry, ei->eventNumber(), ei->runNumber()));
188
189
193
194 for(const auto el : *Electrons) {
195
196 const char passIsol = IsoSelectionTool->accept(*el) ? 1 : 0;
197 dec_PassIsol(*el) = passIsol;
198
200 dec_PassQuality(*el) = passQuality;
201 }
202 for(const auto ph : *Photons) {
203
204 const char passIsol = IsoSelectionTool->accept(*ph) ? 1 : 0;
205 dec_PassIsol(*ph) = passIsol;
206
207 const char passQuality = (ph->pt() >
PhotonPt && std::abs(ph->eta()) <
PhotonEta) ? 1 : 0;
208 dec_PassQuality(*ph) = passQuality;
209 }
210 for (
const auto mu : *
Muons) {
211
212 const char passIsol = IsoSelectionTool->accept(*mu) ? 1 : 0;
213 dec_PassIsol(*mu) = passIsol;
214
215 const char passQuality = (
mu->pt() >
MuonPt && std::abs(
mu->eta()) <
MuonEta) ? 1 : 0;
216 dec_PassQuality(*mu) = passQuality;
217 }
218
219
221 return EXIT_FAILURE;
222 }
223
224
225
226
227
228
229
230
231
232 ANA_CHECK( eleBranches.Fill(Electrons) );
236
237 }
241
242 auto end = std::time(
nullptr);
243 ANA_MSG_INFO(Form(
"Ran on %i event for testing %s",(
int)maxEVT, std::ctime(&end)));
244
245 return EXIT_SUCCESS;
246}
@ Error
Some error happened during the object correction.
SG::Decorator< T, ALLOC > Decorator
Class creating a shallow copy of an existing auxiliary container.
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.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".