Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:32

0001 #ifndef CSCChannelMapperBase_H
0002 #define CSCChannelMapperBase_H
0003 
0004 /**
0005  * \class CSCChannelMapperBase
0006  *
0007  * Base class for concrete CSCChannelMapper classes that
0008  * map between raw/online channel numbers (for strips/cathodes and wires/anodes)
0009  * and offline geometry-oriented channel numbers, in which increasing number
0010  * corresponds to increasing local x (strips) or y (wire groups) as defined
0011  * in CMS Note CMS IN-2007/024.
0012  *
0013  * The original of this class, CSCChannelTranslator, was written in the
0014  * expectation that one day it would be replaced by a full "cable map" stored in
0015  * conditions data. That has not yet been required and so the mappings are
0016  * hard-coded.
0017  *
0018  * Concrete derived classes must implement the following: <BR>
0019  * 1. Sort out any readout-flipping within the two endcaps for ME1a and ME1b
0020  * strip channels. <BR>
0021  * 2. If ME1a is ganged then map the ME1a channels from online labels 65-80 to
0022  * offline 1-16. <BR>
0023  * 3. Do nothing with wiregroup channels; the output = the input. <BR>
0024  * (Historically some test beam data needed wiregroup remapping but this was
0025  * embedded directly in the Unpacker of CSCRawToDigi. We want to move any such
0026  * mappings into this class rather than have them scattered through the code.)
0027  *
0028  * Beware that if ME1a is ganged,the 48 strips in ME1a are fed to 16 channels,
0029  * so it is important to distinguish the nomenclatures "strip" vs "channel". It
0030  * is usually a meaningful distinction!
0031  *
0032  * Also note that the CSCDetId for ME11 and ME1b is identical. Offline we
0033  * presume ring=1 of station 1 to mean the ME1b strips. We use the identifier
0034  * ring=4 to denote the ME1a strips.
0035  *
0036  * \author Tim Cox
0037  *
0038  */
0039 
0040 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0041 
0042 class CSCChannelMapperBase {
0043 public:
0044   CSCChannelMapperBase() {}
0045   virtual ~CSCChannelMapperBase() {}
0046 
0047   virtual std::string name() const { return "CSCChannelMapperBase"; }
0048 
0049   /// Return raw strip channel number for input geometrical channel number
0050   virtual int rawStripChannel(const CSCDetId &id, int igeom) const = 0;
0051   /// Return raw wiregroup channel number for input geometrical channel number
0052   int rawWireChannel(const CSCDetId &id, int igeom) const { return igeom; }
0053   /// Return geometrical strip channel number for input raw channel number
0054   virtual int geomStripChannel(const CSCDetId &id, int iraw) const = 0;
0055   /// Return geometrical wiregroup channel number for input raw channel number
0056   int geomWireChannel(const CSCDetId &id, int iraw) const { return iraw; }
0057 
0058   /// Alias for rawStripChannel
0059   int rawCathodeChannel(const CSCDetId &id, int igeom) const { return rawStripChannel(id, igeom); }
0060   /// Alias for rawWireChannel
0061   int rawAnodeChannel(const CSCDetId &id, int igeom) const { return rawWireChannel(id, igeom); }
0062   /// Alias for geomStripChannel
0063   int geomCathodeChannel(const CSCDetId &id, int iraw) const { return geomStripChannel(id, iraw); }
0064   /// Alias for geomWireChannel
0065   int geomAnodeChannel(const CSCDetId &id, int iraw) const { return geomWireChannel(id, iraw); }
0066 
0067   /// Offline conversion of a strip (geometric labelling) back to channel
0068   /// (At present this just has to convert the 48 strips of ME1A to 16 ganged
0069   /// channels.)
0070   virtual int channelFromStrip(const CSCDetId &id, int strip) const = 0;
0071 
0072   /// Construct raw CSCDetId matching supplied offline CSCDetid
0073   /// (At present all this has to do is return the ME11 CSCDetID when supplied
0074   /// with that for ME1A)
0075   virtual CSCDetId rawCSCDetId(const CSCDetId &id) const = 0;
0076 };
0077 
0078 #endif