12 double chargedHadronP = 0.;
13 double chargedHadronPx = 0.;
14 double chargedHadronPy = 0.;
15 double chargedHadronPz = 0.;
16 double SumNeutrals = 0.;
21 chargedHadronP += chargedPFCand->p();
22 chargedHadronPx = chargedPFCand->px();
23 chargedHadronPy = chargedPFCand->py();
24 chargedHadronPz = chargedPFCand->pz();
28 chargedHadronP += track->p();
29 chargedHadronPx = track->px();
30 chargedHadronPy = track->py();
31 chargedHadronPz = track->pz();
34 for ( std::vector<reco::PFCandidatePtr>::const_iterator neutralPFCand = neutralPFCands.begin();
35 neutralPFCand != neutralPFCands.end(); ++neutralPFCand ) {
36 SumNeutrals += (*neutralPFCand)->p();
38 double noNeutrals=chargedHadronP;
39 chargedHadronP+=scaleFactor_neutralPFCands*SumNeutrals;
40 double ptRatio=chargedHadronP/noNeutrals;
41 chargedHadronPx*=ptRatio;
42 chargedHadronPy*=ptRatio;
43 chargedHadronPz*=ptRatio;
47 chargedHadron.
setP4(chargedHadronP4);
52 const double chargedPionMass = 0.13957;
53 double chargedHadronEn =
sqrt(chargedHadronPx*chargedHadronPx + chargedHadronPy*chargedHadronPy + chargedHadronPz*chargedHadronPz + chargedPionMass*chargedPionMass);
55 return chargedHadronP4;
60 double chargedHadronPx = chargedHadronP*TMath::Cos(chargedHadronPhi)*TMath::Sin(chargedHadronTheta);
61 double chargedHadronPy = chargedHadronP*TMath::Sin(chargedHadronPhi)*TMath::Sin(chargedHadronTheta);
62 double chargedHadronPz = chargedHadronP*TMath::Cos(chargedHadronTheta);
bool isNonnull() const
Checks for non-null.
const TrackPtr & getTrack() const
reference to reco::Track
const std::vector< PFCandidatePtr > & getNeutralPFCandidates() const
references to additional neutral PFCandidates
reco::Candidate::LorentzVector compChargedHadronP4fromPThetaPhi(double, double, double)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
bool algoIs(PFRecoTauChargedHadronAlgorithm algo) const
Check whether a given algo produced this charged hadron.
void setChargedHadronP4(reco::PFRecoTauChargedHadron &chargedHadron, double scaleFactor_neutralPFCands=1.0)
const PFCandidatePtr & getChargedPFCandidate() const
reference to "charged" PFCandidate (either charged PFCandidate or PFNeutralHadron) ...
reco::Candidate::LorentzVector compChargedHadronP4fromPxPyPz(double, double, double)