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 Types | Private Member Functions | Private Attributes
SiStripPsuDetIdMap Class Reference

Extension to SiStripConfigDb to map PSU channels to DetIDs using DCU-PSU map and DCU-DetID map. More...

#include <SiStripPsuDetIdMap.h>

Public Member Functions

void BuildMap (const std::string &mapFile, const bool debug)
 
void BuildMap (const std::string &mapFile, std::vector< std::pair< uint32_t, std::string > > &rawmap)
 
void BuildMap (const std::string &mapFile, const bool debug, std::map< std::string, std::vector< uint32_t > > &LVmap, std::map< std::string, std::vector< uint32_t > > &HVmap, std::map< std::string, std::vector< uint32_t > > &HVUnmappedmap, std::map< std::string, std::vector< uint32_t > > &HVCrosstalkingmap)
 Overloaded method that does the buidling. More...
 
std::vector< uint32_t > getCcuDcuIds ()
 
std::vector< uint32_t > getCgDcuIds ()
 
std::vector< std::string > getControlDetectorLocations ()
 
std::vector< std::pair
< uint32_t, std::string > > 
getControlPsuDetIdMap ()
 
uint32_t getDcuId (std::string pvss)
 
uint32_t getDcuId (uint32_t detid)
 
std::vector< uint32_t > getDcuIds ()
 
std::vector< std::pair
< uint32_t, std::string > > 
getDcuPsuMap ()
 
std::string getDetectorLocation (uint32_t detid)
 
std::string getDetectorLocation (std::string pvss)
 
std::string getDetectorLocation (uint32_t detid, std::string group)
 
std::vector< std::string > getDetectorLocations ()
 
void getDetID (std::string pvss, bool, std::vector< uint32_t > &detids, std::vector< uint32_t > &unmapped_detids, std::vector< uint32_t > &crosstalking_detids)
 
std::map< std::string,
std::vector< uint32_t > > 
getHVCrosstalkingMap ()
 
void getHvDetID (std::string psuchannel, std::vector< uint32_t > &ids, std::vector< uint32_t > &unmapped_ids, std::vector< uint32_t > &crosstalking_ids)
 
std::map< std::string,
std::vector< uint32_t > > 
getHVUnmappedMap ()
 
std::vector< uint32_t > getLvDetID (std::string psu)
 
std::vector< std::pair
< uint32_t, std::string > > 
getPsuDetIdMap ()
 
std::string getPSUName (uint32_t detid)
 
std::string getPSUName (uint32_t detid, std::string group)
 
int IsHVChannel (std::string pvss)
 
void printControlMap ()
 
void printMap ()
 
void RemoveDuplicateDetIDs (std::vector< uint32_t > &detids)
 
 SiStripPsuDetIdMap ()
 
 ~SiStripPsuDetIdMap ()
 

Private Types

typedef edm::MapOfVectors
< std::string, TkDcuPsuMap * > 
DcuPsus
 
typedef DcuPsus::range DcuPsusRange
 
typedef std::vector
< TkDcuPsuMap * > 
DcuPsuVector
 
typedef std::map< std::string,
std::vector< uint32_t > > 
PsuDetIdMap
 

Private Member Functions

void checkMapInputValues (const SiStripConfigDb::DcuDetIdsV &dcuDetIds_, const DcuPsuVector &dcuPsus_)
 
void clone (DcuPsuVector &input, DcuPsuVector &output)
 
std::vector< uint32_t > findDcuIdFromDeviceAddress (uint32_t dcuid_)
 
void getDcuPsuMap (DcuPsusRange &pRange, DcuPsusRange &cRange, std::string partition)
 
std::vector< std::pair
< std::vector< uint16_t >
, std::vector< uint32_t > > > 
retrieveDcuDeviceAddresses (std::string partition)
 

Private Attributes

std::vector< uint32_t > ccuDcuIds
 
std::vector< uint32_t > cgDcuIds
 
std::vector< std::pair
< uint32_t, std::string > > 
cgMap
 
