Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:11

0001 #ifndef SiPixelDetId_PixelModuleName_H
0002 #define SiPixelDetId_PixelModuleName_H
0003 
0004 #include <string>
0005 #include <iostream>
0006 #include <cstdint>
0007 
0008 /** \class PixelModuleName
0009  * Base class to Pixel modules naming, provides a name as in PixelDatabase
0010  */
0011 
0012 class PixelModuleName {
0013 public:
0014   enum ModuleType { v1x2, v1x5, v1x8, v2x3, v2x4, v2x5, v2x8 };
0015 
0016   PixelModuleName(bool isBarrel) : barrel(isBarrel) {}
0017   virtual ~PixelModuleName() {}
0018 
0019   /// true for barrel modules
0020   virtual bool isBarrel() const { return barrel; }
0021 
0022   static bool isBarrel(uint32_t rawDetId) { return (1 == ((rawDetId >> 25) & 0x7)); }
0023 
0024   /// associated name
0025   virtual std::string name() const = 0;
0026 
0027   /// module type
0028   virtual ModuleType moduleType() const = 0;
0029 
0030   /// check equality of modules
0031   virtual bool operator==(const PixelModuleName&) const = 0;
0032 
0033 private:
0034   bool barrel;
0035 };
0036 
0037 std::ostream& operator<<(std::ostream& out, const PixelModuleName::ModuleType& t);
0038 #endif