CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
CSCIndexer Class Reference

#include <CSCIndexer.h>

Public Types

typedef uint16_t IndexType
 
typedef uint32_t LongIndexType
 

Public Member Functions

IndexType chamberIndex (const CSCDetId &id) const
 
IndexType chamberIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic) const
 
IndexType chamberLabelFromChamberIndex (IndexType) const
 
IndexType chambersInRingOfStation (IndexType is, IndexType ir) const
 
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
 
IndexType chipsPerLayer (IndexType is, IndexType ir) const
 
IndexType chipStart (IndexType ie, IndexType is, IndexType ir) const
 
 CSCIndexer ()
 
int dbIndex (const CSCDetId &id, int &channel)
 
CSCDetId detIdFromChamberIndex (IndexType ici) const
 
CSCDetId detIdFromChamberIndex_OLD (IndexType ici) const
 
CSCDetId detIdFromChamberLabel (IndexType ie, IndexType icl) const
 
std::pair< CSCDetId, IndexTypedetIdFromChipIndex (IndexType ichi) const
 
CSCDetId detIdFromLayerIndex (IndexType ili) const
 
std::pair< CSCDetId, IndexTypedetIdFromStripChannelIndex (LongIndexType ichi) const
 
IndexType gasGainIndex (const CSCDetId &id, IndexType istrip, IndexType iwire) const
 
IndexType gasGainIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType istrip, IndexType iwire) const
 
IndexType hvSegmentIndex (IndexType is, IndexType ir, IndexType iwire) const
 
IndexType hvSegmentsPerLayer (IndexType is, IndexType ir) const
 
IndexType layerIndex (const CSCDetId &id) const
 
IndexType layerIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il) const
 
IndexType ringsInStation (IndexType is) const
 
IndexType sectorsPerLayer (IndexType is, IndexType ir) const
 
IndexType sectorStart (IndexType ie, IndexType is, IndexType ir) const
 
IndexType startChamberIndexInEndcap (IndexType ie, IndexType is, IndexType ir) const
 
LongIndexType stripChannelIndex (IndexType ie, IndexType is, IndexType ir, IndexType ic, IndexType il, IndexType istrip) const
 
LongIndexType stripChannelIndex (const CSCDetId &id, IndexType istrip) const
 
IndexType stripChannelsPerLayer (IndexType is, IndexType ir) const
 
LongIndexType stripChannelStart (IndexType ie, IndexType is, IndexType ir) const
 
 ~CSCIndexer ()
 

Private Member Functions

void fillChamberLabel () const
 

Private Attributes

std::vector< IndexTypechamberLabel
 

Detailed Description

Creates a linear index for various sublevels of the endcap muon CSC system.

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 (or 64: ME13 chambers have only 64 channels.) 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.

Warning
This class is hard-wired for the CSC system at start-up of CMS in 2008. with rings ME11, ME12, ME13, ME21, ME22, ME31, ME32, ME41 totalling 234 chambers per endcap. But ME42 is appended (to permit simulation studies), so the chamber order is
+z ME11, ME12, ME13, ME21, ME22, ME31, ME32, ME41,
-z ME11, ME12, ME13, ME21, ME22, ME31, ME32, ME41,
+z ME42, -z ME42
This uses magic numbers galore!!
EVERY LABEL COUNTS FROM ONE NOT ZERO.

Definition at line 44 of file CSCIndexer.h.

Member Typedef Documentation

typedef uint16_t CSCIndexer::IndexType

Definition at line 50 of file CSCIndexer.h.

typedef uint32_t CSCIndexer::LongIndexType

Definition at line 51 of file CSCIndexer.h.

Constructor & Destructor Documentation

CSCIndexer::CSCIndexer ( )
inline

Definition at line 53 of file CSCIndexer.h.

CSCIndexer::~CSCIndexer ( )
inline

Definition at line 54 of file CSCIndexer.h.

Member Function Documentation

IndexType CSCIndexer::chamberIndex ( const CSCDetId id) const
inline

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

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

