CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCChannelTranslator.cc
Go to the documentation of this file.
2 
3 int CSCChannelTranslator::rawStripChannel( const CSCDetId& id, int igeo ) const {
4 
5  // Translate a geometry-oriented strip channel in range 1-80, igeo,
6  // into corresponding raw channel.
7 
8  int iraw = igeo;
9 
10  bool zplus = (id.endcap()==1);
11 
12  bool me1a = (id.station()==1) && (id.ring()==4);
13  bool me1b = (id.station()==1) && (id.ring()==1);
14 
15  if ( me1a && zplus ) { iraw = 17 - iraw; } // 1-16 -> 16-1
16  if ( me1b && !zplus) { iraw = 65 - iraw; } // 1-64 -> 64-1
17  if ( me1a ) { iraw += 64 ;} // set 1-16 to 65-80
18 
19  return iraw;
20 }
21 
22 
23 int CSCChannelTranslator::geomStripChannel( const CSCDetId& id, int iraw ) const {
24  // Translate a raw strip channel in range 1-80, iraw, into
25  // corresponding geometry-oriented channel in which increasing
26  // channel number <-> strip number increasing with +ve local x.
27 
28  int igeo = iraw;
29 
30  bool zplus = (id.endcap()==1);
31  bool me11 = (id.station()==1) && (id.ring()==1);
32  bool me1a = me11 && (iraw > 64);
33  bool me1b = me11 && (iraw <= 64);
34 
35  if ( me1a ) igeo -= 64; // 65-80 -> 1-16
36  //if ( me1a ) igeo %= 64; // 65-80 -> 1-16
37  if ( me1a && zplus ) { igeo = 17 - igeo; } // 65-80 -> 16-1
38  if ( me1b && !zplus) { igeo = 65 - igeo; } // 1-64 -> 64-1
39 
40  return igeo;
41 }
42 
44  // This just returns the electronics channel label to which a given strip is connected
45  // In all chambers but ME1A this is just a direct 1-1 correspondence.
46  // In ME1A the 48 strips are ganged into 16 channels: 1+17+33->1, 2+18+34->2, ... 16+32+48->16.
47  int ichan = strip;
48  bool me1a = (id.station()==1) && (id.ring()==4);
49  if ( me1a && strip>16 ) ichan = (strip-1)%16 + 1; // gang the 48 to 16
50  return ichan;
51 }
52 
54  // Return the effective online CSCDetId for given offline CSCDetId
55  // That means the same one except for ME1A, which online is part of ME11 (channels 65-80)
56  CSCDetId idraw( id );
57  bool me1a = (id.station()==1) && (id.ring()==4);
58  if ( me1a ) idraw = CSCDetId( id.endcap(), id.station(), 1, id.chamber(), id.layer() );
59  return idraw;
60 }
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
int geomStripChannel(const CSCDetId &id, int iraw) const
Return geometrical strip channel number for input raw channel number.
int channelFromStrip(const CSCDetId &id, int strip) const
int rawStripChannel(const CSCDetId &id, int igeom) const
Return raw strip channel number for input geometrical channel number.
CSCDetId rawCSCDetId(const CSCDetId &id) const