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>
11 
15 #include "DeviceFactory.h"
16 
17 #include <vector>
18 #include <string>
19 #include <iostream>
20 #include <fstream>
21 #include <sstream>
22 #include <ostream>
23 #include <cstdint>
24 
25 class SiStripConfigDb;
26 
34 public:
39 
40  std::vector<uint32_t> getLvDetID(std::string psu);
41  void getHvDetID(std::string psuchannel,
42  std::vector<uint32_t> &ids,
43  std::vector<uint32_t> &unmapped_ids,
44  std::vector<uint32_t> &crosstalking_ids);
45 
46  //Produces 3 list of detIDs:
47  //1-detids (positively matching the PSUChannel for HV case, positively matching the PSU for the LV case)
48  //2-unmapped_detids (matching the PSUChannel000 for the HV case, empty for LV case)
49  //3-crosstalking_detids (matching the PSUChannel999 for the HV case, empty for the LV case)
50  void getDetID(std::string pvss,
51  bool,
52  std::vector<uint32_t> &detids,
53  std::vector<uint32_t> &unmapped_detids,
54  std::vector<uint32_t> &crosstalking_detids);
56  std::string getPSUName(uint32_t detid);
58  std::string getPSUName(uint32_t detid, std::string group);
60  std::string getDetectorLocation(uint32_t detid);
66  uint32_t getDcuId(std::string pvss);
68  uint32_t getDcuId(uint32_t detid);
69 
70  //Return the HVUnmapped PSU channels as a map initialized to all channels (002/003) OFF (false):
71  std::map<std::string, std::vector<uint32_t> > getHVUnmappedMap() { return HVUnmapped_Map; }
72  //Return the HVCrosstalking PSU channels as a map initialized to all channels (002/003) OFF (false):
73  std::map<std::string, std::vector<uint32_t> > getHVCrosstalkingMap() { return HVCrosstalking_Map; }
74  //PsuDetIdMap getHVUnmappedDetIdMap() {return HVUnmapped_Map}
75  //Return the HVUnmapped PSUchannel to (HV status) map initialized to all OFF:
76  //PsuDetIdMap getHVUnmappedChannelMap() {return HVUnmapped_ChanStatus}
77  //PsuDetIdMap getHVCrosstalkingChannelMap() {return HVCrossTalking_ChanStatus}
79  std::vector<std::pair<uint32_t, std::string> > getPsuDetIdMap() { return pgMap; }
81  std::vector<std::string> getDetectorLocations() { return detectorLocations; }
83  std::vector<uint32_t> getDcuIds() { return dcuIds; }
85  std::vector<std::pair<uint32_t, std::string> > getControlPsuDetIdMap() { return cgMap; }
87  std::vector<std::string> getControlDetectorLocations() { return controlLocations; }
89  std::vector<uint32_t> getCgDcuIds() { return cgDcuIds; }
91  std::vector<uint32_t> getCcuDcuIds() { return ccuDcuIds; }
92 
94  void printMap();
96  void printControlMap();
98  //void BuildMap();
103  void BuildMap(const std::string &mapFile, const bool debug);
104  //Old "rawmap" (vector of pairs) method to be used by excludeddetids:
105  void BuildMap(const std::string &mapFile, std::vector<std::pair<uint32_t, std::string> > &rawmap);
107  void BuildMap(const std::string &mapFile,
108  const bool debug,
109  std::map<std::string, std::vector<uint32_t> > &LVmap,
110  std::map<std::string, std::vector<uint32_t> > &HVmap,
111  std::map<std::string, std::vector<uint32_t> > &HVUnmappedmap,
112  std::map<std::string, std::vector<uint32_t> > &HVCrosstalkingmap);
113 
114  //Service function to remove duplicated from vectors of detids:
115  void RemoveDuplicateDetIDs(std::vector<uint32_t> &detids);
116 
118  std::vector<std::pair<uint32_t, std::string> > getDcuPsuMap();
120  int IsHVChannel(std::string pvss);
121 
122 private:
123  // typedefs
124  typedef std::vector<TkDcuPsuMap *> DcuPsuVector;
125  typedef std::map<std::string, std::vector<uint32_t> > PsuDetIdMap;
129  void getDcuPsuMap(DcuPsusRange &pRange, DcuPsusRange &cRange, std::string partition);
131  // std::vector< std::pair<uint32_t, SiStripConfigDb::DeviceAddress> > retrieveDcuDeviceAddresses(std::string partition);
132  std::vector<std::pair<std::vector<uint16_t>, std::vector<uint32_t> > > retrieveDcuDeviceAddresses(
133  std::string partition);
135  std::vector<uint32_t> findDcuIdFromDeviceAddress(uint32_t dcuid_);
139  // for debugging
140  void checkMapInputValues(const SiStripConfigDb::DcuDetIdsV &dcuDetIds_, const DcuPsuVector &dcuPsus_);
141 
142  // member variables
145  std::vector<std::pair<uint32_t, std::string> > pgMap, cgMap;
146  std::vector<std::string> detectorLocations, controlLocations;
147  std::vector<uint32_t> dcuIds, cgDcuIds, ccuDcuIds;
149  // std::vector< std::pair<uint32_t, SiStripConfigDb::DeviceAddress> > dcu_device_addr_vector;
150  std::vector<std::pair<std::vector<uint16_t>, std::vector<uint32_t> > > dcu_device_addr_vector;
151 };
152 #endif
Handle.h
SiStripPsuDetIdMap::controlLocations
std::vector< std::string > controlLocations
Definition: SiStripPsuDetIdMap.h:146
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:79
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
ESHandle.h
SiStripConfigDb::DcuDetIdsV
std::vector< DcuDetId > DcuDetIdsV
Definition: SiStripConfigDb.h:128
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
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:71
MapOfVectors.h
SiStripPsuDetIdMap::PsuDetIdMap
std::map< std::string, std::vector< uint32_t > > PsuDetIdMap
Definition: SiStripPsuDetIdMap.h:125
SiStripPsuDetIdMap::HVUnmapped_Map
PsuDetIdMap HVUnmapped_Map
Definition: SiStripPsuDetIdMap.h:144
SiStripPsuDetIdMap::getHVCrosstalkingMap
std::map< std::string, std::vector< uint32_t > > getHVCrosstalkingMap()
Definition: SiStripPsuDetIdMap.h:73
SiStripPsuDetIdMap::printMap
void printMap()
Definition: SiStripPsuDetIdMap.cc:480
SiStripDbParams.h
SiStripPsuDetIdMap::detectorLocations
std::vector< std::string > detectorLocations
Definition: SiStripPsuDetIdMap.h:146
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:150
SiStripPsuDetIdMap::DcuPsus
edm::MapOfVectors< std::string, TkDcuPsuMap * > DcuPsus
Definition: SiStripPsuDetIdMap.h:126
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:144
SiStripPsuDetIdMap
Extension to SiStripConfigDb to map PSU channels to DetIDs using DCU-PSU map and DCU-DetID map.
Definition: SiStripPsuDetIdMap.h:33
SiStripPsuDetIdMap::cgMap
std::vector< std::pair< uint32_t, std::string > > cgMap
Definition: SiStripPsuDetIdMap.h:145
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:91
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:87
SiStripConstants.h
SiStripPsuDetIdMap::db_
edm::Service< SiStripConfigDb > db_
Definition: SiStripPsuDetIdMap.h:143
SiStripPsuDetIdMap::clone
void clone(DcuPsuVector &input, DcuPsuVector &output)
Definition: SiStripPsuDetIdMap.cc:473
SiStripPsuDetIdMap::HVMap
PsuDetIdMap HVMap
Definition: SiStripPsuDetIdMap.h:144
Event.h
SiStripPsuDetIdMap::SiStripPsuDetIdMap
SiStripPsuDetIdMap()
Definition: SiStripPsuDetIdMap.cc:20
SiStripPsuDetIdMap::ccuDcuIds
std::vector< uint32_t > ccuDcuIds
Definition: SiStripPsuDetIdMap.h:147
SiStripPsuDetIdMap::dcuIds
std::vector< uint32_t > dcuIds
Definition: SiStripPsuDetIdMap.h:147
edm::Service< SiStripConfigDb >
SiStripPsuDetIdMap::getDetectorLocations
std::vector< std::string > getDetectorLocations()
Definition: SiStripPsuDetIdMap.h:81
SiStripPsuDetIdMap::getDcuPsuMap
std::vector< std::pair< uint32_t, std::string > > getDcuPsuMap()
Definition: SiStripPsuDetIdMap.cc:499
SiStripPsuDetIdMap::DcuPsuMapPG_
DcuPsus DcuPsuMapPG_
Definition: SiStripPsuDetIdMap.h:148
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:145
edm::MapOfVectors< std::string, TkDcuPsuMap * >::range
boost::iterator_range< data_iterator > range
Definition: MapOfVectors.h:34
SiStripPsuDetIdMap::DcuPsuMapCG_
DcuPsus DcuPsuMapCG_
Definition: SiStripPsuDetIdMap.h:148
SiStripPsuDetIdMap::DcuPsusRange
DcuPsus::range DcuPsusRange
Definition: SiStripPsuDetIdMap.h:127
EventSetup.h
SiStripPsuDetIdMap::LVMap
PsuDetIdMap LVMap
Definition: SiStripPsuDetIdMap.h:144
edm::MapOfVectors< std::string, TkDcuPsuMap * >
SiStripPsuDetIdMap::cgDcuIds
std::vector< uint32_t > cgDcuIds
Definition: SiStripPsuDetIdMap.h:147
SiStripPsuDetIdMap::~SiStripPsuDetIdMap
~SiStripPsuDetIdMap()
Definition: SiStripPsuDetIdMap.cc:24
SiStripPsuDetIdMap::getCgDcuIds
std::vector< uint32_t > getCgDcuIds()
Definition: SiStripPsuDetIdMap.h:89
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SiStripPsuDetIdMap::DcuPsuVector
std::vector< TkDcuPsuMap * > DcuPsuVector
Definition: SiStripPsuDetIdMap.h:124
SiStripPsuDetIdMap::getDcuIds
std::vector< uint32_t > getDcuIds()
Definition: SiStripPsuDetIdMap.h:83
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:85
watchdog.group
group
Definition: watchdog.py:82