36 float totalEnergy(0.);
41 TLorentzVector leadClusVec;
42 TLorentzVector subLeadClusVec;
43 TLorentzVector approxSubstructure4Vec;
51 std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList = tau.
vertexedClusters();
59 float clEnergy = vertexedCluster.e();
64 float PreSampler = cluster.
eSample(CaloSampling::PreSamplerB) + cluster.
eSample(CaloSampling::PreSamplerE);
65 float EMLayer1 = cluster.
eSample(CaloSampling::EMB1) + cluster.
eSample(CaloSampling::EME1);
66 float EMLayer2 = cluster.
eSample(CaloSampling::EMB2) + cluster.
eSample(CaloSampling::EME2);
69 float PSSF = (
Energy != 0.) ? (PreSampler + EMLayer1) /
Energy : 0.;
71 float EMF = PSSF + EM2F;
73 PSSEnergy += PSSF * clEnergy;
74 EMEnergy += EMF * clEnergy;
75 HADEnergy += (
Energy != 0.) ? (1 - EMF) * clEnergy : 0.;
77 TLorentzVector clusterP4 = vertexedCluster.p4();
79 totalEnergy += clusterP4.E();
81 if (tauAxis.DeltaR(clusterP4) < 0.2) {
84 if (clusEnergyBE > clusELead) {
86 clusESubLead = clusELead;
87 subLeadClusVec = leadClusVec;
90 clusELead = clusEnergyBE;
91 leadClusVec.SetPtEtaPhiM(clusELead/std::cosh(clusterP4.Eta()), clusterP4.Eta(), clusterP4.Phi(), 0.);
93 else if (clusEnergyBE > clusESubLead) {
95 clusESubLead = clusEnergyBE;
96 subLeadClusVec.SetPtEtaPhiM(clusESubLead/std::cosh(clusterP4.Eta()), clusterP4.Eta(), clusterP4.Phi(), 0.);
101 if (clusELead > 0.) {
102 approxSubstructure4Vec += leadClusVec;
104 if (clusESubLead > 0.) {
105 approxSubstructure4Vec += subLeadClusVec;
109 float trkSysMomentum(0.);
110 for (
size_t i=0; i < tau.
nTracks(); ++i) {
114 approxSubstructure4Vec += tau.
track(i)->
p4();
126 float fPSSFraction = (totalEnergy != 0.) ? PSSEnergy / totalEnergy :
DEFAULT;
127 float fChPIEMEOverCaloEME = (EMEnergy != 0.) ? (trkSysMomentum - HADEnergy) / EMEnergy :
DEFAULT;
128 float fEMPOverTrkSysP =
DEFAULT;
129 if (tau.
nTracks() > 0) fEMPOverTrkSysP = (trkSysMomentum != 0.) ? EMEnergy / trkSysMomentum :
DEFAULT;
136 size_t numTrack = tau.
nTracks();
141 for (
size_t i=0; i < numTrack; ++i) {
142 dR = tau.
track(i)->
p4().DeltaR(tauAxis);
143 if (dR > dRmax) dRmax = dR;
148 return StatusCode::SUCCESS;
const TauTrack * track(size_t i, TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged, int *container_index=0) const
Get the pointer to a given tauTrack associated with this tau /*container index needed by trackNonCons...