CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
CSCIndexerBase Class Referenceabstract

#include <CSCIndexerBase.h>

Inheritance diagram for CSCIndexerBase:
CSCIndexerPostls1 CSCIndexerStartup

Public Types

typedef boost::tuple< CSCDetId, IndexType, IndexTypeGasGainIndexType
 
typedef uint16_t IndexType
 
typedef uint32_t LongIndexType
 

Public Member Functions

IndexType chamberLabelFromChamberIndex (IndexType) const
 
 CSCIndexerBase ()
 
virtual int dbIndex (const CSCDetId &id, int &channel) const =0
 
virtual std::string name () const
 
virtual ~CSCIndexerBase ()
 
maxIndexMethods

The following methods are expected to define maximum values for various index types.

Warning
The abstract methods need to be implemented by concrete CSCIndexers!
the minimum index value is 1.
IndexType maxChamberIndex () const
 
IndexType maxLayerIndex () const
 
virtual LongIndexType maxStripChannelIndex () const =0
 
virtual IndexType maxChipIndex () const =0
 
virtual IndexType maxGasGainIndex () const =0
 
nonIndexCountingMethods
IndexType ringsInStation (IndexType is) const
 
virtual IndexType onlineRingsInStation (IndexType is) const =0
 
IndexType offlineRingsInStation (IndexType is) const
 
IndexType chambersInRingOfStation (IndexType is, IndexType ir) const
 
virtual IndexType stripChannelsPerOfflineLayer (IndexType is, IndexType ir) const =0
 
virtual IndexType stripChannelsPerOnlineLayer (IndexType is, IndexType ir) const =0
 
virtual IndexType chipsPerOnlineLayer (IndexType is, IndexType ir) const =0
 
IndexType sectorsPerOnlineLayer (IndexType is, IndexType ir) const
 
chamberIndexMethods
IndexType startChamberIndexInEndcap (IndexType ie, IndexType is, IndexType ir) const
 
IndexType chamberIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic) const
 
IndexType chamberIndex (const CSCDetId &id) const
 
layerIndexMethods
IndexType layerIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il) const
 
IndexType layerIndex (const CSCDetId &id) const
 
stripIndexMethods
virtual IndexType stripChannelsPerLayer (IndexType is, IndexType ir) const =0
 
virtual LongIndexType stripChannelStart (IndexType ie, IndexType is, IndexType ir) const =0
 
LongIndexType stripChannelIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType istrip) const
 
LongIndexType stripChannelIndex (const CSCDetId &id, IndexType istrip) const
 
chipIndexMethods
virtual IndexType chipsPerLayer (IndexType is, IndexType ir) const =0
 
virtual IndexType chipStart (IndexType ie, IndexType is, IndexType ir) const =0
 
IndexType chipIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ichip) const
 
IndexType chipIndex (const CSCDetId &id, IndexType ichip) const
 
IndexType chipIndex (IndexType istrip) const
 
gasGainIndexMethods
IndexType hvSegmentsPerLayer (IndexType is, IndexType ir) const
 
IndexType hvSegmentIndex (IndexType is, IndexType ir, IndexType iwire) const
 
IndexType sectorsPerLayer (IndexType is, IndexType ir) const
 
virtual IndexType sectorStart (IndexType ie, IndexType is, IndexType ir) const =0
 
IndexType gasGainIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ihvsegment, IndexType ichip) const
 
IndexType gasGainIndex (const CSCDetId &id, IndexType istrip, IndexType iwire) const
 
IndexType gasGainIndex (IndexType ihvsegment, IndexType ichip, const CSCDetId &id) const
 
reverseIndexMethods

reverse look-up methods: index –> detid + etc.

CSCDetId detIdFromChamberIndex (IndexType ici) const
 
CSCDetId detIdFromLayerIndex (IndexType ili) const
 
virtual std::pair< CSCDetId, IndexTypedetIdFromStripChannelIndex (LongIndexType ichi) const =0
 
virtual std::pair< CSCDetId, IndexTypedetIdFromChipIndex (IndexType ichi) const =0
 
virtual GasGainIndexType detIdFromGasGainIndex (IndexType igg) const =0
 

Protected Member Functions

CSCDetId detIdFromChamberLabel (IndexType ie, IndexType icl) const
 

Protected Attributes

std::vector< IndexTypechamberLabel_
 

Detailed Description

ABC for CSCIndexer classes.

A CSCIndexer class provides a linear index for various sublevels of the endcap muon CSC system for use in access to information stored in the Conditions Database. Only concrete derived classes can be instantiated.

