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 36 of file SiStripRegionCabling.h.

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

Cabling typedefs

Definition at line 32 of file SiStripRegionCabling.h.

Definition at line 33 of file SiStripRegionCabling.h.

Encoded information typedefs

Definition at line 45 of file SiStripRegionCabling.h.

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

Position typedefs

Definition at line 40 of file SiStripRegionCabling.h.

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

Definition at line 41 of file SiStripRegionCabling.h.

Definition at line 35 of file SiStripRegionCabling.h.

Definition at line 34 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.

7  :
8 
9  etadivisions_(static_cast<int>(etadivisions)),
10  phidivisions_(static_cast<int>(phidivisions)),
11  etamax_(etamax),
13 
14 {}
const uint32_t phidivisions() const
const uint32_t etadivisions() const
SiStripRegionCabling::~SiStripRegionCabling ( )
inline
SiStripRegionCabling::SiStripRegionCabling ( )
inlineprivate

Definition at line 106 of file SiStripRegionCabling.h.

106 {;}

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 156 of file SiStripRegionCabling.h.

References ALLLAYERS, ALLSUBDETS, and layer().

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

156  {
158 }
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 160 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 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 164 of file SiStripRegionCabling.h.

References elementIndex(), and region().

164  {
166 }
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 127 of file SiStripRegionCabling.h.

References etadivisions_.

Referenced by ~SiStripRegionCabling().

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

Definition at line 123 of file SiStripRegionCabling.h.

References regioncabling_.

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

123  {
124  return regioncabling_;
125 }
SiStripRegionCabling::PositionIndex SiStripRegionCabling::increment ( const PositionIndex  index,
int  deta,
int  dphi 
) const

Method for incrementing position index.

Definition at line 27 of file SiStripRegionCabling.cc.

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

Referenced by ~SiStripRegionCabling().

27  {
28 
29  int eta = static_cast<int>(index.first)+deta;
30  if (eta > etadivisions_-1) eta = etadivisions_-1;
31  else if (eta < 0) eta = 0;
32 
33  int phi = static_cast<int>(index.second)+dphi;
34  while (phi<0) phi+=phidivisions_;
35  while (phi>phidivisions_-1) phi-=phidivisions_;
36 
37  return PositionIndex(static_cast<uint32_t>(eta),static_cast<uint32_t>(phi));
38 }
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 131 of file SiStripRegionCabling.h.

References phidivisions_.

Referenced by ~SiStripRegionCabling().

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

Definition at line 139 of file SiStripRegionCabling.h.

References diffTreeTool::index, and positionIndex().

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

139  {
141  return position(index);
142 }
const PositionIndex positionIndex(const uint32_t) const
const Position position(const uint32_t) const
const uint32_t region(const Position) const
std::pair< uint32_t, uint32_t > PositionIndex
const SiStripRegionCabling::Position SiStripRegionCabling::position ( const PositionIndex  index) const
inline

Definition at line 144 of file SiStripRegionCabling.h.

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

144  {
145  return Position(regionDimensions().first*(index.first+.5) - etamax_, regionDimensions().second*(index.second+.5)- M_PI);
146 }
const std::pair< double, double > regionDimensions() const
U second(std::pair< T, U > const &p)
std::pair< double, double > Position
#define M_PI
const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex ( const uint32_t  region) const
inline

Definition at line 148 of file SiStripRegionCabling.h.

References phidivisions_.

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

148  {
150 }
const uint32_t region(const Position) const
std::pair< uint32_t, uint32_t > PositionIndex
const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex ( const Position  position) const

Definition at line 16 of file SiStripRegionCabling.cc.

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

16  {
17  int eta = static_cast<int>((position.first+etamax_)*etadivisions_/(2.*etamax_));
18  int phi = static_cast<int>((position.second+M_PI)*phidivisions_/(2.*M_PI));
19  return PositionIndex(static_cast<uint32_t>(eta),static_cast<uint32_t>(phi));
20 }
#define M_PI
const Position position(const uint32_t) const
std::pair< uint32_t, uint32_t > PositionIndex
void SiStripRegionCabling::print ( std::stringstream &  ss) const

