CMS 3D CMS Logo

PixelFECConfig.h
Go to the documentation of this file.
1 #ifndef PixelFECConfig_h
2 #define PixelFECConfig_h
3 
9 #include <iostream>
10 #include <vector>
11 #include <string>
12 #include <cassert>
15 
16 namespace pos {
25  public:
28  filename); // <---- Modified for the conversion from parallel vectors to object that contain the configuration
29 
30  PixelFECConfig(std::vector<std::vector<std::string> > &tableMat);
31 
32  unsigned int getNFECBoards() const;
33 
34  unsigned int getFECNumber(unsigned int i) const;
35  unsigned int getCrate(unsigned int i) const;
36  unsigned int getVMEBaseAddress(unsigned int i) const;
37  unsigned int crateFromFECNumber(unsigned int fecnumber) const;
38  unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const;
39  unsigned int getFECSlot(unsigned int i) { return FECSlotFromVMEBaseAddress(getVMEBaseAddress(i)); }
40  unsigned int FECSlotFromFECNumber(unsigned int fecnumber) {
42  }
43 
44  void writeASCII(std::string dir = "") const override;
45  void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
47  int version,
49  std::ofstream *out,
50  std::ofstream *out1 = nullptr,
51  std::ofstream *out2 = nullptr) const override;
52  void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
53  void writeXMLTrailer(std::ofstream *out,
54  std::ofstream *out1 = nullptr,
55  std::ofstream *out2 = nullptr) const override;
56 
57  //friend std::ostream& operator<<(std::ostream& s, const PixelDetectorconfig& config);
58 
59  private:
60  // VMEBaseAddress = (FEC slot)x(0x8000000)
61  unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress) {
62  assert(VMEBaseAddress % 0x8000000 == 0);
63  return VMEBaseAddress / 0x8000000;
64  }
65 
66  //Already fixed from parallel vectors to vector of objects .... the object that contains the FEC config is PixelFECParameters
67 
68  // std::vector<unsigned int> fecnumber_;
69  // std::vector<unsigned int> crate_;
70  // std::vector<unsigned int> vmebaseaddress_;
71 
72  std::vector<PixelFECParameters> fecconfig_;
73  };
74 } // namespace pos
75 /* @} */
76 #endif
This class specifies which FEC boards are used and how they are addressed.
This file contains the base class for "pixel configuration data" management.
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
This class implements..
assert(be >=bs)
unsigned int getFECSlot(unsigned int i)
unsigned int crateFromFECNumber(unsigned int fecnumber) const
unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress)
This file contains the base class for "pixel configuration data" management.
unsigned int getVMEBaseAddress(unsigned int i) const
PixelFECConfig(std::string filename)
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
void writeASCII(std::string dir="") const override
unsigned int getFECNumber(unsigned int i) const
This class implements..
std::vector< PixelFECParameters > fecconfig_
unsigned int getCrate(unsigned int i) const
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const
unsigned int FECSlotFromFECNumber(unsigned int fecnumber)
unsigned int getNFECBoards() const