15 if (tau.
jet() ==
nullptr) {
17 return StatusCode::FAILURE;
23 TLorentzVector baryCenter;
30 ATH_MSG_DEBUG(
"barycenter (eta, phi): " << baryCenter.Eta() <<
" " << baryCenter.Phi());
33 TLorentzVector tauDetectorAxis;
38 if (baryCenter.DeltaR(constituentP4) >
m_clusterCone)
continue;
40 tauDetectorAxis += constituentP4;
44 ATH_MSG_DEBUG(
"this tau candidate does not have any constituent clusters!");
45 return StatusCode::FAILURE;
48 ATH_MSG_DEBUG(
"detector axis:" << tauDetectorAxis.Pt()<<
" " << tauDetectorAxis.Eta() <<
" " << tauDetectorAxis.Phi() <<
" " << tauDetectorAxis.E());
49 tau.
setP4(tauDetectorAxis.Pt(), tauDetectorAxis.Eta(), tauDetectorAxis.Phi(), tau.
m());
55 TLorentzVector tauInterAxis;
60 if (jetVertex != tau.
vertex()) {
63 if (tau.
vertex() ==
nullptr) {
64 ATH_MSG_WARNING(
"The seed jet has a vertex, while the tau candidate does not. It should not happen.");
65 return StatusCode::FAILURE;
72 if (jetVertex !=
nullptr) {
77 TLorentzVector baryCenterTauVertex;
84 ATH_MSG_DEBUG(
"barycenter (eta, phi) at tau vertex: " << baryCenterTauVertex.Eta() <<
" " << baryCenterTauVertex.Phi());
90 if (baryCenterTauVertex.DeltaR(constituentP4) >
m_clusterCone)
continue;
92 tauInterAxis += constituentP4;
96 tauInterAxis = tauDetectorAxis;
99 if (tauInterAxis.Pt() == 0.) {
100 ATH_MSG_DEBUG(
"this tau candidate does not have any constituent clusters!");
101 return StatusCode::FAILURE;
104 ATH_MSG_DEBUG(
"tau axis:" << tauInterAxis.Pt()<<
" " << tauInterAxis.Eta() <<
" " << tauInterAxis.Phi() <<
" " << tauInterAxis.E() );
105 tau.
setP4(tauInterAxis.Pt(), tauInterAxis.Eta(), tauInterAxis.Phi(), tau.
m());
109 return StatusCode::SUCCESS;
116 TLorentzVector vertexCorrectedP4;
127 ATH_MSG_WARNING(
"Seed jet constituent type not supported, will not do vertex correction !");
131 return vertexCorrectedP4;
137 TLorentzVector vertexCorrectedP4;
140 TVector3
pos(position.x(), position.y(), position.z());
144 vertexCorrectedP4 = fe.
p4();
148 " eta: " << fe.
eta() <<
" phi: " << fe.
phi() <<
" e: " << fe.
e());
149 ATH_MSG_DEBUG(
"Vertex corrected four momentum, pt: " << vertexCorrectedP4.Pt() <<
150 " eta: " << vertexCorrectedP4.Eta() <<
" phi: " << vertexCorrectedP4.Phi() <<
" e: " << vertexCorrectedP4.E());
152 return vertexCorrectedP4;