19 dynamic_cast<const pat::PackedCandidate*>(
chargedHadron.getChargedPFCandidate().get());
20 if (chargedPFPCand !=
nullptr) {
24 dynamic_cast<const pat::PackedCandidate*>(
chargedHadron.getLostTrackCandidate().get());
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);