CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiStripRegionConnectivity Class Reference

#include <SiStripRegionConnectivity.h>

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

List of all members.

Public Member Functions

std::auto_ptr
< SiStripRegionCabling
produceRegionCabling (const SiStripRegionCablingRcd &)
 SiStripRegionConnectivity (const edm::ParameterSet &)
virtual ~SiStripRegionConnectivity ()

Private Attributes

uint32_t etadivisions_
double etamax_
uint32_t phidivisions_

Detailed Description

Definition at line 15 of file SiStripRegionConnectivity.h.


Constructor & Destructor Documentation

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

Definition at line 12 of file SiStripRegionConnectivity.cc.

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

                                                                                :

  etadivisions_(pset.getUntrackedParameter<unsigned int>("EtaDivisions",10)),
  phidivisions_(pset.getUntrackedParameter<unsigned int>("PhiDivisions",10)),
  etamax_(pset.getUntrackedParameter<double>("EtaMax",2.4))

{
  setWhatProduced(this, &SiStripRegionConnectivity::produceRegionCabling);
}
SiStripRegionConnectivity::~SiStripRegionConnectivity ( ) [virtual]

Definition at line 22 of file SiStripRegionConnectivity.cc.

{}

Member Function Documentation

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

Definition at line 24 of file SiStripRegionConnectivity.cc.

References SiStripRegionCabling::ALLLAYERS, SiStripRegionCabling::ALLSUBDETS, eta(), etadivisions_, etamax_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), sistrip::invalid32_, SiStripRegionCabling::layerFromDetId(), phi, phidivisions_, SiStripRegionCabling::region(), SiStripRegionCabling::setRegionCabling(), and SiStripRegionCabling::subdetFromDetId().

Referenced by SiStripRegionConnectivity().

                                                                                                                          {

  edm::ESHandle<SiStripDetCabling> detcabling;
  iRecord.getRecord<SiStripDetCablingRcd>().get( detcabling );

  edm::ESHandle<TrackerGeometry> tkgeom;
  iRecord.getRecord<TrackerDigiGeometryRecord>().get( tkgeom );
  
  //here build an object of type SiStripRegionCabling using the information from class SiStripDetCabling **PLUS** the geometry.
  
  //Construct region cabling object
  SiStripRegionCabling* RegionConnections = new SiStripRegionCabling(etadivisions_,phidivisions_,etamax_);

  //Construct region cabling map
  SiStripRegionCabling::Cabling regioncabling(etadivisions_*phidivisions_,SiStripRegionCabling::RegionCabling(SiStripRegionCabling::ALLSUBDETS,SiStripRegionCabling::WedgeCabling(SiStripRegionCabling::ALLLAYERS,SiStripRegionCabling::ElementCabling())));
  
  //Loop det cabling
  std::map< uint32_t, std::vector<const FedChannelConnection *> >::const_iterator idet = detcabling->getDetCabling().begin();
  for (;idet!=detcabling->getDetCabling().end();idet++) {
    if (!idet->first || (idet->first == sistrip::invalid32_)) continue;

    // Check if geom det unit exists
    GeomDetUnit* geom_det = const_cast<GeomDetUnit*>( tkgeom->idToDetUnit(DetId(idet->first)) );
    StripGeomDetUnit* strip_det = dynamic_cast<StripGeomDetUnit*>( geom_det );
    if ( !strip_det ) { continue; }
    
    //Calculate region from geometry
    double eta = tkgeom->idToDet(DetId(idet->first))->position().eta();
    double phi = tkgeom->idToDet(DetId(idet->first))->position().phi().value();
    uint32_t reg = RegionConnections->region(SiStripRegionCabling::Position(eta,phi));
  
    //Find subdet from det-id 
    uint32_t subdet = static_cast<uint32_t>(SiStripRegionCabling::subdetFromDetId(idet->first));
    
    //Find layer from det-id
    uint32_t layer = SiStripRegionCabling::layerFromDetId(idet->first);

    //@@ BELOW IS TEMP FIX TO HANDLE BUG IN DET CABLING
    std::vector<const FedChannelConnection *> conns = idet->second;
    std::vector<const FedChannelConnection *>::iterator iconn = conns.begin();
    std::vector<const FedChannelConnection *>::iterator jconn = conns.end();

    //Update region cabling map
    regioncabling[reg][subdet][layer][idet->first].resize(conns.size());
    for ( ; iconn != jconn; ++iconn ) {
      if ( ((*iconn) != 0) && ((*iconn)->apvPairNumber() < conns.size()) ) { 
        regioncabling[reg][subdet][layer][idet->first][(*iconn)->apvPairNumber()] = **iconn;
      }
    }
  }

  //Add map to region cabling object
  RegionConnections->setRegionCabling(regioncabling);
  
  return std::auto_ptr<SiStripRegionCabling>( RegionConnections );
}

Member Data Documentation

Number of regions in eta,phi

Definition at line 27 of file SiStripRegionConnectivity.h.

Referenced by produceRegionCabling().

Tracker extent in eta

Definition at line 31 of file SiStripRegionConnectivity.h.

Referenced by produceRegionCabling().

Definition at line 28 of file SiStripRegionConnectivity.h.

Referenced by produceRegionCabling().