CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RecoCandidate.cc
Go to the documentation of this file.
4 
5 using namespace reco;
6 
7 RecoCandidate::~RecoCandidate() {}
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 }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
double dxyError() const
error on dxy
Definition: TrackBase.h:769
float dxyError() const override
uncertainty on dxy
TrackType
track type
Definition: RecoCandidate.h:56
virtual TrackType bestTrackType() const
track type
virtual reco::TrackRef standAloneMuon() const
reference to a stand-alone muon Track
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
float dzError() const override
uncertainty on dz
virtual reco::TrackRef track() const
reference to a Track
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:35
virtual CaloTowerRef caloTower() const
reference to a CaloTower
virtual TrackBaseRef bestTrackRef() const
best track RefToBase
virtual size_t numberOfTracks() const
number of multiple Tracks
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
const Track * bestTrack() const override
best track pointer
double dzError() const
error on dz
Definition: TrackBase.h:778
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
RecoCandidate * clone() const override
returns a clone of the Candidate object
Definition: RecoCandidate.cc:9
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerDefs.h:17
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track