CMS 3D CMS Logo

PFRecoTauChargedHadron.cc
Go to the documentation of this file.
2 
4 
5 namespace reco {
6 
8 
10  : CompositePtrCandidate(), algo_(algo) {
11  if (q > 0.)
12  this->setPdgId(+211);
13  else if (q < 0.)
14  this->setPdgId(-211);
15  }
16 
18  const LorentzVector& p4,
19  const Point& vtx,
20  int status,
21  bool integerCharge,
23  : CompositePtrCandidate(q, p4, vtx, 211, status, integerCharge), algo_(algo) {
24  if (q > 0.)
25  this->setPdgId(+211);
26  else if (q < 0.)
27  this->setPdgId(-211);
28  }
29 
31  : CompositePtrCandidate(c), algo_(algo) {
32  if (c.charge() > 0.)
33  this->setPdgId(+211);
34  else if (c.charge() < 0.)
35  this->setPdgId(-211);
36  }
37 
39 
41 
43 
45 
46  const std::vector<CandidatePtr>& PFRecoTauChargedHadron::getNeutralPFCandidates() const {
47  return neutralPFCandidates_;
48  }
49 
51 
53 
55  return (algo_ == algo);
56  }
57 
58  void PFRecoTauChargedHadron::print(std::ostream& stream) const {
59  stream << " Pt = " << this->pt() << ", eta = " << this->eta() << ", phi = " << this->phi()
60  << " (mass = " << this->mass() << ")" << std::endl;
61  stream << " charge = " << this->charge() << " (pdgId = " << this->pdgId() << ")" << std::endl;
62  stream << "charged PFCandidate";
64  stream << " (" << chargedPFCandidate_.id() << ":" << chargedPFCandidate_.key() << "):"
65  << " Pt = " << chargedPFCandidate_->pt() << ", eta = " << chargedPFCandidate_->eta()
66  << ", phi = " << chargedPFCandidate_->phi() << " (pdgId = " << chargedPFCandidate_->pdgId() << ")"
67  << std::endl;
68  } else {
69  stream << ": N/A" << std::endl;
70  }
71  stream << "reco::Track: ";
72  if (track_.isNonnull()) {
73  stream << "Pt = " << track_->pt() << " +/- " << track_->ptError() << ", eta = " << track_->eta()
74  << ", phi = " << track_->phi() << std::endl;
75  } else if (lostTrackCandidate_.isNonnull()) {
76  stream << "(lostTrackCandidate: " << lostTrackCandidate_.id() << ":" << lostTrackCandidate_.key() << "):"
77  << " Pt = " << lostTrackCandidate_->pt() << ", eta = " << lostTrackCandidate_->eta()
78  << ", phi = " << lostTrackCandidate_->phi() << std::endl;
79  } else {
80  stream << "N/A" << std::endl;
81  }
82  stream << "neutral PFCandidates:";
83  if (!neutralPFCandidates_.empty()) {
84  stream << std::endl;
85  int idx = 0;
86  for (std::vector<CandidatePtr>::const_iterator neutralPFCandidate = neutralPFCandidates_.begin();
87  neutralPFCandidate != neutralPFCandidates_.end();
88  ++neutralPFCandidate) {
89  stream << " #" << idx << " (" << neutralPFCandidate->id() << ":" << neutralPFCandidate->key() << "):"
90  << " Pt = " << (*neutralPFCandidate)->pt() << ", eta = " << (*neutralPFCandidate)->eta()
91  << ", phi = " << (*neutralPFCandidate)->phi() << " (pdgId = " << (*neutralPFCandidate)->pdgId() << ")"
92  << std::endl;
93  ++idx;
94  }
95  } else {
96  stream << " ";
97  stream << "N/A" << std::endl;
98  }
99  stream << "position@ECAL entrance: x = " << this->positionAtECALEntrance().x()
100  << ", y = " << this->positionAtECALEntrance().y() << ", z = " << this->positionAtECALEntrance().z()
101  << " (eta = " << this->positionAtECALEntrance().eta() << ", phi = " << this->positionAtECALEntrance().phi()
102  << ")" << std::endl;
103  std::string algo_string = "undefined";
104  if (algo_ == kChargedPFCandidate)
105  algo_string = "chargedPFCandidate";
106  else if (algo_ == kTrack)
107  algo_string = "Track";
108  else if (algo_ == kPFNeutralHadron)
109  algo_string = "PFNeutralHadron";
110  stream << "algo = " << algo_string << std::endl;
111  }
112 
113  std::ostream& operator<<(std::ostream& stream, const reco::PFRecoTauChargedHadron& c) {
114  c.print(stream);
115  return stream;
116  }
117 } // namespace reco
reco::PFRecoTauChargedHadron::algoIs
bool algoIs(PFRecoTauChargedHadronAlgorithm algo) const
Check whether a given algo produced this charged hadron.
Definition: PFRecoTauChargedHadron.cc:54
reco::LeafCandidate::setPdgId
void setPdgId(int pdgId) final
Definition: LeafCandidate.h:178
PFCandidate.h
mps_update.status
status
Definition: mps_update.py:69
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
reco::PFRecoTauChargedHadron::PFRecoTauChargedHadron
PFRecoTauChargedHadron()
Definition: PFRecoTauChargedHadron.cc:7
reco::PFRecoTauChargedHadron::getNeutralPFCandidates
const std::vector< CandidatePtr > & getNeutralPFCandidates() const
references to additional neutral PFCandidates
Definition: PFRecoTauChargedHadron.cc:46
reco::PFRecoTauChargedHadron::getTrack
const TrackPtr & getTrack() const
reference to reco::Track
Definition: PFRecoTauChargedHadron.cc:42
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Ptr::key
key_type key() const
Definition: Ptr.h:163
reco::PFRecoTauChargedHadron
Definition: PFRecoTauChargedHadron.h:23
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
reco::PFRecoTauChargedHadron::track_
TrackPtr track_
Definition: PFRecoTauChargedHadron.h:87
reco::PFRecoTauChargedHadron::positionAtECALEntrance_
math::XYZPointF positionAtECALEntrance_
Definition: PFRecoTauChargedHadron.h:90
reco::PFRecoTauChargedHadron::positionAtECALEntrance
const math::XYZPointF & positionAtECALEntrance() const
position at ECAL entrance
Definition: PFRecoTauChargedHadron.cc:50
cmsdt::algo
algo
Definition: constants.h:164
reco::Candidate::charge
virtual int charge() const =0
electric charge
reco::PFRecoTauChargedHadron::getChargedPFCandidate
const CandidatePtr & getChargedPFCandidate() const
reference to "charged" PFCandidate (either charged PFCandidate or PFNeutralHadron)
Definition: PFRecoTauChargedHadron.cc:40
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
reco::PFRecoTauChargedHadron::PFRecoTauChargedHadronAlgorithm
PFRecoTauChargedHadronAlgorithm
Definition: PFRecoTauChargedHadron.h:27
edm::Ptr::id
ProductID id() const
Accessor for product ID.
Definition: Ptr.h:158
reco::LeafCandidate::mass
double mass() const final
mass
Definition: LeafCandidate.h:131
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
reco::PFRecoTauChargedHadron::kChargedPFCandidate
Definition: PFRecoTauChargedHadron.h:30
p4
double p4[4]
Definition: TauolaWrapper.h:92
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::Ptr< Candidate >
reco::Candidate
Definition: Candidate.h:27
reco::PFRecoTauChargedHadron::neutralPFCandidates_
std::vector< CandidatePtr > neutralPFCandidates_
Definition: PFRecoTauChargedHadron.h:88
reco::PFRecoTauChargedHadron::print
void print(std::ostream &stream=std::cout) const
Definition: PFRecoTauChargedHadron.cc:58
reco::PFRecoTauChargedHadron::kPFNeutralHadron
Definition: PFRecoTauChargedHadron.h:32
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::PFRecoTauChargedHadron::getLostTrackCandidate
const CandidatePtr & getLostTrackCandidate() const
reference to "lostTrack Candidate" when chadron built with tracks stored as pat::PackedCandidates
Definition: PFRecoTauChargedHadron.cc:44
reco::PFRecoTauChargedHadron::algo
PFRecoTauChargedHadronAlgorithm algo() const
Algorithm that built this charged hadron.
Definition: PFRecoTauChargedHadron.cc:52
reco::CompositePtrCandidate
Definition: CompositePtrCandidate.h:17
reco::PFRecoTauChargedHadron::algo_
PFRecoTauChargedHadronAlgorithm algo_
Definition: PFRecoTauChargedHadron.h:83
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
reco::PFRecoTauChargedHadron::lostTrackCandidate_
CandidatePtr lostTrackCandidate_
Definition: PFRecoTauChargedHadron.h:86
PFRecoTauChargedHadron.h
reco::PFRecoTauChargedHadron::~PFRecoTauChargedHadron
~PFRecoTauChargedHadron() override
destructor
Definition: PFRecoTauChargedHadron.cc:38
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
reco::PFRecoTauChargedHadron::chargedPFCandidate_
CandidatePtr chargedPFCandidate_
Definition: PFRecoTauChargedHadron.h:85
reco::PFRecoTauChargedHadron::kTrack
Definition: PFRecoTauChargedHadron.h:31