29 return StatusCode::SUCCESS;
39 ATH_MSG_WARNING (
"EventInfo decoration not available! Will set mu=0." );
43 mu = (
int)eventInfoDecorHandle(0);
51 if (!vertexInHandle.
isValid()) {
52 ATH_MSG_WARNING (
"Could not retrieve HiveDataObj with key " << vertexInHandle.
key() <<
", will set nVtxPU=0.");
56 for (
const auto *xVertex : *vertexContainer){
62 acc_nVtxPU(xTau) = nVtxPU;
78 double center_lambda=0. , first_eng_dens=0. , em_probability=0. , second_lambda=0. ;
79 double mean_center_lambda=0. , mean_first_eng_dens=0. , mean_em_probability=0. , mean_second_lambda=0. ;
80 double mean_presampler_frac=0., lead_cluster_frac=0. , second_cluster_frac=0. , third_cluster_frac=0. ;
81 double clE=0., Etot=0.;
84 TLorentzVector clusters_EM_P4;
85 clusters_EM_P4.SetPtEtaPhiM(0,0,0,0);
86 TLorentzVector clusters_had_P4;
87 clusters_had_P4.SetPtEtaPhiM(0,0,0,0);
88 TLorentzVector tauIntermediateAxisEM;
89 tauIntermediateAxisEM.SetPtEtaPhiM(0,0,0,0);
104 if (clusterP4.DeltaR(tauAxis) > 0.2)
continue;
108 clE = cluster.
calE();
111 if (clE > lead_cluster_frac) {
112 third_cluster_frac = second_cluster_frac;
113 second_cluster_frac = lead_cluster_frac;
114 lead_cluster_frac = clE;
116 else if (clE > second_cluster_frac) {
117 third_cluster_frac = second_cluster_frac;
118 second_cluster_frac = clE;
120 else if (clE > third_cluster_frac) {
121 third_cluster_frac = clE;
125 mean_center_lambda += clE*center_lambda;
129 mean_first_eng_dens += clE*first_eng_dens;
133 mean_em_probability += clE*em_probability;
137 if (em_probability>0.5) clusters_EM_P4 += cluster.
p4(xAOD::CaloCluster::State::CALIBRATED);
138 else clusters_had_P4 += cluster.
p4(xAOD::CaloCluster::State::CALIBRATED);
143 mean_second_lambda += clE*second_lambda;
151 tauIntermediateAxisEM += vertexedClusterEM.
p4();
154 tauIntermediateAxisEM += cluster.
p4(xAOD::CaloCluster::State::UNCALIBRATED);
160 mean_center_lambda /= Etot;
161 mean_first_eng_dens /= Etot;
162 mean_em_probability /= Etot;
163 mean_second_lambda /= Etot;
164 mean_presampler_frac /= Etot;
165 lead_cluster_frac /= Etot;
166 second_cluster_frac /= Etot;
167 third_cluster_frac /= Etot;
169 if (mean_first_eng_dens>0.) mean_first_eng_dens = TMath::Log10(mean_first_eng_dens/Etot);
173 double upsilon_cluster = -2.;
174 if (clusters_had_P4.E()+clusters_EM_P4.E()!=0.)
175 upsilon_cluster = (clusters_had_P4.E()-clusters_EM_P4.E())/(clusters_had_P4.E()+clusters_EM_P4.E());
184 acc_ClusterTotalEnergy(xTau) = (
float) Etot;
187 acc_ptIntermediateAxisEM(xTau) = (
float) tauIntermediateAxisEM.Pt();
192 acc_LeadClusterFrac(xTau) = (
float) lead_cluster_frac;
193 acc_UpsilonCluster(xTau) = (
float) upsilon_cluster;
199 acc_SecondClusterFrac(xTau) = (
float) second_cluster_frac;
200 acc_ThirdClusterFrac(xTau) = (
float) third_cluster_frac;
202 return StatusCode::SUCCESS;
208 if (jetSeed ==
nullptr) {
210 return StatusCode::FAILURE;
214 if (!jetSeed->
getAttribute<
int>(
"GhostMuonSegmentCount", nMuSeg)) nMuSeg=0;
220 TLorentzVector Pi0_totalP4;
221 Pi0_totalP4.SetPtEtaPhiM(0,0,0,0);
227 double Pi0_totalE = Pi0_totalP4.E();
230 TLorentzVector charged_totalP4;
231 charged_totalP4.SetPtEtaPhiM(0,0,0,0);
234 charged_totalP4 +=
track->p4();
237 double charged_totalE = charged_totalP4.E();
241 if (Pi0_totalE+charged_totalE != 0.){
242 relDiff = (charged_totalE - Pi0_totalE) / (charged_totalE + Pi0_totalE) ;
246 return StatusCode::SUCCESS;