CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::auto_ptr
< SiStripRegionCabling
produceRegionCabling (const SiStripRegionCablingRcd &)
 
 SiStripRegionConnectivity (const edm::ParameterSet &)
 
virtual ~SiStripRegionConnectivity ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

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, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- 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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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::auto_ptr< SiStripRegionCabling > produceRegionCabling(const SiStripRegionCablingRcd &)
SiStripRegionConnectivity::~SiStripRegionConnectivity ( )
virtual

Definition at line 23 of file SiStripRegionConnectivity.cc.

23 {}

Member Function Documentation

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

Definition at line 25 of file SiStripRegionConnectivity.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, HTMLExport::elem(), eta, etadivisions_, etamax_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), sistrip::invalid32_, TrackerTopology::layer(), phi, phidivisions_, edm::ESHandle< class >::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) != 0) && ((*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::auto_ptr<SiStripRegionCabling>( RegionConnections );
86 }
static const uint32_t invalid32_
Definition: Constants.h:15
std::vector< Element > ElementCabling
void setRegionCabling(const Cabling &)
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
Definition: DetId.h:18
T const * product() const
Definition: ESHandle.h:86
unsigned int layer(const DetId &id) const
const uint32_t region(const Position) const
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().