Definition at line 51 of file SiStripRegionCabling.cc.

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

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

51  {
52  uint32_t valid = 0;
53  uint32_t total = 0;
54  ss << "[SiStripRegionCabling::" << __func__ << "] Printing REGION cabling:" << std::endl;
55  ss << "Printing cabling for " << regioncabling_.size() << " regions" << std::endl;
56  Cabling::const_iterator id = regioncabling_.begin();
57  Cabling::const_iterator jd = regioncabling_.end();
58  for ( ; id != jd; ++id ) {
59  ss << "Printing cabling for " << id->size()
60  << " regions for partition " << static_cast<int32_t>( id - regioncabling_.begin() )
61  << std::endl;
62  RegionCabling::const_iterator ir = id->begin();
63  RegionCabling::const_iterator jr = id->end();
64  for ( ; ir != jr; ++ir ) {
65  ss << "Printing cabling for " << ir->size()
66  << " wedges for region " << static_cast<int32_t>( ir - id->begin() )
67  << std::endl;
68  WedgeCabling::const_iterator iw = ir->begin();
69  WedgeCabling::const_iterator jw = ir->end();
70  for ( ; iw != jw; ++iw ) {
71  ss << "Printing cabling for " << iw->size()
72  << " elements for wedge " << static_cast<int32_t>( iw - ir->begin() )
73  << std::endl;
74  ElementCabling::const_iterator ie = iw->begin();
75  ElementCabling::const_iterator je = iw->end();
76  for ( ; ie != je; ++ie ) {
77  ss << "Printing cabling for " << ie->second.size()
78  << " connections for element (DetId) " << ie->first
79  << std::endl;
80  std::vector<FedChannelConnection>::const_iterator ic = ie->second.begin();
81  std::vector<FedChannelConnection>::const_iterator jc = ie->second.end();
82  for ( ; ic != jc; ++ic ) {
83  if ( ic->isConnected() ) { valid++; }
84  total++;
85  ic->print(ss);
86  ss << std::endl;
87  }
88  }
89  }
90  }
91  }
92  ss << "Number of connected: " << valid << std::endl
93  << "Number of connections: " << total << std::endl;
94 }
const uint32_t SiStripRegionCabling::region ( const Position  position) const

Definition at line 22 of file SiStripRegionCabling.cc.

References diffTreeTool::index, and positionIndex().

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

22  {
24  return region(index);
25 }
const PositionIndex positionIndex(const uint32_t) const
const Position position(const uint32_t) const
const uint32_t region(const Position) const
std::pair< uint32_t, uint32_t > PositionIndex
const uint32_t SiStripRegionCabling::region ( const PositionIndex  index) const
inline

Definition at line 152 of file SiStripRegionCabling.h.

References phidivisions_.

152  {
153  return index.first*phidivisions_ + index.second;
154 }
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 135 of file SiStripRegionCabling.h.

References etadivisions_, etamax_, M_PI, and phidivisions_.

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

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

Set and get methods for cabling.

Definition at line 119 of file SiStripRegionCabling.h.

References regioncabling_.

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

119  {
120  regioncabling_ = regioncabling;
121 }
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 40 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().

40  {
41  DetId detectorId=DetId(detid);
42  if (detectorId.subdetId() == StripSubdetector::TIB) return TIB;
43  else if (detectorId.subdetId() == StripSubdetector::TID) return TID;
44  else if (detectorId.subdetId() == StripSubdetector::TOB) return TOB;
45  else if (detectorId.subdetId() == StripSubdetector::TEC) return TEC;
46  else return ALLSUBDETS;
47 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18

Member Data Documentation

int SiStripRegionCabling::etadivisions_
private

Number of regions in eta,phi

Definition at line 109 of file SiStripRegionCabling.h.

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

double SiStripRegionCabling::etamax_
private

Tracker extent in eta

Definition at line 113 of file SiStripRegionCabling.h.

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

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

Cabling

Definition at line 116 of file SiStripRegionCabling.h.

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