CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiStripRegionCabling Class Reference

#include <SiStripRegionCabling.h>

Public Types

typedef std::vector< RegionCablingCabling
 
typedef std::pair< uint32_t, std::vector< FedChannelConnection > > Element
 
typedef std::vector< ElementElementCabling
 
typedef uint32_t ElementIndex
 
enum  Layer {
  TIBLAYERS = 4, TOBLAYERS = 6, TIDLAYERS = 3, TECLAYERS = 9,
  ALLLAYERS = 10
}
 
typedef std::pair< double, double > Position
 
typedef std::pair< uint32_t, uint32_t > PositionIndex
 
typedef std::vector< WedgeCablingRegionCabling
 
enum  SubDet {
  TIB = 0, TOB = 1, TID = 2, TEC = 3,
  ALLSUBDETS = 4
}
 
typedef std::vector< ElementCablingWedgeCabling
 

Public Member Functions

const ElementIndex elementIndex (const Position, const SubDet, const uint32_t layer) const
 
const ElementIndex elementIndex (const PositionIndex, const SubDet, const uint32_t layer) const
 
const uint32_t etadivisions () const
 
const CablinggetRegionCabling () const
 
PositionIndex increment (const PositionIndex, int, int) const
 
const uint32_t phidivisions () const
 
const Position position (const PositionIndex) const
 
const Position position (const uint32_t) const
 
const PositionIndex positionIndex (const Position) const
 
const PositionIndex positionIndex (const uint32_t) const
 
void print (std::stringstream &) const
 
const uint32_t region (const Position) const
 
const uint32_t region (const PositionIndex) const
 
const std::pair< double, double > regionDimensions () const
 
void setRegionCabling (const Cabling &)
 
 SiStripRegionCabling (const uint32_t, const uint32_t, const double)
 
 ~SiStripRegionCabling ()
 

Static Public Member Functions

static const ElementIndex elementIndex (const uint32_t region, const SubDet, const uint32_t layer)
 
static const uint32_t layer (const ElementIndex)
 
static const uint32_t region (const ElementIndex)
 
static const SubDet subdet (const ElementIndex)
 

Private Member Functions

 SiStripRegionCabling ()
 

Private Attributes

int etadivisions_
 
double etamax_
 
int phidivisions_
 
Cabling regioncabling_
 

Detailed Description

Author: pwing Package: CalibFormats/SiStripObjects Class: SiStripRegionCabling Description: Gives a regional view of the silicon strip tracker cabling. Cabling is divided into (eta,phi) "regions". A "region" within a given sub-detector is called a "wedge". A layer within a given wedge is called an "element".

Definition at line 23 of file SiStripRegionCabling.h.

Member Typedef Documentation

◆ Cabling

Definition at line 34 of file SiStripRegionCabling.h.

◆ Element

typedef std::pair<uint32_t, std::vector<FedChannelConnection> > SiStripRegionCabling::Element

Cabling typedefs

Definition at line 30 of file SiStripRegionCabling.h.

◆ ElementCabling

Definition at line 31 of file SiStripRegionCabling.h.

◆ ElementIndex

Encoded information typedefs

Definition at line 43 of file SiStripRegionCabling.h.

◆ Position

typedef std::pair<double, double> SiStripRegionCabling::Position

Position typedefs

Definition at line 38 of file SiStripRegionCabling.h.

◆ PositionIndex

typedef std::pair<uint32_t, uint32_t> SiStripRegionCabling::PositionIndex

Definition at line 39 of file SiStripRegionCabling.h.

◆ RegionCabling

Definition at line 33 of file SiStripRegionCabling.h.

◆ WedgeCabling

Definition at line 32 of file SiStripRegionCabling.h.

Member Enumeration Documentation

◆ Layer

Enumerator
TIBLAYERS 
TOBLAYERS 
TIDLAYERS 
TECLAYERS 
ALLLAYERS 

Definition at line 27 of file SiStripRegionCabling.h.

27 { TIBLAYERS = 4, TOBLAYERS = 6, TIDLAYERS = 3, TECLAYERS = 9, ALLLAYERS = 10 };

◆ SubDet

enums

Enumerator
TIB 
TOB 
TID 
TEC 
ALLSUBDETS 

Definition at line 26 of file SiStripRegionCabling.h.

26 { TIB = 0, TOB = 1, TID = 2, TEC = 3, ALLSUBDETS = 4 };

Constructor & Destructor Documentation

◆ SiStripRegionCabling() [1/2]