std::vector< std::string > controlLocations
 
edm::Service< SiStripConfigDbdb_
 
std::vector< std::pair
< std::vector< uint16_t >
, std::vector< uint32_t > > > 
dcu_device_addr_vector
 
std::vector< uint32_t > dcuIds
 
DcuPsus DcuPsuMapCG_
 
DcuPsus DcuPsuMapPG_
 
std::vector< std::string > detectorLocations
 
PsuDetIdMap HVCrosstalking_Map
 
PsuDetIdMap HVMap
 
PsuDetIdMap HVUnmapped_Map
 
PsuDetIdMap LVMap
 
std::vector< std::pair
< uint32_t, std::string > > 
pgMap
 

Detailed Description

Extension to SiStripConfigDb to map PSU channels to DetIDs using DCU-PSU map and DCU-DetID map.

Author
J.Cole

Definition at line 33 of file SiStripPsuDetIdMap.h.

Member Typedef Documentation

typedef edm::MapOfVectors<std::string,TkDcuPsuMap*> SiStripPsuDetIdMap::DcuPsus
private

Definition at line 115 of file SiStripPsuDetIdMap.h.

Definition at line 116 of file SiStripPsuDetIdMap.h.

typedef std::vector<TkDcuPsuMap *> SiStripPsuDetIdMap::DcuPsuVector
private

Definition at line 113 of file SiStripPsuDetIdMap.h.

typedef std::map<std::string,std::vector<uint32_t> > SiStripPsuDetIdMap::PsuDetIdMap
private

Definition at line 114 of file SiStripPsuDetIdMap.h.

Constructor & Destructor Documentation

SiStripPsuDetIdMap::SiStripPsuDetIdMap ( )

Constructor

Definition at line 20 of file SiStripPsuDetIdMap.cc.

SiStripPsuDetIdMap::~SiStripPsuDetIdMap ( )

Destructor

Definition at line 22 of file SiStripPsuDetIdMap.cc.

Member Function Documentation

void SiStripPsuDetIdMap::BuildMap ( const std::string &  mapFile,
const bool  debug 
)

Main routine that accesses the DB and builds the PSU-DETID map. Build the map from given file. ATTENTION: this will only build the pgMap, not the cgMap.

Definition at line 25 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::BuildMap ( const std::string &  mapFile,
std::vector< std::pair< uint32_t, std::string > > &  rawmap 
)

Definition at line 30 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::BuildMap ( const std::string &  mapFile,
const bool  debug,
std::map< std::string, std::vector< uint32_t > > &  LVmap,
std::map< std::string, std::vector< uint32_t > > &  HVmap,
std::map< std::string, std::vector< uint32_t > > &  HVUnmappedmap,
std::map< std::string, std::vector< uint32_t > > &  HVCrosstalkingmap 
)

Overloaded method that does the buidling.

void SiStripPsuDetIdMap::checkMapInputValues ( const SiStripConfigDb::DcuDetIdsV dcuDetIds_,
const DcuPsuVector dcuPsus_ 
)
private

Produces a detailed debug of the input values.

Definition at line 469 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::clone ( DcuPsuVector input,
DcuPsuVector output 
)
private

Utility to clone a DCU-PSU map.

Definition at line 436 of file SiStripPsuDetIdMap.cc.

std::vector< uint32_t > SiStripPsuDetIdMap::findDcuIdFromDeviceAddress ( uint32_t  dcuid_)
private

Searches the DCU device descriptions for the specified DCU ID. Needed for control groups.

Definition at line 576 of file SiStripPsuDetIdMap.cc.

std::vector<uint32_t> SiStripPsuDetIdMap::getCcuDcuIds ( )
inline

Return the CCU DCU IDs associated to the CG map.

Definition at line 85 of file SiStripPsuDetIdMap.h.

std::vector<uint32_t> SiStripPsuDetIdMap::getCgDcuIds ( )
inline

Return the module DCU IDs associated to the CG map.