It supplies a linear index for:

  1. Each chamber of the CSC system: range 1-468 (CSC system as installed 2008) 469-540 for ME42
  2. Each layer of the CSC system: range 1-2808 (CSCs 2008) 2809-3240 for ME42
  3. Each strip channel of the CSC system: range 1-217728 (CSCs 2008) 217729-252288 for ME42
  4. Each Buckeye chip (1 for each layer in each CFEB) of the CSC system: range 1-13608 (CSCs 2008) 13609-15768 for ME42
  5. Each Gas Gain Sector (1 for each [CFEB*HV segment] combination in each layer): range 1-45144 (CSCs 2008) 45145-55944 for ME42

The chamber and layer may be specified by CSCDetId or labels for endcap, station, ring, chamber, layer.

The strip channel is a value 1-80 for most chambers.
ME1/3 and ME1/1B have 64 channels.
ME1/1A has 16 channels at CMS startup (2008-2013) and 48 channels after Long Shutdown 1 ('LS1' 2013-2014)
The chip number is a value 1-30 (or 24: ME13 chambers have only 24 chips.)

The main user interface is the set of functions
chamberIndex(.)
layerIndex(.)
stripChannelIndex(.)
chipIndex(.)
But the other functions are public since they may be useful in contexts other than for Conditions Data for which the above functions are intended.

The terminology "label" can be confusing.
The CSC project typically refers to an element of the CSC detector by hardware labels endcap (+z, -z), station (1-4), ring (1-3), chamber (1-18 or 1-36 depending on ring), layer (1-6). Strips (and wiregroups) are number 1-N where N is the total number of strips in a given layer.
Offline, we turn +z, -z into integers 1, 2 and extend the ring index to 4 to mean ME1/1A (leaving ring 1 in station 1 to mean ME1/1B when dealing with strip planes. Since there is only one common wire plane sometimes ring 1, station 1 means the entire ME1/1 and sometimes just ME1/1B.) So in offline code, when we talk about "labels" for an element, we typically mean these integer values.
For example, strip 71 of layer 4 of chamber 17 of ME-3/1 is labelled {ie=2, is=3, ir=1, ic=17, il=4, istrip=71}. However, in CSCIndexer classes, "label" may be generalized to mean more than this. For example, the "chamberLabel_" vector encodes these integer labels for a chamber, and does not just mean the value ic=1-18 or 36.

Warning
EVERY LABEL COUNTS FROM ONE NOT ZERO.
Contains a number of non-virtual method that derived classes are not expected to override! TODO: add 'final' attribute to those non-virtual methods after full migration to gcc4.7

Definition at line 55 of file CSCIndexerBase.h.

Member Typedef Documentation

Definition at line 64 of file CSCIndexerBase.h.

typedef uint16_t CSCIndexerBase::IndexType

Definition at line 59 of file CSCIndexerBase.h.

Definition at line 60 of file CSCIndexerBase.h.

Constructor & Destructor Documentation

CSCIndexerBase::CSCIndexerBase ( )

Definition at line 3 of file CSCIndexerBase.cc.

References chamberLabel_, chambersInRingOfStation(), KineDebug3::count(), and ringsInStation().

4 : chamberLabel_(271) // # of physical chambers per endcap + 1. Includes ME42.
5 {
6  // Fill the member vector which permits decoding of the linear chamber index.
7  // Beware that the ME42 indices 235-270 within this vector do NOT correspond to
8  // their 'real' linear indices (which are 469-504 for +z)
9  IndexType count = 0;
10  chamberLabel_[count] = 0;
11 
12  for ( IndexType is = 1 ; is <= 4; ++is )
13  {
14  IndexType irmax = ringsInStation(is);
15  for ( IndexType ir = 1; ir <= irmax; ++ir )
16  {
17  IndexType icmax = chambersInRingOfStation(is, ir);
18  for ( IndexType ic = 1; ic <= icmax; ++ic )
19  {
20  chamberLabel_[ ++count ] = is*1000 + ir*100 + ic ;
21  }
22  }
23  }
24 }
IndexType chambersInRingOfStation(IndexType is, IndexType ir) const
uint16_t IndexType
IndexType ringsInStation(IndexType is) const
std::vector< IndexType > chamberLabel_
CSCIndexerBase::~CSCIndexerBase ( )
virtual

Definition at line 27 of file CSCIndexerBase.cc.

27 {}

Member Function Documentation

IndexType CSCIndexerBase::chamberIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic 
) const
inline

Linear index for chamber 'ic' in ring 'ir' of station 'is' in endcap 'ie', in range 1-468 (CSCs 2008) or 469-540 (ME42)

Warning
: Since both ME1a and ME1b are part of one ME11 chamber the output is the same for input {is=1, ir=1} and {is=1, ir=4}, i.e. chamberIndex for ME1/1a is the same as for ME1/1b.

Definition at line 186 of file CSCIndexerBase.h.

References startChamberIndexInEndcap().

Referenced by CSCConditions::anodeBXoffset(), chamberIndex(), CSCConditions::chamberTimingCorrection(), CSCConditions::fillBadStripWord(), CSCConditions::fillBadWireWord(), CSCConditions::isInBadChamber(), and layerIndex().