WARNING: Do not input ME1a values (i.e. ring '4'): does not consider ME1a and ME1b to be separate, No sanity checking on input value: if you supply an ME1a CSCDetId then you'll get nonsense.

Definition at line 66 of file CSCIndexer.h.

IndexType CSCIndexer::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)

Definition at line 99 of file CSCIndexer.h.

CSCIndexer::IndexType CSCIndexer::chamberLabelFromChamberIndex ( IndexType  ici) const

Definition at line 86 of file CSCIndexer.cc.

IndexType CSCIndexer::chambersInRingOfStation ( IndexType  is,
IndexType  ir 
) const
inline

How many chambers are there in ring ir of station is?

Works for ME1a (ring 4 of ME1) too.

Definition at line 127 of file CSCIndexer.h.

IndexType CSCIndexer::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'.

Output is 1-13608 (CSCs 2008) or 13609-15768 (ME42).

WARNING: Use at your own risk! You must input labels within hardware ranges. No trapping on out-of-range values!

Definition at line 237 of file CSCIndexer.h.

IndexType CSCIndexer::chipIndex ( const CSCDetId id,
IndexType  ichip 
) const
inline

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

Output is 1-13608 (CSCs 2008) or 13609-15768 (ME42).

WARNING: Use at your own risk! The supplied CSCDetId must be a layer id. No trapping on out-of-range values!

Definition at line 252 of file CSCIndexer.h.

IndexType CSCIndexer::chipIndex ( IndexType  istrip) const
inline

Linear index for Buckeye chip processing strip 'istrip'.

Output is 1-5.

WARNING: Use at your own risk! The supplied CSCDetId must be a strip id 1-80 ME1/1a strips must be 65-80 No trapping on out-of-range values!

Definition at line 266 of file CSCIndexer.h.

IndexType CSCIndexer::chipsPerLayer ( IndexType  is,
IndexType  ir 
) const
inline

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

Station label range 1-4, Ring label range 1-3.

WARNING: ME1a channels are the last 1 of the 5 total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.
Considers ME42 as standard 5 chip per layer chambers.

Definition at line 202 of file CSCIndexer.h.

IndexType CSCIndexer::chipStart ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
inline

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

Endcap label range 1-2, Station label range 1-4, Ring label range 1-3.

WARNING: ME1a channels are the last 1 of the 5 chips total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.

Definition at line 215 of file CSCIndexer.h.

int CSCIndexer::dbIndex ( const CSCDetId id,
int &  channel 
)

Build index used internally in online CSC conditions databases (the 'Igor Index')

This is the decimal integer ie*100000 + is*10000 + ir*1000 + ic*10 + il
(ie=1-2, is=1-4, ir=1-4, ic=1-36, il=1-6)
Channels 1-16 in ME1A (is=1, ir=4) are reset to channels 65-80 of ME11.

Definition at line 240 of file CSCIndexer.cc.

Referenced by CSCPedestals::item(), CSCGains::item(), CSCNoiseMatrix::item(), and CSCcrosstalk::item().

CSCDetId CSCIndexer::detIdFromChamberIndex ( IndexType  ici) const

Definition at line 62 of file CSCIndexer.cc.

CSCDetId CSCIndexer::detIdFromChamberIndex_OLD ( IndexType  ici) const

Definition at line 24 of file CSCIndexer.cc.

CSCDetId CSCIndexer::detIdFromChamberLabel ( IndexType  ie,
IndexType  icl 
) const

Definition at line 109 of file CSCIndexer.cc.

std::pair< CSCDetId, CSCIndexer::IndexType > CSCIndexer::detIdFromChipIndex ( IndexType  ichi) const

Definition at line 185 of file CSCIndexer.cc.

CSCDetId CSCIndexer::detIdFromLayerIndex ( IndexType  ili) const

Decode CSCDetId from various indexes and labels

Definition at line 120 of file CSCIndexer.cc.

std::pair< CSCDetId, CSCIndexer::IndexType > CSCIndexer::detIdFromStripChannelIndex ( LongIndexType  ichi) const

Definition at line 129 of file CSCIndexer.cc.

