CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 {
11  public:
12  enum ModuleTypes { SS, PS };
13 
14  public:
15  // normal constructor... for now, nothing is mandatory
16  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):
17  moduleType_(moduleType), detid_(detid), gbtid_(gbtid), powerGroup_(powerGroup), coolingLoop_(coolingLoop) { ch_ = std::make_pair(fedid, fedch); }
18 
19  // destructor
20  virtual ~Phase2TrackerModule() {}
21 
22  // setters (complement the constructor)
23  void setDetid(uint32_t detid) { detid_ = detid; }
24  void setGbtid(uint32_t gbtid) { gbtid_ = gbtid; }
25  void setFedChannel(unsigned int fedid, unsigned int fedch) { ch_ = std::make_pair(fedid, fedch); }
26  void setCoolingLoop(uint32_t cl) { coolingLoop_ = cl; }
27  void setPowerGroup(uint32_t pg) { powerGroup_ = pg; }
28  void setModuleType(ModuleTypes moduleType) { moduleType_ = moduleType; }
29  void addI2cDevice(unsigned int dev) { i2cDevices_.push_back(dev); }
30  void setI2cDevices(std::vector<unsigned int> i2cd) { i2cDevices_ = i2cd; }
31 
32  // getters
33  uint32_t getDetid() const { return detid_; }
34  uint32_t getGbtid() const { return gbtid_; }
35  std::pair<unsigned int, unsigned int> getCh() const { return ch_; }
36  uint32_t getCoolingLoop() const { return coolingLoop_; }
37  uint32_t getPowerGroup() const { return powerGroup_; }
39  const std::vector<unsigned int>& getI2cDevices() const { return i2cDevices_; }
40 
41  // description (for printing)
42  std::string description(bool compact=false) const;
43 
44  private:
45  // 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
46  // the detid/GBTid map comes from construction. It should be in the construction database
47  // the power groups and cooling groups are defined in terms of detids. Known from construction.
48  // ... of course, for now there is nothing like the GBTid...
50  uint32_t detid_, gbtid_;
52  std::pair<unsigned int,unsigned int> ch_;
53  std::vector<unsigned int> i2cDevices_;
54 
56 };
57 
58 #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 > ch_
std::pair< unsigned int, unsigned int > getCh() const
uint32_t getGbtid() const
void setDetid(uint32_t detid)
void setFedChannel(unsigned int fedid, unsigned int fedch)
ModuleTypes getModuleType() const
void setCoolingLoop(uint32_t cl)