CMS 3D CMS Logo

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 #include <cstdint>
15 
16 namespace pos{
27  class PixelFEDCard : public PixelConfigBase{
28 
29  public:
30 
31  //Return true or false depending on if iChannel is used
32  //iChannel=1..36
33  bool useChannel(unsigned int iChannel);
34 
35  //Set iChannel enable to mode
36  //iChannel=1..36
37  void setChannel(unsigned int iChannel, bool mode);
38 
41 
42 
43  // Constructor and destructor
44  PixelFEDCard(); // empty
45  PixelFEDCard(std::string filename); // create from files
46  PixelFEDCard(std::vector<std::vector<std::string> > & tab); // create from DB
47  ~PixelFEDCard() override {};
48 
49  void readDBTBMLevels(std::vector<std::vector<std::string> > &tableMat, int first, int last) ;
50  void readDBROCLevels(std::vector<std::vector<std::string> > &tableMat, int first, int last) ;
51  void writeASCII(std::string dir="") const override; // write to files
52  void writeXML( pos::PixelConfigKey key, int version, std::string path) const override ;
53  void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const override ;
54  void writeXML( std::ofstream *out) const override ;
55  void writeXMLTrailer( std::ofstream *out) const override ;
57  int version,
58  std::string path,
59  std::ofstream *fedstream,
60  std::ofstream *roclvlstream,
61  std::ofstream *tbmlvlsteram) const override ;
62  void writeXML(std::ofstream *fedstream,
63  std::ofstream *rocstream,
64  std::ofstream *tbmstream) const override ;
65  void writeXMLTrailer(std::ofstream *fedstream,
66  std::ofstream *recostream,
67  std::ofstream *tbmstream) const override ;
68  uint64_t enabledChannels(); // returns 64-bit integer mask 35..0
69 
70 
71  //Settable optical input parameters (one for each 12-receiver)
72  int opt_cap[3]; // Capacitor adjust
73  int opt_inadj[3]; // DC-input offset
74  int opt_ouadj[3]; // DC-output offset
75 
76  //input offset dac (one for each channel)
77  int offs_dac[36];
78 
79  //clock phases, use bits 0-8, select the clock edge
81 
82  //Channel delays, one for each channel, 0=15
83  int DelayCh[36];
84 
85  //Blacks and Ultra-blacks, 3 limit per channel
86  int BlackHi[36];
87  int BlackLo[36];
88  int Ublack[36];
89 
90  //Signal levels for the TBM, one per channel
91  int TBM_L0[36],TBM_L1[36],TBM_L2[36],TBM_L3[36],TBM_L4[36];
92  int TRL_L0[36],TRL_L1[36],TRL_L2[36],TRL_L3[36],TRL_L4[36];
93  // Address levels 1 per channel (36) per roc(max=26)
94  int ROC_L0[36][26],ROC_L1[36][26],ROC_L2[36][26],ROC_L3[36][26],
95  ROC_L4[36][26];
96 
97  //These bits turn off(1) and on(0) channels
98  unsigned int Ncntrl,NCcntrl,SCcntrl,Scntrl;
99 
100  //The values as read from file so that they can be restored after
101  //calibration
103 
104  //Bits (1st 8) used to mask TBM trailer bits
106 
107  //Bits (1st 8) used to set the Private Word in the gap and filler words
109 
110  // 1 = Special Random trigger DAC mode on, 0=off
111  unsigned int SpecialDac;
112 
113  // Control register and delays for the TTCrx
115  unsigned int ClkDes2;
116 
117  //Main control reg for determining the DAQ mode
118  unsigned int Ccntrl; // "CtrlReg" in LAD_C
119 
120  //Mode register
121  int modeRegister; // "ModeReg" in LAD_C
122 
123  //Number of ROCS per FED channel
124  int NRocs[36];
125 
126  //Control Regs for setting ADC 1Vpp and 2Vpp
127  unsigned int Nadcg,NCadcg,SCadcg,Sadcg;
128 
129  //Control and data Regs for setting Baseline Adjustment
131 
132  //data Regs for TTs adjustable levels
134 
135  //data Regs adjustable fifo Almost Full levels
137 
138  //Master delay for FED TTC signals
140 
141  //data Regs adjustable hit limits in fifo1s by fpga
143 
144  //data Regs to skip bad ROCs by fpga
146 
147  //The values as read from file so that they can be restored after
148  //calibration
151 
154 
155  //VME base address
156  unsigned long FEDBASE_0, fedNumber;
157 
158  // Most recent additions requested by Will and Danek (Dario)
167  int SPARE1 ;
168  int SPARE2 ;
169  int SPARE3 ;
170  int SPARE4 ;
171  int SPARE5 ;
172  int SPARE6 ;
173  int SPARE7 ;
174  int SPARE8 ;
175  int SPARE9 ;
176  int SPARE10 ;
177 
178  private:
179 
180  // Added by Dario (March 26th 2008)
181  void clear(void) ;
182 
183  }; // end class PixelFEDCard
184 }
185 /* @} */
186 #endif // ifdef include
unsigned long FEDBASE_0
Definition: PixelFEDCard.h:156
This file contains the base class for "pixel configuration data" management.
int ROC_L3[36][26]
Definition: PixelFEDCard.h:94
unsigned int ClkDes2
Definition: PixelFEDCard.h:115
unsigned int SC_Pword
Definition: PixelFEDCard.h:108
void restoreBaselinAndChannelMasks()
unsigned int NCbaseln
Definition: PixelFEDCard.h:130
void restoreControlAndModeRegister()
unsigned int Scntrl
Definition: PixelFEDCard.h:98
unsigned int S_Pword
Definition: PixelFEDCard.h:108
unsigned int SCbaseln
Definition: PixelFEDCard.h:130
void writeXMLTrailer(std::ofstream *out) const override
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const override
int ROC_L4[36][26]
Definition: PixelFEDCard.h:94
void readDBROCLevels(std::vector< std::vector< std::string > > &tableMat, int first, int last)
unsigned int Sadcg
Definition: PixelFEDCard.h:127
unsigned int Sbaseln
Definition: PixelFEDCard.h:130
void writeASCII(std::string dir="") const override
bool useChannel(unsigned int iChannel)
unsigned int NC_TBMmask
Definition: PixelFEDCard.h:105
This file contains the base class for "pixel configuration data" management.
unsigned int Nbaseln
Definition: PixelFEDCard.h:130
void readDBTBMLevels(std::vector< std::vector< std::string > > &tableMat, int first, int last)
~PixelFEDCard() override
Definition: PixelFEDCard.h:47
unsigned int N_TBMmask
Definition: PixelFEDCard.h:105
unsigned int Nadcg
Definition: PixelFEDCard.h:127
unsigned int S_TBMmask
Definition: PixelFEDCard.h:105
int ROC_L0[36][26]
Definition: PixelFEDCard.h:94
unsigned int Ccntrl
Definition: PixelFEDCard.h:118
unsigned int NC_Pword
Definition: PixelFEDCard.h:108
unsigned int NCadcg
Definition: PixelFEDCard.h:127
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
This class implements..
unsigned int SCadcg
Definition: PixelFEDCard.h:127
unsigned int SC_TBMmask
Definition: PixelFEDCard.h:105
unsigned int NCcntrl_original
Definition: PixelFEDCard.h:102
unsigned int clkphs1_9
Definition: PixelFEDCard.h:80
unsigned long long uint64_t
Definition: Time.h:15
unsigned int Ncntrl_original
Definition: PixelFEDCard.h:102
unsigned int clkphs19_27
Definition: PixelFEDCard.h:80
unsigned int clkphs10_18
Definition: PixelFEDCard.h:80
unsigned int N_Pword
Definition: PixelFEDCard.h:108
unsigned int SpecialDac
Definition: PixelFEDCard.h:111
uint64_t enabledChannels()
void setChannel(unsigned int iChannel, bool mode)
int ROC_L2[36][26]
Definition: PixelFEDCard.h:94
unsigned int Scntrl_original
Definition: PixelFEDCard.h:102
unsigned int Ncntrl
Definition: PixelFEDCard.h:98
dbl *** dir
Definition: mlp_gen.cc:35
This is the documentation about PixelFEDCard...
Definition: PixelFEDCard.h:27
unsigned int SCcntrl
Definition: PixelFEDCard.h:98
unsigned long fedNumber
Definition: PixelFEDCard.h:156
unsigned int NCcntrl
Definition: PixelFEDCard.h:98
unsigned int clkphs28_36
Definition: PixelFEDCard.h:80
unsigned int SCcntrl_original
Definition: PixelFEDCard.h:102
int ROC_L1[36][26]
Definition: PixelFEDCard.h:94