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