CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 {
9  undef = 0,
10  single = 1,
12  projMono = 3,
13  match = 4,
14  multi = 5,
18  fastMatch = 9,
20  mipTiming = 11,
21  vector = 12
22  };
23  inline RTTI rtti(TrackingRecHit const& hit) { return RTTI(hit.getRTTI()); }
24  inline bool isUndef(TrackingRecHit const& hit) { return rtti(hit) == undef; }
25  inline bool isNotFromCluster(TrackingRecHit const& hit) { return rtti(hit) == notFromCluster; }
26  inline bool isSingle(TrackingRecHit const& hit) { return rtti(hit) == single || rtti(hit) == fastSingle; }
27  inline bool isProjMono(TrackingRecHit const& hit) { return rtti(hit) == projMono || rtti(hit) == fastProjMono; }
28  inline bool isProjStereo(TrackingRecHit const& hit) { return rtti(hit) == projStereo || rtti(hit) == fastProjStereo; }
29  inline bool isProjected(TrackingRecHit const& hit) {
30  return ((rtti(hit) == projMono) | (rtti(hit) == projStereo)) ||
31  (rtti(hit) == fastProjMono) | (rtti(hit) == fastProjStereo);
32  }
33  inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; }
34  inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; }
35  inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); }
36  inline bool isFromDet(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 6)) | (rtti(hit) == 12)); }
37  inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); }
38  inline bool isFromDetOrFast(TrackingRecHit const& hit) {
39  return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12));
40  }
41  inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; }
42  inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; }
43  inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; }
44 } // namespace trackerHitRTTI
45 
46 #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 isVector(TrackingRecHit const &hit)
bool isUndef(TrackingRecHit const &hit)
bool isFromDetOrFast(TrackingRecHit const &hit)
bool isProjected(TrackingRecHit const &hit)
id_type rawId() const