Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-07-22 23:30:58

0001 #ifndef SiPixelDetId_PixelBarrelNameUpgrade_H
0002 #define SiPixelDetId_PixelBarrelNameUpgrade_H
0003 
0004 /** \class PixelBarrelNameUpgrade
0005  * Module name (as in PixelDatabase) in barrel
0006  */
0007 
0008 #include "DataFormats/SiPixelDetId/interface/PixelModuleName.h"
0009 #include <string>
0010 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
0011 
0012 class DetId;
0013 
0014 class PixelBarrelNameUpgrade : public PixelModuleName {
0015 public:
0016   enum Shell { mO = 1, mI = 2, pO = 3, pI = 4 };
0017 
0018   /// ctor from DetId
0019   PixelBarrelNameUpgrade(const DetId&);
0020 
0021   /// ctor for defined name with dummy parameters
0022   PixelBarrelNameUpgrade(Shell shell = mO, int layer = 0, int module = 0, int ladder = 0)
0023       : PixelModuleName(true), thePart(shell), theLayer(layer), theModule(module), theLadder(ladder) {}
0024 
0025   /// ctor from name string
0026   PixelBarrelNameUpgrade(std::string name);
0027 
0028   ~PixelBarrelNameUpgrade() override {}
0029 
0030   /// from base class
0031   std::string name() const override;
0032 
0033   Shell shell() const { return thePart; }
0034 
0035   /// layer id
0036   int layerName() const { return theLayer; }
0037 
0038   /// module id (index in z)
0039   int moduleName() const { return theModule; }
0040 
0041   /// ladder id (index in phi)
0042   int ladderName() const { return theLadder; }
0043 
0044   /// sector id
0045   int sectorName() const;
0046 
0047   /// full or half module
0048   bool isHalfModule() const;
0049 
0050   /// module Type
0051   PixelModuleName::ModuleType moduleType() const override;
0052 
0053   /// return the DetId
0054   PXBDetId getDetId();
0055 
0056   /// check equality of modules from datamemebers
0057   bool operator==(const PixelModuleName&) const override;
0058   bool operator==(const PixelBarrelNameUpgrade& other) const {
0059     return (thePart == other.thePart && theLayer == other.theLayer && theModule == other.theModule &&
0060             theLadder == other.theLadder);
0061   }
0062 
0063 private:
0064   Shell thePart;
0065   int theLayer, theModule, theLadder;
0066 };
0067 
0068 std::ostream& operator<<(std::ostream& out, const PixelBarrelNameUpgrade::Shell& t);
0069 #endif