#include <CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h>
Public Types | |
typedef std::vector < RegionCabling > | Cabling |
typedef std::map< uint32_t, std::vector < FedChannelConnection > > | ElementCabling |
Cabling typedefs. | |
typedef uint32_t | ElementIndex |
Encoded information typedefs. | |
enum | Layer { TIBLAYERS = 4, TOBLAYERS = 6, TIDLAYERS = 3, TECLAYERS = 9, ALLLAYERS = 10 } |
typedef std::pair< double, double > | Position |
Position typedefs. | |
typedef std::pair< uint32_t, uint32_t > | PositionIndex |
typedef std::vector< WedgeCabling > | RegionCabling |
enum | SubDet { TIB = 0, TOB = 1, TID = 2, TEC = 3, ALLSUBDETS = 4 } |
enums More... | |
typedef std::vector < ElementCabling > | WedgeCabling |
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 Cabling & | getRegionCabling () const |
PositionIndex | increment (const PositionIndex, int, int) const |
Method for incrementing position index. | |
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 |
const uint32_t | region (const PositionIndex) const |
const uint32_t | region (const Position) const |
const std::pair< double, double > | regionDimensions () const |
Methods for interchanging between region, region-index and eta/phi-position. | |
void | setRegionCabling (const Cabling &) |
Set and get methods for cabling. | |
SiStripRegionCabling (const uint32_t, const uint32_t, const double) | |
template<class T> | |
void | updateSiStripRefGetter (edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const Position position, const double deltaeta, const double deltaphi, const SubDet subdet, const uint32_t layer) const |
template<class T> | |
void | updateSiStripRefGetter (edm::RefGetter< T > &refgetter, const edm::Handle< edm::LazyGetter< T > > &lazygetter, const ElementIndex) const |
Methods for updating a SiStripRefGetter<T> container with elements of interest. | |
~SiStripRegionCabling () | |
Static Public Member Functions | |
static const ElementIndex | elementIndex (const uint32_t region, const SubDet, const uint32_t layer) |
Methods for interchanging between region-subdet-layer and the corresponding element index. | |
static const uint32_t | layer (const ElementIndex) |
static const uint32_t | layerFromDetId (const uint32_t detid) |
static const uint32_t | physicalLayer (const SubDet, const uint32_t layer) |
static const uint32_t | physicalLayerFromDetId (const uint32_t detid) |
static const uint32_t | region (const ElementIndex) |
static const SubDet | subdet (const ElementIndex) |
static const SubDet | subdetFromDetId (const uint32_t detid) |
Methods for extracting det-id information. | |
Private Member Functions | |
SiStripRegionCabling () | |
Private Attributes | |
int | etadivisions_ |
Number of regions in eta,phi. | |
double | etamax_ |
Tracker extent in eta. | |
int | phidivisions_ |
Cabling | regioncabling_ |
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 24 of file SiStripRegionCabling.h.
typedef std::vector< RegionCabling > SiStripRegionCabling::Cabling |
Definition at line 36 of file SiStripRegionCabling.h.
typedef std::map< uint32_t, std::vector<FedChannelConnection> > SiStripRegionCabling::ElementCabling |
typedef uint32_t SiStripRegionCabling::ElementIndex |
typedef std::pair<double,double> SiStripRegionCabling::Position |
typedef std::pair<uint32_t,uint32_t> SiStripRegionCabling::PositionIndex |
Definition at line 41 of file SiStripRegionCabling.h.
typedef std::vector< WedgeCabling > SiStripRegionCabling::RegionCabling |
Definition at line 35 of file SiStripRegionCabling.h.
typedef std::vector< ElementCabling > SiStripRegionCabling::WedgeCabling |
Definition at line 34 of file SiStripRegionCabling.h.
enums
Definition at line 29 of file SiStripRegionCabling.h.
00029 {TIB = 0, TOB = 1, TID = 2, TEC = 3, ALLSUBDETS = 4};
SiStripRegionCabling::SiStripRegionCabling | ( | const | uint32_t, | |
const | uint32_t, | |||
const | double | |||
) |
Definition at line 10 of file SiStripRegionCabling.cc.
00010 : 00011 00012 etadivisions_(static_cast<int>(etadivisions)), 00013 phidivisions_(static_cast<int>(phidivisions)), 00014 etamax_(etamax), 00015 regioncabling_() 00016 00017 {}
SiStripRegionCabling::~SiStripRegionCabling | ( | ) | [inline] |
SiStripRegionCabling::SiStripRegionCabling | ( | ) | [inline, private] |
const uint32_t SiStripRegionCabling::elementIndex | ( | const | Position, | |
const | SubDet, | |||
const uint32_t | layer | |||
) | const [inline] |
Definition at line 184 of file SiStripRegionCabling.h.
References elementIndex(), and region().
00184 { 00185 return elementIndex(region(position),subdet,layer); 00186 }
const uint32_t SiStripRegionCabling::elementIndex | ( | const | PositionIndex, | |
const | SubDet, | |||
const uint32_t | layer | |||
) | const [inline] |
Definition at line 180 of file SiStripRegionCabling.h.
References elementIndex(), and region().
00180 { 00181 return elementIndex(region(index),subdet,layer); 00182 }
const uint32_t SiStripRegionCabling::elementIndex | ( | const uint32_t | region, | |
const | SubDet, | |||
const uint32_t | layer | |||
) | [inline, static] |
Methods for interchanging between region-subdet-layer and the corresponding element index.
Definition at line 176 of file SiStripRegionCabling.h.
References ALLLAYERS, and ALLSUBDETS.
Referenced by HITSiStripRawToClustersRoI::beginJob(), elementIndex(), OnDemandMeasurementTracker::OnDemandMeasurementTracker(), HITSiStripRawToClustersRoI::random(), SiStripRawToClustersRoI::random(), SiStripRawToClustersRoI::updateCabling(), and updateSiStripRefGetter().
const uint32_t SiStripRegionCabling::etadivisions | ( | ) | const [inline] |
Definition at line 147 of file SiStripRegionCabling.h.
References etadivisions_.
00147 { 00148 return static_cast<uint32_t>(etadivisions_); 00149 }
const SiStripRegionCabling::Cabling & SiStripRegionCabling::getRegionCabling | ( | ) | const [inline] |
Definition at line 143 of file SiStripRegionCabling.h.
References regioncabling_.
Referenced by SiStripRawToClusters::produce(), SiStripRawToClustersRoI::random(), and SiStripRawToClustersRoI::updateCabling().
00143 { 00144 return regioncabling_; 00145 }
SiStripRegionCabling::PositionIndex SiStripRegionCabling::increment | ( | const | PositionIndex, | |
int | deta, | |||
int | dphi | |||
) | const |
Method for incrementing position index.
Definition at line 30 of file SiStripRegionCabling.cc.
References eta, etadivisions_, phi, and phidivisions_.
Referenced by updateSiStripRefGetter().
00030 { 00031 00032 int eta = static_cast<int>(index.first)+deta; 00033 if (eta > etadivisions_-1) eta = etadivisions_-1; 00034 else if (eta < 0) eta = 0; 00035 00036 int phi = static_cast<int>(index.second)+dphi; 00037 while (phi<0) phi+=phidivisions_; 00038 while (phi>phidivisions_-1) phi-=phidivisions_; 00039 00040 return PositionIndex(static_cast<uint32_t>(eta),static_cast<uint32_t>(phi)); 00041 }
const uint32_t SiStripRegionCabling::layer | ( | const | ElementIndex | ) | [inline, static] |
Definition at line 188 of file SiStripRegionCabling.h.
References ALLLAYERS.
Referenced by SiStripRawToClustersLazyUnpacker::fill().
const uint32_t SiStripRegionCabling::layerFromDetId | ( | const uint32_t | detid | ) | [static] |
Definition at line 53 of file SiStripRegionCabling.cc.
References ALLLAYERS, subdet(), subdetFromDetId(), TEC, TIB, TID, and TOB.
Referenced by OnDemandMeasurementTracker::OnDemandMeasurementTracker(), physicalLayerFromDetId(), and SiStripRegionConnectivity::produceRegionCabling().
00053 { 00054 00055 SiStripRegionCabling::SubDet subdet = subdetFromDetId(detid); 00056 if (subdet == TIB) return TIBDetId(detid).layer(); 00057 else if (subdet == TID) return TIDDetId(detid).wheel(); 00058 else if (subdet == TOB) return TOBDetId(detid).layer(); 00059 else if (subdet == TEC) return TECDetId(detid).wheel(); 00060 else return ALLLAYERS; 00061 }
const uint32_t SiStripRegionCabling::phidivisions | ( | ) | const [inline] |
Definition at line 151 of file SiStripRegionCabling.h.
References phidivisions_.
00151 { 00152 return static_cast<uint32_t>(phidivisions_); 00153 }
const uint32_t SiStripRegionCabling::physicalLayer | ( | const | SubDet, | |
const uint32_t | layer | |||
) | [static] |
Definition at line 67 of file SiStripRegionCabling.cc.
References ALLLAYERS, TEC, TIB, TIBLAYERS, TID, TIDLAYERS, and TOB.
Referenced by SiStripRawToClustersRoI::physicalLayer(), HITSiStripRawToClustersRoI::physicalLayer(), and physicalLayerFromDetId().
00067 { 00068 00069 if (subdet == TIB) return layer; 00070 else if (subdet == TOB) return TIBLAYERS + layer; 00071 else if (subdet == TID) return layer; 00072 else if (subdet == TEC) return TIDLAYERS + layer; 00073 else return ALLLAYERS; 00074 }
const uint32_t SiStripRegionCabling::physicalLayerFromDetId | ( | const uint32_t | detid | ) | [static] |
Definition at line 63 of file SiStripRegionCabling.cc.
References layerFromDetId(), physicalLayer(), and subdetFromDetId().
00063 { 00064 return physicalLayer(subdetFromDetId(detid),layerFromDetId(detid)); 00065 }
const SiStripRegionCabling::Position SiStripRegionCabling::position | ( | const | PositionIndex | ) | const [inline] |
Definition at line 164 of file SiStripRegionCabling.h.
References etamax_, first, regionDimensions(), and edm::second().
00164 { 00165 return Position(regionDimensions().first*(index.first+.5) - etamax_, regionDimensions().second*(index.second+.5)- M_PI); 00166 }
const SiStripRegionCabling::Position SiStripRegionCabling::position | ( | const | uint32_t | ) | const [inline] |
Definition at line 159 of file SiStripRegionCabling.h.
References index, and positionIndex().
Referenced by OnDemandMeasurementTracker::dumpRegion(), OnDemandMeasurementTracker::OnDemandMeasurementTracker(), and updateSiStripRefGetter().
00159 { 00160 PositionIndex index = positionIndex(region); 00161 return position(index); 00162 }
const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex | ( | const | Position | ) | const |
Definition at line 19 of file SiStripRegionCabling.cc.
References eta, etadivisions_, etamax_, phi, and phidivisions_.
00019 { 00020 int eta = static_cast<int>((position.first+etamax_)*etadivisions_/(2.*etamax_)); 00021 int phi = static_cast<int>((position.second+M_PI)*phidivisions_/(2.*M_PI)); 00022 return PositionIndex(static_cast<uint32_t>(eta),static_cast<uint32_t>(phi)); 00023 }
const SiStripRegionCabling::PositionIndex SiStripRegionCabling::positionIndex | ( | const | uint32_t | ) | const [inline] |
Definition at line 168 of file SiStripRegionCabling.h.
References phidivisions_.
Referenced by OnDemandMeasurementTracker::dumpRegion(), OnDemandMeasurementTracker::OnDemandMeasurementTracker(), position(), region(), and updateSiStripRefGetter().
00168 { 00169 return PositionIndex(region/phidivisions_,region%phidivisions_); 00170 }
const uint32_t SiStripRegionCabling::region | ( | const | ElementIndex | ) | [inline, static] |
Definition at line 196 of file SiStripRegionCabling.h.
References ALLLAYERS, and ALLSUBDETS.
00196 { 00197 return index/(ALLSUBDETS*ALLLAYERS); 00198 }
const uint32_t SiStripRegionCabling::region | ( | const | PositionIndex | ) | const [inline] |
Definition at line 172 of file SiStripRegionCabling.h.
References phidivisions_.
00172 { 00173 return index.first*phidivisions_ + index.second; 00174 }
const uint32_t SiStripRegionCabling::region | ( | const | Position | ) | const |
Definition at line 25 of file SiStripRegionCabling.cc.
References index, and positionIndex().
Referenced by OnDemandMeasurementTracker::dumpRegion(), elementIndex(), SiStripRawToClustersLazyUnpacker::fill(), OnDemandMeasurementTracker::OnDemandMeasurementTracker(), and SiStripRegionConnectivity::produceRegionCabling().
00025 { 00026 PositionIndex index = positionIndex(position); 00027 return region(index); 00028 }
const std::pair< double, double > SiStripRegionCabling::regionDimensions | ( | ) | const [inline] |
Methods for interchanging between region, region-index and eta/phi-position.
Definition at line 155 of file SiStripRegionCabling.h.
References etadivisions_, etamax_, and phidivisions_.
Referenced by position(), and updateSiStripRefGetter().
00155 { 00156 return std::pair<double,double>((2.*etamax_)/etadivisions_,2.*M_PI/phidivisions_); 00157 }
Set and get methods for cabling.
Definition at line 139 of file SiStripRegionCabling.h.
References regioncabling_.
Referenced by SiStripRegionConnectivity::produceRegionCabling().
00139 { 00140 regioncabling_ = regioncabling; 00141 }
const SiStripRegionCabling::SubDet SiStripRegionCabling::subdet | ( | const | ElementIndex | ) | [inline, static] |
Definition at line 192 of file SiStripRegionCabling.h.
References ALLLAYERS, and ALLSUBDETS.
Referenced by SiStripRawToClustersLazyUnpacker::fill(), layerFromDetId(), and subdetFromDetId().
00192 { 00193 return static_cast<SiStripRegionCabling::SubDet>((index/ALLLAYERS)%ALLSUBDETS); 00194 }
const SiStripRegionCabling::SubDet SiStripRegionCabling::subdetFromDetId | ( | const uint32_t | detid | ) | [static] |
Methods for extracting det-id information.
Definition at line 43 of file SiStripRegionCabling.cc.
References ALLSUBDETS, subdet(), TEC, TIB, TID, and TOB.
Referenced by layerFromDetId(), OnDemandMeasurementTracker::OnDemandMeasurementTracker(), physicalLayerFromDetId(), and SiStripRegionConnectivity::produceRegionCabling().
00043 { 00044 00045 SiStripDetId::SubDetector subdet = SiStripDetId(detid).subDetector(); 00046 if (subdet == 3) return TIB; 00047 else if (subdet == 4) return TID; 00048 else if (subdet == 5) return TOB; 00049 else if (subdet == 6) return TEC; 00050 else return ALLSUBDETS; 00051 }
void SiStripRegionCabling::updateSiStripRefGetter | ( | edm::RefGetter< T > & | refgetter, | |
const edm::Handle< edm::LazyGetter< T > > & | lazygetter, | |||
const Position | position, | |||
const double | deltaeta, | |||
const double | deltaphi, | |||
const SubDet | subdet, | |||
const uint32_t | layer | |||
) | const [inline] |
Definition at line 206 of file SiStripRegionCabling.h.
References elementIndex(), i, increment(), index, j, k, position(), positionIndex(), and regionDimensions().
00206 { 00207 00208 PositionIndex index = positionIndex(pos); 00209 Position center = position(index); 00210 double offeta = pos.first-center.first; 00211 double offphi = pos.second-center.second; 00212 double toteta = deltaeta/regionDimensions().first; 00213 double totphi = deltaphi/regionDimensions().second; 00214 uint32_t plueta = static_cast<uint32_t>(offeta+.5+toteta); 00215 uint32_t pluphi = static_cast<uint32_t>(offphi+.5+totphi); 00216 uint32_t mineta = static_cast<uint32_t>(-offeta+.5+toteta); 00217 uint32_t minphi = static_cast<uint32_t>(-offphi+.5+totphi); 00218 00219 for (uint32_t i=0;i<mineta+plueta+1;i++) { 00220 for (uint32_t j=0;j<minphi+pluphi+1;j++) { 00221 const uint32_t k=elementIndex(increment(index,i-mineta,j-minphi),sub,layer); 00222 updateSiStripRefGetter<T>(refgetter,lazygetter,k); 00223 } 00224 } 00225 }
void SiStripRegionCabling::updateSiStripRefGetter | ( | edm::RefGetter< T > & | refgetter, | |
const edm::Handle< edm::LazyGetter< T > > & | lazygetter, | |||
const | ElementIndex | |||
) | const [inline] |
Methods for updating a SiStripRefGetter<T> container with elements of interest.
Definition at line 201 of file SiStripRegionCabling.h.
References edm::RefGetter< T >::find(), and edm::RefGetter< T >::push_back().
Referenced by SiStripRawToClustersRoI::bjets(), OnDemandMeasurementTracker::define(), SiStripRawToClustersRoI::electrons(), SiStripRawToClustersRoI::muons(), SiStripRawToClustersRoI::random(), and SiStripRawToClustersRoI::taujets().
int SiStripRegionCabling::etadivisions_ [private] |
Number of regions in eta,phi.
Definition at line 129 of file SiStripRegionCabling.h.
Referenced by etadivisions(), increment(), positionIndex(), and regionDimensions().
double SiStripRegionCabling::etamax_ [private] |
Tracker extent in eta.
Definition at line 133 of file SiStripRegionCabling.h.
Referenced by position(), positionIndex(), and regionDimensions().
int SiStripRegionCabling::phidivisions_ [private] |
Definition at line 130 of file SiStripRegionCabling.h.
Referenced by increment(), phidivisions(), positionIndex(), region(), and regionDimensions().
Cabling SiStripRegionCabling::regioncabling_ [private] |
Cabling.
Definition at line 136 of file SiStripRegionCabling.h.
Referenced by getRegionCabling(), and setRegionCabling().