CMS 3D CMS Logo

SiStripDetCabling.h
Go to the documentation of this file.
1 #ifndef SiStripObjects_SiStripDetCabling_h
2 #define SiStripObjects_SiStripDetCabling_h
3 // -*- C++ -*-
4 //
5 // Package: CalibFormats/SiStripObjects
6 // Class : SiStripDetCabling
12 // Original Author: dkcira
13 // Created: Wed Mar 22 12:24:20 CET 2006
16 #include <map>
17 #include <string>
18 #include <vector>
19 #include <cstdint>
20 class TrackerTopology;
22 public:
23  SiStripDetCabling(const TrackerTopology *const topology);
24  virtual ~SiStripDetCabling();
25  SiStripDetCabling(const SiStripFedCabling &, const TrackerTopology *const topology);
26 
27  SiStripDetCabling(const SiStripDetCabling &) = delete;
28  const SiStripDetCabling &operator=(const SiStripDetCabling &) = delete;
29 
30  void addDevices(const FedChannelConnection &, std::map<uint32_t, std::vector<const FedChannelConnection *>> &);
31  void addDevices(const FedChannelConnection &); // special case of above addDevices
32  // getters
33  inline const std::map<uint32_t, std::vector<const FedChannelConnection *>> &getDetCabling() const {
34  return fullcabling_;
35  }
36  // for DQM use: all detectors that have at least one connected APV
38  std::vector<uint32_t> &) const; // add to vector Ids of connected modules (active == connected)
40  std::vector<uint32_t> &vector_to_fill_with_detids) const; // add to vector Ids of all modules
42  std::map<uint32_t, unsigned int> &) const; // map of all connected, detected, undetected to contiguous Ids -
43  // map is reset first!
45  std::map<uint32_t, unsigned int> &) const; // map of all connected to contiguous Ids - map is reset first!
46  // for RECO use
47  void addConnected(std::map<uint32_t, std::vector<int>> &)
48  const; // map of detector to list of APVs for APVs seen from FECs and FEDs
49  void addDetected(
50  std::map<uint32_t, std::vector<int>> &) const; // map of detector to list of APVs for APVs seen from FECs but not
51  // from FEDs
52  void addUnDetected(
53  std::map<uint32_t, std::vector<int>> &) const; // map of detector to list of APVs for APVs seen neither from FECS
54  // or FEDs
56  std::map<uint32_t, std::vector<int>> &) const; // map of detector to list of APVs that are not connected -
57  // combination of addDetected and addUnDetected
58  // other
59  const std::vector<const FedChannelConnection *> &getConnections(uint32_t det_id) const;
60  const FedChannelConnection &getConnection(uint32_t det_id, unsigned short apv_pair) const;
61  const unsigned int getDcuId(uint32_t det_id) const;
62  const uint16_t nApvPairs(uint32_t det_id) const; // maximal nr. of apvpairs a detector can have (2 or 3)
63  bool IsConnected(const uint32_t &det_id) const;
64  bool IsDetected(const uint32_t &det_id) const;
65  bool IsUndetected(const uint32_t &det_id) const;
66 
68  void print(std::stringstream &) const;
69 
72  void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
75  void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const;
76 
77  // Methods to get the number of connected, detected and undetected modules for
78  // each layer of each subdetector.
79  uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const {
80  return detNumber(subDet, layer, 0);
81  }
82  uint32_t detectedNumber(const std::string &subDet, const uint16_t layer) const { return detNumber(subDet, layer, 1); }
83  uint32_t undetectedNumber(const std::string &subDet, const uint16_t layer) const {
84  return detNumber(subDet, layer, 2);
85  }
86  inline const SiStripFedCabling *fedCabling() const { return fedCabling_; }
87  inline const TrackerTopology *const trackerTopology() const { return tTopo; }
88 
89  std::map<uint32_t, std::vector<int>> const &connected() const { return connected_; }
90 
91 private:
92  void addFromSpecificConnection(std::map<uint32_t, std::vector<int>> &,
93  const std::map<uint32_t, std::vector<int>> &,
94  std::map<int16_t, uint32_t> *connectionsToFill = nullptr) const;
95  bool IsInMap(const uint32_t &det_id, const std::map<uint32_t, std::vector<int>> &) const;
96  int16_t layerSearch(const uint32_t detId) const;
97  uint32_t detNumber(const std::string &subDet, const uint16_t layer, const int connectionType) const;
98 
99  // ---------- member data --------------------------------
100  // map of KEY=detid DATA=vector<FedChannelConnection>
101  std::map<uint32_t, std::vector<const FedChannelConnection *>> fullcabling_;
102  // map of KEY=detid DATA=vector of apvs, maximum 6 APVs per detector module :
103  // 0,1,2,3,4,5
104  std::map<uint32_t, std::vector<int>> connected_; // seen from FECs and FEDs
105  std::map<uint32_t, std::vector<int>> detected_; // seen from FECs but not from FEDs
106  std::map<uint32_t, std::vector<int>> undetected_; // seen from neither FECs or FEDs, DetIds inferred from
107  // static Look-Up-Table in the configuration database
108 
109  // Map containing the number of detectors for each connectionType
110  // 0 = connected
111  // 1 = detected
112  // 2 = undetected
113  std::map<int16_t, uint32_t> connectionCount[3];
115  const TrackerTopology *const tTopo;
116 };
117 #endif
SiStripDetCabling::trackerTopology
const TrackerTopology *const trackerTopology() const
Definition: SiStripDetCabling.h:87
SiStripDetCabling::addActiveDetectorsRawIds
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
Definition: SiStripDetCabling.cc:134
SiStripDetCabling::getDcuId
const unsigned int getDcuId(uint32_t det_id) const
Definition: SiStripDetCabling.cc:192
SiStripDetCabling::detectedNumber
uint32_t detectedNumber(const std::string &subDet, const uint16_t layer) const
Definition: SiStripDetCabling.h:82
SiStripDetCabling::getDetCabling
const std::map< uint32_t, std::vector< const FedChannelConnection * > > & getDetCabling() const
Definition: SiStripDetCabling.h:33
TrackerTopology
Definition: TrackerTopology.h:16
SiStripDetCabling::printSummary
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripDetCabling.cc:410
SiStripFedCabling.h
SiStripDetCabling::printDebug
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripDetCabling.cc:445
SiStripDetCabling::fedCabling
const SiStripFedCabling * fedCabling() const
Definition: SiStripDetCabling.h:86
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
SiStripDetCabling::fullcabling_
std::map< uint32_t, std::vector< const FedChannelConnection * > > fullcabling_
Definition: SiStripDetCabling.h:101
SiStripDetCabling::IsUndetected
bool IsUndetected(const uint32_t &det_id) const
Definition: SiStripDetCabling.cc:378
SiStripDetCabling::getConnection
const FedChannelConnection & getConnection(uint32_t det_id, unsigned short apv_pair) const
Definition: SiStripDetCabling.cc:176
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripDetCabling::undetectedNumber
uint32_t undetectedNumber(const std::string &subDet, const uint16_t layer) const
Definition: SiStripDetCabling.h:83
SiStripDetCabling::IsInMap
bool IsInMap(const uint32_t &det_id, const std::map< uint32_t, std::vector< int >> &) const
Definition: SiStripDetCabling.cc:379
SiStripDetCabling::connected
const std::map< uint32_t, std::vector< int > > & connected() const
Definition: SiStripDetCabling.h:89
SiStripDetCabling::fedCabling_
const SiStripFedCabling * fedCabling_
Definition: SiStripDetCabling.h:114
SiStripDetCabling
Definition: SiStripDetCabling.h:21
SiStripDetCabling::addNotConnectedAPVs
void addNotConnectedAPVs(std::map< uint32_t, std::vector< int >> &) const
Definition: SiStripDetCabling.cc:243
SiStripDetCabling::IsConnected
bool IsConnected(const uint32_t &det_id) const
Definition: SiStripDetCabling.cc:375
SiStripDetCabling::layerSearch
int16_t layerSearch(const uint32_t detId) const
Definition: SiStripDetCabling.cc:299
SiStripDetCabling::getAllDetectorsContiguousIds
void getAllDetectorsContiguousIds(std::map< uint32_t, unsigned int > &) const
Definition: SiStripDetCabling.cc:344
SiStripDetCabling::connected_
std::map< uint32_t, std::vector< int > > connected_
Definition: SiStripDetCabling.h:104
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
SiStripDetCabling::operator=
const SiStripDetCabling & operator=(const SiStripDetCabling &)=delete
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
SiStripDetCabling::getActiveDetectorsContiguousIds
void getActiveDetectorsContiguousIds(std::map< uint32_t, unsigned int > &) const
Definition: SiStripDetCabling.cc:357
SiStripDetCabling::addFromSpecificConnection
void addFromSpecificConnection(std::map< uint32_t, std::vector< int >> &, const std::map< uint32_t, std::vector< int >> &, std::map< int16_t, uint32_t > *connectionsToFill=nullptr) const
Definition: SiStripDetCabling.cc:249
SiStripDetCabling::print
void print(std::stringstream &) const
Definition: SiStripDetCabling.cc:386
SiStripDetCabling::addUnDetected
void addUnDetected(std::map< uint32_t, std::vector< int >> &) const
Definition: SiStripDetCabling.cc:237
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripDetCabling::IsDetected
bool IsDetected(const uint32_t &det_id) const
Definition: SiStripDetCabling.cc:377
SiStripDetCabling::addDevices
void addDevices(const FedChannelConnection &, std::map< uint32_t, std::vector< const FedChannelConnection * >> &)
Definition: SiStripDetCabling.cc:105
FedChannelConnection.h
SiStripDetCabling::SiStripDetCabling
SiStripDetCabling(const TrackerTopology *const topology)
Definition: SiStripDetCabling.cc:15
SiStripDetCabling::tTopo
const TrackerTopology *const tTopo
Definition: SiStripDetCabling.h:115
SiStripDetCabling::undetected_
std::map< uint32_t, std::vector< int > > undetected_
Definition: SiStripDetCabling.h:106
SiStripDetCabling::nApvPairs
const uint16_t nApvPairs(uint32_t det_id) const
Definition: SiStripDetCabling.cc:209
SiStripDetCabling::detNumber
uint32_t detNumber(const std::string &subDet, const uint16_t layer, const int connectionType) const
Definition: SiStripDetCabling.cc:318
SiStripDetCabling::~SiStripDetCabling
virtual ~SiStripDetCabling()
Definition: SiStripDetCabling.cc:16
SiStripDetCabling::addAllDetectorsRawIds
void addAllDetectorsRawIds(std::vector< uint32_t > &vector_to_fill_with_detids) const
Definition: SiStripDetCabling.cc:143
SiStripDetCabling::detected_
std::map< uint32_t, std::vector< int > > detected_
Definition: SiStripDetCabling.h:105
SiStripDetCabling::connectionCount
std::map< int16_t, uint32_t > connectionCount[3]
Definition: SiStripDetCabling.h:113
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SiStripDetCabling::addConnected
void addConnected(std::map< uint32_t, std::vector< int >> &) const
Definition: SiStripDetCabling.cc:227
SiStripDetCabling::getConnections
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
Definition: SiStripDetCabling.cc:161
SiStripDetCabling::addDetected
void addDetected(std::map< uint32_t, std::vector< int >> &) const
Definition: SiStripDetCabling.cc:232
SiStripDetCabling::connectedNumber
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
Definition: SiStripDetCabling.h:79