187  {
188  return startChamberIndexInEndcap(ie, is, ir) + ic - 1; // -1 so start index _is_ ic=1
189  }
IndexType startChamberIndexInEndcap(IndexType ie, IndexType is, IndexType ir) const
IndexType CSCIndexerBase::chamberIndex ( const CSCDetId id) const
inline

Linear index to label each CSC in CSC system. Argument is the CSCDetId of some CSC chamber.

Output is 1-468 (CSCs 2008) 469-540 (with ME42)

Warning
: Since both ME1a and ME1b are part of one ME11 chamber the output is the same for input {is=1, ir=1} and {is=1, ir=4}, i.e. chamberIndex for ME1/1a is the same as for ME1/1b.

Definition at line 201 of file CSCIndexerBase.h.

References relativeConstraints::chamber, chamberIndex(), makeMuonMisalignmentScenario::endcap, relativeConstraints::ring, and relativeConstraints::station.

202  {
203  return chamberIndex( id.endcap(), id.station(), id.ring(), id.chamber() );
204  }
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
CSCIndexerBase::IndexType CSCIndexerBase::chamberLabelFromChamberIndex ( IndexType  ici) const

Encoded chambers label value from cache for input chamber index. For debugging only!

Definition at line 30 of file CSCIndexerBase.cc.

References chamberLabel_.

Referenced by gasGainIndex().

31 {
32  // This is just for cross-checking
33 
34  // Expected range of input range argument is 1-540.
35  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
36 
37  if ( ici > 468 )
38  {
39  // ME42
40  ici -= 234; // now in range 235-306
41  if ( ici > 270 ) // -z
42  {
43  ici -= 36; // now in range 235-270
44  }
45  }
46  else // in range 1-468
47  {
48  if ( ici > 234 ) // -z
49  {
50  ici -= 234; // now in range 1-234
51  }
52  }
53  return chamberLabel_[ici];
54 }
std::vector< IndexType > chamberLabel_
IndexType CSCIndexerBase::chambersInRingOfStation ( IndexType  is,
IndexType  ir 
) const
inline

How many chambers are there in an "offline" ring ir of station is? Works for ME1a (ring 4 of ME1) too.

Definition at line 118 of file CSCIndexerBase.h.

References chipsPerOnlineLayer(), stripChannelsPerOfflineLayer(), and stripChannelsPerOnlineLayer().

Referenced by CSCIndexerBase().

119  {
120  const IndexType nCinR[16] = { 36,36,36,36, 18,36,0,0, 18,36,0,0, 18,36,0,0 }; // chambers in ring
121  return nCinR[(is - 1)*4 + ir - 1];
122  }
uint16_t IndexType
IndexType CSCIndexerBase::chipIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic,
IndexType  il,
IndexType  ichip 
) const
inline

Linear index for Buckeye chip 'ichip' in layer 'il' of chamber 'ic' of ring 'ir' in station 'is' of endcap 'ie'.

Warning
: You must input labels within hardware ranges. No trapping on out-of-range values! E.g., if you provide ir=4 in ganged case, it would still be treated the same as ir=1, but ichip must be 5 for it to make sense!

Definition at line 316 of file CSCIndexerBase.h.

References chipsPerLayer(), and chipStart().

Referenced by CSCConditions::chipCorrection(), chipIndex(), and gasGainIndex().

317  {
318  return chipStart(ie, is, ir)
319  + ( (ic - 1)*6 + il - 1 ) * chipsPerLayer(is, ir)
320  + (ichip - 1);
321  }
virtual IndexType chipsPerLayer(IndexType is, IndexType ir) const =0
virtual IndexType chipStart(IndexType ie, IndexType is, IndexType ir) const =0
IndexType CSCIndexerBase::chipIndex ( const CSCDetId id,
IndexType  ichip 
) const
inline

Linear index for Buckeye chip 'ichip' in layer labelled by CSCDetId 'id'.

Warning
: The supplied CSCDetId must be a layer id, and ichip must be h/w chip number in a chamber. No trapping on out-of-range values! E.g., if you provide ME1a id in ganged case, it would still be treated the same as whole ME11 id, but ichip must be 5 for it to make sense!

Definition at line 331 of file CSCIndexerBase.h.

References relativeConstraints::chamber, chipIndex(), makeMuonMisalignmentScenario::endcap, relativeConstraints::ring, and relativeConstraints::station.

332  {
333  return chipIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(), ichip );
334  }
IndexType chipIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ichip) const
IndexType CSCIndexerBase::chipIndex ( IndexType  istrip) const
inline

Chip number in a chamber for a Buckeye chip processing strip 'istrip'.

Input is hardware strip channel 1-80.

Warning
: for ganged ME1a istrip would have to be in 65-80, while for unganged ME1a it would be in 1-48

