test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ( )
inline

Definition at line 37 of file CSCChannelTranslator.h.

37 {}
CSCChannelTranslator::~CSCChannelTranslator ( )
inline

Definition at line 38 of file CSCChannelTranslator.h.

38 {}

Member Function Documentation

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 43 of file CSCChannelTranslator.cc.

References relativeConstraints::ring.

43  {
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 }
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.
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.
int CSCChannelTranslator::geomStripChannel ( const CSCDetId id,
int  iraw 
) const

Return geometrical strip channel number for input raw channel number.

Definition at line 23 of file CSCChannelTranslator.cc.

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

Referenced by geomCathodeChannel().

23  {
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 }
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; }
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.
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.
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 53 of file CSCChannelTranslator.cc.

References CSCDetId, Reference_intrackfit_cff::endcap, relativeConstraints::ring, and relativeConstraints::station.

53  {
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 }
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 
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 }
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; }