Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:38

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   // normal constructor... for now, nothing is mandatory
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   // destructor
0027   virtual ~Phase2TrackerModule() {}
0028 
0029   // setters (complement the constructor)
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   // getters
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   // description (for printing)
0049   std::string description(bool compact = false) const;
0050 
0051 private:
0052   // 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
0053   // the detid/GBTid map comes from construction. It should be in the construction database
0054   // the power groups and cooling groups are defined in terms of detids. Known from construction.
0055   // ... of course, for now there is nothing like the GBTid...
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