Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:50:42

0001 #ifndef MuonDetId_DTLayerId_h
0002 #define MuonDetId_DTLayerId_h
0003 
0004 /** \class DTLayerId
0005  *  DetUnit identifier for DT layers
0006  *
0007  *  \author G. Cerminara - INFN Torino
0008  */
0009 
0010 #include <DataFormats/MuonDetId/interface/DTSuperLayerId.h>
0011 
0012 class DTLayerId : public DTSuperLayerId {
0013 public:
0014   /// Default constructor.
0015   /// Fills the common part in the base and leaves 0 in all other fields
0016   DTLayerId();
0017 
0018   /// Construct from a packed id.
0019   /// It is required that the packed id represents a valid DT DetId
0020   /// (proper Detector and  SubDet fields), otherwise an exception is thrown.
0021   /// Any bits outside the DTLayerId fields are zeroed; apart for
0022   /// this, no check is done on the vaildity of the values.
0023   explicit DTLayerId(uint32_t id);
0024 
0025   /// Construct from indexes.
0026   /// Input values are required to be within legal ranges, otherwise an
0027   /// exception is thrown.
0028   DTLayerId(int wheel, int station, int sector, int superlayer, int layer);
0029 
0030   /// Copy Constructor.
0031   /// Any bits outside the DTLayerId fields are zeroed; apart for
0032   /// this, no check is done on the vaildity of the values.
0033   DTLayerId(const DTLayerId& layerId);
0034 
0035   /// Constructor from a camberId and SL and layer numbers
0036   DTLayerId(const DTChamberId& chId, int superlayer, int layer);
0037 
0038   /// Constructor from a SuperLayerId and layer number
0039   DTLayerId(const DTSuperLayerId& slId, int layer);
0040 
0041   /// Return the layer number
0042   int layer() const { return ((id_ >> layerStartBit_) & lMask_); }
0043 
0044   /// Return the corresponding SuperLayerId
0045   DTSuperLayerId superlayerId() const { return DTSuperLayerId(id_ & slIdMask_); }
0046 };
0047 
0048 std::ostream& operator<<(std::ostream& os, const DTLayerId& id);
0049 
0050 #endif