CMS 3D CMS Logo

CSCChannelTranslator.cc
Go to the documentation of this file.
2 
3 int CSCChannelTranslator::rawStripChannel(const CSCDetId& id, int igeo) const {
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 }
26 
27 int CSCChannelTranslator::geomStripChannel(const CSCDetId& id, int iraw) const {
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 }
51 
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 }
62 
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 }
int rawStripChannel(const CSCDetId &id, int igeom) const
Return raw strip channel number for input geometrical channel number.
int channelFromStrip(const CSCDetId &id, int strip) const
CSCDetId rawCSCDetId(const CSCDetId &id) const
int geomStripChannel(const CSCDetId &id, int iraw) const
Return geometrical strip channel number for input raw channel number.