CMS 3D CMS Logo

RecoCandidate.cc
Go to the documentation of this file.
4 
5 using namespace reco;
6 
8 
10  throw cms::Exception("LogicError", "reco::RecoCandidate is abstract, so it's clone() method can't be implemented.\n");
11 }
12 
13 TrackRef RecoCandidate::track() const { return TrackRef(); }
14 
15 TrackRef RecoCandidate::track(size_t) const { return TrackRef(); }
16 
17 size_t RecoCandidate::numberOfTracks() const { return 0; }
18 
20 
22 
24 
26 
28 
30  TrackRef muRef = combinedMuon();
31  if (muRef.isNonnull())
32  return muRef.get();
33  TrackRef trkRef = track();
34  if (trkRef.isNonnull())
35  return trkRef.get();
36  GsfTrackRef gsfTrkRef = gsfTrack();
37  if (gsfTrkRef.isNonnull())
38  return gsfTrkRef.get();
39  TrackRef staRef = standAloneMuon();
40  if (staRef.isNonnull())
41  return staRef.get();
42  return nullptr;
43 }
44 
46  TrackRef muRef = combinedMuon();
47  if (muRef.isNonnull())
48  return TrackBaseRef(muRef);
49  TrackRef trkRef = track();
50  if (trkRef.isNonnull())
51  return TrackBaseRef(trkRef);
52  GsfTrackRef gsfTrkRef = gsfTrack();
53  if (gsfTrkRef.isNonnull())
54  return TrackBaseRef(gsfTrkRef);
55  TrackRef staRef = standAloneMuon();
56  if (staRef.isNonnull())
57  return TrackBaseRef(staRef);
58  return TrackBaseRef();
59 }
60 
62  if (combinedMuon().isNonnull())
63  return recoTrackType;
64  if (track().isNonnull())
65  return recoTrackType;
66  if (gsfTrack().isNonnull())
67  return gsfTrackType;
68  return noTrackType;
69 }
70 
71 float RecoCandidate::dzError() const {
72  const Track* tr = bestTrack();
73  if (tr != nullptr)
74  return tr->dzError();
75  else
76  return 0;
77 }
78 float RecoCandidate::dxyError() const {
79  const Track* tr = bestTrack();
80  if (tr != nullptr)
81  return tr->dxyError();
82  else
83  return 0;
84 }
reco::GsfTrackRef
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
reco::RecoCandidate::combinedMuon
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track
Definition: RecoCandidate.cc:23
reco::RecoCandidate::superCluster
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: RecoCandidate.cc:25
reco::RecoCandidate::dzError
float dzError() const override
uncertainty on dz
Definition: RecoCandidate.cc:71
edm::Ref::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
reco::TrackBaseRef
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:35
reco::RecoCandidate::standAloneMuon
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: RecoCandidate.cc:21
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
RecoCandidate.h
reco::RecoCandidate::gsfTrack
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: RecoCandidate.cc:19
reco::RecoCandidate::noTrackType
Definition: RecoCandidate.h:56
reco::TrackBase::dxyError
double dxyError() const
error on dxy
Definition: TrackBase.h:722
reco::RecoCandidate::track
virtual reco::TrackRef track() const
reference to a Track
Definition: RecoCandidate.cc:13
edm::Ref< TrackCollection >
reco::RecoCandidate::TrackType
TrackType
track type
Definition: RecoCandidate.h:56
reco::RecoCandidate::bestTrack
const Track * bestTrack() const override
best track pointer
Definition: RecoCandidate.cc:29
reco::RecoCandidate::numberOfTracks
virtual size_t numberOfTracks() const
number of multiple Tracks
Definition: RecoCandidate.cc:17
reco::SuperClusterRef
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
Definition: SuperClusterFwd.h:15
reco::Track
Definition: Track.h:27
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
reco::RecoCandidate::bestTrackType
virtual TrackType bestTrackType() const
track type
Definition: RecoCandidate.cc:61
reco::RecoCandidate::dxyError
float dxyError() const override
uncertainty on dxy
Definition: RecoCandidate.cc:78
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::TrackBase::dzError
double dzError() const
error on dz
Definition: TrackBase.h:731
reco::RecoCandidate::caloTower
virtual CaloTowerRef caloTower() const
reference to a CaloTower
Definition: RecoCandidate.cc:27
GsfTrack.h
reco::RecoCandidate::recoTrackType
Definition: RecoCandidate.h:56
reco::RecoCandidate
Definition: RecoCandidate.h:20
Exception
Definition: hltDiff.cc:246
edm::RefToBase< reco::Track >
Exception.h
CaloTowerRef
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerDefs.h:17
reco::RecoCandidate::clone
RecoCandidate * clone() const override
returns a clone of the Candidate object
Definition: RecoCandidate.cc:9
reco::RecoCandidate::gsfTrackType
Definition: RecoCandidate.h:56
reco::RecoCandidate::~RecoCandidate
~RecoCandidate() override
destructor
Definition: RecoCandidate.cc:7
reco::RecoCandidate::bestTrackRef
virtual TrackBaseRef bestTrackRef() const
best track RefToBase
Definition: RecoCandidate.cc:45