Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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