Output is 1-5.

Definition at line 344 of file CSCIndexerBase.h.

345  {
346  return (istrip - 1)/16 + 1;
347  }
virtual IndexType CSCIndexerBase::chipsPerLayer ( IndexType  is,
IndexType  ir 
) const
pure virtual

Number of Buckeye chips indices per layer in a chamber in ring 'ir' of station 'is'.

Station label range 1-4, Ring label range 1-4 (4=ME1a)

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by chipIndex(), gasGainIndex(), sectorsPerLayer(), and stripChannelIndex().

virtual IndexType CSCIndexerBase::chipsPerOnlineLayer ( IndexType  is,
IndexType  ir 
) const
pure virtual

Number of Buckeye chips per layer in an online chamber in ring 'ir' of station 'is'. Works for ME1a (ring 4 of ME1) too.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by chambersInRingOfStation(), and sectorsPerOnlineLayer().

virtual IndexType CSCIndexerBase::chipStart ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
pure virtual

Linear index for 1st Buckeye chip in ring 'ir' of station 'is' in endcap 'ie'.

Endcap label range 1-2, Station label range 1-4, Ring label range 1-4 (4=ME1a)

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by chipIndex(), and stripChannelIndex().

virtual int CSCIndexerBase::dbIndex ( const CSCDetId id,
int &  channel 
) const
pure virtual

Create the "Igor Index" for a strip channel. This is integer ie*100000 + is*10000 + ir*1000 + ic*10 + il.

Warning
The channel is NOT encoded. BUT... channel is passed in as a reference and is converted from 1-16 to 65-80 if the chamber is ME1/1a and ganged.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by gasGainIndex().

CSCDetId CSCIndexerBase::detIdFromChamberIndex ( IndexType  ici) const

CSCDetId for a physical chamber labelled by the chamber index (1-468 non-ME4/2, 469-540 ME4/2)

No distinction between ME1/1a and ME1/1b.

Definition at line 104 of file CSCIndexerBase.cc.

References chamberLabel_, detIdFromChamberLabel(), and diffTwoXMLs::label.

Referenced by detIdFromLayerIndex(), and gasGainIndex().

105 {
106  // Expected range of input range argument is 1-540.
107  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
108 
109  IndexType ie = 1;
110  if ( ici > 468 )
111  {
112  // ME42
113  ici -= 234; // now in range 235-306
114  if ( ici > 270 ) // -z
115  {
116  ie = 2;
117  ici -= 36; // now in range 235-270
118  }
119  }
120  else // in range 1-468
121  {
122  if ( ici > 234 ) // -z
123  {
124  ie = 2;
125  ici -= 234; // now in range 1-234
126  }
127  }
128 
130  return detIdFromChamberLabel( ie, label );
131 }
CSCDetId detIdFromChamberLabel(IndexType ie, IndexType icl) const
uint16_t IndexType
std::vector< IndexType > chamberLabel_
CSCDetId CSCIndexerBase::detIdFromChamberLabel ( IndexType  ie,
IndexType  icl 
) const
protected

Decode CSCDetId from the encoded chamber values in chamberLabel cache vector. Requires endcap label since that is not encoded in cache.

Definition at line 92 of file CSCIndexerBase.cc.

References diffTwoXMLs::label.

Referenced by detIdFromChamberIndex(), and gasGainIndex().

93 {
94  IndexType is = label/1000;
95  label -= is*1000;
96  IndexType ir = label/100;
97  label -= ir*100;
98  IndexType ic = label;
99 
100  return CSCDetId( ie, is, ir, ic );
101 }
uint16_t IndexType
virtual std::pair<CSCDetId, IndexType> CSCIndexerBase::detIdFromChipIndex ( IndexType  ichi) const
pure virtual

CSCDetId + chip within chamber from conditions data chip index.

Warning
This function changes meaning with ganged and unganged ME1/1a. If ME1/1a is ganged then an ME1/1a chip index returns ME1/1b CSCDetId + chip=5.
If ME1/1a is unganged then an ME1/1a chip index returns ME1/1a CSCDetId + chip# in range 1-3.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by gasGainIndex().

virtual GasGainIndexType CSCIndexerBase::detIdFromGasGainIndex ( IndexType  igg) const
pure virtual

CSCDetId + HV segment + chip within chamber from conditions data gas gain index.

Warning
This function changes meaning with ganged and unganged ME1/1a. If ME1/1a is ganged then an ME1/1a gas gain index returns ME1/1b CSCDetId + HVsegment=1 + chip=5.
If ME1/1a is unganged then an ME1/1a gas gain index returns ME1/1a CSCDetId + HVsegment=1 + chip# in range 1-3.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by gasGainIndex().

CSCDetId CSCIndexerBase::detIdFromLayerIndex ( IndexType  ili) const

