Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:59

0001 #ifndef CSCChannelTranslator_h
0002 #define CSCChannelTranslator_h
0003 
0004 /**
0005  * \class CSCChannelTranslator
0006  *
0007  * Maps between raw/online channel numbers (for strips/cathodes and wires/anodes)
0008  * and offline geometry-oriented channel numbers, in which increasing number
0009  * corresponds to increasing local x (strips) or y (wire groups) as defined
0010  * in CMS Note CMS IN-2007/024.
0011  *
0012  * It is expected that this class will one day need to make use of a 'cable map' stored
0013  * in conditions data. At present it does not, and the mappings are hard-coded.
0014  *
0015  * Currently this class does the following: <BR>
0016  * 1. Sorts out the readout-flipping within the two endcaps for ME1a and ME1b strip channels. <BR>
0017  * 2. Maps the ME1a channels from online labels 65-80 to offline 1-16. It is expected that in the long
0018  * run we may drop the offline convention for ME1a as an independent CSCDetId but this has not yet
0019  * been done. When it is, this conversion will be removed. <BR>
0020  * 3. Does nothing with wiregroup channels; the output = the input. In the long term we intend to
0021  * move remapping currently embedded in the CSCRawToDigi unpacker into this class.<BR>
0022  *
0023  * Beware that the 48 strips in ME1a are ganged to 16 channels, so be careful to distinguish
0024  * the nomenclatures 'strip' vs 'channel'. It is usually a meaningful distinction!
0025  *
0026  * Also note that CSCDetId for ME11 and ME1b are identical. Offline we presume ring=1 of station 1
0027  * to mean the ME1b strips. We use the identifier ring=4 to denote the ME1a strips.
0028  *
0029  * \author Tim Cox
0030  *
0031  */
0032 
0033 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0034 
0035 class CSCChannelTranslator {
0036 public:
0037   CSCChannelTranslator() {}
0038   ~CSCChannelTranslator() {}
0039 
0040   /// Return raw strip channel number for input geometrical channel number
0041   int rawStripChannel(const CSCDetId& id, int igeom) const;
0042   /// Return raw wiregroup channel number for input geometrical channel number
0043   int rawWireChannel(const CSCDetId& id, int igeom) const { return igeom; }
0044   /// Return geometrical strip channel number for input raw channel number
0045   int geomStripChannel(const CSCDetId& id, int iraw) const;
0046   /// Return geometrical wiregroup channel number for input raw channel number
0047   int geomWireChannel(const CSCDetId& id, int iraw) const { return iraw; }
0048 
0049   /// Alias for rawStripChannel
0050   int rawCathodeChannel(const CSCDetId& id, int igeom) const { return rawStripChannel(id, igeom); }
0051   /// Alias for rawWireChannel
0052   int rawAnodeChannel(const CSCDetId& id, int igeom) const { return rawWireChannel(id, igeom); }
0053   /// Alias for geomStripChannel
0054   int geomCathodeChannel(const CSCDetId& id, int iraw) const { return geomStripChannel(id, iraw); }
0055   /// Alias for geomWireChannel
0056   int geomAnodeChannel(const CSCDetId& id, int iraw) const { return geomWireChannel(id, iraw); }
0057 
0058   /// Offline conversion of a strip (geometric labelling) back to channel
0059   /// (At present this just has to convert the 48 strips of ME1A to 16 ganged channels.)
0060   int channelFromStrip(const CSCDetId& id, int strip) const;
0061 
0062   /// Construct raw CSCDetId matching supplied offline CSCDetid
0063   /// (At present all this has to do is return the ME11 CSCDetID when supplied with that for ME1A)
0064   CSCDetId rawCSCDetId(const CSCDetId& id) const;
0065 };
0066 
0067 #endif