CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
21 {
22  public:
24  virtual ~SiStripDetCabling();
26  void addDevices(const FedChannelConnection &, std::map< uint32_t, std::vector<const FedChannelConnection *> >&);
27  void addDevices(const FedChannelConnection &); // special case of above addDevices
28  // getters
29  inline const std::map< uint32_t, std::vector<const FedChannelConnection *> >& getDetCabling() const { return fullcabling_; }
30  // for DQM use: all detectors that have at least one connected APV
31  void addActiveDetectorsRawIds(std::vector<uint32_t> &) const; // add to vector Ids of connected modules (active == connected)
32  void addAllDetectorsRawIds(std::vector<uint32_t> & vector_to_fill_with_detids ) const; // add to vector Ids of all modules
33  void getAllDetectorsContiguousIds(std::map<uint32_t, unsigned int>&) const; // map of all connected, detected, undetected to contiguous Ids - map is reset first!
34  void getActiveDetectorsContiguousIds(std::map<uint32_t, unsigned int>&) const; // map of all connected to contiguous Ids - map is reset first!
35  // for RECO use
36  void addConnected ( std::map<uint32_t, std::vector<int> > &) const; // map of detector to list of APVs for APVs seen from FECs and FEDs
37  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
38  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
39  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
40  // other
41  const std::vector<const FedChannelConnection *>& getConnections( uint32_t det_id ) const;
42  const FedChannelConnection& getConnection( uint32_t det_id, unsigned short apv_pair ) const;
43  const unsigned int getDcuId( uint32_t det_id ) const;
44  const uint16_t nApvPairs(uint32_t det_id) const; // maximal nr. of apvpairs a detector can have (2 or 3)
45  bool IsConnected(const uint32_t& det_id) const;
46  bool IsDetected(const uint32_t& det_id) const;
47  bool IsUndetected(const uint32_t& det_id) const;
48 
50  void print( std::stringstream& ) const;
51 
53  void printSummary(std::stringstream& ss) const;
55  void printDebug(std::stringstream& ss) const;
56 
57  // Methods to get the number of connected, detected and undetected modules for each layer of each subdetector.
58  uint32_t connectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 0); }
59  uint32_t detectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 1); }
60  uint32_t undetectedNumber(const std::string & subDet, const uint16_t layer) const { return detNumber(subDet, layer, 2); }
61  inline const SiStripFedCabling * fedCabling() const {return fedCabling_;}
62 
63  std::map< uint32_t, std::vector<int> > const & connected() const { return connected_;}
64 
65  private:
66  SiStripDetCabling(const SiStripDetCabling&); // stop default
67  const SiStripDetCabling& operator=(const SiStripDetCabling&); // stop default
68  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;
69  bool IsInMap(const uint32_t& det_id, const std::map<uint32_t, std::vector<int> > &) const;
70  int16_t layerSearch( const uint32_t detId ) const;
71  uint32_t detNumber(const std::string & subDet, const uint16_t layer, const int connectionType) const;
72 
73  // ---------- member data --------------------------------
74  // map of KEY=detid DATA=vector<FedChannelConnection>
75  std::map< uint32_t, std::vector<const FedChannelConnection *> > fullcabling_;
76  // map of KEY=detid DATA=vector of apvs, maximum 6 APVs per detector module : 0,1,2,3,4,5
77  std::map< uint32_t, std::vector<int> > connected_; // seen from FECs and FEDs
78  std::map< uint32_t, std::vector<int> > detected_; // seen from FECs but not from FEDs
79  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
80 
81  // Map containing the number of detectors for each connectionType
82  // 0 = connected
83  // 1 = detected
84  // 2 = undetected
85  std::map< int16_t, uint32_t > connectionCount[3];
87 };
88 #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_
const unsigned int getDcuId(uint32_t det_id) 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...
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
const SiStripDetCabling & operator=(const SiStripDetCabling &)
void getAllDetectorsContiguousIds(std::map< uint32_t, unsigned int > &) const
const SiStripFedCabling * fedCabling() const
const std::map< uint32_t, std::vector< const FedChannelConnection * > > & getDetCabling() const
virtual ~SiStripDetCabling()
void printSummary(std::stringstream &ss) const
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
std::map< uint32_t, std::vector< int > > const & connected() const
void addDetected(std::map< uint32_t, std::vector< int > > &) const
void printDebug(std::stringstream &ss) 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
void addConnected(std::map< uint32_t, std::vector< int > > &) const