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 PositionIndex, const SubDet, const uint32_t layer) const
 
const ElementIndex elementIndex (const Position, 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 uint32_t) const
 
const Position position (const PositionIndex) const
 
const PositionIndex positionIndex (const uint32_t) const
 
const PositionIndex positionIndex (const Position) 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)
 
static const SubDet subdetFromDetId (const uint32_t detid)
 

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

◆ SubDet

Constructor & Destructor Documentation

◆ SiStripRegionCabling() [1/2]

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

◆ ~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 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.

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

Referenced by elementIndex().

148  {
149  return region * ALLSUBDETS * ALLLAYERS + subdet * ALLLAYERS + layer;
150 }
const uint32_t region(const Position) const
static const SubDet subdet(const ElementIndex)
static const uint32_t layer(const ElementIndex)

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

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

154  {
155  return elementIndex(region(index), subdet, layer);
156 }
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
const uint32_t region(const Position) const
static const SubDet subdet(const ElementIndex)
static const uint32_t layer(const ElementIndex)

◆ elementIndex() [3/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.

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

160  {
162 }
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
const Position position(const uint32_t) const
const uint32_t region(const Position) const
static const SubDet subdet(const ElementIndex)
static const uint32_t layer(const ElementIndex)

◆ etadivisions()

const uint32_t SiStripRegionCabling::etadivisions ( ) const
inline

Definition at line 120 of file SiStripRegionCabling.h.

References etadivisions_.

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

◆ getRegionCabling()

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

Definition at line 118 of file SiStripRegionCabling.h.

References regioncabling_.

Referenced by SiStripRegFEDSelector::produce().

118 { return regioncabling_; }

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

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

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 }
std::pair< uint32_t, uint32_t > PositionIndex

◆ layer()

const uint32_t SiStripRegionCabling::layer ( const ElementIndex  index)
inlinestatic

◆ phidivisions()

const uint32_t SiStripRegionCabling::phidivisions ( ) const
inline

Definition at line 122 of file SiStripRegionCabling.h.

References phidivisions_.

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

◆ position() [1/2]

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

Definition at line 128 of file SiStripRegionCabling.h.

References positionIndex(), and region().

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

128  {
130  return position(index);
131 }
std::pair< uint32_t, uint32_t > PositionIndex
const Position position(const uint32_t) const
const uint32_t region(const Position) const
const PositionIndex positionIndex(const uint32_t) const

◆ position() [2/2]

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

Definition at line 133 of file SiStripRegionCabling.h.

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

133  {
134  return Position(regionDimensions().first * (index.first + .5) - etamax_,
135  regionDimensions().second * (index.second + .5) - M_PI);
136 }
U second(std::pair< T, U > const &p)
#define M_PI
std::pair< double, double > Position
const std::pair< double, double > regionDimensions() const

◆ positionIndex() [1/2]

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

Definition at line 138 of file SiStripRegionCabling.h.

References phidivisions_, and region().

Referenced by position(), and region().

138  {
140 }
std::pair< uint32_t, uint32_t > PositionIndex
const uint32_t region(const Position) const

◆ positionIndex() [2/2]

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

Definition at line 19 of file SiStripRegionCabling.cc.

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

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 }
std::pair< uint32_t, uint32_t > PositionIndex
const Position position(const uint32_t) const
#define M_PI

◆ print()

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

Definition at line 64 of file SiStripRegionCabling.cc.

References l1ctLayer2EG_cff::id, regioncabling_, contentValuesCheck::ss, dqmMemoryStats::total, and validateGeometry_cfg::valid.

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 }

◆ region() [1/3]

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

Definition at line 25 of file SiStripRegionCabling.cc.

References position(), and positionIndex().

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

25  {
27  return region(index);
28 }
std::pair< uint32_t, uint32_t > PositionIndex
const Position position(const uint32_t) const
const uint32_t region(const Position) const
const PositionIndex positionIndex(const uint32_t) const

◆ region() [2/3]

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

Definition at line 142 of file SiStripRegionCabling.h.

References phidivisions_.

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

◆ region() [3/3]

const uint32_t SiStripRegionCabling::region ( const ElementIndex  index)
inlinestatic

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

References etadivisions_, etamax_, M_PI, and phidivisions_.

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

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

◆ setRegionCabling()

void SiStripRegionCabling::setRegionCabling ( const Cabling regioncabling)
inline

Set and get methods for cabling.

Definition at line 116 of file SiStripRegionCabling.h.

References regioncabling_.

116 { regioncabling_ = regioncabling; }

◆ subdet()

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

◆ subdetFromDetId()

const SiStripRegionCabling::SubDet SiStripRegionCabling::subdetFromDetId ( const uint32_t  detid)
static

Methods for extracting det-id information

Definition at line 48 of file SiStripRegionCabling.cc.

References ALLSUBDETS, DetId::subdetId(), StripSubdetector::TEC, TEC, StripSubdetector::TIB, TIB, StripSubdetector::TID, TID, StripSubdetector::TOB, and TOB.

Referenced by SiStripRegionConnectivity::produceRegionCabling().

48  {
49  DetId detectorId = DetId(detid);
50  if (detectorId.subdetId() == StripSubdetector::TIB)
51  return TIB;
52  else if (detectorId.subdetId() == StripSubdetector::TID)
53  return TID;
54  else if (detectorId.subdetId() == StripSubdetector::TOB)
55  return TOB;
56  else if (detectorId.subdetId() == StripSubdetector::TEC)
57  return TEC;
58  else
59  return ALLSUBDETS;
60 }
static constexpr auto TEC
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TIB
static constexpr auto TID

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