00001 #ifndef TP_PIXELFEDCARD_H
00002 #define TP_PIXELFEDCARD_H
00003
00010 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
00011
00012 #include <vector>
00013 #include <string>
00014
00015 namespace pos{
00026 class PixelFEDCard : public PixelConfigBase{
00027
00028 public:
00029
00030
00031
00032 bool useChannel(unsigned int iChannel);
00033
00034
00035
00036 void setChannel(unsigned int iChannel, bool mode);
00037
00038 void restoreBaselinAndChannelMasks();
00039 void restoreControlAndModeRegister();
00040
00041
00042
00043 PixelFEDCard();
00044 PixelFEDCard(std::string filename);
00045 PixelFEDCard(std::vector<std::vector<std::string> > & tab);
00046 ~PixelFEDCard() {};
00047
00048 void readDBTBMLevels(std::vector<std::vector<std::string> > &tableMat, int first, int last) ;
00049 void readDBROCLevels(std::vector<std::vector<std::string> > &tableMat, int first, int last) ;
00050 void writeASCII(std::string dir="") const;
00051 void writeXML( pos::PixelConfigKey key, int version, std::string path) const ;
00052 virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const ;
00053 virtual void writeXML( std::ofstream *out) const ;
00054 virtual void writeXMLTrailer( std::ofstream *out) const ;
00055 virtual void writeXMLHeader(pos::PixelConfigKey key,
00056 int version,
00057 std::string path,
00058 std::ofstream *fedstream,
00059 std::ofstream *roclvlstream,
00060 std::ofstream *tbmlvlsteram) const ;
00061 virtual void writeXML(std::ofstream *fedstream,
00062 std::ofstream *rocstream,
00063 std::ofstream *tbmstream) const ;
00064 virtual void writeXMLTrailer(std::ofstream *fedstream,
00065 std::ofstream *recostream,
00066 std::ofstream *tbmstream) const ;
00067 unsigned long long enabledChannels();
00068
00069
00070
00071 int opt_cap[3];
00072 int opt_inadj[3];
00073 int opt_ouadj[3];
00074
00075
00076 int offs_dac[36];
00077
00078
00079 unsigned int clkphs1_9,clkphs10_18,clkphs19_27,clkphs28_36;
00080
00081
00082 int DelayCh[36];
00083
00084
00085 int BlackHi[36];
00086 int BlackLo[36];
00087 int Ublack[36];
00088
00089
00090 int TBM_L0[36],TBM_L1[36],TBM_L2[36],TBM_L3[36],TBM_L4[36];
00091 int TRL_L0[36],TRL_L1[36],TRL_L2[36],TRL_L3[36],TRL_L4[36];
00092
00093 int ROC_L0[36][26],ROC_L1[36][26],ROC_L2[36][26],ROC_L3[36][26],
00094 ROC_L4[36][26];
00095
00096
00097 unsigned int Ncntrl,NCcntrl,SCcntrl,Scntrl;
00098
00099
00100
00101 unsigned int Ncntrl_original,NCcntrl_original,SCcntrl_original,Scntrl_original;
00102
00103
00104 unsigned int N_TBMmask,NC_TBMmask,SC_TBMmask,S_TBMmask;
00105
00106
00107 unsigned int N_Pword,NC_Pword,SC_Pword,S_Pword;
00108
00109
00110 unsigned int SpecialDac;
00111
00112
00113 int CoarseDel,FineDes2Del,FineDes1Del;
00114 unsigned int ClkDes2;
00115
00116
00117 unsigned int Ccntrl;
00118
00119
00120 int modeRegister;
00121
00122
00123 int NRocs[36];
00124
00125
00126 unsigned int Nadcg,NCadcg,SCadcg,Sadcg;
00127
00128
00129 unsigned int Nbaseln,NCbaseln,SCbaseln,Sbaseln;
00130
00131
00132 int Ooslvl,Errlvl;
00133
00134
00135 int Nfifo1Bzlvl,NCfifo1Bzlvl,SCfifo1Bzlvl,Sfifo1Bzlvl,fifo3Wrnlvl;
00136
00137
00138 int FedTTCDelay;
00139
00140
00141 int N_hitlimit,NC_hitlimit,SC_hitlimit,S_hitlimit;
00142
00143
00144 int N_testreg,NC_testreg,SC_testreg,S_testreg;
00145
00146
00147
00148 int Nbaseln_original,NCbaseln_original,SCbaseln_original,
00149 Sbaseln_original;
00150
00151 int Ccntrl_original;
00152 int modeRegister_original;
00153
00154
00155 unsigned long FEDBASE_0, fedNumber;
00156
00157 private:
00158
00159
00160 void clear(void) ;
00161
00162 };
00163 }
00164
00165 #endif // ifdef include