CMS 3D CMS Logo

Phase2TrackerModule.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiStripObjects_Phase2TrackerModule_H
2 #define CondFormats_SiStripObjects_Phase2TrackerModule_H
3 
4 #include <vector>
5 #include <algorithm>
6 
8 
10 public:
11  enum ModuleTypes { SS, PS };
12 
13 public:
14  // normal constructor... for now, nothing is mandatory
16  uint32_t detid = 0,
17  uint32_t gbtid = 0,
18  uint32_t fedid = 0,
19  uint32_t fedch = 0,
20  uint32_t powerGroup = 0,
21  uint32_t coolingLoop = 0)
22  : moduleType_(moduleType), detid_(detid), gbtid_(gbtid), powerGroup_(powerGroup), coolingLoop_(coolingLoop) {
23  ch_ = std::make_pair(fedid, fedch);
24  }
25 
26  // destructor
27  virtual ~Phase2TrackerModule() {}
28 
29  // setters (complement the constructor)
30  void setDetid(uint32_t detid) { detid_ = detid; }
31  void setGbtid(uint32_t gbtid) { gbtid_ = gbtid; }
32  void setFedChannel(unsigned int fedid, unsigned int fedch) { ch_ = std::make_pair(fedid, fedch); }
33  void setCoolingLoop(uint32_t cl) { coolingLoop_ = cl; }
34  void setPowerGroup(uint32_t pg) { powerGroup_ = pg; }
35  void setModuleType(ModuleTypes moduleType) { moduleType_ = moduleType; }
36  void addI2cDevice(unsigned int dev) { i2cDevices_.push_back(dev); }
37  void setI2cDevices(std::vector<unsigned int> i2cd) { i2cDevices_ = i2cd; }
38 
39  // getters
40  uint32_t getDetid() const { return detid_; }
41  uint32_t getGbtid() const { return gbtid_; }
42  std::pair<unsigned int, unsigned int> getCh() const { return ch_; }
43  uint32_t getCoolingLoop() const { return coolingLoop_; }
44  uint32_t getPowerGroup() const { return powerGroup_; }
46  const std::vector<unsigned int>& getI2cDevices() const { return i2cDevices_; }
47 
48  // description (for printing)
49  std::string description(bool compact = false) const;
50 
51 private:
52  // the GBTid/fed map should be easy to build automatically, since the FED can ask to the link. It could be put in some commissioning packet
53  // the detid/GBTid map comes from construction. It should be in the construction database
54  // the power groups and cooling groups are defined in terms of detids. Known from construction.
55  // ... of course, for now there is nothing like the GBTid...
57  uint32_t detid_, gbtid_;
59  std::pair<unsigned int, unsigned int> ch_;
60  std::vector<unsigned int> i2cDevices_;
61 
63 };
64 
65 #endif
Phase2TrackerModule(ModuleTypes moduleType=SS, uint32_t detid=0, uint32_t gbtid=0, uint32_t fedid=0, uint32_t fedch=0, uint32_t powerGroup=0, uint32_t coolingLoop=0)
void setGbtid(uint32_t gbtid)
void setPowerGroup(uint32_t pg)
uint32_t getPowerGroup() const
void setI2cDevices(std::vector< unsigned int > i2cd)
uint32_t getCoolingLoop() const
const std::vector< unsigned int > & getI2cDevices() const
void setModuleType(ModuleTypes moduleType)
void addI2cDevice(unsigned int dev)
uint32_t getDetid() const
std::vector< unsigned int > i2cDevices_
std::string description(bool compact=false) const
std::pair< unsigned int, unsigned int > getCh() const
uint32_t getGbtid() const
#define COND_SERIALIZABLE
Definition: Serializable.h:38
std::pair< unsigned int, unsigned int > ch_
void setDetid(uint32_t detid)
void setFedChannel(unsigned int fedid, unsigned int fedch)
ModuleTypes getModuleType() const
void setCoolingLoop(uint32_t cl)