CSCDetId for a physical layer labelled by the layer index (1-2808 non-ME4/2, 2809-3240 ME4/2)

No distinction between ME1/1a and ME1/1b.

Definition at line 134 of file CSCIndexerBase.cc.

References relativeConstraints::chamber, detIdFromChamberIndex(), makeMuonMisalignmentScenario::endcap, relativeConstraints::ring, and relativeConstraints::station.

Referenced by CSCIndexerStartup::detIdFromChipIndex(), CSCIndexerPostls1::detIdFromChipIndex(), CSCIndexerStartup::detIdFromStripChannelIndex(), CSCIndexerPostls1::detIdFromStripChannelIndex(), and gasGainIndex().

135 {
136  IndexType il = (ili - 1)%6 + 1;
137  IndexType ici = (ili - 1)/6 + 1;
138  CSCDetId id = detIdFromChamberIndex( ici );
139 
140  return CSCDetId(id.endcap(), id.station(), id.ring(), id.chamber(), il);
141 }
CSCDetId detIdFromChamberIndex(IndexType ici) const
uint16_t IndexType
virtual std::pair<CSCDetId, IndexType> CSCIndexerBase::detIdFromStripChannelIndex ( LongIndexType  ichi) const
pure virtual

CSCDetId + strip channel within layer from conditions data strip index.

Warning
This function changes meaning with ganged and unganged ME1/1a. If ME1/1a is ganged then an ME1/1a strip index returns ME1/1b CSCDetId + channel in range 65-80.
If ME1/1a is unganged then an ME1/1a strip index returns ME1/1a CSCDetId + channel in range 1-48.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by gasGainIndex().

IndexType CSCIndexerBase::gasGainIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic,
IndexType  il,
IndexType  ihvsegment,
IndexType  ichip 
) const
inline

Linear index for Gas gain sector, based on the HV segment# and the chip# located in layer 'il' of chamber 'ic' of ring 'ir' in station 'is' of endcap 'ie'.

Output is 1-45144 (CSCs 2008) and 45145-55944 (ME42) and 55945-57240 (ME1a)

Warning
: You must input labels within hardware ranges. No trapping on out-of-range values! E.g., if you provide ir=4 in ganged case, it would still be treated the same as ir=1, but ichip must be 5 for it to make sense!

Definition at line 411 of file CSCIndexerBase.h.

References chipsPerLayer(), sectorsPerLayer(), and sectorStart().

Referenced by CSCConditions::gasGainCorrection(), and gasGainIndex().

413  {
414  return sectorStart(ie,is,ir)
415  + ( (ic-1)*6 + il - 1 ) * sectorsPerLayer(is,ir)
416  + (ihvsegment - 1) * chipsPerLayer(is,ir)
417  + (ichip - 1);
418  }
virtual IndexType chipsPerLayer(IndexType is, IndexType ir) const =0
IndexType sectorsPerLayer(IndexType is, IndexType ir) const
virtual IndexType sectorStart(IndexType ie, IndexType is, IndexType ir) const =0
IndexType CSCIndexerBase::gasGainIndex ( const CSCDetId id,
IndexType  istrip,
IndexType  iwire 
) const
inline

Linear index for Gas gain sector, based on CSCDetId 'id', cathode strip 'istrip' and anode wire 'iwire'

Warning
: You must input labels within hardware ranges (e.g., 'id' must correspond to a specific layer 1-6). No trapping on out-of-range values! E.g., if you provide ME1a id in ganged case, it would still be treated the same as whole ME11 id, but istrip must be a h/w strip number in 64-80 in that case!

Definition at line 428 of file CSCIndexerBase.h.

References relativeConstraints::chamber, chipIndex(), makeMuonMisalignmentScenario::endcap, gasGainIndex(), hvSegmentIndex(), relativeConstraints::ring, and relativeConstraints::station.

429  {
430  return gasGainIndex( id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(),
431  hvSegmentIndex( id.station(), id.ring(), iwire ),
432  chipIndex(istrip) );
433  }
IndexType gasGainIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ihvsegment, IndexType ichip) const
IndexType hvSegmentIndex(IndexType is, IndexType ir, IndexType iwire) const
IndexType chipIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ichip) const
IndexType CSCIndexerBase::gasGainIndex ( IndexType  ihvsegment,
IndexType  ichip,
const CSCDetId id 
) const
inline

Linear index for Gas gain sector, based on CSCDetId 'id', the HV segment# and the chip#. Note: to allow method overloading, the parameters order is reversed comparing to the (id,strip,wire) method

Output is 1-45144 (CSCs 2008) and 45145-55944 (ME42) and 55945-57240 (ME1a)

Warning
: Use at your own risk! You must input labels within hardware ranges. No trapping on out-of-range values! The supplied CSCDetId must be a layer id, and ichip must be h/w chip number in a chamber. E.g., if you provide ME1a id in ganged case, it would still be treated the same as whole ME11 id, but ichip must be 5 for it to make sense!

