Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:50

0001 #ifndef DataFormats_TrackerRecHit2D_trackerHitRTTI_H
0002 #define DataFormats_TrackerRecHit2D_trackerHitRTTI_H
0003 
0004 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0005 
0006 namespace trackerHitRTTI {
0007   // tracking hit can be : single (si1D, si2D, pix), projected, matched or multi
0008   enum RTTI {
0009     undef = 0,
0010     single = 1,
0011     projStereo = 2,
0012     projMono = 3,
0013     match = 4,
0014     multi = 5,
0015     fastSingle = 6,
0016     fastProjStereo = 7,
0017     fastProjMono = 8,
0018     fastMatch = 9,
0019     notFromCluster = 10,
0020     mipTiming = 11,
0021     vector = 12
0022   };
0023   inline RTTI rtti(TrackingRecHit const& hit) { return RTTI(hit.getRTTI()); }
0024   inline bool isUndef(TrackingRecHit const& hit) { return rtti(hit) == undef; }
0025   inline bool isNotFromCluster(TrackingRecHit const& hit) { return rtti(hit) == notFromCluster; }
0026   inline bool isSingle(TrackingRecHit const& hit) { return rtti(hit) == single || rtti(hit) == fastSingle; }
0027   inline bool isProjMono(TrackingRecHit const& hit) { return rtti(hit) == projMono || rtti(hit) == fastProjMono; }
0028   inline bool isProjStereo(TrackingRecHit const& hit) { return rtti(hit) == projStereo || rtti(hit) == fastProjStereo; }
0029   inline bool isProjected(TrackingRecHit const& hit) {
0030     return ((rtti(hit) == projMono) | (rtti(hit) == projStereo)) ||
0031            (rtti(hit) == fastProjMono) | (rtti(hit) == fastProjStereo);
0032   }
0033   inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; }
0034   inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; }
0035   inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); }
0036   inline bool isFromDet(TrackingRecHit const& hit) { return (((rtti(hit) > 0) & (rtti(hit) < 6)) | (rtti(hit) == 12)); }
0037   inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); }
0038   inline bool isFromDetOrFast(TrackingRecHit const& hit) {
0039     return (((rtti(hit) > 0) & (rtti(hit) < 10)) | (rtti(hit) == 12));
0040   }
0041   inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; }
0042   inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; }
0043   inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; }
0044 }  // namespace trackerHitRTTI
0045 
0046 #endif