CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
14  return TrackRef();
15 }
16 
17 TrackRef RecoCandidate::track( size_t ) const {
18  return TrackRef();
19 }
20 
22  return 0;
23 }
24 
26  return GsfTrackRef();
27 }
28 
30  return TrackRef();
31 }
32 
34  return TrackRef();
35 }
36 
38  return SuperClusterRef();
39 }
40 
42  return CaloTowerRef();
43 }
44 
46  TrackRef muRef = combinedMuon();
47  if( muRef.isNonnull() )
48  return muRef.get();
49  TrackRef trkRef = track();
50  if ( trkRef.isNonnull() )
51  return trkRef.get();
52  GsfTrackRef gsfTrkRef = gsfTrack();
53  if ( gsfTrkRef.isNonnull() )
54  return gsfTrkRef.get();
55  TrackRef staRef = standAloneMuon();
56  if ( staRef.isNonnull() )
57  return staRef.get();
58  return 0;
59 }
60 
62  TrackRef muRef = combinedMuon();
63  if( muRef.isNonnull() ) return TrackBaseRef(muRef);
64  TrackRef trkRef = track();
65  if ( trkRef.isNonnull() ) return TrackBaseRef(trkRef);
66  GsfTrackRef gsfTrkRef = gsfTrack();
67  if ( gsfTrkRef.isNonnull() ) return TrackBaseRef(gsfTrkRef);
68  TrackRef staRef = standAloneMuon();
69  if ( staRef.isNonnull() ) return TrackBaseRef(staRef);
70  return TrackBaseRef();
71 }
72 
73 
75  if( combinedMuon().isNonnull() )
76  return recoTrackType;
77  if ( track().isNonnull() )
78  return recoTrackType;
79  if ( gsfTrack().isNonnull() )
80  return gsfTrackType;
81  return noTrackType;
82 }
83 
84 float RecoCandidate::dzError() const
85 {
86  const Track * tr=bestTrack();
87  if(tr!=nullptr)
88  return tr->dzError();
89  else
90  return 0;
91 }
93 {
94  const Track * tr=bestTrack();
95  if(tr!=nullptr)
96  return tr->dxyError();
97  else
98  return 0;
99 }
edm::Ref< GsfTrackCollection > GsfTrackRef
persistent reference to a GsfTrack
Definition: GsfTrackFwd.h:13
virtual float dxyError() const
uncertainty on dxy
virtual reco::GsfTrackRef gsfTrack() const
reference to a GsfTrack
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
double dxyError() const
error on dxy
Definition: TrackBase.h:783
TrackType
track type
Definition: RecoCandidate.h:57
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
virtual reco::TrackRef track() const
reference to a Track
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:32
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:244
double dzError() const
error on dz
Definition: TrackBase.h:801
virtual const Track * bestTrack() const
best track pointer
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
virtual ~RecoCandidate()
destructor
Definition: RecoCandidate.cc:7
virtual RecoCandidate * clone() const
returns a clone of the Candidate object
Definition: RecoCandidate.cc:9
edm::Ref< CaloTowerCollection > CaloTowerRef
Definition: CaloTowerFwd.h:16
virtual float dzError() const
uncertainty on dz
virtual reco::SuperClusterRef superCluster() const
reference to a SuperCluster
virtual reco::TrackRef combinedMuon() const
reference to a stand-alone muon Track