Definition at line 447 of file CSCIndexerBase.h.

References relativeConstraints::chamber, chamberLabelFromChamberIndex(), dbIndex(), detIdFromChamberIndex(), detIdFromChamberLabel(), detIdFromChipIndex(), detIdFromGasGainIndex(), detIdFromLayerIndex(), detIdFromStripChannelIndex(), makeMuonMisalignmentScenario::endcap, gasGainIndex(), relativeConstraints::ring, and relativeConstraints::station.

448  {
449  return gasGainIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(), ihvsegment, ichip);
450  }
IndexType gasGainIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ihvsegment, IndexType ichip) const
CSCIndexerBase::IndexType CSCIndexerBase::hvSegmentIndex ( IndexType  is,
IndexType  ir,
IndexType  iwire 
) const

Linear index inside a chamber for HV segment given station, ring, and wiregroup number.

Output is 1-5.

ME1a (ir=4), ME1b(ir=1) and whole ME11 are all assumed to have the same single HV segment

Definition at line 57 of file CSCIndexerBase.cc.

Referenced by gasGainIndex(), and hvSegmentsPerLayer().

58 {
59  IndexType hvSegment = 1; // There is only one HV segment in ME1/1
60 
61  if (is > 2 && ir == 1) // HV segments are the same in ME3/1 and ME4/1
62  {
63  if ( iwire >= 33 && iwire <= 64 ) { hvSegment = 2; }
64  else if ( iwire >= 65 && iwire <= 96 ) { hvSegment = 3; }
65  }
66  else if (is > 1 && ir == 2) // HV segments are the same in ME2/2, ME3/2, and ME4/2
67  {
68  if ( iwire >= 17 && iwire <= 28 ) { hvSegment = 2; }
69  else if ( iwire >= 29 && iwire <= 40 ) { hvSegment = 3; }
70  else if ( iwire >= 41 && iwire <= 52 ) { hvSegment = 4; }
71  else if ( iwire >= 53 && iwire <= 64 ) { hvSegment = 5; }
72  }
73  else if (is == 1 && ir == 2)
74  {
75  if ( iwire >= 25 && iwire <= 48 ) { hvSegment = 2; }
76  else if ( iwire >= 49 && iwire <= 64 ) { hvSegment = 3; }
77  }
78  else if (is == 1 && ir == 3)
79  {
80  if ( iwire >= 13 && iwire <= 22 ) { hvSegment = 2; }
81  else if ( iwire >= 23 && iwire <= 32 ) { hvSegment = 3; }
82  }
83  else if (is == 2 && ir == 1)
84  {
85  if ( iwire >= 45 && iwire <= 80 ) { hvSegment = 2; }
86  else if ( iwire >= 81 && iwire <= 112) { hvSegment = 3; }
87  }
88  return hvSegment;
89 }
uint16_t IndexType
IndexType CSCIndexerBase::hvSegmentsPerLayer ( IndexType  is,
IndexType  ir 
) const
inline

Number of HV segments per layer in a chamber in ring ir of station is.

Station label range 1-4, Ring label range 1-4 (4=ME1a)

ME1a (ir=4), ME1b(ir=1) and whole ME11 are all assumed to have the same single HV segment

Definition at line 360 of file CSCIndexerBase.h.

References hvSegmentIndex().

Referenced by sectorsPerLayer(), and sectorsPerOnlineLayer().

361  {
362  const IndexType nSinL[16] = { 1,3,3,1, 3,5,0,0, 3,5,0,0, 3,5,0,0 };
363  return nSinL[(is - 1) * 4 + ir - 1];
364  }
uint16_t IndexType
IndexType CSCIndexerBase::layerIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic,
IndexType  il 
) const
inline

Linear index for layer 'il' of chamber 'ic' in ring 'ir' of station 'is' in endcap 'ie', in range 1-2808 (CSCs 2008) or 2809-3240 (ME42).

Warning
: Since both ME1a and ME1b are part of one ME11 chamber the output is the same for input {is=1, ir=1} and {is=1, ir=4}, i.e. layerIndex for ME1/1a is the same as for ME1/1b.

Definition at line 218 of file CSCIndexerBase.h.

References chamberIndex().

Referenced by layerIndex().

219  {
220  const IndexType layersInChamber = 6;
221  return (chamberIndex(ie, is, ir, ic) - 1 ) * layersInChamber + il;
222  }
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
uint16_t IndexType
IndexType CSCIndexerBase::layerIndex ( const CSCDetId id) const
inline

Linear index to label each hardware layer in CSC system. Argument is the CSCDetId of some CSC layer.

Output is 1-2808 (CSCs 2008) 2809-3240 (ME42)

Warning
: Since both ME1a and ME1b are part of one ME11 chamber the output is the same for input {is=1, ir=1} and {is=1, ir=4}, i.e. layerIndex for ME1/1a is the same as for ME1/1b.

