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 std::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 69 of file CSCIndexerBase.h.

Member Typedef Documentation

◆ GasGainIndexType

Definition at line 77 of file CSCIndexerBase.h.

◆ IndexType

typedef uint16_t CSCIndexerBase::IndexType

Definition at line 71 of file CSCIndexerBase.h.

◆ LongIndexType

Definition at line 72 of file CSCIndexerBase.h.

Constructor & Destructor Documentation

◆ CSCIndexerBase()

CSCIndexerBase::CSCIndexerBase ( )

Definition at line 3 of file CSCIndexerBase.cc.

References chamberLabel_, chambersInRingOfStation(), submitPVResolutionJobs::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
8  // to 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  IndexType irmax = ringsInStation(is);
14  for (IndexType ir = 1; ir <= irmax; ++ir) {
15  IndexType icmax = chambersInRingOfStation(is, ir);
16  for (IndexType ic = 1; ic <= icmax; ++ic) {
17  chamberLabel_[++count] = is * 1000 + ir * 100 + ic;
18  }
19  }
20  }
21 }
IndexType chambersInRingOfStation(IndexType is, IndexType ir) const
uint16_t IndexType
IndexType ringsInStation(IndexType is) const
std::vector< IndexType > chamberLabel_

◆ ~CSCIndexerBase()

CSCIndexerBase::~CSCIndexerBase ( )
virtual

Definition at line 23 of file CSCIndexerBase.cc.

23 {}

Member Function Documentation

◆ chamberIndex() [1/2]

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 193 of file CSCIndexerBase.h.

References startChamberIndexInEndcap().

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

193  {
194  return startChamberIndexInEndcap(ie, is, ir) + ic - 1; // -1 so start index _is_ ic=1
195  }
IndexType startChamberIndexInEndcap(IndexType ie, IndexType is, IndexType ir) const

◆ chamberIndex() [2/2]

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 207 of file CSCIndexerBase.h.

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

207  {
208  return chamberIndex(id.endcap(), id.station(), id.ring(), id.chamber());
209  }
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const

◆ chamberLabelFromChamberIndex()

CSCIndexerBase::IndexType CSCIndexerBase::chamberLabelFromChamberIndex ( IndexType  ici) const

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

Definition at line 25 of file CSCIndexerBase.cc.

References chamberLabel_.

25  {
26  // This is just for cross-checking
27 
28  // Expected range of input range argument is 1-540.
29  // 1-468 for CSCs installed at 2008 start-up. 469-540 for ME42.
30 
31  if (ici > 468) {
32  // ME42
33  ici -= 234; // now in range 235-306
34  if (ici > 270) // -z
35  {
36  ici -= 36; // now in range 235-270
37  }
38  } else // in range 1-468
39  {
40  if (ici > 234) // -z
41  {
42  ici -= 234; // now in range 1-234
43  }
44  }
45  return chamberLabel_[ici];
46 }
std::vector< IndexType > chamberLabel_

◆ chambersInRingOfStation()

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 130 of file CSCIndexerBase.h.

Referenced by CSCIndexerBase().

130  {
131  const IndexType nCinR[16] = {36, 36, 36, 36, 18, 36, 0, 0, 18, 36, 0, 0, 18, 36, 0, 0}; // chambers in ring
132  return nCinR[(is - 1) * 4 + ir - 1];
133  }
uint16_t IndexType

◆ chipIndex() [1/3]

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 322 of file CSCIndexerBase.h.

References chipsPerLayer(), and chipStart().

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

322  {
323  return chipStart(ie, is, ir) + ((ic - 1) * 6 + il - 1) * chipsPerLayer(is, ir) + (ichip - 1);
324  }
virtual IndexType chipsPerLayer(IndexType is, IndexType ir) const =0
virtual IndexType chipStart(IndexType ie, IndexType is, IndexType ir) const =0

◆ chipIndex() [2/3]

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 334 of file CSCIndexerBase.h.

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

334  {
335  return chipIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(), ichip);
336  }
IndexType chipIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ichip) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer

◆ chipIndex() [3/3]

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 347 of file CSCIndexerBase.h.