SiStripRegionCabling::SiStripRegionCabling ( const uint32_t  etadivisions,
const uint32_t  phidivisions,
const double  etamax 
)

Definition at line 7 of file SiStripRegionCabling.cc.

10  :
11 
12  etadivisions_(static_cast<int>(etadivisions)),
13  phidivisions_(static_cast<int>(phidivisions)),
14  etamax_(etamax),
16 
17 {}

◆ ~SiStripRegionCabling()

SiStripRegionCabling::~SiStripRegionCabling ( )
inline

Definition at line 47 of file SiStripRegionCabling.h.

47 {}

◆ SiStripRegionCabling() [2/2]

SiStripRegionCabling::SiStripRegionCabling ( )
inlineprivate

Definition at line 103 of file SiStripRegionCabling.h.

103 { ; }

Member Function Documentation

◆ elementIndex() [1/3]

const uint32_t SiStripRegionCabling::elementIndex ( const Position  position,
const SubDet  subdet,
const uint32_t  layer 
) const
inline

Definition at line 158 of file SiStripRegionCabling.h.

160  {
162 }

References elementIndex(), layer(), position(), region(), and subdet().

◆ elementIndex() [2/3]

const uint32_t SiStripRegionCabling::elementIndex ( const PositionIndex  index,
const SubDet  subdet,
const uint32_t  layer 
) const
inline

Definition at line 152 of file SiStripRegionCabling.h.

154  {
155  return elementIndex(region(index), subdet, layer);
156 }

References elementIndex(), layer(), region(), and subdet().

◆ elementIndex() [3/3]

const uint32_t SiStripRegionCabling::elementIndex ( const uint32_t  region,
const SubDet  subdet,
const uint32_t  layer 
)
inlinestatic

Methods for interchanging between region-subdet-layer and the corresponding element index.

Definition at line 146 of file SiStripRegionCabling.h.

148  {
149  return region * ALLSUBDETS * ALLLAYERS + subdet * ALLLAYERS + layer;
150 }

References ALLLAYERS, ALLSUBDETS, layer(), region(), and subdet().

Referenced by elementIndex().

◆ etadivisions()

const uint32_t SiStripRegionCabling::etadivisions ( ) const
inline

Definition at line 120 of file SiStripRegionCabling.h.

120 { return static_cast<uint32_t>(etadivisions_); }

References etadivisions_.

◆ getRegionCabling()

const SiStripRegionCabling::Cabling & SiStripRegionCabling::getRegionCabling ( ) const
inline

◆ increment()

SiStripRegionCabling::PositionIndex SiStripRegionCabling::increment ( const PositionIndex  index,
int  deta,
int  dphi 
) const

Method for incrementing position index.

Definition at line 30 of file SiStripRegionCabling.cc.

32  {
33  int eta = static_cast<int>(index.first) + deta;
34  if (eta > etadivisions_ - 1)
35  eta = etadivisions_ - 1;
36  else if (eta < 0)
37  eta = 0;
38 
39  int phi = static_cast<int>(index.second) + dphi;
40  while (phi < 0)
41  phi += phidivisions_;
42  while (phi > phidivisions_ - 1)
43  phi -= phidivisions_;
44 
45  return PositionIndex(static_cast<uint32_t>(eta), static_cast<uint32_t>(phi));
46 }

References PVValHelper::eta, etadivisions_, phi, and phidivisions_.

◆ layer()

const uint32_t SiStripRegionCabling::layer ( const  ElementIndex)
inlinestatic

◆ phidivisions()

const uint32_t SiStripRegionCabling::phidivisions ( ) const
inline

Definition at line 122 of file SiStripRegionCabling.h.

122 { return static_cast<uint32_t>(phidivisions_); }

References phidivisions_.

◆ position() [1/2]

const SiStripRegionCabling::Position SiStripRegionCabling::position ( const PositionIndex  index) const
inline

Definition at line 133 of file SiStripRegionCabling.h.

133  {
134  return Position(regionDimensions().first * (index.first + .5) - etamax_,
135  regionDimensions().second * (index.second + .5) - M_PI);
136 }

References etamax_, first, M_PI, regionDimensions(), and edm::second().

◆ position() [2/2]

const SiStripRegionCabling::Position SiStripRegionCabling::position ( const uint32_t  region) const
inline

Definition at line 128 of file SiStripRegionCabling.h.

128  {
130  return position(index);
131 }

References positionIndex(), and region().

Referenced by elementIndex(), positionIndex(), SiStripRegFEDSelector::produce(), and region().

◆ positionIndex() [1/2]

const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex ( const Position  position) const