Definition at line 234 of file CSCIndexerBase.h.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, layerIndex(), relativeConstraints::ring, relativeConstraints::station, stripChannelsPerLayer(), and stripChannelStart().

235  {
236  return layerIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer());
237  }
IndexType layerIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il) const
IndexType CSCIndexerBase::maxChamberIndex ( ) const
inline

Definition at line 78 of file CSCIndexerBase.h.

78 { return 540; }
virtual IndexType CSCIndexerBase::maxChipIndex ( ) const
pure virtual

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by maxLayerIndex().

virtual IndexType CSCIndexerBase::maxGasGainIndex ( ) const
pure virtual

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by maxLayerIndex().

IndexType CSCIndexerBase::maxLayerIndex ( ) const
inline

Definition at line 79 of file CSCIndexerBase.h.

References maxChipIndex(), maxGasGainIndex(), and maxStripChannelIndex().

79 { return 3240; }
virtual LongIndexType CSCIndexerBase::maxStripChannelIndex ( ) const
pure virtual

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by maxLayerIndex().

virtual std::string CSCIndexerBase::name ( ) const
inlinevirtual
IndexType CSCIndexerBase::offlineRingsInStation ( IndexType  is) const
inline

How many offline rings are there in station 'is'=1, 2, 3, 4 ?

Warning
:
  • ME1 has 4 rings in the offline notation (virtual ring 4 is used for ME1a).

Definition at line 108 of file CSCIndexerBase.h.

109  {
110  const IndexType nrings[5] = { 0, 4, 2, 2, 2 }; // offline rings per station
111  return nrings[is];
112  }
uint16_t IndexType
virtual IndexType CSCIndexerBase::onlineRingsInStation ( IndexType  is) const
pure virtual

How many online rings are there in station 'is'=1, 2, 3, 4 ?

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by ringsInStation().

IndexType CSCIndexerBase::ringsInStation ( IndexType  is) const
inline

How many physical rings are there in station 'is'=1, 2, 3, 4 ?

Definition at line 91 of file CSCIndexerBase.h.

References onlineRingsInStation().

Referenced by CSCIndexerBase().

92  {
93  const IndexType nrins[5] = {0, 3, 2, 2, 2}; // physical rings per station
94  return nrins[is];
95  }
uint16_t IndexType
IndexType CSCIndexerBase::sectorsPerLayer ( IndexType  is,
IndexType  ir 
) const
inline

Number of Gas Gain sectors per layer in a chamber in ring ir of station is.

Station label range 1-4, Ring label range 1-4 (4=ME1a)

Warning
: for ganged case, the ir=4 ME1a input would give the same result as ir=1

Definition at line 383 of file CSCIndexerBase.h.

References chipsPerLayer(), hvSegmentsPerLayer(), and sectorStart().

Referenced by CSCIndexerStartup::detIdFromGasGainIndex(), CSCIndexerPostls1::detIdFromGasGainIndex(), and gasGainIndex().

384  {
385  return chipsPerLayer(is, ir) * hvSegmentsPerLayer(is, ir);
386  }
IndexType hvSegmentsPerLayer(IndexType is, IndexType ir) const
virtual IndexType chipsPerLayer(IndexType is, IndexType ir) const =0
IndexType CSCIndexerBase::sectorsPerOnlineLayer ( IndexType  is,
IndexType  ir 
) const
inline

Number of Gas Gain sectors per layer in an online chamber in ring 'ir' of station 'is'. Works for ME1a (ring 4 of ME1) too.

The difference between this and sectorsPerLayer completely depends on the difference between chipsPerOnlineLayer and chipsPerLayer

Definition at line 153 of file CSCIndexerBase.h.

References chipsPerOnlineLayer(), and hvSegmentsPerLayer().

154  {
155  return chipsPerOnlineLayer(is, ir) * hvSegmentsPerLayer(is, ir);
156  }
virtual IndexType chipsPerOnlineLayer(IndexType is, IndexType ir) const =0
IndexType hvSegmentsPerLayer(IndexType is, IndexType ir) const
virtual IndexType CSCIndexerBase::sectorStart ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
pure virtual

Linear index for 1st Gas gain sector in ring 'ir' of station 'is' in endcap 'ie'.

Endcap label range 1-2, Station label range 1-4, Ring label range 1-4 (4=ME1a)

Warning
: current: ME1a chip is the last 1 of the 5 chips total in each layer of an ME11 chamber, and an input ir=4 in this case would give the same result as ir=1 upgraded: ME1a has 3 own chips, which are appended to the end of the index range, ME1b still keeps 5 chips with chip #5 index unused.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by gasGainIndex(), and sectorsPerLayer().

IndexType CSCIndexerBase::startChamberIndexInEndcap ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
inline

