File indexing completed on 2024-07-22 23:30:58
0001 #ifndef SiPixelDetId_PixelBarrelNameUpgrade_H
0002 #define SiPixelDetId_PixelBarrelNameUpgrade_H
0003
0004
0005
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
0019 PixelBarrelNameUpgrade(const DetId&);
0020
0021
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
0026 PixelBarrelNameUpgrade(std::string name);
0027
0028 ~PixelBarrelNameUpgrade() override {}
0029
0030
0031 std::string name() const override;
0032
0033 Shell shell() const { return thePart; }
0034
0035
0036 int layerName() const { return theLayer; }
0037
0038
0039 int moduleName() const { return theModule; }
0040
0041
0042 int ladderName() const { return theLadder; }
0043
0044
0045 int sectorName() const;
0046
0047
0048 bool isHalfModule() const;
0049
0050
0051 PixelModuleName::ModuleType moduleType() const override;
0052
0053
0054 PXBDetId getDetId();
0055
0056
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