CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelFEDCard.h
Go to the documentation of this file.
1 #ifndef TP_PIXELFEDCARD_H
2 #define TP_PIXELFEDCARD_H
3 
11 
12 #include <vector>
13 #include <string>
14 
15 namespace pos{
26  class PixelFEDCard : public PixelConfigBase{
27 
28  public:
29 
30  //Return true or false depending on if iChannel is used
31  //iChannel=1..36
32  bool useChannel(unsigned int iChannel);
33 
34  //Set iChannel enable to mode
35  //iChannel=1..36
36  void setChannel(unsigned int iChannel, bool mode);
37 
40 
41 
42  // Constructor and destructor
43  PixelFEDCard(); // empty
44  PixelFEDCard(std::string filename); // create from files
45  PixelFEDCard(std::vector<std::vector<std::string> > & tab); // create from DB
47 
48  void readDBTBMLevels(std::vector<std::vector<std::string> > &tableMat, int first, int last) ;
49  void readDBROCLevels(std::vector<std::vector<std::string> > &tableMat, int first, int last) ;
50  void writeASCII(std::string dir="") const; // write to files
52  virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const ;
53  virtual void writeXML( std::ofstream *out) const ;
54  virtual void writeXMLTrailer( std::ofstream *out) const ;
56  int version,
58  std::ofstream *fedstream,
59  std::ofstream *roclvlstream,
60  std::ofstream *tbmlvlsteram) const ;
61  virtual void writeXML(std::ofstream *fedstream,
62  std::ofstream *rocstream,
63  std::ofstream *tbmstream) const ;
64  virtual void writeXMLTrailer(std::ofstream *fedstream,
65  std::ofstream *recostream,
66  std::ofstream *tbmstream) const ;
67  unsigned long long enabledChannels(); // returns 64-bit integer mask 35..0
68 
69 
70  //Settable optical input parameters (one for each 12-receiver)
71  int opt_cap[3]; // Capacitor adjust
72  int opt_inadj[3]; // DC-input offset
73  int opt_ouadj[3]; // DC-output offset
74 
75  //input offset dac (one for each channel)
76  int offs_dac[36];
77 
78  //clock phases, use bits 0-8, select the clock edge
80 
81  //Channel delays, one for each channel, 0=15
82  int DelayCh[36];
83 
84  //Blacks and Ultra-blacks, 3 limit per channel
85  int BlackHi[36];
86  int BlackLo[36];
87  int Ublack[36];
88 
89  //Signal levels for the TBM, one per channel
90  int TBM_L0[36],TBM_L1[36],TBM_L2[36],TBM_L3[36],TBM_L4[36];
91  int TRL_L0[36],TRL_L1[36],TRL_L2[36],TRL_L3[36],TRL_L4[36];
92  // Address levels 1 per channel (36) per roc(max=26)
93  int ROC_L0[36][26],ROC_L1[36][26],ROC_L2[36][26],ROC_L3[36][26],
94  ROC_L4[36][26];
95 
96  //These bits turn off(1) and on(0) channels
97  unsigned int Ncntrl,NCcntrl,SCcntrl,Scntrl;
98 
99  //The values as read from file so that they can be restored after
100  //calibration
102 
103  //Bits (1st 8) used to mask TBM trailer bits
105 
106  //Bits (1st 8) used to set the Private Word in the gap and filler words
108 
109  // 1 = Special Random trigger DAC mode on, 0=off
110  unsigned int SpecialDac;
111 
112  // Control register and delays for the TTCrx
114  unsigned int ClkDes2;
115 
116  //Main control reg for determining the DAQ mode
117  unsigned int Ccntrl; // "CtrlReg" in LAD_C
118 
119  //Mode register
120  int modeRegister; // "ModeReg" in LAD_C
121 
122  //Number of ROCS per FED channel
123  int NRocs[36];
124 
125  //Control Regs for setting ADC 1Vpp and 2Vpp
126  unsigned int Nadcg,NCadcg,SCadcg,Sadcg;
127 
128  //Control and data Regs for setting Baseline Adjustment
130 
131  //data Regs for TTs adjustable levels
133 
134  //data Regs adjustable fifo Almost Full levels
136 
137  //Master delay for FED TTC signals
139 
140  //data Regs adjustable hit limits in fifo1s by fpga
142 
143  //data Regs to skip bad ROCs by fpga
145 
146  //The values as read from file so that they can be restored after
147  //calibration
150 
153 
154  //VME base address
155  unsigned long FEDBASE_0, fedNumber;
156 
157  private:
158 
159  // Added by Dario (March 26th 2008)
160  void clear(void) ;
161 
162  }; // end class PixelFEDCard
163 }
164 /* @} */
165 #endif // ifdef include
unsigned long FEDBASE_0
Definition: PixelFEDCard.h:155
This file contains the base class for &quot;pixel configuration data&quot; management.
int ROC_L3[36][26]
Definition: PixelFEDCard.h:93
unsigned int ClkDes2
Definition: PixelFEDCard.h:114
unsigned int SC_Pword
Definition: PixelFEDCard.h:107
void restoreBaselinAndChannelMasks()
virtual void writeXMLTrailer(std::ofstream *out) const
unsigned long long enabledChannels()
unsigned int NCbaseln
Definition: PixelFEDCard.h:129
void restoreControlAndModeRegister()
unsigned int Scntrl
Definition: PixelFEDCard.h:97
unsigned int S_Pword
Definition: PixelFEDCard.h:107
unsigned int SCbaseln
Definition: PixelFEDCard.h:129
int ROC_L4[36][26]
Definition: PixelFEDCard.h:93
void readDBROCLevels(std::vector< std::vector< std::string > > &tableMat, int first, int last)
unsigned int Sadcg
Definition: PixelFEDCard.h:126
unsigned int Sbaseln
Definition: PixelFEDCard.h:129
bool useChannel(unsigned int iChannel)
unsigned int NC_TBMmask
Definition: PixelFEDCard.h:104
This file contains the base class for &quot;pixel configuration data&quot; management.
unsigned int Nbaseln
Definition: PixelFEDCard.h:129
void readDBTBMLevels(std::vector< std::vector< std::string > > &tableMat, int first, int last)
tuple tab
Definition: accesses.py:4
unsigned int N_TBMmask
Definition: PixelFEDCard.h:104
unsigned int Nadcg
Definition: PixelFEDCard.h:126
unsigned int S_TBMmask
Definition: PixelFEDCard.h:104
int ROC_L0[36][26]
Definition: PixelFEDCard.h:93
bool first
Definition: L1TdeRCT.cc:79
unsigned int Ccntrl
Definition: PixelFEDCard.h:117
unsigned int NC_Pword
Definition: PixelFEDCard.h:107
unsigned int NCadcg
Definition: PixelFEDCard.h:126
This class implements..
tuple out
Definition: dbtoconf.py:99
unsigned int SCadcg
Definition: PixelFEDCard.h:126
unsigned int SC_TBMmask
Definition: PixelFEDCard.h:104
unsigned int NCcntrl_original
Definition: PixelFEDCard.h:101
unsigned int clkphs1_9
Definition: PixelFEDCard.h:79
unsigned int Ncntrl_original
Definition: PixelFEDCard.h:101
unsigned int clkphs19_27
Definition: PixelFEDCard.h:79
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
unsigned int clkphs10_18
Definition: PixelFEDCard.h:79
unsigned int N_Pword
Definition: PixelFEDCard.h:107
unsigned int SpecialDac
Definition: PixelFEDCard.h:110
list key
Definition: combine.py:13
tuple filename
Definition: lut2db_cfg.py:20
void setChannel(unsigned int iChannel, bool mode)
int ROC_L2[36][26]
Definition: PixelFEDCard.h:93
unsigned int Scntrl_original
Definition: PixelFEDCard.h:101
unsigned int Ncntrl
Definition: PixelFEDCard.h:97
dbl *** dir
Definition: mlp_gen.cc:35
void writeASCII(std::string dir="") const
This is the documentation about PixelFEDCard...
Definition: PixelFEDCard.h:26
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
unsigned int SCcntrl
Definition: PixelFEDCard.h:97
unsigned long fedNumber
Definition: PixelFEDCard.h:155
unsigned int NCcntrl
Definition: PixelFEDCard.h:97
unsigned int clkphs28_36
Definition: PixelFEDCard.h:79
unsigned int SCcntrl_original
Definition: PixelFEDCard.h:101
int ROC_L1[36][26]
Definition: PixelFEDCard.h:93