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 
26  public:
27 
28  PixelFECConfig(std::string 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) {return FECSlotFromVMEBaseAddress(VMEBaseAddressFromFECNumber(fecnumber));}
41 
42  void writeASCII(std::string dir="") const override;
43  void writeXML( pos::PixelConfigKey key, int version, std::string path) const override {;}
45  int version,
47  std::ofstream *out,
48  std::ofstream *out1 = nullptr,
49  std::ofstream *out2 = nullptr
50  ) const override ;
51  void writeXML( std::ofstream *out,
52  std::ofstream *out1 = nullptr ,
53  std::ofstream *out2 = nullptr ) const override ;
54  void writeXMLTrailer( std::ofstream *out,
55  std::ofstream *out1 = nullptr,
56  std::ofstream *out2 = nullptr
57  ) const override ;
58 
59  //friend std::ostream& operator<<(std::ostream& s, const PixelDetectorconfig& config);
60 
61  private:
62 
63  // VMEBaseAddress = (FEC slot)x(0x8000000)
64  unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress) {assert(VMEBaseAddress%0x8000000 == 0); return VMEBaseAddress/0x8000000;}
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 
75 
76  };
77 }
78 /* @} */
79 #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.
unsigned int getFECNumber(unsigned int i) const
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
unsigned int getFECSlot(unsigned int i)
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
unsigned int crateFromFECNumber(unsigned int fecnumber) const
unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress)
std::vector< PixelFECParameters > fecconfig_
This file contains the base class for "pixel configuration data" management.
PixelFECConfig(std::string filename)
unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const
void writeASCII(std::string dir="") const override
This class implements..
unsigned int getNFECBoards() const
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
unsigned int FECSlotFromFECNumber(unsigned int fecnumber)
dbl *** dir
Definition: mlp_gen.cc:35