23 if (tau.
jet() ==
nullptr) {
25 return StatusCode::FAILURE;
31 TLorentzVector baryCenter;
38 ATH_MSG_DEBUG(
"barycenter (eta, phi): " << baryCenter.Eta() <<
" " << baryCenter.Phi());
41 TLorentzVector tauDetectorAxis;
46 if (baryCenter.DeltaR(constituentP4) >
m_clusterCone)
continue;
48 tauDetectorAxis += constituentP4;
52 ATH_MSG_DEBUG(
"this tau candidate does not have any constituent clusters!");
53 return StatusCode::FAILURE;
56 ATH_MSG_DEBUG(
"detector axis:" << tauDetectorAxis.Pt()<<
" " << tauDetectorAxis.Eta() <<
" " << tauDetectorAxis.Phi() <<
" " << tauDetectorAxis.E());
57 tau.
setP4(tauDetectorAxis.Pt(), tauDetectorAxis.Eta(), tauDetectorAxis.Phi(), tau.
m());
63 TLorentzVector tauInterAxis;
72 if (jetVertex != tau.
vertex()) {
75 if (tau.
vertex() ==
nullptr) {
76 ATH_MSG_WARNING(
"The seed jet has a vertex, while the tau candidate does not. It should not happen.");
77 return StatusCode::FAILURE;
84 if (jetVertex !=
nullptr) {
89 TLorentzVector baryCenterTauVertex;
96 ATH_MSG_DEBUG(
"barycenter (eta, phi) at tau vertex: " << baryCenterTauVertex.Eta() <<
" " << baryCenterTauVertex.Phi());
102 if (baryCenterTauVertex.DeltaR(constituentP4) >
m_clusterCone)
continue;
104 tauInterAxis += constituentP4;
108 tauInterAxis = tauDetectorAxis;
111 if (tauInterAxis.Pt() == 0.) {
112 ATH_MSG_DEBUG(
"this tau candidate does not have any constituent clusters!");
113 return StatusCode::FAILURE;
116 ATH_MSG_DEBUG(
"tau axis:" << tauInterAxis.Pt()<<
" " << tauInterAxis.Eta() <<
" " << tauInterAxis.Phi() <<
" " << tauInterAxis.E() );
117 tau.
setP4(tauInterAxis.Pt(), tauInterAxis.Eta(), tauInterAxis.Phi(), tau.
m());
121 return StatusCode::SUCCESS;
128 TLorentzVector vertexCorrectedP4;
139 ATH_MSG_WARNING(
"Seed jet constituent type not supported, will not do vertex correction !");
143 return vertexCorrectedP4;
149 TLorentzVector vertexCorrectedP4;
152 TVector3
pos(position.x(), position.y(), position.z());
156 vertexCorrectedP4 = fe.
p4();
160 " eta: " << fe.
eta() <<
" phi: " << fe.
phi() <<
" e: " << fe.
e());
161 ATH_MSG_DEBUG(
"Vertex corrected four momentum, pt: " << vertexCorrectedP4.Pt() <<
162 " eta: " << vertexCorrectedP4.Eta() <<
" phi: " << vertexCorrectedP4.Phi() <<
" e: " << vertexCorrectedP4.E());
164 return vertexCorrectedP4;