29 m_specifiedSystematicsPhotons(),
30 m_specifiedSystematicsElectrons(),
31 m_specifiedSystematicsFwdElectrons(),
32 m_recommendedSystematicsPhotons(),
33 m_recommendedSystematicsElectrons(),
34 m_recommendedSystematicsFwdElectrons(),
36 m_calibrationTool(
"EgammaCalibrationAndSmearingTool"),
37 m_photonFudgeTool(
"PhotonFudgeTool"),
39 m_isolationCorr(
"IsolationCorrectionTool") {
44 ATH_MSG_INFO(
" top::EgammaObjectCollectionMaker initialize");
54 for (
const std::string&
WP :
m_config->photonIsolationWPs()) {
62 for (
const std::string&
WP :
m_config->electronIsolationWPs()) {
70 std::set<std::string> systPhoton;
71 std::set<std::string> systElectron;
72 std::set<std::string> systFwdElectron;
74 const std:: string& syststr =
m_config->systematics();
75 std::set<std::string> syst;
78 bool ok =
m_config->getSystematicsList(syststr, syst);
80 ATH_MSG_ERROR(
" top::EgammaObjectCollectionMaker could not determine systematic list");
81 return StatusCode::FAILURE;
85 if (!
m_config->contains(syst,
"AllElectrons")) {
88 if (!
m_config->contains(syst,
"AllPhotons")) {
91 if (!
m_config->contains(syst,
"AllFwdElectrons")) {
92 systFwdElectron = syst;
113 return StatusCode::SUCCESS;
125 if (executeNominal && !
m_config->isSystNominal(
m_config->systematicName(systematic.hash())))
continue;
126 if (!executeNominal &&
m_config->isSystNominal(
m_config->systematicName(systematic.hash())))
continue;
136 for (
auto photon : *(shallow_xaod_copy.first)) {
139 if (!
photon->caloCluster())
continue;
143 "Failed to applyCorrection");
155 if (
photon->caloCluster() ==
nullptr) {
157 return StatusCode::FAILURE;
161 " Didn't find the necessary photon shower shapes variables for the ElectronPhotonShowerShapeFudgeTool! (but don't worry, you're still getting correctly ID'd photons)");
170 const char passIsol = (photonIsoWP.second->accept(*
photon)) ? 1 : 0;
171 photon->auxdecor<
char>(
"AnalysisTop_Isol_" + photonIsoWP.first) = passIsol;
177 if (!setLinks)
ATH_MSG_ERROR(
" Cannot set original object links for photons, MET recalculation may struggle");
180 std::string outputSGKey =
m_config->sgKeyPhotons(systematic.hash());
181 std::string outputSGKeyAux = outputSGKey +
"Aux.";
184 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
186 if (!
save || !saveAux) {
187 return StatusCode::FAILURE;
190 return StatusCode::SUCCESS;
208 if (executeNominal && !
m_config->isSystNominal(
m_config->systematicName(systematic.hash())))
continue;
209 if (!executeNominal &&
m_config->isSystNominal(
m_config->systematicName(systematic.hash())))
continue;
219 for (
auto electron : *(shallow_xaod_copy.first)) {
222 if (
electron->caloCluster() !=
nullptr &&
electron->trackParticle() !=
nullptr) {
235 electron->auxdecor<
float>(
"d0sig") = d0sig;
237 if (eventInfo->
isAvailable<
float>(
"AnalysisTop_PRIVTX_z_position")) {
238 float vtx_z = eventInfo->
auxdata<
float>(
"AnalysisTop_PRIVTX_z_position");
239 float delta_z0 =
electron->trackParticle()->z0() +
electron->trackParticle()->vz() - vtx_z;
240 electron->auxdecor<
float>(
"delta_z0") = delta_z0;
247 const char passIsol = (electronIsoWP.second->accept(*
electron)) ? 1 : 0;
248 electron->auxdecor<
char>(
"AnalysisTop_Isol_" + electronIsoWP.first) = passIsol;
254 if (!setLinks)
ATH_MSG_ERROR(
" Cannot set original object links for electrons, MET recalculation may struggle");
257 std::string outputSGKey =
m_config->sgKeyElectronsStandAlone(systematic.hash());
258 std::string outputSGKeyAux = outputSGKey +
"Aux.";
261 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
263 if (!
save || !saveAux) {
264 return StatusCode::FAILURE;
268 return StatusCode::SUCCESS;
283 if (executeNominal && !
m_config->isSystNominal(
m_config->systematicName(systematic.hash())))
continue;
284 if (!executeNominal &&
m_config->isSystNominal(
m_config->systematicName(systematic.hash())))
continue;
294 for (
auto electron : *(shallow_xaod_copy.first)) {
297 if (
electron->caloCluster() !=
nullptr) {
306 if (!setLinks)
ATH_MSG_ERROR(
" Cannot set original object links for fwd electrons");
309 std::string outputSGKey =
m_config->sgKeyFwdElectronsStandAlone(systematic.hash());
310 std::string outputSGKeyAux = outputSGKey +
"Aux.";
313 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
315 if (!
save || !saveAux) {
316 return StatusCode::FAILURE;
320 return StatusCode::SUCCESS;
330 for (
auto x : *xaod) {
337 return StatusCode::SUCCESS;
345 s.hash())),
"Failed to retrieve Electrons");
348 for (
auto x : *xaod) {
355 return StatusCode::SUCCESS;
363 s.hash())),
"Failed to retrieve Fwd Electrons");
366 for (
auto x : *xaod) {
371 return StatusCode::SUCCESS;
379 for (
auto s : systList) {
381 if(!
m_config->getTreeFilter()->filterTree(
s.name()))
continue;
383 if (
s.name() ==
"") {
391 if (specifiedSystematics.size() == 0) {
394 if (specifiedSystematics.size() > 0) {
395 for (
auto i : specifiedSystematics) {
397 if (!
filter.filterTree(
s.name())) {
416 for (
auto s : systList) {
418 if(!
m_config->getTreeFilter()->filterTree(
s.name()))
continue;
420 if (
s.name() ==
"") {
428 if (specifiedSystematics.size() == 0) {
431 if (specifiedSystematics.size() > 0) {
432 for (
auto i : specifiedSystematics) {
434 if (!
filter.filterTree(
s.name())) {
454 for (
auto s : systList) {
456 if(!
m_config->getTreeFilter()->filterTree(
s.name()))
continue;
458 if (
s.name() ==
"") {
466 if (specifiedSystematics.size() == 0) {
469 if (specifiedSystematics.size() > 0) {
470 for (
auto i : specifiedSystematics) {
472 if (!
filter.filterTree(
s.name())) {