CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripRegionConnectivity Class Reference

#include <SiStripRegionConnectivity.h>

Inheritance diagram for SiStripRegionConnectivity:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

std::unique_ptr< SiStripRegionCablingproduceRegionCabling (const SiStripRegionCablingRcd &)
 
 SiStripRegionConnectivity (const edm::ParameterSet &)
 
 ~SiStripRegionConnectivity () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

uint32_t etadivisions_
 
double etamax_
 
uint32_t phidivisions_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 15 of file SiStripRegionConnectivity.h.

Constructor & Destructor Documentation

SiStripRegionConnectivity::SiStripRegionConnectivity ( const edm::ParameterSet pset)

Definition at line 13 of file SiStripRegionConnectivity.cc.

References produceRegionCabling(), and edm::ESProducer::setWhatProduced().

13  :
14 
15  etadivisions_(pset.getUntrackedParameter<unsigned int>("EtaDivisions",10)),
16  phidivisions_(pset.getUntrackedParameter<unsigned int>("PhiDivisions",10)),
17  etamax_(pset.getUntrackedParameter<double>("EtaMax",2.4))
18 
19 {
21 }
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::unique_ptr< SiStripRegionCabling > produceRegionCabling(const SiStripRegionCablingRcd &)
SiStripRegionConnectivity::~SiStripRegionConnectivity ( )
override

Definition at line 23 of file SiStripRegionConnectivity.cc.

23 {}

Member Function Documentation

std::unique_ptr< SiStripRegionCabling > SiStripRegionConnectivity::produceRegionCabling ( const SiStripRegionCablingRcd iRecord)

Definition at line 25 of file SiStripRegionConnectivity.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, HTMLExport::elem(), PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), etadivisions_, etamax_, SiStripDetCabling::getDetCabling(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), sistrip::invalid32_, TrackerTopology::layer(), phi, PV3DBase< T, PVType, FrameType >::phi(), phidivisions_, GeomDet::position(), edm::ESHandle< T >::product(), SiStripRegionCabling::region(), SiStripRegionCabling::setRegionCabling(), and SiStripRegionCabling::subdetFromDetId().

Referenced by SiStripRegionConnectivity().

25  {
26 
28  iRecord.getRecord<SiStripDetCablingRcd>().get( detcabling );
29 
31  iRecord.getRecord<TrackerDigiGeometryRecord>().get( tkgeom );
32 
34  iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle);
35  const TrackerTopology* const tTopo = tTopoHandle.product();
36 
37  //here build an object of type SiStripRegionCabling using the information from class SiStripDetCabling **PLUS** the geometry.
38 
39  //Construct region cabling object
41 
42  //Construct region cabling map
44 
45  //Loop det cabling
46  std::map< uint32_t, std::vector<const FedChannelConnection *> >::const_iterator idet = detcabling->getDetCabling().begin();
47  for (;idet!=detcabling->getDetCabling().end();idet++) {
48  if (!idet->first || (idet->first == sistrip::invalid32_)) continue;
49 
50  // Check if geom det unit exists
51  auto geom_det = tkgeom->idToDetUnit(DetId(idet->first));
52  auto strip_det = dynamic_cast<StripGeomDetUnit const *>( geom_det );
53  if ( !strip_det ) { continue; }
54 
55  //Calculate region from geometry
56  double eta = tkgeom->idToDet(DetId(idet->first))->position().eta();
57  double phi = tkgeom->idToDet(DetId(idet->first))->position().phi().value();
58  uint32_t reg = RegionConnections->region(SiStripRegionCabling::Position(eta,phi));
59 
60  //Find subdet from det-id
61  uint32_t subdet = static_cast<uint32_t>(SiStripRegionCabling::subdetFromDetId(idet->first));
62 
63  //Find layer from det-id
64  uint32_t layer = tTopo->layer(idet->first);
65 
66  //@@ BELOW IS TEMP FIX TO HANDLE BUG IN DET CABLING
67  std::vector<const FedChannelConnection *> conns = idet->second;
68  std::vector<const FedChannelConnection *>::iterator iconn = conns.begin();
69  std::vector<const FedChannelConnection *>::iterator jconn = conns.end();
70 
71  //Update region cabling map
72  regioncabling[reg][subdet][layer].push_back(SiStripRegionCabling::Element());
73  auto & elem = regioncabling[reg][subdet][layer].back();
74  elem.first=idet->first; elem.second.resize(conns.size());
75  for ( ; iconn != jconn; ++iconn ) {
76  if ( ((*iconn) != nullptr) && ((*iconn)->apvPairNumber() < conns.size()) ) {
77  elem.second[(*iconn)->apvPairNumber()] = **iconn;
78  }
79  }
80  }
81 
82  //Add map to region cabling object
83  RegionConnections->setRegionCabling(regioncabling);
84 
85  return std::unique_ptr<SiStripRegionCabling>( RegionConnections );
86 }
static const uint32_t invalid32_
Definition: Constants.h:15
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< Element > ElementCabling
void setRegionCabling(const Cabling &)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
std::vector< ElementCabling > WedgeCabling
static const SubDet subdetFromDetId(const uint32_t detid)
std::pair< double, double > Position
std::pair< uint32_t, std::vector< FedChannelConnection > > Element
def elem(elemtype, innerHTML='', html_class='', kwargs)
Definition: HTMLExport.py:18
Definition: DetId.h:18
const std::map< uint32_t, std::vector< const FedChannelConnection * > > & getDetCabling() const
unsigned int layer(const DetId &id) const
T eta() const
Definition: PV3DBase.h:76
const uint32_t region(const Position) const
const TrackerGeomDet * idToDet(DetId) const override
T const * product() const
Definition: ESHandle.h:86
std::vector< WedgeCabling > RegionCabling
std::vector< RegionCabling > Cabling

Member Data Documentation

uint32_t SiStripRegionConnectivity::etadivisions_
private

Number of regions in eta,phi

Definition at line 27 of file SiStripRegionConnectivity.h.

Referenced by produceRegionCabling().

double SiStripRegionConnectivity::etamax_
private

Tracker extent in eta

Definition at line 31 of file SiStripRegionConnectivity.h.

Referenced by produceRegionCabling().

uint32_t SiStripRegionConnectivity::phidivisions_
private

Definition at line 28 of file SiStripRegionConnectivity.h.

Referenced by produceRegionCabling().