void CSCIndexer::fillChamberLabel ( ) const
private

Definition at line 4 of file CSCIndexer.cc.

IndexType CSCIndexer::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'

Output is 1-45144 (CSCs 2008) and 45145-55944 (ME42).

WARNING: Use at your own risk! 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!

Definition at line 370 of file CSCIndexer.h.

IndexType CSCIndexer::gasGainIndex ( IndexType  ie,
IndexType  is,
IndexType  ir,
IndexType  ic,
IndexType  il,
IndexType  istrip,
IndexType  iwire 
) const
inline

Linear index for Gas gain sector, based on the cathode strip 'istrip' and anode wire 'iwire' 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).

WARNING: Use at your own risk! You must input labels within hardware ranges. No trapping on out-of-range values!

Definition at line 383 of file CSCIndexer.h.

IndexType CSCIndexer::hvSegmentIndex ( IndexType  is,
IndexType  ir,
IndexType  iwire 
) const
inline

Linear index for HV segment

Output is 1-5.

WARNING: Use at your own risk! The supplied CSCDetId must be chamber station, ring, and wire. No trapping on out-of-range values!

Definition at line 303 of file CSCIndexer.h.

IndexType CSCIndexer::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-3.

WARNING: ME1a channels are the last 1 of the 5 total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.

Definition at line 278 of file CSCIndexer.h.

IndexType CSCIndexer::layerIndex ( const CSCDetId id) const
inline

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

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

WARNING: Do not input ME1a values (i.e. ring '4'): does not consider ME1a and ME1b to be separate, No sanity checking on input value: if you supply an ME1a CSCDetId then you'll get nonsense.

Definition at line 80 of file CSCIndexer.h.

IndexType CSCIndexer::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).

Definition at line 107 of file CSCIndexer.h.

IndexType CSCIndexer::ringsInStation ( IndexType  is) const
inline

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

BEWARE! Includes ME42 so claims 2 rings in station 4. There is only 1 at CSC installation 2008.

Definition at line 117 of file CSCIndexer.h.

IndexType CSCIndexer::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-3.

WARNING: ME1a channels are the last 1 of the 5 total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.

Definition at line 291 of file CSCIndexer.h.

IndexType CSCIndexer::sectorStart ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
inline

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-3.

WARNING: ME1a channels are the last 1 of the 5 chips total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.

Definition at line 342 of file CSCIndexer.h.

IndexType CSCIndexer::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).

Definition at line 88 of file CSCIndexer.h.

LongIndexType CSCIndexer::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'.

Output is 1-217728 (CSCs 2008) or 217729-252288 (ME42).

WARNING: Use at your own risk! You must input labels within hardware ranges. No trapping on out-of-range values!

Definition at line 176 of file CSCIndexer.h.

LongIndexType CSCIndexer::stripChannelIndex ( const CSCDetId id,
IndexType  istrip 
) const
inline

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

Output is 1-217728 (CSCs 2008) or 217729-252288 (ME42).

WARNING: Use at your own risk! The supplied CSCDetId must be a layer id. No trapping on out-of-range values!

Definition at line 189 of file CSCIndexer.h.

IndexType CSCIndexer::stripChannelsPerLayer ( IndexType  is,
IndexType  ir 
) const
inline

Number of strip channels per layer in a chamber in ring ir of station is.

Station label range 1-4, Ring label range 1-3.

WARNING: ME1a channels are the last 16 of the 80 total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.
Considers ME42 as standard 80-strip per layer chambers.

Definition at line 142 of file CSCIndexer.h.

LongIndexType CSCIndexer::stripChannelStart ( IndexType  ie,
IndexType  is,
IndexType  ir 
) const
inline

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-3.

WARNING: ME1a channels are the last 16 of the 80 total in each layer of an ME11 chamber, and an input ir=4 is invalid and will give nonsense.

Definition at line 155 of file CSCIndexer.h.

Member Data Documentation

std::vector<IndexType> CSCIndexer::chamberLabel
mutableprivate

Definition at line 413 of file CSCIndexer.h.