Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SiPixelDetId_PixelEndcapNameUpgrade_H
0002 #define SiPixelDetId_PixelEndcapNameUpgrade_H
0003 
0004 /** \class PixelEndcapNameUpgrade
0005  * Endcap Module name (as in PixelDatabase) for endcaps
0006  */
0007 
0008 #include "DataFormats/SiPixelDetId/interface/PixelModuleName.h"
0009 
0010 #include <string>
0011 #include <iostream>
0012 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
0013 
0014 class DetId;
0015 
0016 class PixelEndcapNameUpgrade : public PixelModuleName {
0017 public:
0018   enum HalfCylinder { mO = 1, mI = 2, pO = 3, pI = 4 };
0019 
0020   /// ctor from DetId
0021   PixelEndcapNameUpgrade(const DetId &);
0022 
0023   /// ctor for defined name
0024   PixelEndcapNameUpgrade(HalfCylinder part = mO, int disk = 0, int blade = 0, int pannel = 0, int plaq = 0)
0025       : PixelModuleName(false), thePart(part), theDisk(disk), theBlade(blade), thePannel(pannel), thePlaquette(plaq) {}
0026 
0027   /// ctor from name string
0028   PixelEndcapNameUpgrade(std::string name);
0029 
0030   ~PixelEndcapNameUpgrade() override {}
0031 
0032   /// from base class
0033   std::string name() const override;
0034 
0035   HalfCylinder halfCylinder() const { return thePart; }
0036 
0037   /// disk id
0038   int diskName() const { return theDisk; }
0039 
0040   /// blade id
0041   int bladeName() const { return theBlade; }
0042 
0043   /// pannel id
0044   int pannelName() const { return thePannel; }
0045 
0046   /// plaquetteId (in pannel)
0047   int plaquetteName() const { return thePlaquette; }
0048 
0049   /// module Type
0050   PixelModuleName::ModuleType moduleType() const override;
0051 
0052   /// return DetId
0053   PXFDetId getDetId();
0054 
0055   /// check equality of modules from datamemebers
0056   bool operator==(const PixelModuleName &) const override;
0057   bool operator==(const PixelEndcapNameUpgrade &other) const {
0058     return (thePart == other.thePart && theDisk == other.theDisk && theBlade == other.theBlade &&
0059             thePannel == other.thePannel && thePlaquette == other.thePlaquette);
0060   }
0061 
0062 private:
0063   HalfCylinder thePart;
0064   int theDisk, theBlade, thePannel, thePlaquette;
0065 };
0066 
0067 std::ostream &operator<<(std::ostream &out, const PixelEndcapNameUpgrade::HalfCylinder &t);
0068 #endif