CMS 3D CMS Logo

SiStripPsuDetIdMap.h
Go to the documentation of this file.
1 #ifndef SISTRIPPSUDETIDMAP_H
2 #define SISTRIPPSUDETIDMAP_H
3 
4 #include <memory>
10 
14 #include "DeviceFactory.h"
15 
16 #include <vector>
17 #include <string>
18 #include <iostream>
19 #include <fstream>
20 #include <sstream>
21 #include <ostream>
22 #include <cstdint>
23 
24 class SiStripConfigDb;
25 
33 public:
38 
39  std::vector<uint32_t> getLvDetID(std::string psu);
40  void getHvDetID(std::string psuchannel,
41  std::vector<uint32_t> &ids,
42  std::vector<uint32_t> &unmapped_ids,
43  std::vector<uint32_t> &crosstalking_ids);
44 
45  //Produces 3 list of detIDs:
46  //1-detids (positively matching the PSUChannel for HV case, positively matching the PSU for the LV case)
47  //2-unmapped_detids (matching the PSUChannel000 for the HV case, empty for LV case)
48  //3-crosstalking_detids (matching the PSUChannel999 for the HV case, empty for the LV case)
49  void getDetID(std::string pvss,
50  bool,
51  std::vector<uint32_t> &detids,
52  std::vector<uint32_t> &unmapped_detids,
53  std::vector<uint32_t> &crosstalking_detids);
55  std::string getPSUName(uint32_t detid);
57  std::string getPSUName(uint32_t detid, std::string group);
59  std::string getDetectorLocation(uint32_t detid);
65  uint32_t getDcuId(std::string pvss);
67  uint32_t getDcuId(uint32_t detid);
68 
69  //Return the HVUnmapped PSU channels as a map initialized to all channels (002/003) OFF (false):
70  std::map<std::string, std::vector<uint32_t> > getHVUnmappedMap() { return HVUnmapped_Map; }
71  //Return the HVCrosstalking PSU channels as a map initialized to all channels (002/003) OFF (false):
72  std::map<std::string, std::vector<uint32_t> > getHVCrosstalkingMap() { return HVCrosstalking_Map; }
73  //PsuDetIdMap getHVUnmappedDetIdMap() {return HVUnmapped_Map}
74  //Return the HVUnmapped PSUchannel to (HV status) map initialized to all OFF:
75  //PsuDetIdMap getHVUnmappedChannelMap() {return HVUnmapped_ChanStatus}
76  //PsuDetIdMap getHVCrosstalkingChannelMap() {return HVCrossTalking_ChanStatus}
78  std::vector<std::pair<uint32_t, std::string> > getPsuDetIdMap() { return pgMap; }
80  std::vector<std::string> getDetectorLocations() { return detectorLocations; }
82  std::vector<uint32_t> getDcuIds() { return dcuIds; }
84  std::vector<std::pair<uint32_t, std::string> > getControlPsuDetIdMap() { return cgMap; }
86  std::vector<std::string> getControlDetectorLocations() { return controlLocations; }
88  std::vector<uint32_t> getCgDcuIds() { return cgDcuIds; }
90  std::vector<uint32_t> getCcuDcuIds() { return ccuDcuIds; }
91 
93  void printMap();
95  void printControlMap();
97  //void BuildMap();
102  void BuildMap(const std::string &mapFile, const bool debug);
103  //Old "rawmap" (vector of pairs) method to be used by excludeddetids:
104  void BuildMap(const std::string &mapFile, std::vector<std::pair<uint32_t, std::string> > &rawmap);
106  void BuildMap(const std::string &mapFile,
107  const bool debug,
108  std::map<std::string, std::vector<uint32_t> > &LVmap,
109  std::map<std::string, std::vector<uint32_t> > &HVmap,
110  std::map<std::string, std::vector<uint32_t> > &HVUnmappedmap,
111  std::map<std::string, std::vector<uint32_t> > &HVCrosstalkingmap);
112 
113  //Service function to remove duplicated from vectors of detids:
114  void RemoveDuplicateDetIDs(std::vector<uint32_t> &detids);
115 
117  std::vector<std::pair<uint32_t, std::string> > getDcuPsuMap();
119  int IsHVChannel(std::string pvss);
120 
121 private:
122  // typedefs
123  typedef std::vector<TkDcuPsuMap *> DcuPsuVector;
124  typedef std::map<std::string, std::vector<uint32_t> > PsuDetIdMap;
128  void getDcuPsuMap(DcuPsusRange &pRange, DcuPsusRange &cRange, std::string partition);
130  // std::vector< std::pair<uint32_t, SiStripConfigDb::DeviceAddress> > retrieveDcuDeviceAddresses(std::string partition);
131  std::vector<std::pair<std::vector<uint16_t>, std::vector<uint32_t> > > retrieveDcuDeviceAddresses(
132  std::string partition);
134  std::vector<uint32_t> findDcuIdFromDeviceAddress(uint32_t dcuid_);
138  // for debugging
139  void checkMapInputValues(const SiStripConfigDb::DcuDetIdsV &dcuDetIds_, const DcuPsuVector &dcuPsus_);
140 
141  // member variables
144  std::vector<std::pair<uint32_t, std::string> > pgMap, cgMap;
145  std::vector<std::string> detectorLocations, controlLocations;
146  std::vector<uint32_t> dcuIds, cgDcuIds, ccuDcuIds;
148  // std::vector< std::pair<uint32_t, SiStripConfigDb::DeviceAddress> > dcu_device_addr_vector;
149  std::vector<std::pair<std::vector<uint16_t>, std::vector<uint32_t> > > dcu_device_addr_vector;
150 };
151 #endif
Handle.h
SiStripPsuDetIdMap::controlLocations
std::vector< std::string > controlLocations
Definition: SiStripPsuDetIdMap.h:145
input
static const std::string input
Definition: EdmProvDump.cc:48
SiStripPsuDetIdMap::findDcuIdFromDeviceAddress
std::vector< uint32_t > findDcuIdFromDeviceAddress(uint32_t dcuid_)
Definition: SiStripPsuDetIdMap.cc:625
SiStripPsuDetIdMap::getPsuDetIdMap
std::vector< std::pair< uint32_t, std::string > > getPsuDetIdMap()
Definition: SiStripPsuDetIdMap.h:78
SiStripPsuDetIdMap::getDetID
void getDetID(std::string pvss, bool, std::vector< uint32_t > &detids, std::vector< uint32_t > &unmapped_detids, std::vector< uint32_t > &crosstalking_detids)
Definition: SiStripPsuDetIdMap.cc:195
SiStripPsuDetIdMap::getHvDetID
void getHvDetID(std::string psuchannel, std::vector< uint32_t > &ids, std::vector< uint32_t > &unmapped_ids, std::vector< uint32_t > &crosstalking_ids)
Definition: SiStripPsuDetIdMap.cc:173
SiStripConfigDb::DcuDetIdsV
std::vector< DcuDetId > DcuDetIdsV
Definition: SiStripConfigDb.h:128
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
SiStripPsuDetIdMap::retrieveDcuDeviceAddresses
std::vector< std::pair< std::vector< uint16_t >, std::vector< uint32_t > > > retrieveDcuDeviceAddresses(std::string partition)
Definition: SiStripPsuDetIdMap.cc:553
SiStripPsuDetIdMap::getHVUnmappedMap
std::map< std::string, std::vector< uint32_t > > getHVUnmappedMap()
Definition: SiStripPsuDetIdMap.h:70
MapOfVectors.h
SiStripPsuDetIdMap::PsuDetIdMap
std::map< std::string, std::vector< uint32_t > > PsuDetIdMap
Definition: SiStripPsuDetIdMap.h:124
SiStripPsuDetIdMap::HVUnmapped_Map
PsuDetIdMap HVUnmapped_Map
Definition: SiStripPsuDetIdMap.h:143
SiStripPsuDetIdMap::getHVCrosstalkingMap
std::map< std::string, std::vector< uint32_t > > getHVCrosstalkingMap()
Definition: SiStripPsuDetIdMap.h:72
SiStripPsuDetIdMap::printMap
void printMap()
Definition: SiStripPsuDetIdMap.cc:480
SiStripDbParams.h
SiStripPsuDetIdMap::detectorLocations
std::vector< std::string > detectorLocations
Definition: SiStripPsuDetIdMap.h:145
SiStripPsuDetIdMap::BuildMap
void BuildMap(const std::string &mapFile, const bool debug)
Definition: SiStripPsuDetIdMap.cc:29
SiStripPsuDetIdMap::getDcuId
uint32_t getDcuId(std::string pvss)
Definition: SiStripPsuDetIdMap.cc:426
SiStripPsuDetIdMap::getDetectorLocation
std::string getDetectorLocation(uint32_t detid)
Definition: SiStripPsuDetIdMap.cc:382
debug
#define debug
Definition: HDRShower.cc:19
SiStripPsuDetIdMap::dcu_device_addr_vector
std::vector< std::pair< std::vector< uint16_t >, std::vector< uint32_t > > > dcu_device_addr_vector
Definition: SiStripPsuDetIdMap.h:149
SiStripPsuDetIdMap::DcuPsus
edm::MapOfVectors< std::string, TkDcuPsuMap * > DcuPsus
Definition: SiStripPsuDetIdMap.h:125
Service.h
SiStripPsuDetIdMap::IsHVChannel
int IsHVChannel(std::string pvss)
Definition: SiStripPsuDetIdMap.cc:450
SiStripPsuDetIdMap::getLvDetID
std::vector< uint32_t > getLvDetID(std::string psu)
Definition: SiStripPsuDetIdMap.cc:162
SiStripPsuDetIdMap::HVCrosstalking_Map
PsuDetIdMap HVCrosstalking_Map
Definition: SiStripPsuDetIdMap.h:143
SiStripPsuDetIdMap
Extension to SiStripConfigDb to map PSU channels to DetIDs using DCU-PSU map and DCU-DetID map.
Definition: SiStripPsuDetIdMap.h:32
SiStripPsuDetIdMap::cgMap
std::vector< std::pair< uint32_t, std::string > > cgMap
Definition: SiStripPsuDetIdMap.h:144
SiStripConfigDb
An interface class to the DeviceFactory.
Definition: SiStripConfigDb.h:47
SiStripPsuDetIdMap::printControlMap
void printControlMap()
Definition: SiStripPsuDetIdMap.cc:489
SiStripPsuDetIdMap::getCcuDcuIds
std::vector< uint32_t > getCcuDcuIds()
Definition: SiStripPsuDetIdMap.h:90
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripPsuDetIdMap::checkMapInputValues
void checkMapInputValues(const SiStripConfigDb::DcuDetIdsV &dcuDetIds_, const DcuPsuVector &dcuPsus_)
Definition: SiStripPsuDetIdMap.cc:507
SiStripPsuDetIdMap::getControlDetectorLocations
std::vector< std::string > getControlDetectorLocations()
Definition: SiStripPsuDetIdMap.h:86
SiStripConstants.h
SiStripPsuDetIdMap::db_
edm::Service< SiStripConfigDb > db_
Definition: SiStripPsuDetIdMap.h:142
SiStripPsuDetIdMap::clone
void clone(DcuPsuVector &input, DcuPsuVector &output)
Definition: SiStripPsuDetIdMap.cc:473
SiStripPsuDetIdMap::HVMap
PsuDetIdMap HVMap
Definition: SiStripPsuDetIdMap.h:143
Event.h
SiStripPsuDetIdMap::SiStripPsuDetIdMap
SiStripPsuDetIdMap()
Definition: SiStripPsuDetIdMap.cc:20
SiStripPsuDetIdMap::ccuDcuIds
std::vector< uint32_t > ccuDcuIds
Definition: SiStripPsuDetIdMap.h:146
SiStripPsuDetIdMap::dcuIds
std::vector< uint32_t > dcuIds
Definition: SiStripPsuDetIdMap.h:146
edm::Service< SiStripConfigDb >
SiStripPsuDetIdMap::getDetectorLocations
std::vector< std::string > getDetectorLocations()
Definition: SiStripPsuDetIdMap.h:80
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
SiStripPsuDetIdMap::getDcuPsuMap
std::vector< std::pair< uint32_t, std::string > > getDcuPsuMap()
Definition: SiStripPsuDetIdMap.cc:499
SiStripPsuDetIdMap::DcuPsuMapPG_
DcuPsus DcuPsuMapPG_
Definition: SiStripPsuDetIdMap.h:147
SiStripConfigDb.h
SiStripPsuDetIdMap::RemoveDuplicateDetIDs
void RemoveDuplicateDetIDs(std::vector< uint32_t > &detids)
Definition: SiStripPsuDetIdMap.cc:153
SiStripPsuDetIdMap::pgMap
std::vector< std::pair< uint32_t, std::string > > pgMap
Definition: SiStripPsuDetIdMap.h:144
edm::MapOfVectors< std::string, TkDcuPsuMap * >::range
boost::iterator_range< data_iterator > range
Definition: MapOfVectors.h:34
SiStripPsuDetIdMap::DcuPsuMapCG_
DcuPsus DcuPsuMapCG_
Definition: SiStripPsuDetIdMap.h:147
SiStripPsuDetIdMap::DcuPsusRange
DcuPsus::range DcuPsusRange
Definition: SiStripPsuDetIdMap.h:126
EventSetup.h
SiStripPsuDetIdMap::LVMap
PsuDetIdMap LVMap
Definition: SiStripPsuDetIdMap.h:143
edm::MapOfVectors< std::string, TkDcuPsuMap * >
SiStripPsuDetIdMap::cgDcuIds
std::vector< uint32_t > cgDcuIds
Definition: SiStripPsuDetIdMap.h:146
SiStripPsuDetIdMap::~SiStripPsuDetIdMap
~SiStripPsuDetIdMap()
Definition: SiStripPsuDetIdMap.cc:24
SiStripPsuDetIdMap::getCgDcuIds
std::vector< uint32_t > getCgDcuIds()
Definition: SiStripPsuDetIdMap.h:88
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SiStripPsuDetIdMap::DcuPsuVector
std::vector< TkDcuPsuMap * > DcuPsuVector
Definition: SiStripPsuDetIdMap.h:123
SiStripPsuDetIdMap::getDcuIds
std::vector< uint32_t > getDcuIds()
Definition: SiStripPsuDetIdMap.h:82
SiStripPsuDetIdMap::getPSUName
std::string getPSUName(uint32_t detid)
Definition: SiStripPsuDetIdMap.cc:350
SiStripPsuDetIdMap::getControlPsuDetIdMap
std::vector< std::pair< uint32_t, std::string > > getControlPsuDetIdMap()
Definition: SiStripPsuDetIdMap.h:84
watchdog.group
group
Definition: watchdog.py:82