CMS 3D CMS Logo

List of all members | Public Member Functions
CSCChannelTranslator Class Reference

#include <CSCChannelTranslator.h>

Public Member Functions

int channelFromStrip (const CSCDetId &id, int strip) const
 
 CSCChannelTranslator ()
 
int geomAnodeChannel (const CSCDetId &id, int iraw) const
 Alias for geomWireChannel. More...
 
int geomCathodeChannel (const CSCDetId &id, int iraw) const
 Alias for geomStripChannel. More...
 
int geomStripChannel (const CSCDetId &id, int iraw) const
 Return geometrical strip channel number for input raw channel number. More...
 
int geomWireChannel (const CSCDetId &id, int iraw) const
 Return geometrical wiregroup channel number for input raw channel number. More...
 
int rawAnodeChannel (const CSCDetId &id, int igeom) const
 Alias for rawWireChannel. More...
 
int rawCathodeChannel (const CSCDetId &id, int igeom) const
 Alias for rawStripChannel. More...
 
CSCDetId rawCSCDetId (const CSCDetId &id) const
 
int rawStripChannel (const CSCDetId &id, int igeom) const
 Return raw strip channel number for input geometrical channel number. More...
 
int rawWireChannel (const CSCDetId &id, int igeom) const
 Return raw wiregroup channel number for input geometrical channel number. More...
 
 ~CSCChannelTranslator ()
 

Detailed Description

Maps between raw/online channel numbers (for strips/cathodes and wires/anodes) and offline geometry-oriented channel numbers, in which increasing number corresponds to increasing local x (strips) or y (wire groups) as defined in CMS Note CMS IN-2007/024.

It is expected that this class will one day need to make use of a 'cable map' stored in conditions data. At present it does not, and the mappings are hard-coded.

Currently this class does the following:

  1. Sorts out the readout-flipping within the two endcaps for ME1a and ME1b strip channels.
  2. Maps the ME1a channels from online labels 65-80 to offline 1-16. It is expected that in the long run we may drop the offline convention for ME1a as an independent CSCDetId but this has not yet been done. When it is, this conversion will be removed.
  3. Does nothing with wiregroup channels; the output = the input. In the long term we intend to move remapping currently embedded in the CSCRawToDigi unpacker into this class.

Beware that the 48 strips in ME1a are ganged to 16 channels, so be careful to distinguish the nomenclatures 'strip' vs 'channel'. It is usually a meaningful distinction!

Also note that CSCDetId for ME11 and ME1b are identical. Offline we presume ring=1 of station 1 to mean the ME1b strips. We use the identifier ring=4 to denote the ME1a strips.

Author
Tim Cox

Definition at line 35 of file CSCChannelTranslator.h.

Constructor & Destructor Documentation

◆ CSCChannelTranslator()

CSCChannelTranslator::CSCChannelTranslator ( )
inline

Definition at line 37 of file CSCChannelTranslator.h.

37 {}

◆ ~CSCChannelTranslator()

CSCChannelTranslator::~CSCChannelTranslator ( )
inline

Definition at line 38 of file CSCChannelTranslator.h.

38 {}

Member Function Documentation

◆ channelFromStrip()

int CSCChannelTranslator::channelFromStrip ( const CSCDetId id,
int  strip 
) const

Offline conversion of a strip (geometric labelling) back to channel (At present this just has to convert the 48 strips of ME1A to 16 ganged channels.)

Definition at line 52 of file CSCChannelTranslator.cc.

References relativeConstraints::ring, and digitizers_cfi::strip.

52  {
53  // This just returns the electronics channel label to which a given strip is connected
54  // In all chambers but ME1A this is just a direct 1-1 correspondence.
55  // In ME1A the 48 strips are ganged into 16 channels: 1+17+33->1, 2+18+34->2, ... 16+32+48->16.
56  int ichan = strip;
57  bool me1a = (id.station() == 1) && (id.ring() == 4);
58  if (me1a && strip > 16)
59  ichan = (strip - 1) % 16 + 1; // gang the 48 to 16
60  return ichan;
61 }

◆ geomAnodeChannel()

int CSCChannelTranslator::geomAnodeChannel ( const CSCDetId id,
int  iraw 
) const
inline

Alias for geomWireChannel.

Definition at line 56 of file CSCChannelTranslator.h.

References geomWireChannel().

56 { return geomWireChannel(id, iraw); }
int geomWireChannel(const CSCDetId &id, int iraw) const
Return geometrical wiregroup channel number for input raw channel number.

◆ geomCathodeChannel()

int CSCChannelTranslator::geomCathodeChannel ( const CSCDetId id,
int  iraw 
) const
inline

Alias for geomStripChannel.

Definition at line 54 of file CSCChannelTranslator.h.

References geomStripChannel().

54 { return geomStripChannel(id, iraw); }
int geomStripChannel(const CSCDetId &id, int iraw) const
Return geometrical strip channel number for input raw channel number.

