74 {
76
77
79
80
81 if( argc < 3 ) {
84 return EXIT_FAILURE;
85 }
86
88 auto start = std::time(
nullptr);
89 char tbuf_start[26]; ::ctime_r(&start, tbuf_start);
91
92
95 std::unique_ptr< TFile >
ifile( TFile::Open( fileName,
"READ" ) );
96 if( !
ifile.get() )
return EXIT_FAILURE;
97
100
101
104 ANA_MSG_INFO(
"Number of events in the file" <<
static_cast<int>(
event.getEntries()));
105
106
108
109
110 Long64_t
entries =
event.getEntries();
111 if( argc > 3 ) {
112 const Long64_t
e = atoll( argv[ 3 ] );
114 }
115
116
117#ifdef XAOD_STANDALONE
118 StatusCode::enableFailure();
119#endif
120
121 ANA_MSG_INFO(
"Initialize the standard instance of the tool");
123 ANA_CHECK( IsoSelectionTool.setProperty(
"MuonWP", MuonIso) );
124 ANA_CHECK( IsoSelectionTool.setProperty(
"ElectronWP", ElectronIso) );
125 ANA_CHECK( IsoSelectionTool.setProperty(
"PhotonWP", PhotonIso) );
126
127 ANA_CHECK( IsoSelectionTool.setProperty(
"OutputLevel", MSG::DEBUG) );
128 ANA_CHECK( IsoSelectionTool.initialize() );
129
130 ANA_MSG_INFO(
"Initialize the low-Pt augmentation (PLV-only)");
132 ANA_CHECK( IsoSelectionTool_lowPt.setProperty(
"OutputLevel", MSG::DEBUG) );
133 ANA_CHECK( IsoSelectionTool_lowPt.initialize() );
134
135 std::string sgKeyPhotons("Photons");
136 std::string sgKeyElectrons("Electrons");
137 std::string sgKeyMuons("Muons");
138
139
142 event.getEntry( entry );
143
146 ANA_MSG_INFO(
" Number of pre-selected photons: " << (
int)photons->size());
147
148 for (auto ph : *photons) {
149 if (ph->caloCluster() == nullptr) continue;
150 if (ph->pt() < PhotonPt || std::abs(ph->caloCluster()->eta()) > PhotonEta) continue;
151
152 if (IsoSelectionTool.accept( *ph ))
153 ANA_MSG_INFO(Form(
" --> Photon (pt=%.1f, eta=%.3f, phi=%.3f) PASSES Isolation %s",ph->pt(),ph->eta(),ph->phi(),PhotonIso.c_str()));
154 else
155 ANA_MSG_INFO(Form(
" --> Photon (pt=%.1f, eta=%.3f, phi=%.3f) FAILS Isolation %s",ph->pt(),ph->eta(),ph->phi(),PhotonIso.c_str()));
156 continue;
157 }
158
162
163 for (auto el : *electrons) {
164 if (
el->caloCluster() ==
nullptr)
continue;
165 if (
el->pt() < ElectronPt || std::abs(
el->caloCluster()->eta()) > ElectronEta)
continue;
166 if(ElectronIso.find(
"PLV") != std::string::npos)
ANA_CHECK( IsoSelectionTool_lowPt.augmentPLV(*el) );
167
168 if (IsoSelectionTool.accept( *el ))
169 ANA_MSG_INFO(Form(
" --> Electron (pt=%.1f, eta=%.3f, phi=%.3f) PASSES Isolation %s",
el->pt(),
el->eta(),
el->phi(), ElectronIso.c_str()));
170 else
171 ANA_MSG_INFO(Form(
" --> Electron (pt=%.1f, eta=%.3f, phi=%.3f) FAILS Isolation %s",
el->pt(),
el->eta(),
el->phi(), ElectronIso.c_str()));
172 continue;
173 }
174
177 ANA_MSG_INFO(
" Number of pre-selected muons: " << (
int)muons->size());
178
179 for (auto mu : *muons) {
180 if (
mu->pt() < MuonPt || std::abs(
mu->eta()) > MuonEta)
continue;
181 if(MuonIso.find(
"PLV") != std::string::npos)
ANA_CHECK( IsoSelectionTool_lowPt.augmentPLV(*mu) );
182
183 if (IsoSelectionTool.accept( *mu ))
184 ANA_MSG_INFO(Form(
" --> Muon (pt=%.1f, eta=%.3f, phi=%.3f) PASSES Isolation %s",
mu->pt(),
mu->eta(),
mu->phi(), MuonIso.c_str()));
185 else
186 ANA_MSG_INFO(Form(
" --> Muon (pt=%.1f, eta=%.3f, phi=%.3f) FAILS Isolation %s",
mu->pt(),
mu->eta(),
mu->phi(), MuonIso.c_str()));
187 continue;
188 }
189
190 continue;
191 }
192
193 auto end = std::time(
nullptr);
194 char tbuf_end[26]; ::ctime_r(&end, tbuf_end);
196
197 return EXIT_SUCCESS;
198}
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".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".