347 { return (istrip - 1) / 16 + 1; }

◆ chipsPerLayer()

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(), and sectorsPerLayer().

◆ chipsPerOnlineLayer()

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 sectorsPerOnlineLayer().

◆ chipStart()

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().

◆ dbIndex()

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.

◆ detIdFromChamberIndex()

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 101 of file CSCIndexerBase.cc.

References chamberLabel_, detIdFromChamberLabel(), and label.

Referenced by detIdFromLayerIndex().

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

◆ detIdFromChamberLabel()

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 91 of file CSCIndexerBase.cc.

References label.

Referenced by detIdFromChamberIndex().

91  {
92  IndexType is = label / 1000;
93  label -= is * 1000;
94  IndexType ir = label / 100;
95  label -= ir * 100;
96  IndexType ic = label;
97 
98  return CSCDetId(ie, is, ir, ic);
99 }
char const * label
uint16_t IndexType

◆ detIdFromChipIndex()

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.

◆ detIdFromGasGainIndex()

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.

◆ detIdFromLayerIndex()

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 127 of file CSCIndexerBase.cc.

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

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

127  {
128  IndexType il = (ili - 1) % 6 + 1;
129  IndexType ici = (ili - 1) / 6 + 1;
131 
132  return CSCDetId(id.endcap(), id.station(), id.ring(), id.chamber(), il);
133 }
uint16_t IndexType
CSCDetId detIdFromChamberIndex(IndexType ici) const

◆ detIdFromStripChannelIndex()

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.

◆ gasGainIndex() [1/3]

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 415 of file CSCIndexerBase.h.

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

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

421  {
422  return sectorStart(ie, is, ir) + ((ic - 1) * 6 + il - 1) * sectorsPerLayer(is, ir) +
423  (ihvsegment - 1) * chipsPerLayer(is, ir) + (ichip - 1);
424  }
virtual IndexType sectorStart(IndexType ie, IndexType is, IndexType ir) const =0
virtual IndexType chipsPerLayer(IndexType is, IndexType ir) const =0
IndexType sectorsPerLayer(IndexType is, IndexType ir) const

◆ gasGainIndex() [2/3]

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 436 of file CSCIndexerBase.h.

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

436  {
437  return gasGainIndex(id.endcap(),
438  id.station(),
439  id.ring(),
440  id.chamber(),
441  id.layer(),
442  hvSegmentIndex(id.station(), id.ring(), iwire),
443  chipIndex(istrip));
444  }
IndexType gasGainIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ihvsegment, IndexType ichip) const
IndexType chipIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ichip) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
IndexType hvSegmentIndex(IndexType is, IndexType ir, IndexType iwire) const

◆ gasGainIndex() [3/3]

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 459 of file CSCIndexerBase.h.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, gasGainIndex(), pixelTopology::layer, relativeConstraints::ring, and relativeConstraints::station.

459  {
460  return gasGainIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(), ihvsegment, ichip);
461  }
IndexType gasGainIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType ihvsegment, IndexType ichip) const
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer

◆ hvSegmentIndex()

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 48 of file CSCIndexerBase.cc.

Referenced by gasGainIndex().

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

◆ hvSegmentsPerLayer()

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.

Referenced by sectorsPerLayer(), and sectorsPerOnlineLayer().

360  {
361  const IndexType nSinL[16] = {1, 3, 3, 1, 3, 5, 0, 0, 3, 5, 0, 0, 3, 5, 0, 0};
362  return nSinL[(is - 1) * 4 + ir - 1];
363  }
uint16_t IndexType

◆ layerIndex() [1/2]

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 222 of file CSCIndexerBase.h.

References chamberIndex().

Referenced by layerIndex().

222  {
223  const IndexType layersInChamber = 6;
224  return (chamberIndex(ie, is, ir, ic) - 1) * layersInChamber + il;
225  }
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
uint16_t IndexType

◆ layerIndex() [2/2]

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 237 of file CSCIndexerBase.h.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, pixelTopology::layer, layerIndex(), relativeConstraints::ring, and relativeConstraints::station.

237  {
238  return layerIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer());
239  }
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
IndexType layerIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il) const

