CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 &quot;pixel configuration data&quot; management.
unsigned int getFECNumber(unsigned int i) const
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
This class implements..
unsigned int getVMEBaseAddress(unsigned int i) const
unsigned int getCrate(unsigned int i) const
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
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 &quot;pixel configuration data&quot; management.
tuple key
prepare the HTCondor submission files and eventually submit them
PixelFECConfig(std::string filename)
unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const
This class implements..
unsigned int getNFECBoards() const
void writeASCII(std::string dir="") const override
std::vector< PixelFECParameters > fecconfig_
tuple filename
Definition: lut2db_cfg.py:20
unsigned int FECSlotFromFECNumber(unsigned int fecnumber)