◆ geomStripChannel()

int CSCChannelTranslator::geomStripChannel ( const CSCDetId id,
int  iraw 
) const

Return geometrical strip channel number for input raw channel number.

Definition at line 27 of file CSCChannelTranslator.cc.

References relativeConstraints::ring, and SurfaceOrientation::zplus.

Referenced by geomCathodeChannel().

27  {
28  // Translate a raw strip channel in range 1-80, iraw, into
29  // corresponding geometry-oriented channel in which increasing
30  // channel number <-> strip number increasing with +ve local x.
31 
32  int igeo = iraw;
33 
34  bool zplus = (id.endcap() == 1);
35  bool me11 = (id.station() == 1) && (id.ring() == 1);
36  bool me1a = me11 && (iraw > 64);
37  bool me1b = me11 && (iraw <= 64);
38 
39  if (me1a)
40  igeo -= 64; // 65-80 -> 1-16
41  //if ( me1a ) igeo %= 64; // 65-80 -> 1-16
42  if (me1a && zplus) {
43  igeo = 17 - igeo;
44  } // 65-80 -> 16-1
45  if (me1b && !zplus) {
46  igeo = 65 - igeo;
47  } // 1-64 -> 64-1
48 
49  return igeo;
50 }

◆ geomWireChannel()

int CSCChannelTranslator::geomWireChannel ( const CSCDetId id,
int  iraw 
) const
inline

Return geometrical wiregroup channel number for input raw channel number.

Definition at line 47 of file CSCChannelTranslator.h.

Referenced by geomAnodeChannel().

47 { return iraw; }

◆ rawAnodeChannel()

int CSCChannelTranslator::rawAnodeChannel ( const CSCDetId id,
int  igeom 
) const
inline

Alias for rawWireChannel.

Definition at line 52 of file CSCChannelTranslator.h.

References rawWireChannel().

52 { return rawWireChannel(id, igeom); }
int rawWireChannel(const CSCDetId &id, int igeom) const
Return raw wiregroup channel number for input geometrical channel number.

◆ rawCathodeChannel()

int CSCChannelTranslator::rawCathodeChannel ( const CSCDetId id,
int  igeom 
) const
inline

Alias for rawStripChannel.

Definition at line 50 of file CSCChannelTranslator.h.

References rawStripChannel().

50 { return rawStripChannel(id, igeom); }
int rawStripChannel(const CSCDetId &id, int igeom) const
Return raw strip channel number for input geometrical channel number.

◆ rawCSCDetId()

CSCDetId CSCChannelTranslator::rawCSCDetId ( const CSCDetId id) const

Construct raw CSCDetId matching supplied offline CSCDetid (At present all this has to do is return the ME11 CSCDetID when supplied with that for ME1A)

Definition at line 63 of file CSCChannelTranslator.cc.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, phase1PixelTopology::layer, relativeConstraints::ring, and relativeConstraints::station.

63  {
64  // Return the effective online CSCDetId for given offline CSCDetId
65  // That means the same one except for ME1A, which online is part of ME11 (channels 65-80)
66  CSCDetId idraw(id);
67  bool me1a = (id.station() == 1) && (id.ring() == 4);
68  if (me1a)
69  idraw = CSCDetId(id.endcap(), id.station(), 1, id.chamber(), id.layer());
70  return idraw;
71 }
constexpr std::array< uint8_t, layerIndexSize > layer

◆ rawStripChannel()

int CSCChannelTranslator::rawStripChannel ( const CSCDetId id,
int  igeom 
) const

Return raw strip channel number for input geometrical channel number.

Definition at line 3 of file CSCChannelTranslator.cc.

References relativeConstraints::ring, and SurfaceOrientation::zplus.

Referenced by rawCathodeChannel().

3  {
4  // Translate a geometry-oriented strip channel in range 1-80, igeo,
5  // into corresponding raw channel.
6 
7  int iraw = igeo;
8 
9  bool zplus = (id.endcap() == 1);
10 
11  bool me1a = (id.station() == 1) && (id.ring() == 4);
12  bool me1b = (id.station() == 1) && (id.ring() == 1);
13 
14  if (me1a && zplus) {
15  iraw = 17 - iraw;
16  } // 1-16 -> 16-1
17  if (me1b && !zplus) {
18  iraw = 65 - iraw;
19  } // 1-64 -> 64-1
20  if (me1a) {
21  iraw += 64;
22  } // set 1-16 to 65-80
23 
24  return iraw;
25 }

◆ rawWireChannel()

int CSCChannelTranslator::rawWireChannel ( const CSCDetId id,
int  igeom 
) const
inline

Return raw wiregroup channel number for input geometrical channel number.

Definition at line 43 of file CSCChannelTranslator.h.

Referenced by rawAnodeChannel().

43 { return igeom; }