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  typedef std::vector<Phase2TrackerModule> store;
11  typedef std::vector<Phase2TrackerModule>::const_iterator key;
12  typedef std::vector<key> cabling;
13 
14 public:
15  // Constructor taking FED channel connection objects as input.
16  Phase2TrackerCabling(const std::vector<Phase2TrackerModule>& cons);
17 
18  // Copy ocnstructor
20 
21  // Default constructor
23 
24  // Default destructor
25  virtual ~Phase2TrackerCabling() {}
26 
27  // Initialize the internal maps
28  void initializeCabling();
29 
30  // get the list of modules
31  const std::vector<Phase2TrackerModule>& connections() const { return connections_; }
32 
33  // find a connection for a given fed channel
34  const Phase2TrackerModule& findFedCh(std::pair<unsigned int, unsigned int> fedch) const;
35 
36  // find a connection for a given detid
37  const Phase2TrackerModule& findDetid(uint32_t detid) const;
38 
39  // find a connection for a given gbtid
40  const Phase2TrackerModule& findGbtid(uint32_t gbtid) const;
41 
42  // return all the modules connected to a given cooling line
43  Phase2TrackerCabling filterByCoolingLine(uint32_t coolingLine) const;
44 
45  // return all the modules connected to a given HV group
46  Phase2TrackerCabling filterByPowerGroup(uint32_t powerGroup) const;
47 
48  // print a summary of the content
50 
51  // print the details of the content
52  std::string description(bool compact = false) const;
53 
54 private:
55  // the connections
57 
58  // indices for fast searches
62 
63 private:
64  // sorting functions
65  static bool chOrdering(key a, key b);
66  static bool chComp(key a, std::pair<unsigned int, unsigned int> b);
67  static bool fedeq(key a, key b);
68  static bool detidOrdering(key a, key b);
69  static bool detidComp(key a, uint32_t b);
70  static bool gbtidOrdering(key a, key b);
71  static bool gbtidComp(key a, uint32_t b);
72  static bool coolingOrdering(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
73  static bool coolingComp(const Phase2TrackerModule& a, uint32_t b);
74  static bool cooleq(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
75  static bool powerOrdering(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
76  static bool powerComp(const Phase2TrackerModule& a, uint32_t b);
77  static bool poweq(const Phase2TrackerModule& a, const Phase2TrackerModule& b);
78 
80 };
81 
82 #endif
Phase2TrackerCabling::poweq
static bool poweq(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
Definition: Phase2TrackerCabling.cc:50
Phase2TrackerCabling::Phase2TrackerCabling
Phase2TrackerCabling()
Definition: Phase2TrackerCabling.h:22
Phase2TrackerCabling::powerComp
static bool powerComp(const Phase2TrackerModule &a, uint32_t b)
Definition: Phase2TrackerCabling.cc:49
Phase2TrackerCabling::gbtCabling_
cabling gbtCabling_
Definition: Phase2TrackerCabling.h:60
Phase2TrackerCabling::detCabling_
cabling detCabling_
Definition: Phase2TrackerCabling.h:61
Phase2TrackerCabling::gbtidOrdering
static bool gbtidOrdering(key a, key b)
Definition: Phase2TrackerCabling.cc:31
Phase2TrackerCabling
Definition: Phase2TrackerCabling.h:9
Phase2TrackerCabling::findGbtid
const Phase2TrackerModule & findGbtid(uint32_t gbtid) const
Definition: Phase2TrackerCabling.cc:104
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
Phase2TrackerCabling::coolingComp
static bool coolingComp(const Phase2TrackerModule &a, uint32_t b)
Definition: Phase2TrackerCabling.cc:40
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
Phase2TrackerCabling::filterByCoolingLine
Phase2TrackerCabling filterByCoolingLine(uint32_t coolingLine) const
Definition: Phase2TrackerCabling.cc:114
Phase2TrackerCabling::cabling
std::vector< key > cabling
Definition: Phase2TrackerCabling.h:12
Phase2TrackerCabling::coolingOrdering
static bool coolingOrdering(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
Definition: Phase2TrackerCabling.cc:37
Phase2TrackerCabling::cooleq
static bool cooleq(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
Definition: Phase2TrackerCabling.cc:41
Phase2TrackerCabling::filterByPowerGroup
Phase2TrackerCabling filterByPowerGroup(uint32_t powerGroup) const
Definition: Phase2TrackerCabling.cc:133
Phase2TrackerCabling::chOrdering
static bool chOrdering(key a, key b)
Definition: Phase2TrackerCabling.cc:10
Phase2TrackerCabling::~Phase2TrackerCabling
virtual ~Phase2TrackerCabling()
Definition: Phase2TrackerCabling.h:25
Phase2TrackerCabling::initializeCabling
void initializeCabling()
Definition: Phase2TrackerCabling.cc:68
Phase2TrackerCabling::findFedCh
const Phase2TrackerModule & findFedCh(std::pair< unsigned int, unsigned int > fedch) const
Definition: Phase2TrackerCabling.cc:84
Phase2TrackerCabling::key
std::vector< Phase2TrackerModule >::const_iterator key
Definition: Phase2TrackerCabling.h:11
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
Phase2TrackerModule
Definition: Phase2TrackerModule.h:9
Serializable.h
Phase2TrackerCabling::store
std::vector< Phase2TrackerModule > store
Definition: Phase2TrackerCabling.h:10
Phase2TrackerCabling::connections
const std::vector< Phase2TrackerModule > & connections() const
Definition: Phase2TrackerCabling.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2TrackerCabling::findDetid
const Phase2TrackerModule & findDetid(uint32_t detid) const
Definition: Phase2TrackerCabling.cc:94
Phase2TrackerCabling::detidOrdering
static bool detidOrdering(key a, key b)
Definition: Phase2TrackerCabling.cc:25
Phase2TrackerCabling::connections_
store connections_
Definition: Phase2TrackerCabling.h:56
Phase2TrackerCabling::fedeq
static bool fedeq(key a, key b)
Definition: Phase2TrackerCabling.cc:22
Phase2TrackerCabling::detidComp
static bool detidComp(key a, uint32_t b)
Definition: Phase2TrackerCabling.cc:28
Phase2TrackerModule.h
Phase2TrackerCabling::chComp
static bool chComp(key a, std::pair< unsigned int, unsigned int > b)
Definition: Phase2TrackerCabling.cc:16
Phase2TrackerCabling::fedCabling_
cabling fedCabling_
Definition: Phase2TrackerCabling.h:59
Phase2TrackerCabling::summaryDescription
std::string summaryDescription() const
Definition: Phase2TrackerCabling.cc:152
Phase2TrackerCabling::description
std::string description(bool compact=false) const
Definition: Phase2TrackerCabling.cc:173
Phase2TrackerCabling::powerOrdering
static bool powerOrdering(const Phase2TrackerModule &a, const Phase2TrackerModule &b)
Definition: Phase2TrackerCabling.cc:46
Phase2TrackerCabling::gbtidComp
static bool gbtidComp(key a, uint32_t b)
Definition: Phase2TrackerCabling.cc:34