Definition at line 83 of file SiStripPsuDetIdMap.h.

std::vector<std::string> SiStripPsuDetIdMap::getControlDetectorLocations ( )
inline

Return the CG detector locations as a vector - one-to-one correspondance with the contents of the PSU-DetID map vector.

Definition at line 81 of file SiStripPsuDetIdMap.h.

std::vector< std::pair<uint32_t, std::string> > SiStripPsuDetIdMap::getControlPsuDetIdMap ( )
inline

Return the CG PSU-DETID map as a vector.

Definition at line 79 of file SiStripPsuDetIdMap.h.

uint32_t SiStripPsuDetIdMap::getDcuId ( std::string  pvss)

Returns the DCU ID for the specified PSU channel - checks power and control groups.

Definition at line 397 of file SiStripPsuDetIdMap.cc.

uint32_t SiStripPsuDetIdMap::getDcuId ( uint32_t  detid)

Returns the DCU ID associated to the specified Det ID. NB. This checks power groups only, by definition.

Definition at line 407 of file SiStripPsuDetIdMap.cc.

std::vector<uint32_t> SiStripPsuDetIdMap::getDcuIds ( )
inline

Return the DCU IDs associated to the PG map.

Definition at line 77 of file SiStripPsuDetIdMap.h.

std::vector< std::pair< uint32_t, std::string > > SiStripPsuDetIdMap::getDcuPsuMap ( )

Returns the DCU-PSU map as a vector.

Definition at line 463 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::getDcuPsuMap ( DcuPsusRange pRange,
DcuPsusRange cRange,
std::string  partition 
)
private

Extracts the DCU-PSU map from the DB.

std::string SiStripPsuDetIdMap::getDetectorLocation ( uint32_t  detid)

Returns the detector location for the specified Det ID, for power groups only.

Definition at line 363 of file SiStripPsuDetIdMap.cc.

std::string SiStripPsuDetIdMap::getDetectorLocation ( std::string  pvss)

Returns the detector location for the specified PSU channel.

Definition at line 386 of file SiStripPsuDetIdMap.cc.

std::string SiStripPsuDetIdMap::getDetectorLocation ( uint32_t  detid,
std::string  group 
)

Returns the detector location for the specified Det ID and specified group type (PG or CG).

Definition at line 371 of file SiStripPsuDetIdMap.cc.

std::vector<std::string> SiStripPsuDetIdMap::getDetectorLocations ( )
inline

Return the PG detector locations as a vector - one-to-one correspondance with the contents of the PSU-DetID map vector.

Definition at line 75 of file SiStripPsuDetIdMap.h.

void SiStripPsuDetIdMap::getDetID ( std::string  pvss,
bool  debug,
std::vector< uint32_t > &  detids,
std::vector< uint32_t > &  unmapped_detids,
std::vector< uint32_t > &  crosstalking_detids 
)

Definition at line 184 of file SiStripPsuDetIdMap.cc.

std::map<std::string,std::vector<uint32_t> > SiStripPsuDetIdMap::getHVCrosstalkingMap ( )
inline

Definition at line 67 of file SiStripPsuDetIdMap.h.

void SiStripPsuDetIdMap::getHvDetID ( std::string  psuchannel,
std::vector< uint32_t > &  ids,
std::vector< uint32_t > &  unmapped_ids,
std::vector< uint32_t > &  crosstalking_ids 
)

Definition at line 165 of file SiStripPsuDetIdMap.cc.

std::map<std::string,std::vector<uint32_t> > SiStripPsuDetIdMap::getHVUnmappedMap ( )
inline

Definition at line 65 of file SiStripPsuDetIdMap.h.

std::vector< uint32_t > SiStripPsuDetIdMap::getLvDetID ( std::string  psu)

Definition at line 153 of file SiStripPsuDetIdMap.cc.

std::vector< std::pair<uint32_t, std::string> > SiStripPsuDetIdMap::getPsuDetIdMap ( )
inline

