20 if (chargedPFPCand !=
nullptr) {
25 if (lostTrackCand !=
nullptr) {
32 double chargedHadronP = 0.;
33 double chargedHadronPx = 0.;
34 double chargedHadronPy = 0.;
35 double chargedHadronPz = 0.;
36 double SumNeutrals = 0.;
41 chargedHadronP += chargedPFCand->p();
42 chargedHadronPx = chargedPFCand->px();
43 chargedHadronPy = chargedPFCand->py();
44 chargedHadronPz = chargedPFCand->pz();
47 if (
track !=
nullptr) {
48 chargedHadronP +=
track->p();
49 chargedHadronPx =
track->px();
50 chargedHadronPy =
track->py();
51 chargedHadronPz =
track->pz();
55 chargedHadronP += lostTrack->p();
56 chargedHadronPx = lostTrack->px();
57 chargedHadronPy = lostTrack->py();
58 chargedHadronPz = lostTrack->pz();
62 const std::vector<reco::CandidatePtr>& neutralPFCands =
chargedHadron.getNeutralPFCandidates();
63 for (std::vector<reco::CandidatePtr>::const_iterator neutralPFCand = neutralPFCands.begin();
64 neutralPFCand != neutralPFCands.end();
66 SumNeutrals += (*neutralPFCand)->p();
68 double noNeutrals = chargedHadronP;
69 chargedHadronP += scaleFactor_neutralPFCands * SumNeutrals;
70 double ptRatio = chargedHadronP / noNeutrals;
81 double chargedHadronPy,
82 double chargedHadronPz) {
83 const double chargedPionMass = 0.13957;
84 double chargedHadronEn =
sqrt(chargedHadronPx * chargedHadronPx + chargedHadronPy * chargedHadronPy +
85 chargedHadronPz * chargedHadronPz + chargedPionMass * chargedPionMass);
87 chargedHadronPx, chargedHadronPy, chargedHadronPz, chargedHadronEn);
88 return chargedHadronP4;
92 double chargedHadronTheta,
93 double chargedHadronPhi) {
94 double chargedHadronPx = chargedHadronP * TMath::Cos(chargedHadronPhi) * TMath::Sin(chargedHadronTheta);
95 double chargedHadronPy = chargedHadronP * TMath::Sin(chargedHadronPhi) * TMath::Sin(chargedHadronTheta);
96 double chargedHadronPz = chargedHadronP * TMath::Cos(chargedHadronTheta);
bool isNonnull() const
Checks for non-null.
const reco::Track * bestTrack() const override
return a pointer to the track if present. otherwise, return a null pointer
reco::Candidate::LorentzVector compChargedHadronP4fromPThetaPhi(double, double, double)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const reco::Track * getTrackFromChargedHadron(const reco::PFRecoTauChargedHadron &chargedHadron)
void setChargedHadronP4(reco::PFRecoTauChargedHadron &chargedHadron, double scaleFactor_neutralPFCands=1.0)
reco::Candidate::LorentzVector compChargedHadronP4fromPxPyPz(double, double, double)