CMS 3D CMS Logo

CSCChannelMapperStartup.cc
Go to the documentation of this file.
2 
3 int CSCChannelMapperStartup::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 CSCChannelMapperStartup::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
54  // connected In all chambers but ME1A this is just a direct 1-1
55  // correspondence. In ME1A the 48 strips are ganged into 16 channels:
56  // 1+17+33->1, 2+18+34->2, ... 16+32+48->16.
57  int ichan = strip;
58  bool me1a = (id.station() == 1) && (id.ring() == 4);
59  if (me1a && strip > 16)
60  ichan = (strip - 1) % 16 + 1; // gang the 48 to 16
61  return ichan;
62 }
63 
65  // Return the effective online CSCDetId for given offline CSCDetId
66  // That means the same one except for ME1A, which online is part of ME11
67  // (channels 65-80)
68  CSCDetId idraw(id);
69  bool me1a = (id.station() == 1) && (id.ring() == 4);
70  if (me1a)
71  idraw = CSCDetId(id.endcap(), id.station(), 1, id.chamber(), id.layer());
72  return idraw;
73 }
int geomStripChannel(const CSCDetId &id, int iraw) const override
Return geometrical strip channel number for input raw channel number.
int rawStripChannel(const CSCDetId &id, int igeom) const override
Return raw strip channel number for input geometrical channel number.
CSCDetId rawCSCDetId(const CSCDetId &id) const override
int channelFromStrip(const CSCDetId &id, int strip) const override