CMS 3D CMS Logo

Phase2TrackerCabling.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiStripObjects_Phase2TrackerCabling_H
2 #define CondFormats_SiStripObjects_Phase2TrackerCabling_H
3 
6 #include <vector>
7 #include <algorithm>
8 
10 {
11  typedef std::vector<Phase2TrackerModule> store;
12  typedef std::vector<Phase2TrackerModule>::const_iterator key;
13  typedef std::vector<key> cabling;
14 
15  public:
16  // Constructor taking FED channel connection objects as input.
17  Phase2TrackerCabling( const std::vector<Phase2TrackerModule>& cons );
18 
19  // Copy ocnstructor
21 
22  // Default constructor
24 
25  // Default destructor
26  virtual ~Phase2TrackerCabling() {}
27 
28  // Initialize the internal maps
29  void initializeCabling();
30 
31  // get the list of modules
32  const std::vector<Phase2TrackerModule>& connections() const { return connections_; }
33 
34  // find a connection for a given fed channel
35  const Phase2TrackerModule& findFedCh(std::pair<unsigned int, unsigned int> fedch) const;
36 
37  // find a connection for a given detid
38  const Phase2TrackerModule& findDetid(uint32_t detid) const;
39 
40  // find a connection for a given gbtid
41  const Phase2TrackerModule& findGbtid(uint32_t gbtid) const;
42 
43  // return all the modules connected to a given cooling line
44  Phase2TrackerCabling filterByCoolingLine(uint32_t coolingLine) const;
45 
46  // return all the modules connected to a given HV group
47  Phase2TrackerCabling filterByPowerGroup(uint32_t powerGroup) const;
48 
49  // print a summary of the content
51 
52  // print the details of the content
53  std::string description(bool compact=false) const;
54 
55  private:
56  // the connections
57  store connections_;
58 
59  // indices for fast searches
63 
64  private:
65  // sorting functions
66  static bool chOrdering(key a, key b);
67  static bool chComp(key a, std::pair<unsigned int, unsigned int> b);
68  static bool fedeq(key a, key b);
69  static bool detidOrdering(key a, key b);
70  static bool detidComp(key a, uint32_t b);
71  static bool gbtidOrdering(key a, key b);
72  static bool gbtidComp(key a, uint32_t b);
73  static bool coolingOrdering(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
74  static bool coolingComp(const Phase2TrackerModule& a, uint32_t b);
75  static bool cooleq(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
76  static bool powerOrdering(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
77  static bool powerComp(const Phase2TrackerModule& a, uint32_t b);
78  static bool poweq(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
79 
81 };
82 
83 #endif
static bool powerOrdering(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
Phase2TrackerCabling filterByCoolingLine(uint32_t coolingLine) const
Phase2TrackerCabling filterByPowerGroup(uint32_t powerGroup) const
const Phase2TrackerModule & findFedCh(std::pair< unsigned int, unsigned int > fedch) const
const std::vector< Phase2TrackerModule > & connections() const
static bool gbtidOrdering(key a, key b)
static bool coolingOrdering(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
static bool powerComp(const Phase2TrackerModule &a, uint32_t b)
static bool chOrdering(key a, key b)
static bool cooleq(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
static bool coolingComp(const Phase2TrackerModule &a, uint32_t b)
static bool poweq(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
std::vector< Phase2TrackerModule >::const_iterator key
static bool detidOrdering(key a, key b)
std::string summaryDescription() const
std::string description(bool compact=false) const
#define COND_TRANSIENT
Definition: Serializable.h:61
static bool detidComp(key a, uint32_t b)
double b
Definition: hdecay.h:120
#define COND_SERIALIZABLE
Definition: Serializable.h:38
static bool chComp(key a, std::pair< unsigned int, unsigned int > b)
static bool fedeq(key a, key b)
double a
Definition: hdecay.h:121
static bool gbtidComp(key a, uint32_t b)
const Phase2TrackerModule & findDetid(uint32_t detid) const
std::vector< Phase2TrackerModule > store
const Phase2TrackerModule & findGbtid(uint32_t gbtid) const
std::vector< key > cabling