CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
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;
44  virtual void writeXMLHeader( pos::PixelConfigKey key,
45  int version,
47  std::ofstream *out,
48  std::ofstream *out1 = NULL,
49  std::ofstream *out2 = NULL
50  ) const ;
51  virtual void writeXML( std::ofstream *out,
52  std::ofstream *out1 = NULL ,
53  std::ofstream *out2 = NULL ) const ;
54  virtual void writeXMLTrailer( std::ofstream *out,
55  std::ofstream *out1 = NULL,
56  std::ofstream *out2 = NULL
57  ) const ;
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
int i
Definition: DBlmapReader.cc:9
This class specifies which FEC boards are used and how they are addressed.
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
This file contains the base class for &quot;pixel configuration data&quot; management.
unsigned int getFECNumber(unsigned int i) const
This class implements..
assert(m_qm.get())
unsigned int getVMEBaseAddress(unsigned int i) const
#define NULL
Definition: scimark2.h:8
unsigned int getCrate(unsigned int i) const
unsigned int getFECSlot(unsigned int i)
unsigned int crateFromFECNumber(unsigned int fecnumber) const
unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress)
void writeASCII(std::string dir="") const
std::vector< PixelFECParameters > fecconfig_
This file contains the base class for &quot;pixel configuration data&quot; management.
PixelFECConfig(std::string filename)
unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
This class implements..
tuple out
Definition: dbtoconf.py:99
unsigned int getNFECBoards() const
tuple filename
Definition: lut2db_cfg.py:20
unsigned int FECSlotFromFECNumber(unsigned int fecnumber)
dbl *** dir
Definition: mlp_gen.cc:35