Definition at line 19 of file SiStripRegionCabling.cc.

19  {
20  int eta = static_cast<int>((position.first + etamax_) * etadivisions_ / (2. * etamax_));
21  int phi = static_cast<int>((position.second + M_PI) * phidivisions_ / (2. * M_PI));
22  return PositionIndex(static_cast<uint32_t>(eta), static_cast<uint32_t>(phi));
23 }

References PVValHelper::eta, etadivisions_, etamax_, M_PI, phi, phidivisions_, and position().

◆ positionIndex() [2/2]

const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex ( const uint32_t  region) const
inline

Definition at line 138 of file SiStripRegionCabling.h.

138  {
140 }

References phidivisions_, and region().

Referenced by position(), and region().

◆ print()

void SiStripRegionCabling::print ( std::stringstream &  ss) const

Methods for extracting det-id information *‍/

static const SubDet subdetFromDetId(const uint32_t detid);

/**

Definition at line 64 of file SiStripRegionCabling.cc.

64  {
65  uint32_t valid = 0;
66  uint32_t total = 0;
67  ss << "[SiStripRegionCabling::" << __func__ << "] Printing REGION cabling:" << std::endl;
68  ss << "Printing cabling for " << regioncabling_.size() << " regions" << std::endl;
69  Cabling::const_iterator id = regioncabling_.begin();
70  Cabling::const_iterator jd = regioncabling_.end();
71  for (; id != jd; ++id) {
72  ss << "Printing cabling for " << id->size() << " regions for partition "
73  << static_cast<int32_t>(id - regioncabling_.begin()) << std::endl;
74  RegionCabling::const_iterator ir = id->begin();
75  RegionCabling::const_iterator jr = id->end();
76  for (; ir != jr; ++ir) {
77  ss << "Printing cabling for " << ir->size() << " wedges for region " << static_cast<int32_t>(ir - id->begin())
78  << std::endl;
79  WedgeCabling::const_iterator iw = ir->begin();
80  WedgeCabling::const_iterator jw = ir->end();
81  for (; iw != jw; ++iw) {
82  ss << "Printing cabling for " << iw->size() << " elements for wedge " << static_cast<int32_t>(iw - ir->begin())
83  << std::endl;
84  ElementCabling::const_iterator ie = iw->begin();
85  ElementCabling::const_iterator je = iw->end();
86  for (; ie != je; ++ie) {
87  ss << "Printing cabling for " << ie->second.size() << " connections for element (DetId) " << ie->first
88  << std::endl;
89  std::vector<FedChannelConnection>::const_iterator ic = ie->second.begin();
90  std::vector<FedChannelConnection>::const_iterator jc = ie->second.end();
91  for (; ic != jc; ++ic) {
92  if (ic->isConnected()) {
93  valid++;
94  }
95  total++;
96  ic->print(ss);
97  ss << std::endl;
98  }
99  }
100  }
101  }
102  }
103  ss << "Number of connected: " << valid << std::endl << "Number of connections: " << total << std::endl;
104 }

References triggerObjects_cff::id, regioncabling_, contentValuesCheck::ss, dqmMemoryStats::total, and RunInfoPI::valid.

◆ region() [1/3]

const uint32_t SiStripRegionCabling::region ( const  ElementIndex)
inlinestatic

Definition at line 170 of file SiStripRegionCabling.h.

170 { return index / (ALLSUBDETS * ALLLAYERS); }

References ALLLAYERS, and ALLSUBDETS.

◆ region() [2/3]

const uint32_t SiStripRegionCabling::region ( const Position  position) const

Definition at line 25 of file SiStripRegionCabling.cc.

25  {
27  return region(index);
28 }

References position(), and positionIndex().

Referenced by elementIndex(), position(), and positionIndex().

◆ region() [3/3]

const uint32_t SiStripRegionCabling::region ( const PositionIndex  index) const
inline

Definition at line 142 of file SiStripRegionCabling.h.

142  {
143  return index.first * phidivisions_ + index.second;
144 }

References phidivisions_.

◆ regionDimensions()

const std::pair< double, double > SiStripRegionCabling::regionDimensions ( ) const
inline

Methods for interchanging between region, region-index and eta/phi-position.

Definition at line 124 of file SiStripRegionCabling.h.

124  {
125  return std::pair<double, double>((2. * etamax_) / etadivisions_, 2. * M_PI / phidivisions_);
126 }

References etadivisions_, etamax_, M_PI, and phidivisions_.

Referenced by position(), and SiStripRegFEDSelector::produce().

◆ setRegionCabling()

void SiStripRegionCabling::setRegionCabling ( const Cabling regioncabling)
inline

Set and get methods for cabling.

Definition at line 116 of file SiStripRegionCabling.h.

116 { regioncabling_ = regioncabling; }

References regioncabling_.

◆ subdet()

const SiStripRegionCabling::SubDet SiStripRegionCabling::subdet ( const  ElementIndex)
inlinestatic

Definition at line 166 of file SiStripRegionCabling.h.

166  {
167  return static_cast<SiStripRegionCabling::SubDet>((index / ALLLAYERS) % ALLSUBDETS);
168 }

References ALLLAYERS, and ALLSUBDETS.

Referenced by elementIndex().

Member Data Documentation

◆ etadivisions_

int SiStripRegionCabling::etadivisions_
private

Number of regions in eta,phi

Definition at line 106 of file SiStripRegionCabling.h.

Referenced by etadivisions(), increment(), positionIndex(), and regionDimensions().

◆ etamax_

double SiStripRegionCabling::etamax_
private

Tracker extent in eta

Definition at line 110 of file SiStripRegionCabling.h.

Referenced by position(), positionIndex(), and regionDimensions().

◆ phidivisions_

int SiStripRegionCabling::phidivisions_
private

◆ regioncabling_

Cabling SiStripRegionCabling::regioncabling_
private

Cabling

Definition at line 113 of file SiStripRegionCabling.h.

Referenced by getRegionCabling(), print(), and setRegionCabling().

SiStripRegionCabling::Position
std::pair< double, double > Position
Definition: SiStripRegionCabling.h:38
SiStripRegionCabling::ALLLAYERS
Definition: SiStripRegionCabling.h:27
SiStripRegionCabling::TIBLAYERS
Definition: SiStripRegionCabling.h:27
SiStripRegionCabling::TID
Definition: SiStripRegionCabling.h:26
SiStripRegionCabling::TOB
Definition: SiStripRegionCabling.h:26
SiStripRegionCabling::positionIndex
const PositionIndex positionIndex(const uint32_t) const
Definition: SiStripRegionCabling.h:138
SiStripRegionCabling::position
const Position position(const uint32_t) const
Definition: SiStripRegionCabling.h:128
SiStripRegionCabling::ALLSUBDETS
Definition: SiStripRegionCabling.h:26
SiStripRegionCabling::phidivisions_
int phidivisions_
Definition: SiStripRegionCabling.h:107
SiStripRegionCabling::elementIndex
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
Definition: SiStripRegionCabling.h:146
SiStripRegionCabling::TOBLAYERS
Definition: SiStripRegionCabling.h:27
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
SiStripRegionCabling::layer
static const uint32_t layer(const ElementIndex)
Definition: SiStripRegionCabling.h:164
SiStripRegionCabling::TEC
Definition: SiStripRegionCabling.h:26
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripRegionCabling::TECLAYERS
Definition: SiStripRegionCabling.h:27
PVValHelper::eta
Definition: PVValidationHelpers.h:70
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
SiStripRegionCabling::etadivisions
const uint32_t etadivisions() const
Definition: SiStripRegionCabling.h:120
SiStripRegionCabling::etamax_
double etamax_
Definition: SiStripRegionCabling.h:110
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
SiStripRegionCabling::etadivisions_
int etadivisions_
Definition: SiStripRegionCabling.h:106
SiStripRegionCabling::TIB
Definition: SiStripRegionCabling.h:26
SiStripRegionCabling::phidivisions
const uint32_t phidivisions() const
Definition: SiStripRegionCabling.h:122
DDAxes::phi
SiStripRegionCabling::region
const uint32_t region(const Position) const
Definition: SiStripRegionCabling.cc:25
SiStripRegionCabling::regioncabling_
Cabling regioncabling_
Definition: SiStripRegionCabling.h:113
SiStripRegionCabling::TIDLAYERS
Definition: SiStripRegionCabling.h:27
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
muonTiming_cfi.etamax
etamax
Definition: muonTiming_cfi.py:23
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
dqmMemoryStats.total
total
Definition: dqmMemoryStats.py:152
SiStripRegionCabling::PositionIndex
std::pair< uint32_t, uint32_t > PositionIndex
Definition: SiStripRegionCabling.h:39
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
SiStripRegionCabling::regionDimensions
const std::pair< double, double > regionDimensions() const
Definition: SiStripRegionCabling.h:124
SiStripRegionCabling::subdet
static const SubDet subdet(const ElementIndex)
Definition: SiStripRegionCabling.h:166