Return the PG PSU-DETID map as a vector.

Definition at line 73 of file SiStripPsuDetIdMap.h.

std::string SiStripPsuDetIdMap::getPSUName ( uint32_t  detid)

Returns the PSU channel name for the specified Det ID, for power groups only.

Definition at line 337 of file SiStripPsuDetIdMap.cc.

std::string SiStripPsuDetIdMap::getPSUName ( uint32_t  detid,
std::string  group 
)

Returns the PSU channel name for the specified Det ID.

Definition at line 346 of file SiStripPsuDetIdMap.cc.

int SiStripPsuDetIdMap::IsHVChannel ( std::string  pvss)

Returns 1 if the specified PSU channel is a HV channel, 0 if it is a LV channel. -1 means error.

Definition at line 415 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::printControlMap ( )

Produces a formatted printout of the control PSU-DETID map.

Definition at line 453 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::printMap ( )

Produces a formatted printout of the PSU-DETID map.

Definition at line 443 of file SiStripPsuDetIdMap.cc.

void SiStripPsuDetIdMap::RemoveDuplicateDetIDs ( std::vector< uint32_t > &  detids)

Definition at line 144 of file SiStripPsuDetIdMap.cc.

std::vector< std::pair< std::vector< uint16_t >, std::vector< uint32_t > > > SiStripPsuDetIdMap::retrieveDcuDeviceAddresses ( std::string  partition)
private

Extracts the DCU device descriptions and stores them for further use. Only used for control groups.

Definition at line 508 of file SiStripPsuDetIdMap.cc.

Member Data Documentation

std::vector<uint32_t> SiStripPsuDetIdMap::ccuDcuIds
private

Definition at line 135 of file SiStripPsuDetIdMap.h.

std::vector<uint32_t> SiStripPsuDetIdMap::cgDcuIds
private

Definition at line 135 of file SiStripPsuDetIdMap.h.

std::vector< std::pair<uint32_t, std::string> > SiStripPsuDetIdMap::cgMap
private

Definition at line 133 of file SiStripPsuDetIdMap.h.

std::vector<std::string> SiStripPsuDetIdMap::controlLocations
private

Definition at line 134 of file SiStripPsuDetIdMap.h.

edm::Service<SiStripConfigDb> SiStripPsuDetIdMap::db_
private

Definition at line 131 of file SiStripPsuDetIdMap.h.

std::vector< std::pair< std::vector<uint16_t> , std::vector<uint32_t> > > SiStripPsuDetIdMap::dcu_device_addr_vector
private

Definition at line 138 of file SiStripPsuDetIdMap.h.

std::vector<uint32_t> SiStripPsuDetIdMap::dcuIds
private

Definition at line 135 of file SiStripPsuDetIdMap.h.

DcuPsus SiStripPsuDetIdMap::DcuPsuMapCG_
private

Definition at line 136 of file SiStripPsuDetIdMap.h.

DcuPsus SiStripPsuDetIdMap::DcuPsuMapPG_
private

Definition at line 136 of file SiStripPsuDetIdMap.h.

std::vector<std::string> SiStripPsuDetIdMap::detectorLocations
private

Definition at line 134 of file SiStripPsuDetIdMap.h.

PsuDetIdMap SiStripPsuDetIdMap::HVCrosstalking_Map
private

Definition at line 132 of file SiStripPsuDetIdMap.h.

PsuDetIdMap SiStripPsuDetIdMap::HVMap
private

Definition at line 132 of file SiStripPsuDetIdMap.h.

PsuDetIdMap SiStripPsuDetIdMap::HVUnmapped_Map
private

Definition at line 132 of file SiStripPsuDetIdMap.h.

PsuDetIdMap SiStripPsuDetIdMap::LVMap
private

Definition at line 132 of file SiStripPsuDetIdMap.h.

std::vector< std::pair<uint32_t, std::string> > SiStripPsuDetIdMap::pgMap
private

Definition at line 133 of file SiStripPsuDetIdMap.h.