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
11 // Original Author: dkcira
12 // Created: Wed Mar 22 12:24:20 CET 2006
15 #include <boost/cstdint.hpp>
16 #include <vector>
17 #include <string>
18 #include <map>
19 class TrackerTopology;
21 {
22  public:
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 { return fullcabling_; }
34  // for DQM use: all detectors that have at least one connected APV
35  void addActiveDetectorsRawIds(std::vector<uint32_t> &) const; // add to vector Ids of connected modules (active == connected)
36  void addAllDetectorsRawIds(std::vector<uint32_t> & vector_to_fill_with_detids ) const; // add to vector Ids of all modules
37  void getAllDetectorsContiguousIds(std::map<uint32_t, unsigned int>&) const; // map of all connected, detected, undetected to contiguous Ids - map is reset first!
38  void getActiveDetectorsContiguousIds(std::map<uint32_t, unsigned int>&) const; // map of all connected to contiguous Ids - map is reset first!
39  // for RECO use
40  void addConnected ( std::map<uint32_t, std::vector<int> > &) const; // map of detector to list of APVs for APVs seen from FECs and FEDs
41  void addDetected ( std::map<uint32_t, std::vector<int> > &) const; // map of detector to list of APVs for APVs seen from FECs but not from FEDs
42  void addUnDetected( std::map<uint32_t, std::vector<int> > &) const; // map of detector to list of APVs for APVs seen neither from FECS or FEDs
43  void addNotConnectedAPVs( std::map<uint32_t, std::vector<int> > &) const; // map of detector to list of APVs that are not connected - combination of addDetected and addUnDetected
44  // other
45  const std::vector<const FedChannelConnection *>& getConnections( uint32_t det_id ) const;
46  const FedChannelConnection& getConnection( uint32_t det_id, unsigned short apv_pair ) const;
47  const unsigned int getDcuId( uint32_t det_id ) const;
48  const uint16_t nApvPairs(uint32_t det_id) const; // maximal nr. of apvpairs a detector can have (2 or 3)
49  bool IsConnected(const uint32_t& det_id) const;
50  bool IsDetected(const uint32_t& det_id) const;
51  bool IsUndetected(const uint32_t& det_id) const;
52 
54  void print( std::stringstream& ) const;
55 
57  void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
59  void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
60 
61  // Methods to get the number of connected, detected and undetected modules for each layer of each subdetector.
62  uint32_t connectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 0); }
63  uint32_t detectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 1); }
64  uint32_t undetectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 2); }
65  inline const SiStripFedCabling * fedCabling() const {return fedCabling_;}
66  inline const TrackerTopology* const trackerTopology() const {return tTopo;}
67 
68  std::map< uint32_t, std::vector<int> > const & connected() const { return connected_;}
69 
70  private:
71  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;
72  bool IsInMap(const uint32_t& det_id, const std::map<uint32_t, std::vector<int> > &) const;
73  int16_t layerSearch( const uint32_t detId ) const;
74  uint32_t detNumber(const std::string & subDet, const uint16_t layer, const int connectionType) const;
75 
76  // ---------- member data --------------------------------
77  // map of KEY=detid DATA=vector<FedChannelConnection>
78  std::map< uint32_t, std::vector<const FedChannelConnection *> > fullcabling_;
79  // map of KEY=detid DATA=vector of apvs, maximum 6 APVs per detector module : 0,1,2,3,4,5
80  std::map< uint32_t, std::vector<int> > connected_; // seen from FECs and FEDs
81  std::map< uint32_t, std::vector<int> > detected_; // seen from FECs but not from FEDs
82  std::map< uint32_t, std::vector<int> > undetected_; // seen from neither FECs or FEDs, DetIds inferred from static Look-Up-Table in the configuration database
83 
84  // Map containing the number of detectors for each connectionType
85  // 0 = connected
86  // 1 = detected
87  // 2 = undetected
88  std::map< int16_t, uint32_t > connectionCount[3];
90  const TrackerTopology* const tTopo;
91 };
92 #endif
uint32_t detectedNumber(const std::string &subDet, const uint16_t layer) const
uint32_t undetectedNumber(const std::string &subDet, const uint16_t layer) const
const FedChannelConnection & getConnection(uint32_t det_id, unsigned short apv_pair) const
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
std::map< uint32_t, std::vector< int > > connected_
CaloTopology const * topology(0)
const unsigned int getDcuId(uint32_t det_id) const
const TrackerTopology *const trackerTopology() const
bool IsInMap(const uint32_t &det_id, const std::map< uint32_t, std::vector< int > > &) const
bool IsConnected(const uint32_t &det_id) const
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
int16_t layerSearch(const uint32_t detId) const
const SiStripFedCabling * fedCabling_
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
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
std::map< uint32_t, std::vector< int > > detected_
Class containning control, module, detector and connection information, at the level of a FED channel...
const SiStripDetCabling & operator=(const SiStripDetCabling &)=delete
void addNotConnectedAPVs(std::map< uint32_t, std::vector< int > > &) const
uint32_t detNumber(const std::string &subDet, const uint16_t layer, const int connectionType) const
Return the number of modules for the specified subDet, layer and connectionType.
std::map< uint32_t, std::vector< const FedChannelConnection * > > fullcabling_
bool IsUndetected(const uint32_t &det_id) const
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
void getAllDetectorsContiguousIds(std::map< uint32_t, unsigned int > &) const
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
const SiStripFedCabling * fedCabling() const
const std::map< uint32_t, std::vector< const FedChannelConnection * > > & getDetCabling() const
virtual ~SiStripDetCabling()
std::map< int16_t, uint32_t > connectionCount[3]
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
const uint16_t nApvPairs(uint32_t det_id) const
void getActiveDetectorsContiguousIds(std::map< uint32_t, unsigned int > &) const
const TrackerTopology *const tTopo
std::map< uint32_t, std::vector< int > > const & connected() const
void addDetected(std::map< uint32_t, std::vector< int > > &) const
void addDevices(const FedChannelConnection &, std::map< uint32_t, std::vector< const FedChannelConnection * > > &)
std::map< uint32_t, std::vector< int > > undetected_
void addAllDetectorsRawIds(std::vector< uint32_t > &vector_to_fill_with_detids) const
void addUnDetected(std::map< uint32_t, std::vector< int > > &) const
bool IsDetected(const uint32_t &det_id) const
void print(std::stringstream &) const
SiStripDetCabling(const TrackerTopology *const topology)
void addConnected(std::map< uint32_t, std::vector< int > > &) const