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