File indexing completed on 2024-04-06 12:02:39
0001 #ifndef CondFormats_SiStripObjects_Phase2TrackerModule_H
0002 #define CondFormats_SiStripObjects_Phase2TrackerModule_H
0003
0004 #include <vector>
0005 #include <algorithm>
0006
0007 #include "CondFormats/Serialization/interface/Serializable.h"
0008
0009 class Phase2TrackerModule {
0010 public:
0011 enum ModuleTypes { SS, PS };
0012
0013 public:
0014
0015 Phase2TrackerModule(ModuleTypes moduleType = SS,
0016 uint32_t detid = 0,
0017 uint32_t gbtid = 0,
0018 uint32_t fedid = 0,
0019 uint32_t fedch = 0,
0020 uint32_t powerGroup = 0,
0021 uint32_t coolingLoop = 0)
0022 : moduleType_(moduleType), detid_(detid), gbtid_(gbtid), powerGroup_(powerGroup), coolingLoop_(coolingLoop) {
0023 ch_ = std::make_pair(fedid, fedch);
0024 }
0025
0026
0027 virtual ~Phase2TrackerModule() {}
0028
0029
0030 void setDetid(uint32_t detid) { detid_ = detid; }
0031 void setGbtid(uint32_t gbtid) { gbtid_ = gbtid; }
0032 void setFedChannel(unsigned int fedid, unsigned int fedch) { ch_ = std::make_pair(fedid, fedch); }
0033 void setCoolingLoop(uint32_t cl) { coolingLoop_ = cl; }
0034 void setPowerGroup(uint32_t pg) { powerGroup_ = pg; }
0035 void setModuleType(ModuleTypes moduleType) { moduleType_ = moduleType; }
0036 void addI2cDevice(unsigned int dev) { i2cDevices_.push_back(dev); }
0037 void setI2cDevices(std::vector<unsigned int> i2cd) { i2cDevices_ = i2cd; }
0038
0039
0040 uint32_t getDetid() const { return detid_; }
0041 uint32_t getGbtid() const { return gbtid_; }
0042 std::pair<unsigned int, unsigned int> getCh() const { return ch_; }
0043 uint32_t getCoolingLoop() const { return coolingLoop_; }
0044 uint32_t getPowerGroup() const { return powerGroup_; }
0045 ModuleTypes getModuleType() const { return moduleType_; }
0046 const std::vector<unsigned int>& getI2cDevices() const { return i2cDevices_; }
0047
0048
0049 std::string description(bool compact = false) const;
0050
0051 private:
0052
0053
0054
0055
0056 ModuleTypes moduleType_;
0057 uint32_t detid_, gbtid_;
0058 uint32_t powerGroup_, coolingLoop_;
0059 std::pair<unsigned int, unsigned int> ch_;
0060 std::vector<unsigned int> i2cDevices_;
0061
0062 COND_SERIALIZABLE;
0063 };
0064
0065 #endif