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

Definition at line 34 of file SiStripRegionCabling.h.

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

Cabling typedefs

Definition at line 30 of file SiStripRegionCabling.h.

Definition at line 31 of file SiStripRegionCabling.h.

Encoded information typedefs

Definition at line 43 of file SiStripRegionCabling.h.

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

Position typedefs

Definition at line 38 of file SiStripRegionCabling.h.

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

Definition at line 39 of file SiStripRegionCabling.h.

Definition at line 33 of file SiStripRegionCabling.h.

Definition at line 32 of file SiStripRegionCabling.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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 {}
const uint32_t phidivisions() const
const uint32_t etadivisions() const
SiStripRegionCabling::~SiStripRegionCabling ( )
inline
SiStripRegionCabling::SiStripRegionCabling ( )
inlineprivate

Definition at line 103 of file SiStripRegionCabling.h.

103 { ; }

Member Function Documentation

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

Referenced by elementIndex(), and ~SiStripRegionCabling().

148  {
149  return region * ALLSUBDETS * ALLLAYERS + subdet * ALLLAYERS + layer;
150 }
static const SubDet subdet(const ElementIndex)
const uint32_t region(const Position) const
static const uint32_t layer(const ElementIndex)
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(), and region().

154  {
155  return elementIndex(region(index), subdet, layer);
156 }
static const ElementIndex elementIndex(const uint32_t region, const SubDet, const uint32_t layer)
static const SubDet subdet(const ElementIndex)
const uint32_t region(const Position) const
static const uint32_t layer(const ElementIndex)
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(), and region().

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

Definition at line 120 of file SiStripRegionCabling.h.

References etadivisions_.

Referenced by ~SiStripRegionCabling().

120 { return static_cast<uint32_t>(etadivisions_); }
const SiStripRegionCabling::Cabling & SiStripRegionCabling::getRegionCabling ( ) const
inline

Definition at line 118 of file SiStripRegionCabling.h.

References regioncabling_.

Referenced by SiStripRegFEDSelector::produce(), and ~SiStripRegionCabling().

118 { return regioncabling_; }
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_.

Referenced by ~SiStripRegionCabling().

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
const uint32_t SiStripRegionCabling::layer ( const ElementIndex  index)
inlinestatic
const uint32_t SiStripRegionCabling::phidivisions ( ) const
inline

Definition at line 122 of file SiStripRegionCabling.h.

References phidivisions_.

Referenced by ~SiStripRegionCabling().

122 { return static_cast<uint32_t>(phidivisions_); }
const SiStripRegionCabling::Position SiStripRegionCabling::position ( const uint32_t  region) const
inline

Definition at line 128 of file SiStripRegionCabling.h.

References positionIndex().

Referenced by SiStripRegFEDSelector::produce(), and ~SiStripRegionCabling().

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

Definition at line 133 of file SiStripRegionCabling.h.

References etamax_, plotBeamSpotDB::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 }
const std::pair< double, double > regionDimensions() const
U second(std::pair< T, U > const &p)
#define M_PI
std::pair< double, double > Position
const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex ( const uint32_t  region) const
inline

Definition at line 138 of file SiStripRegionCabling.h.

References phidivisions_.

Referenced by position(), region(), and ~SiStripRegionCabling().

138  {
140 }
std::pair< uint32_t, uint32_t > PositionIndex
const uint32_t region(const Position) const
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, and phidivisions_.

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
#define M_PI
const Position position(const uint32_t) const
void SiStripRegionCabling::print ( std::stringstream &  ss) const

Definition at line 64 of file SiStripRegionCabling.cc.

References triggerObjects_cff::id, regioncabling_, and pileupDistInMC::total.

Referenced by SiStripFedCablingBuilder::beginRun(), SiStripFedCablingReader::beginRun(), and ~SiStripRegionCabling().

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 }
const uint32_t SiStripRegionCabling::region ( const Position  position) const

Definition at line 25 of file SiStripRegionCabling.cc.

References positionIndex().

Referenced by elementIndex(), SiStripRegionConnectivity::produceRegionCabling(), and ~SiStripRegionCabling().

25  {
27  return region(index);
28 }
std::pair< uint32_t, uint32_t > PositionIndex
const PositionIndex positionIndex(const uint32_t) const
const Position position(const uint32_t) const
const uint32_t region(const Position) const
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 }
const uint32_t SiStripRegionCabling::region ( const ElementIndex  index)
inlinestatic
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(), SiStripRegFEDSelector::produce(), and ~SiStripRegionCabling().

124  {
125  return std::pair<double, double>((2. * etamax_) / etadivisions_, 2. * M_PI / phidivisions_);
126 }
#define M_PI
void SiStripRegionCabling::setRegionCabling ( const Cabling regioncabling)
inline

Set and get methods for cabling.

Definition at line 116 of file SiStripRegionCabling.h.

References regioncabling_.

Referenced by SiStripRegionConnectivity::produceRegionCabling(), and ~SiStripRegionCabling().

116 { regioncabling_ = regioncabling; }
const SiStripRegionCabling::SubDet SiStripRegionCabling::subdet ( const ElementIndex  index)
inlinestatic
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(), and ~SiStripRegionCabling().

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 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Definition: DetId.h:18

Member Data Documentation

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

double SiStripRegionCabling::etamax_
private

Tracker extent in eta

Definition at line 110 of file SiStripRegionCabling.h.

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

int SiStripRegionCabling::phidivisions_
private
Cabling SiStripRegionCabling::regioncabling_
private

Cabling

Definition at line 113 of file SiStripRegionCabling.h.

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