◆ maxChamberIndex()

IndexType CSCIndexerBase::maxChamberIndex ( ) const
inline

Definition at line 92 of file CSCIndexerBase.h.

92 { return 540; }

◆ maxChipIndex()

virtual IndexType CSCIndexerBase::maxChipIndex ( ) const
pure virtual

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

◆ maxGasGainIndex()

virtual IndexType CSCIndexerBase::maxGasGainIndex ( ) const
pure virtual

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

◆ maxLayerIndex()

IndexType CSCIndexerBase::maxLayerIndex ( ) const
inline

Definition at line 93 of file CSCIndexerBase.h.

93 { return 3240; }

◆ maxStripChannelIndex()

virtual LongIndexType CSCIndexerBase::maxStripChannelIndex ( ) const
pure virtual

Implemented in CSCIndexerPostls1, and CSCIndexerStartup.

◆ name()

virtual std::string CSCIndexerBase::name ( ) const
inlinevirtual

◆ offlineRingsInStation()

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 121 of file CSCIndexerBase.h.

121  {
122  const IndexType nrings[5] = {0, 4, 2, 2, 2}; // offline rings per station
123  return nrings[is];
124  }
uint16_t IndexType

◆ onlineRingsInStation()

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.

◆ ringsInStation()

IndexType CSCIndexerBase::ringsInStation ( IndexType  is) const
inline

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

Definition at line 104 of file CSCIndexerBase.h.

Referenced by CSCIndexerBase().

104  {
105  const IndexType nrins[5] = {0, 3, 2, 2, 2}; // physical rings per station
106  return nrins[is];
107  }
uint16_t IndexType

◆ sectorsPerLayer()

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 384 of file CSCIndexerBase.h.

References chipsPerLayer(), and hvSegmentsPerLayer().

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

◆ sectorsPerOnlineLayer()

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 164 of file CSCIndexerBase.h.

References chipsPerOnlineLayer(), and hvSegmentsPerLayer().

164  {
165  return chipsPerOnlineLayer(is, ir) * hvSegmentsPerLayer(is, ir);
166  }
virtual IndexType chipsPerOnlineLayer(IndexType is, IndexType ir) const =0
IndexType hvSegmentsPerLayer(IndexType is, IndexType ir) const

◆ sectorStart()

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().

◆ startChamberIndexInEndcap()

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 179 of file CSCIndexerBase.h.

Referenced by chamberIndex().

179  {
180  const IndexType nschin[32] = {1, 37, 73, 1, 109, 127, 0, 0, 163, 181, 0, 0, 217, 469, 0, 0,
181  235, 271, 307, 235, 343, 361, 0, 0, 397, 415, 0, 0, 451, 505, 0, 0};
182  return nschin[(ie - 1) * 16 + (is - 1) * 4 + ir - 1];
183  }
uint16_t IndexType

◆ stripChannelIndex() [1/2]

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 278 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().

279  {
280  return stripChannelStart(ie, is, ir) + ((ic - 1) * 6 + il - 1) * stripChannelsPerLayer(is, ir) + (istrip - 1);
281  }
virtual LongIndexType stripChannelStart(IndexType ie, IndexType is, IndexType ir) const =0
virtual IndexType stripChannelsPerLayer(IndexType is, IndexType ir) const =0

◆ stripChannelIndex() [2/2]

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 289 of file CSCIndexerBase.h.

References relativeConstraints::chamber, makeMuonMisalignmentScenario::endcap, pixelTopology::layer, relativeConstraints::ring, relativeConstraints::station, and stripChannelIndex().

289  {
290  return stripChannelIndex(id.endcap(), id.station(), id.ring(), id.chamber(), id.layer(), istrip);
291  }
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
LongIndexType stripChannelIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType istrip) const

◆ stripChannelsPerLayer()

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 stripChannelIndex().

◆ stripChannelsPerOfflineLayer()

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.

◆ stripChannelsPerOnlineLayer()

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.

◆ stripChannelStart()

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 stripChannelIndex().

Member Data Documentation

◆ chamberLabel_

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 545 of file CSCIndexerBase.h.

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