CMS 3D CMS Logo

trackerHitRTTI.h
Go to the documentation of this file.
1 #ifndef DataFormats_TrackerRecHit2D_trackerHitRTTI_H
2 #define DataFormats_TrackerRecHit2D_trackerHitRTTI_H
3 
5 
6 namespace trackerHitRTTI {
7  // tracking hit can be : single (si1D, si2D, pix), projected, matched or multi
8  enum RTTI { undef=0, single=1, projStereo=2, projMono=3, match=4, multi=5,
11  inline RTTI rtti(TrackingRecHit const & hit) { return RTTI(hit.getRTTI());}
12  inline bool isUndef(TrackingRecHit const & hit) { return rtti(hit)==undef;}
13  inline bool isNotFromCluster(TrackingRecHit const & hit) { return rtti(hit)==notFromCluster;}
14  inline bool isSingle(TrackingRecHit const & hit) { return rtti(hit)==single || rtti(hit)==fastSingle;}
15  inline bool isProjMono(TrackingRecHit const & hit) { return rtti(hit)==projMono || rtti(hit)==fastProjMono;}
16  inline bool isProjStereo(TrackingRecHit const & hit) { return rtti(hit)==projStereo || rtti(hit)==fastProjStereo;}
17  inline bool isProjected(TrackingRecHit const & hit) { return ((rtti(hit)==projMono) | (rtti(hit)==projStereo)) || (rtti(hit)==fastProjMono) | (rtti(hit)==fastProjStereo);}
18  inline bool isMatched(TrackingRecHit const & hit) { return rtti(hit)==match || rtti(hit)==fastMatch;}
19  inline bool isMulti(TrackingRecHit const & hit) { return rtti(hit)==multi;}
20  inline bool isSingleType(TrackingRecHit const & hit) { return (rtti(hit)>0) & (rtti(hit)<4) ;}
21  inline bool isFromDet(TrackingRecHit const & hit) { return (rtti(hit)>0) & (rtti(hit)<6) ;}
22  inline bool isFast(TrackingRecHit const & hit) { return (rtti(hit)>5) & (rtti(hit)<=9) ;}
23  inline bool isFromDetOrFast(TrackingRecHit const & hit) { return (rtti(hit)>0) & (rtti(hit)<10) ;}
24  inline bool isTiming(TrackingRecHit const & hit) { return rtti(hit)==mipTiming; }
25  inline unsigned int projId(TrackingRecHit const & hit) { return hit.rawId()+int(rtti(hit))-1;}
26 }
27 
28 
29 #endif
RTTI rtti(TrackingRecHit const &hit)
bool isSingleType(TrackingRecHit const &hit)
bool isFromDet(TrackingRecHit const &hit)
bool isNotFromCluster(TrackingRecHit const &hit)
bool isProjMono(TrackingRecHit const &hit)
unsigned int projId(TrackingRecHit const &hit)
bool isProjStereo(TrackingRecHit const &hit)
bool isTiming(TrackingRecHit const &hit)
bool isMatched(TrackingRecHit const &hit)
bool isFast(TrackingRecHit const &hit)
unsigned int getRTTI() const
bool isSingle(TrackingRecHit const &hit)
bool isMulti(TrackingRecHit const &hit)
bool isUndef(TrackingRecHit const &hit)
bool isFromDetOrFast(TrackingRecHit const &hit)
bool isProjected(TrackingRecHit const &hit)
id_type rawId() const