#include #include #include #include #include #define CDCDACDefault 0xc000 #define FDCDACDefault 0x8000 #define FA125Channels 72 #define FA250Channels 16 using namespace std; using namespace ccdb; class DetectorReadoutConfig { public: //DetectorReadoutConfig(const char* DetectorName=""); DetectorReadoutConfig(const string DN="" , const string R="" , const string V="" , const string D="", const string S="ver1" ); //DetectorReadoutConfig(char* DetectorName, char* dir1, char* dir1); ~DetectorReadoutConfig(){}; void Print(int OFS, int DACOnly); string PrintADCMode(); void Convert2Lower(char* str); private: MySQLCalibration *calibDB ; int DetectorIndex; // 1 = CDC, 2 = FDC, ..... char DetectorName[128]; char Date[128]; char Variation[128]; char RunVal[128]; char Suffix[128]; int DACDefault; int ADC_Channels; int ADC_Type; int Has_TDCs; int N125; // Number of FADC125s int N250; // Number of FADC250s int NF1HI; // Number of hi res TDCs int NF1LOW;// Number of low res TDCs int FCAEN; // Number of CAEN TDCs // F125 int FADC125_TYPE; int FADC125_F_REV; int FADC125_B_REV; int FADC125_P_REV; int FA125_MODE; int FA125_W_OFFSET; int FA125_W_WIDTH; int FA125_NSB; int FA125_NSA; int FA125_NPEAK; int FA125_THR; int FA125_DAC; char FADC125_COM_DIR[512]; char FADC125_COM_VER[512]; char FADC125_USER_DIR[512]; char FADC125_USER_VER[512]; int FADC125_DAC_CH_00_17[20][16]; int FADC125_DAC_CH_18_35[20][16]; int FADC125_DAC_CH_36_53[20][16]; int FADC125_DAC_CH_54_71[20][16]; int FADC125_THR_CH_00_17[20][16]; int FADC125_THR_CH_18_35[20][16]; int FADC125_THR_CH_36_53[20][16]; int FADC125_THR_CH_54_71[20][16]; int FADC125_CH_ENB[20][16]; int FADC125_CH_DIS[20][16]; // F1TDC float F1TDC_WINDOW; float F1TDC_LATENCY; float F1TDC_BIN_SIZE; float F1TDC_HR_WINDOW; float F1TDC_HR_LATENCY; float F1TDC_HR_BIN_SIZE; int F1TDC_CLOCK; //F250 int FA250_MODE; int FA250_W_OFFSET; int FA250_W_WIDTH; int FA250_NSB; int FA250_NSA; int FA250_NPEAK; int FA250_READ_THR; int FA250_DAC; int FADC250_TRIG_BL; int FADC250_TRIG_THR; int FADC250_TRIG_NSB; int FADC250_TRIG_NSA; int FADC125_IBIT; int FADC125_ABIT; int FADC125_PBIT; char FADC250_COM_DIR[512]; char FADC250_COM_VER[512]; char FADC250_USER_DIR[512]; char FADC250_USER_VER[512]; int FADC250_ALLCH_DAC[20][16]; int FADC250_ALLCH_THR[20][16]; int NumberOfCrates; int DetectorROCNumber[20]; int DetectorCrateModules[20]; int FADC125_DAC_VALUES[20][20][72]; float FADC125_BASELINE_VALUES[20][20][72]; float FADC125_SIGMA_VALUES[20][20][72]; int FADC125_THRESHOLD_VALUES[20][20][72]; float FADC125_THRESHOLD_FACTOR; int FADC125_TARGET_BASELINE; int FADC125_COMMON_LTT; int FADC125_COMMON_HTT; // private: void write2File(); void write2DB(); void InitDACValues(); void GetVariation(char *); void GetDate(char *); void GetRunVal(char *); void GetSuffix(char *); };