112 std::vector<float> cluster_et_log, cluster_dEta, cluster_dPhi;
113 std::vector<float> cluster_log_SECOND_R, cluster_SECOND_LAMBDA, cluster_CENTER_LAMBDA;
118 auto mon_cluster_SECOND_LAMBDA =
Monitored::Collection(
"cluster_SECOND_LAMBDA", cluster_SECOND_LAMBDA);
119 auto mon_cluster_CENTER_LAMBDA =
Monitored::Collection(
"cluster_CENTER_LAMBDA", cluster_CENTER_LAMBDA);
120 std::vector<unsigned char> calo_errors;
142 std::vector<float> track_pt_log, track_dEta, track_dPhi;
143 std::vector<float> track_d0_abs_log, track_z0sinthetaTJVA_abs_log;
144 std::vector<float> track_nPixelHitsPlusDeadSensors, track_nSCTHitsPlusDeadSensors;
149 auto mon_track_z0sinthetaTJVA_abs_log =
Monitored::Collection(
"track_z0sinthetaTJVA_abs_log", track_z0sinthetaTJVA_abs_log);
150 auto mon_track_nPixelHitsPlusDeadSensors =
Monitored::Collection(
"track_nPixelHitsPlusDeadSensors", track_nPixelHitsPlusDeadSensors);
151 auto mon_track_nSCTHitsPlusDeadSensors =
Monitored::Collection(
"track_nSCTHitsPlusDeadSensors", track_nSCTHitsPlusDeadSensors);
152 std::vector<unsigned char> track_errors;
165 etaRoI, phiRoI, dEta_RoI, dPhi_RoI,
169 EMRadius, HadRadius, EtHad, EtEm, EMFrac, IsoFrac, CentFrac,
170 clustersMeanCenterLambda, clustersMeanFirstEngDens, clustersMeanEMProbability,
171 clustersMeanSecondLambda, clustersMeanPresamplerFrac,
172 n_clusters, mon_cluster_et_log, mon_cluster_dEta, mon_cluster_dPhi,
173 mon_cluster_log_SECOND_R, mon_cluster_SECOND_LAMBDA, mon_cluster_CENTER_LAMBDA,
175 n_core_tracks, n_wide_tracks,
178 vertex_x, vertex_y, vertex_z,
179 n_tracks, mon_track_pt_log, mon_track_dEta, mon_track_dPhi,
180 mon_track_d0_abs_log, mon_track_z0sinthetaTJVA_abs_log,
181 mon_track_nPixelHitsPlusDeadSensors, mon_track_nSCTHitsPlusDeadSensors,
183 IDScore_0p, IDScoreSigTrans_0p, IDScore_1p, IDScoreSigTrans_1p, IDScore_mp, IDScoreSigTrans_mp);
199 return StatusCode::FAILURE;
202 if(roisHandle->
empty()) {
204 return StatusCode::FAILURE;
213 return StatusCode::FAILURE;
229 inputTauContainer = tauInputHandle.cptr();
235 inputTauTrackContainer = tauTrackInputHandle.cptr();
242 std::unique_ptr<xAOD::TauJetContainer> outputContainer = std::make_unique<xAOD::TauJetContainer>();
243 std::unique_ptr<xAOD::TauJetAuxContainer> outputAuxContainer = std::make_unique<xAOD::TauJetAuxContainer>();
244 outputContainer->setStore(outputAuxContainer.get());
247 ATH_CHECK(outputTauHandle.record(std::move(outputContainer), std::move(outputAuxContainer)));
252 std::unique_ptr<xAOD::TauTrackContainer> outputTrackContainer = std::make_unique<xAOD::TauTrackContainer>();
253 std::unique_ptr<xAOD::TauTrackAuxContainer> outputTrackAuxContainer = std::make_unique<xAOD::TauTrackAuxContainer>();
254 outputTrackContainer->setStore(outputTrackAuxContainer.get());
257 ATH_CHECK(tauTrackHandle.record(std::move(outputTrackContainer), std::move(outputTrackAuxContainer)));
264 tau = outputTauHandle->back();
282 if(RoICaloClusterContainer) {
283 ATH_MSG_DEBUG(
"CaloCluster container found of size: " << RoICaloClusterContainer->
size());
290 return StatusCode::FAILURE;
294 std::unique_ptr<xAOD::JetContainer> jetContainer{std::make_unique<xAOD::JetContainer>()};
295 std::unique_ptr<xAOD::JetAuxContainer> jetAuxContainer{std::make_unique<xAOD::JetAuxContainer>()};
296 jetContainer->setStore(jetAuxContainer.get());
299 ATH_CHECK(outputTauSeedJetHandle.
record(std::move(jetContainer), std::move(jetAuxContainer)));
302 outputTauSeedJetHandle->
push_back(std::make_unique<xAOD::Jet>());
310 TLorentzVector cluster_p4, barycenter;
312 ATH_MSG_DEBUG(
"Cluster (e, eta, phi): (" << cluster->e() <<
", " << cluster->eta() <<
", " << cluster->phi() <<
")");
314 if(cluster->e() < 0) {
319 cluster_p4.SetPtEtaPhiE(cluster->pt(), cluster->eta(), cluster->phi(), cluster->e());
320 jet->addConstituent(cluster);
322 barycenter += cluster_p4;
325 jet->setJetP4(
xAOD::JetFourMom_t(barycenter.Pt(), barycenter.Eta(), barycenter.Phi(), barycenter.M()));
326 ATH_MSG_DEBUG(
"Built jet with eta: " <<
jet->eta() <<
", phi: " <<
jet->phi() <<
", pT: " <<
jet->pt() <<
", E: "<<
jet->e() );
332 outputTauHandle->push_back(std::make_unique<xAOD::TauJet>());
333 tau = outputTauHandle->back();
342 ATH_MSG_DEBUG(
"Changing (eta, phi) back to the RoI center due to energy: " <<
jet->e());
343 tau->
setP4(tau->
pt(), roiDescriptor->
eta(), roiDescriptor->
phi(), tau->
m());
356 if(!VertexContainerHandle.
isValid()) {
357 ATH_MSG_DEBUG(
"No VertexContainer retrieved for the trigger element");
360 RoIVxContainer = VertexContainerHandle.
get();
371 StatusCode processStatus = StatusCode::SUCCESS;
376 processStatus =
tool->executeVertexFinder(*tau, RoIVxContainer);
378 if(!processStatus.isFailure()) {
390 processStatus =
tool->execute(*tau);
392 if(!processStatus.isFailure()) {
404 processStatus =
tool->executeTrackFinder(*tau, *tauTrackHandle);
406 if(!processStatus.isFailure()) {
418 processStatus =
tool->execute(*tau);
420 if(!processStatus.isFailure()) {
434 processStatus =
tool->executeVertexVariables(*tau, dummyVxCont);
436 if(!processStatus.isFailure()) {
448 processStatus =
tool->execute(*tau);
450 if(!processStatus.isFailure()) {
461 if(!processStatus.isSuccess()) {
462 ATH_MSG_DEBUG(
"The tau object has NOT been registered in the tau container");
466 tauTrackHandle->erase(tauTrackHandle->end() - bad_tau->
nAllTracks(), tauTrackHandle->end());
468 outputTauHandle->pop_back();
474 float fJetEnergy = (*tau->
jetLink())->
e();
477 if(fJetEnergy < 0.00001) {
478 ATH_MSG_DEBUG(
"Changing tau's (eta,phi) to RoI ones due to negative energy (PxPyPzE flips eta and phi)");
479 ATH_MSG_DEBUG(
"This is probably not needed anymore, method PxPyPzE has been corrected");
482 tau->
setP4(tau->
pt(), roiDescriptor->
eta(), roiDescriptor->
phi(), tau->
m());
484 ATH_MSG_DEBUG(
"Roi: " << roiDescriptor->
roiId() <<
", Tau eta: " << tau->
eta() <<
", phi: " << tau->
phi() <<
", pT: " << tau->
pt());
497 etaRoI = roiDescriptor->
eta();
498 phiRoI = roiDescriptor->
phi();
499 dEta_RoI =
eta - roiDescriptor->
eta();
500 dPhi_RoI =
phi - roiDescriptor->
phi();
501 if(dPhi_RoI < -
M_PI) dPhi_RoI += 2.0*
M_PI;
502 if(dPhi_RoI >
M_PI) dPhi_RoI -= 2.0*
M_PI;
505 float pre_mEflowApprox;
509 float pre_ptRatioEflowApprox;
527 float Et_raw = EtEm + EtHad;
528 if(Et_raw != 0) EMFrac = EtEm / Et_raw;
538 if(
test) clustersMeanCenterLambda =
tmp;
540 if(
test) clustersMeanFirstEngDens =
tmp;
542 if(
test) clustersMeanEMProbability =
tmp;
544 if(
test) clustersMeanSecondLambda =
tmp;
546 if(
test) clustersMeanPresamplerFrac =
tmp;
550 n_clusters = tau->
clusters().size();
551 for(
const auto& cluster : tau->
clusters()) {
554 cluster_et_log.push_back(std::log10(
cls->et()));
555 cluster_dEta.push_back(
cls->eta() - tau->
eta());
556 cluster_dPhi.push_back(
cls->p4().DeltaPhi(tau->
p4()));
558 double log_second_R = -999;
560 if(success_SECOND_R) log_second_R = std::log10(log_second_R + 0.1);
561 cluster_log_SECOND_R.push_back(log_second_R);
563 double second_lambda = -999;
565 if(success_SECOND_LAMBDA) second_lambda = std::log10(second_lambda + 0.1);
566 cluster_SECOND_LAMBDA.push_back(second_lambda);
568 double center_lambda = -999;
570 if(success_CENTER_LAMBDA) center_lambda = std::log10(center_lambda + 1
e-6);
571 cluster_CENTER_LAMBDA.push_back(center_lambda);
575 n_core_tracks = tau->
nTracks();
600 track_pt_log.push_back(std::log10(
track->pt()));
601 track_dEta.push_back(
track->eta() - tau->
eta());
602 track_dPhi.push_back(
track->p4().DeltaPhi(tau->
p4()));
603 track_d0_abs_log.push_back(std::log10(std::abs(
track->track()->d0()) + 1
e-6));
604 track_z0sinthetaTJVA_abs_log.push_back(
track->z0sinthetaTJVA());
606 uint8_t pixel_hits, pixel_dead;
609 float nPixelHitsPlusDeadSensor = -999;
610 if(success1_pixel_hits && success2_pixel_dead) nPixelHitsPlusDeadSensor = pixel_hits + pixel_dead;
611 track_nPixelHitsPlusDeadSensors.push_back(nPixelHitsPlusDeadSensor);
641 <<
", Tau pT (GeV): " <<
pT <<
", Tau eta: " <<
eta <<
", Tau phi: " <<
phi
642 <<
", wrt RoI dEta: " << dEta_RoI <<
", dPhi: " << dPhi_RoI);
649 ATH_MSG_DEBUG(
"Output TauJetContainer size: " << outputTauHandle->size());
650 ATH_MSG_DEBUG(
"Output TauJetTrackContainer size: " << tauTrackHandle->size());
652 ATH_MSG_DEBUG(
"Recorded a tau container: " << outputTauHandle.name());
653 ATH_MSG_DEBUG(
"The tau object has been registered in the tau container");
655 return StatusCode::SUCCESS;