Starting index for first chamber in ring 'ir' of station 'is' in endcap 'ie', in range 1-468 (CSCs 2008) or 469-540 (ME42).

Warning
: Considers both ME1a and ME1b to be part of one whole ME11 chamber (result would be the same for is=1 and ir=1 or 4).

Definition at line 170 of file CSCIndexerBase.h.

Referenced by chamberIndex().

171  {
172  const IndexType nschin[32] =
173  { 1,37,73,1, 109,127,0,0, 163,181,0,0, 217,469,0,0,
174  235,271,307,235, 343,361,0,0, 397,415,0,0, 451,505,0,0 };
175  return nschin[(ie - 1)*16 + (is - 1)*4 + ir - 1];
176  }
uint16_t IndexType
LongIndexType CSCIndexerBase::stripChannelIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic,
IndexType  il,
IndexType  istrip 
) const
inline

Linear index for strip channel istrip in layer 'il' of chamber 'ic' of ring 'ir' in station 'is' of endcap 'ie'.

Warning
: You must input labels within hardware ranges. No trapping on out-of-range values!

Definition at line 273 of file CSCIndexerBase.h.

References stripChannelsPerLayer(), and stripChannelStart().

Referenced by CSCConditions::crossTalk(), CSCConditions::crosstalkIntercept(), CSCConditions::crosstalkSlope(), CSCConditions::gain(), CSCConditions::noiseMatrix(), CSCConditions::pedestal(), CSCConditions::pedestalSigma(), and stripChannelIndex().

274  {
275  return stripChannelStart(ie, is, ir)
276  + ( (ic - 1)*6 + il - 1 ) * stripChannelsPerLayer(is, ir)
277  + (istrip - 1);
278  }
virtual IndexType stripChannelsPerLayer(IndexType is, IndexType ir) const =0
virtual LongIndexType stripChannelStart(IndexType ie, IndexType is, IndexType ir) const =0
LongIndexType CSCIndexerBase::stripChannelIndex ( const CSCDetId id,
IndexType  istrip 
) const
inline

Linear index for strip channel 'istrip' in layer labeled by CSCDetId 'id'

Warning
: You must input labels within hardware ranges. No trapping on out-of-range values!

Definition at line 285 of file CSCIndexerBase.h.

References relativeConstraints::chamber, chipsPerLayer(), chipStart(), makeMuonMisalignmentScenario::endcap, relativeConstraints::ring, relativeConstraints::station, and stripChannelIndex().

286  {
287  return stripChannelIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(), istrip );
288  }
LongIndexType stripChannelIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType istrip) const
virtual IndexType CSCIndexerBase::stripChannelsPerLayer ( IndexType  is,
IndexType  ir 
) const
pure virtual

Number of strip channel indices for a layer in a chamber defined by station number 'is' and ring number 'ir'.

Station label range 1-4, Ring label range 1-4 (4=ME1a)

This depends on the ordering of the channels in the database. E.g., in startup scenario there are 80 indices allocated per ME1/1 layer with 1-64 belonging to ME1b and 65-80 belonging to ME1a. So the ME1/a database indices are mapped to extend the ME1/b index ranges, which is how the raw hardware chnnels numbering is implemented.

In the currently implemented upgrade scenario on the other hand, the ME1b still keeps the 80 indices wide ranges (with the last 16 of them remaining unused), while the ME1/1A gets its own 48 indices wide ranges.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by layerIndex(), and stripChannelIndex().

virtual IndexType CSCIndexerBase::stripChannelsPerOfflineLayer ( IndexType  is,
IndexType  ir 
) const
pure virtual

Number of strip readout channels per layer in an offline chamber with ring 'ir' and station 'is'. Works for ME1a (ring 4 of ME1) too.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by chambersInRingOfStation().

virtual IndexType CSCIndexerBase::stripChannelsPerOnlineLayer ( IndexType  is,
IndexType  ir 
) const
pure virtual

Number of strip readout channels per layer in an online chamber with ring 'ir' and station 'is'. Works for ME1a (ring 4 of ME1) too.

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by chambersInRingOfStation().

virtual LongIndexType CSCIndexerBase::stripChannelStart ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
pure virtual

Linear index for 1st strip channel in ring 'ir' of station 'is' in endcap 'ie'.

Endcap label range 1-2, Station label range 1-4, Ring label range 1-4 (4=ME1a)

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

Referenced by layerIndex(), and stripChannelIndex().

Member Data Documentation

std::vector<IndexType> CSCIndexerBase::chamberLabel_
protected

Encode a chamber's is, ir, ic values as is*1000 + ir*100 + ic in linear vector with serial index 1-270. Save space in this vector by not storing ie.

Definition at line 530 of file CSCIndexerBase.h.

Referenced by chamberLabelFromChamberIndex(), CSCIndexerBase(), and detIdFromChamberIndex().