• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

beamtime/tof-tdctest/go4/VFTX/TVftxParam.cxx (r4864/r4727)

Go to the documentation of this file.
00001 /* Generated by Together */
00002 
00003 #include "TVftxParam.h"
00004 
00005 #include "TGo4Version.h"
00006 #if __GO4BUILDVERSION__ > 40502
00007    #include "go4iostream.h"
00008 #else
00009    #include "Riostream.h"
00010 #endif
00011  
00012 // define default values
00013 #define DEBUG_OPTION              0
00014 #define CALIB_HISTOS_ENABLE       0
00015 #define REFERENCE_CHANNEL        -1
00016 #define MAIN_REFERENCE_TDC       -1
00017 #define DIAMOND_CHANNEL          -1
00018 #define COINCIDENCE_MAPPING       0
00019 #define BIT_CONTROL               0
00020 #define FINE_TIME_HISTO_ENABLE    0
00021 #define COARSE_TIME_HIST_ENABLE   0
00022 #define CALIBRATION_ENABLE        0
00023 #define MIN_NB_HITS_CALIB      5000
00024 #define INITIAL_CAL_FILENAME      ""
00025 #define CALIBRATION_OUT_ENABLE    0
00026 #define TIME_HISTO_ENABLE         0
00027 #define TIME_HISTO_SINGLES_ENABLE 0
00028 #define TOT_HISTO_ENABLE          0
00029 #define MULTI_DIST_HISTO_ENABLE   0
00030 
00031 #define TDC_OFFSET                0
00032 #define MANUAL_TDC_OFFSET         0
00033 #define AUTO_TDC_OFFSET_DET       0
00034 #define USE_COARSE_CORR_TIME      0
00035 
00036 #define SINGLE_CHAN_CALIB_INPUT   0
00037 #define SINGLE_CHAN_CALIB_OUTPUT  0
00038 
00039 #define BOARD_TO_SLOT            -1
00040 #define TIME_OFFSET_CALIB_ENA     0
00041 #define TIME_OFFSET               0.0
00042 #define TOT_CALIB_ENABLE          0
00043 #define TOT_OFFSET                0.0
00044 
00045 TVftxParam::TVftxParam(const char* name) : TGo4Parameter(name)
00046 {
00047    ReadOptions();
00048 }
00049 
00050 //***********************************************************
00051 TVftxParam::~TVftxParam()
00052 {
00053 }
00054 
00055 Bool_t TVftxParam::ReadOptions(){
00056    // Loading default values
00057    uDebug           = DEBUG_OPTION;
00058    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00059    {
00060       uVftxCalHistosEnabled[iIndexVftx] = CALIB_HISTOS_ENABLE;
00061       iVftxReference1Channel[iIndexVftx] = REFERENCE_CHANNEL;
00062       iVftxReference2Channel[iIndexVftx] = DIAMOND_CHANNEL;
00063    }
00064    iMainReferenceTdc = MAIN_REFERENCE_TDC;
00065    uVftxCoincidenceMap = COINCIDENCE_MAPPING;
00066    uBitControl      = BIT_CONTROL;
00067    uFineHistEnable  = FINE_TIME_HISTO_ENABLE;
00068    uCoarseTimeHisto = COARSE_TIME_HIST_ENABLE; 
00069    uEnableCalib     = CALIBRATION_ENABLE;
00070    iMinNbHitsCalib  = MIN_NB_HITS_CALIB;
00071    sInitialCalibrationFilename = INITIAL_CAL_FILENAME;
00072    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00073       uVftxInitalCalIndex[iIndexVftx] = iIndexVftx;
00074    uEnableCalibOutput = CALIBRATION_OUT_ENABLE;
00075    uTimeHistEnable  = TIME_HISTO_ENABLE;
00076    uTimeHistSinglesEnable = TIME_HISTO_SINGLES_ENABLE;
00077    uTotHistoEnable  = TOT_HISTO_ENABLE;
00078    uMultiHitsDistanceHistoEnable = MULTI_DIST_HISTO_ENABLE;
00079 
00080    uTdcOffsetEnable       = TDC_OFFSET;
00081    uManualTdcOffsetEnable = MANUAL_TDC_OFFSET;
00082    uAutomaticOffsetEnable = AUTO_TDC_OFFSET_DET;
00083    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00084       iAutomaticTdcOffset[iIndexVftx] = 0;
00085    
00086    uUseCoarseCorrectedTime = USE_COARSE_CORR_TIME;
00087 
00088    uSingleChannelCalibFilesEnable = SINGLE_CHAN_CALIB_INPUT;
00089    uSingleChannelCalibFilesOutput = SINGLE_CHAN_CALIB_OUTPUT;
00090 
00091    uEnableTimeOffsetCalibration = TIME_OFFSET_CALIB_ENA; // Enable/disable time offset calibration
00092    uEnableTotCalibration = TOT_CALIB_ENABLE;             // Enable/disable tot calibration
00093    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00094    {
00095       iVftxBoardIndex[iIndexVftx] = BOARD_TO_SLOT;     // No Online Change - Tdc hardware board #Y in slot/data #X
00096       for( Int_t iChannel = 0; iChannel < FPGA_TDC_NBCHAN/2; iChannel++)
00097       {
00098          dTimeOffset[iIndexVftx][iChannel] = TIME_OFFSET; // No Online Change - Time offset per channel, depends on TDC board, not TDC slot!!!!!
00099          dTotOffset[iIndexVftx][iChannel] = TOT_OFFSET; // No Online Change - ToT offset per channel, depends on TDC board, not TDC slot!!!!!
00100       } // for( Int_t iChannel = 0; iChannel < FPGA_TDC_NBCHAN/2; iChannel++)
00101    } // for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00102    for( Int_t iChannel = 0; iChannel < FPGA_TDC_NBCHAN/2; iChannel++)
00103    {
00104       dMeanTimeOffset[iChannel] = TIME_OFFSET; // No Online Change - Time offset per channel, independent of TDC board, this is a mean value!!!!!
00105       dMeanTotOffset[iChannel] = TOT_OFFSET; // No Online Change - ToT offset per channel, independent of TDC board, this is a mean value!!!!!
00106    } // for( Int_t iChannel = 0; iChannel < FPGA_TDC_NBCHAN/2; iChannel++)
00107 
00108    // Try to read the option filename from the general option files text file
00109    TString sOptionFileName = "./Vftx_options.txt";
00110    Bool_t bFilenameFound = kFALSE;
00111    fstream optionFilenameFile("./Option_files.txt", ios::in);
00112    // Testing if the file does exist. If not I use default values
00113    if( optionFilenameFile.fail() == true)
00114    {
00115       cout<<"************************************************************************"<<endl;
00116       cout<<" File with option filename for VFTX not found: using the default value ";
00117       cout<<sOptionFileName<<endl;
00118    } // if( optionFilenameFile.fail() == true)
00119       else
00120       {
00121          TString line;
00122 
00123          // Goes through all lines
00124          while( !optionFilenameFile.eof() )
00125          {
00126            line.ReadLine(optionFilenameFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00127 
00128            if(line(0) == '#' || line(0) == '*'||
00129                (line(0) == '/' && line(1) == '/') )
00130            {
00131               //Comment in the text file
00132               ;
00133            }
00134            else if(line.Contains("vftxcalib")==kTRUE)
00135            {
00136               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00137               cout<<"************************************************************************"<<endl;
00138               cout<<"Using "<<sOptionFileName<<" as source for the options of Vftx step"<<endl;
00139               bFilenameFound = kTRUE;
00140               break;
00141            }
00142          } // while( !optionFilenameFile.eof() )
00143          if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00144          {
00145             cout<<"************************************************************************"<<endl;
00146             cout<<"Field for Vftx step not found in File with option filename => Using "<<sOptionFileName<<endl;
00147          } // if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00148       } // else of if( optionFilenameFile.fail() == true)
00149 
00150    // Read the option file
00151    fstream setupFile(sOptionFileName, ios::in);
00152    
00153    // Testing if the option does exist. If not I use default values.
00154    if( setupFile.fail() == true)
00155    {
00156       cout<<"Error for TVftxParam: Setup file "<<sOptionFileName<<" can not be opened or is missing."<<endl;
00157       cout<<"=> Using default values!"<<endl;
00158    }
00159    else
00160    {
00161       TString line;
00162       
00163       // Goes through all lines
00164       while( !setupFile.eof() )
00165       {
00166          line.ReadLine(setupFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00167          if(1 == uDebug)
00168             cout<<line<<endl;
00169 
00170          if(line(0) == '#' || line(0) == '*')
00171          {
00172             //Comment in the text file
00173             ;
00174          }
00175          else if(line.Contains("debug")==kTRUE)
00176          {
00177             uDebug = ((TString)line(5,10)).Atoi();
00178             if(1 == uDebug)
00179                cout<<"Debug ON!!!!!!"<<endl;
00180          }
00181          else if(line.Contains("vftxcalena")==kTRUE)
00182          {
00183             line = line(11,3*MAX_FPGA_TDC);
00184             if( 0 != line.Sizeof() )
00185             {
00186                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00187                {
00188                   uVftxCalHistosEnabled[temp_index] = ((TString)line(0,3)).Atoi();
00189                   line = line(3,3*MAX_FPGA_TDC);
00190                } // for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00191             } // if( 0 != line.Sizeof() )
00192          }
00193          else if(line.Contains("refonechan")==kTRUE)
00194          {
00195             line = line(11,3*MAX_FPGA_TDC);
00196             if( 0 != line.Sizeof() )
00197             {
00198                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00199                {
00200                   iVftxReference1Channel[temp_index] = ((TString)line(0,3)).Atoi();
00201                   line = line(3,3*MAX_FPGA_TDC);
00202                } // for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00203             } // if( 0 != line.Sizeof() )
00204          }
00205          else if(line.Contains("reftwochan")==kTRUE)
00206          {
00207             line = line(11,3*MAX_FPGA_TDC);
00208             if( 0 != line.Sizeof() )
00209             {
00210                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00211                {
00212                   iVftxReference2Channel[temp_index] = ((TString)line(0,3)).Atoi();
00213                   line = line(3,3*MAX_FPGA_TDC);
00214                } // for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00215             } // if( 0 != line.Sizeof() )
00216          }
00217          else if(line.Contains("mainreftdc")==kTRUE)
00218          {
00219             iMainReferenceTdc = ((TString)line(11,10)).Atoi();
00220             if(1 == uDebug)
00221                cout<<"Test iMainReferenceTdc: "<<iMainReferenceTdc<<endl;
00222          }
00223          else if(line.Contains("chcoimap")==kTRUE)
00224          {
00225             uVftxCoincidenceMap = ((TString)line(8,10)).Atoi();
00226             if(1 == uDebug)
00227                cout<<"Test uVftxCoincidenceMap: "<<uVftxCoincidenceMap<<endl;
00228          }
00229          else if(line.Contains("bitcontrol")==kTRUE)
00230          {
00231             uBitControl = ((TString)line(10,10)).Atoi();
00232             if(1 == uDebug)
00233                cout<<"Test uBitControl: "<<uBitControl<<endl;
00234          }
00235          else if(line.Contains("coarsetimehisto")==kTRUE)
00236          {
00237             uCoarseTimeHisto = ((TString)line(15,10)).Atoi();
00238             if(1 == uDebug)
00239                cout<<"Test uCoarseTimeHisto: "<<uCoarseTimeHisto<<endl;
00240          }
00241          else if(line.Contains("finetime")==kTRUE)
00242          {
00243             uFineHistEnable = ((TString)line(8,10)).Atoi();
00244             if(1 == uDebug)
00245                cout<<"Test uFineHistEnable: "<<uFineHistEnable<<endl;
00246          }
00247          else if(line.Contains("finetevo")==kTRUE)
00248          {
00249             uFineEvolutionHistEnable = ((TString)line(8,10)).Atoi();
00250             if(1 == uDebug)
00251                cout<<"Test uFineEvolutionHistEnable: "<<uFineEvolutionHistEnable<<endl;
00252          }
00253          else if(line.Contains("calibena")==kTRUE)
00254          {
00255             uEnableCalib = ((TString)line(9,10)).Atoi();
00256             if(1 == uDebug)
00257                cout<<"Test uEnableCalib: "<<uEnableCalib<<endl;
00258          }
00259          else if(line.Contains("calibnb")==kTRUE)
00260          {
00261             iMinNbHitsCalib = ((TString)line(8,10)).Atoi();
00262             if(1 == uDebug)
00263                cout<<"Test iMinNbHitsCalib: "<<iMinNbHitsCalib<<endl;
00264          }
00265          else if(line.Contains("initialcalibfile")==kTRUE)
00266          {
00267             sInitialCalibrationFilename = (TString)line(17,128);
00268             if(1 == uDebug)
00269                cout<<"Test sInitialCalibrationFilename: "<<sInitialCalibrationFilename<<endl;
00270          } 
00271          else if(line.Contains("inicalindex")==kTRUE)
00272          {
00273             line = line(12,3*MAX_FPGA_TDC);
00274             if( 0 != line.Sizeof() )
00275             {
00276                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00277                {
00278                   uVftxInitalCalIndex[temp_index] = ((TString)line(0,3)).Atoi();
00279                   line = line(3,3*MAX_FPGA_TDC);
00280                } // for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00281             } // if( 0 != line.Sizeof() )
00282          }
00283          else if(line.Contains("caliboutena")==kTRUE)
00284          {
00285             uEnableCalibOutput = ((TString)line(12,10)).Atoi();
00286             if(1 == uDebug)
00287                cout<<"Test uEnableCalibOutput: "<<uEnableCalibOutput<<endl;
00288          }
00289          else if(line.Contains("timeplot")==kTRUE)
00290          {
00291             uTimeHistEnable = ((TString)line(8,10)).Atoi();
00292             if(1 == uDebug)
00293                cout<<"Test uTimeHistEnable: "<<uTimeHistEnable<<endl;
00294          }
00295          else if(line.Contains("timesing")==kTRUE)
00296          {
00297             uTimeHistSinglesEnable = ((TString)line(8,10)).Atoi();
00298             if(1 == uDebug)
00299                cout<<"Test uTimeHistSinglesEnable: "<<uTimeHistSinglesEnable<<endl;
00300          }
00301          else if(line.Contains("totplot")==kTRUE)
00302          {
00303             uTotHistoEnable = ((TString)line(8,10)).Atoi();
00304             if(1 == uDebug)
00305                cout<<"Test uTotHistoEnable: "<<uTotHistoEnable<<endl;
00306          }
00307          else if(line.Contains("muldist")==kTRUE)
00308          {
00309             uMultiHitsDistanceHistoEnable = ((TString)line(8,10)).Atoi();
00310             if(1 == uDebug)
00311                cout<<"Test uMultiHitsDistanceHistoEnable: "<<uMultiHitsDistanceHistoEnable<<endl;
00312          }
00313          else if(line.Contains("manuoffs")==kTRUE)
00314          {
00315             uManualTdcOffsetEnable = ((TString)line(8,10)).Atoi();
00316             if( 1 == uManualTdcOffsetEnable )
00317             {
00318                uAutomaticOffsetEnable = 0;
00319                uTdcOffsetEnable       = 1;
00320             }
00321             if(1 == uDebug)
00322                cout<<"Test uManualTdcOffsetEnable: "<<uManualTdcOffsetEnable<<endl;
00323          }
00324          else if(line.Contains("tdcoffsm")==kTRUE && 1 == uManualTdcOffsetEnable)
00325          {
00326             line = line(12,3*MAX_FPGA_TDC);
00327             if( 0 != line.Sizeof() )
00328             {
00329                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00330                {
00331                   iAutomaticTdcOffset[temp_index] = ((TString)line(0,3)).Atoi();
00332                   line = line(3,3*MAX_FPGA_TDC);
00333                } // for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00334             } // if( 0 != line.Sizeof() )
00335          }
00336          else if(line.Contains("autooffs")==kTRUE)
00337          {
00338             if( 0 == uManualTdcOffsetEnable )
00339             {
00340                uAutomaticOffsetEnable = ((TString)line(8,10)).Atoi();
00341                if( 1 == uAutomaticOffsetEnable )
00342                   uTdcOffsetEnable       = 1;
00343                if(1 == uDebug)
00344                   cout<<"Test uAutomaticOffsetEnable: "<<uAutomaticOffsetEnable<<endl;
00345             }
00346                else cout<<"Ignored uAutomaticOffsetEnable as uManualTdcOffsetEnable is ON"<<endl;
00347          }
00348          else if(line.Contains("coarsecorrt")==kTRUE)
00349          {
00350             uUseCoarseCorrectedTime = ((TString)line(12,10)).Atoi();
00351          }
00352          else if(line.Contains("singchcalib")==kTRUE)
00353          {
00354             uSingleChannelCalibFilesEnable = ((TString)line(11,10)).Atoi();
00355             if(1 == uDebug)
00356                cout<<"Test uSingleChannelCalibFilesEnable: "<<uSingleChannelCalibFilesEnable<<endl;
00357          }
00358          else if(line.Contains("schcalibout")==kTRUE)
00359          {
00360             uSingleChannelCalibFilesOutput = ((TString)line(11,10)).Atoi();
00361             if(1 == uDebug)
00362                cout<<"Test uSingleChannelCalibFilesOutput: "<<uSingleChannelCalibFilesOutput<<endl;
00363          }
00364          else if(line.Contains("tdcboard")==kTRUE)
00365          {
00366             line = line(12,3*MAX_FPGA_TDC);
00367             if( 0 != line.Sizeof() )
00368             {
00369                for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00370                {
00371                   iVftxBoardIndex[temp_index] = ((TString)line(0,3)).Atoi();
00372                   if( MAX_FPGA_TDC < iVftxBoardIndex[temp_index] )
00373                      iVftxBoardIndex[temp_index] = -1;
00374                   line = line(3,3*MAX_FPGA_TDC);
00375                } // for(UInt_t temp_index = 0; temp_index < MAX_FPGA_TDC && 0 != line.Sizeof(); temp_index++)
00376             } // if( 0 != line.Sizeof() )
00377          }
00378          else if(line.Contains("offcalib")==kTRUE)
00379          {
00380             uEnableTimeOffsetCalibration = ((TString)line(9,10)).Atoi();
00381             if(1 == uDebug)
00382                cout<<"Test uEnableTimeOffsetCalibration: "<<uEnableTimeOffsetCalibration<<endl;
00383          }
00384          else if(line.Contains("chanoffs")==kTRUE)
00385          {
00386             Int_t iTdc= ((TString)line(8,2)).Atoi();
00387             if( iTdc < MAX_FPGA_TDC )
00388             {
00389                line = line(10,6*FPGA_TDC_NBCHAN/2);
00390                if( 0 != line.Sizeof() )
00391                {
00392                   for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00393                   {
00394                      dTimeOffset[iTdc][temp_index] = ((TString)line(0,6)).Atof();
00395                      line = line(6,6*FPGA_TDC_NBCHAN/2);
00396                   } // for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00397                } // if( 0 != line.Sizeof() )
00398             } // if( iTdc < MAX_FPGA_TDC )
00399          }
00400          else if(line.Contains("chanalloff")==kTRUE)
00401          {
00402             line = line(10,6*FPGA_TDC_NBCHAN/2);
00403             if( 0 != line.Sizeof() )
00404             {
00405                for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00406                {
00407                   dMeanTimeOffset[temp_index] = ((TString)line(0,6)).Atof();
00408                   line = line(6,6*FPGA_TDC_NBCHAN/2);
00409                } // for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00410             } // if( 0 != line.Sizeof() )
00411          }
00412          else if(line.Contains("totcalib")==kTRUE)
00413          {
00414             uEnableTotCalibration = ((TString)line(9,10)).Atoi();
00415             if(1 == uDebug)
00416                cout<<"Test uEnableTotCalibration: "<<uEnableTotCalibration<<endl;
00417          }
00418          else if(line.Contains("totoffs")==kTRUE)
00419          {
00420             Int_t iTdc= ((TString)line(7,2)).Atoi();
00421             if( iTdc < MAX_FPGA_TDC )
00422             {
00423                line = line(10,6*FPGA_TDC_NBCHAN/2);
00424                if( 0 != line.Sizeof() )
00425                {
00426                   for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00427                   {
00428                      dTotOffset[iTdc][temp_index] = ((TString)line(0,6)).Atof();
00429                      line = line(6,6*FPGA_TDC_NBCHAN/2);
00430                   } // for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00431                } // if( 0 != line.Sizeof() )
00432             } // if( iTdc < MAX_FPGA_TDC )
00433          }
00434          else if(line.Contains("totalloff")==kTRUE)
00435          {
00436             line = line(10,6*FPGA_TDC_NBCHAN/2);
00437             if( 0 != line.Sizeof() )
00438             {
00439                for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00440                {
00441                   dMeanTotOffset[temp_index] = ((TString)line(0,6)).Atof();
00442                   line = line(6,6*FPGA_TDC_NBCHAN/2);
00443                } // for(UInt_t temp_index = 0; temp_index < FPGA_TDC_NBCHAN/2 && 0 != line.Sizeof(); temp_index++)
00444             } // if( 0 != line.Sizeof() )
00445          }
00446       } // while( !setupFile.eof() )
00447    } //  else of if( setupFile.fail() == true)
00448    if( uEnableCalib )
00449    {
00450       cout<<" Fine time Histos needed for corrections => Enable!!"<<endl;
00451       uFineHistEnable = 1;
00452 
00453       if( -1 == iMinNbHitsCalib &&
00454           ( kTRUE == sInitialCalibrationFilename.EqualTo("") ||
00455             kTRUE == sInitialCalibrationFilename.EqualTo("-") ) &&
00456            0 == uSingleChannelCalibFilesEnable )
00457       {
00458          cout<<" Nb of hits per channel needed for corrections disabled while calibration file disabled ";
00459          cout<<"=> Enable iMinNbHitsCalib and set it to 400!!"<<endl;
00460          iMinNbHitsCalib = 400;
00461       }
00462    }
00463    
00464    this->PrintOptions(); //print out all values to see, if the setting has worked correctly
00465    return kTRUE;
00466 }
00467 
00468 
00469 Int_t TVftxParam::PrintOptions(){
00470    cout<<"********************* VFTX calibration parameters **********************"<<endl;
00471    if(1 == uDebug)
00472       cout<<"Debug ON!!!!!!"<<endl;
00473       else cout<<"Debug OFF"<<endl;
00474    cout<<"VFTX FPGA TDC index:       |-      ";
00475    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00476    {
00477       cout.width(2);
00478       cout<<iIndexVftx<<" ";
00479    }
00480    cout<<endl<<"Calibration histo. enabled |->     ";
00481    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00482    {
00483       cout.width(2);
00484       cout<<uVftxCalHistosEnabled[iIndexVftx] <<" ";
00485    }
00486    cout<<endl<<"1st reference channel      |->     ";
00487    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00488    {
00489       cout.width(2);
00490       cout<<iVftxReference1Channel[iIndexVftx] <<" ";
00491    }
00492    cout<<endl<<"2nd reference channel      |->     ";
00493    for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00494    {
00495       cout.width(2);
00496       cout<<iVftxReference2Channel[iIndexVftx] <<" ";
00497    }
00498    cout<<endl;
00499    if( -1 < iMainReferenceTdc )
00500       cout<<"Main reference tdc            :     "<<iMainReferenceTdc<<endl;
00501       else cout<<"Main reference tdc            :     OFF"<<endl;
00502 
00503    cout<<"Channel coincidence mapping   :     "<<uVftxCoincidenceMap<<endl;
00504    cout<<"Control bit Histograms        :     "<<uBitControl<<endl; 
00505    cout<<"Fine Time Histograms          :     "<<uFineHistEnable<<endl;
00506    cout<<"Fine Time Evolution Histograms:     "<<uFineEvolutionHistEnable<<endl;
00507    cout<<"Coarse time Histograms        :     "<<uCoarseTimeHisto<<endl;
00508    if(1 == uEnableCalib)
00509       cout<<"Calibration                   :     ON"<<endl;
00510       else cout<<"Calibration                   :     OFF"<<endl;
00511    if( -1 == iMinNbHitsCalib &&
00512          kTRUE != sInitialCalibrationFilename.EqualTo("") && kTRUE != sInitialCalibrationFilename.EqualTo("-") )
00513    {
00514       cout<<"Filename for calib hist:            "<<sInitialCalibrationFilename<<endl;
00515       cout<<"VFTX FPGA TDC index:       |-      ";
00516       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00517       {
00518          cout.width(2);
00519          cout<<iIndexVftx<<" ";
00520       }
00521       cout<<endl<<"Tdc initial calib. index:  |->     ";
00522       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00523       {
00524          cout.width(2);
00525          cout<<uVftxInitalCalIndex[iIndexVftx] <<" ";
00526       }
00527       cout<<endl;
00528    }
00529       else
00530       {
00531          cout<<"Min nb hits for calib         :     "<<iMinNbHitsCalib<<endl;
00532          if( kTRUE != sInitialCalibrationFilename.EqualTo("") && kTRUE != sInitialCalibrationFilename.EqualTo("-") )
00533          {
00534             cout<<"Filename for intial calib hist:     "<<sInitialCalibrationFilename<<endl;
00535             cout<<"VFTX FPGA TDC index:       |-      ";
00536             for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00537             {
00538                cout.width(2);
00539                cout<<iIndexVftx<<" ";
00540             }
00541             cout<<endl<<"Tdc initial calib. index:  |->     ";
00542             for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00543             {
00544                cout.width(2);
00545                cout<<uVftxInitalCalIndex[iIndexVftx] <<" ";
00546             }
00547             cout<<endl;
00548          }
00549       }
00550    if(1 == uEnableCalibOutput)
00551       cout<<"Calibration saved in root file:     ON"<<endl;
00552       else cout<<"Calibration saved in root file:     OFF"<<endl;
00553    if( 1 == uTimeHistEnable )
00554       cout<<"Time Histograms               :     ON"<<endl;
00555       else cout<<"Time Histograms               :     OFF"<<endl;
00556    if( 1 == uTimeHistSinglesEnable )
00557       cout<<"Time Histograms Multiplicity 1:     ON"<<endl;
00558       else cout<<"Time Histograms Multiplicity 1:     OFF"<<endl;
00559    if( 1 == uTotHistoEnable )
00560       cout<<"Tot  Histograms               :     ON"<<endl;
00561       else cout<<"Tot  Histograms               :     OFF"<<endl;
00562    if( 1 == uMultiHitsDistanceHistoEnable )
00563       cout<<"Histograms Distance Multi Hits:     ON"<<endl;
00564       else cout<<"Histograms Distance Multi Hits:     OFF"<<endl;
00565    if(1 == uManualTdcOffsetEnable)
00566    {
00567       cout<<"Manual tdc offset detection:        ON"<<endl;
00568       cout<<"VFTX FPGA TDC index:       |-      ";
00569       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00570       {
00571          cout.width(2);
00572          cout<<iIndexVftx<<" ";
00573       }
00574       cout<<endl<<"Manual offset val., clock: |->     ";
00575       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00576       {
00577          cout.width(2);
00578          cout<<iAutomaticTdcOffset[iIndexVftx] <<" ";
00579       }
00580       cout<<endl;
00581    }
00582       else cout<<"Manual tdc offset detection:        OFF"<<endl;
00583    if(1 == uAutomaticOffsetEnable)
00584       cout<<"Automatic tdc offset detection:     ON"<<endl;
00585       else cout<<"Automatic tdc offset detection:     OFF"<<endl;
00586    if( 1 == uUseCoarseCorrectedTime )
00587       cout<<"Coarse time cycle correc.:          ON"<<endl;
00588       else cout<<"Coarse time cycle correc.:          OFF"<<endl;
00589    if(1 == uSingleChannelCalibFilesEnable)
00590       cout<<"Use single channel calib files:     ON"<<endl;
00591       else cout<<"Use single channel calib files:     OFF"<<endl;
00592    switch( uSingleChannelCalibFilesOutput )
00593    {
00594       case 0:
00595          cout<<"Single channel calib files output:  OFF"<<endl;
00596          break;
00597       case 1:
00598          cout<<"Single channel calib files output:  New files from data"<<endl;
00599          break;
00600       case 2:
00601          cout<<"Single channel calib files output:  Update files with data"<<endl;
00602          break;
00603       default:
00604          break;
00605    }
00606    if( 1 == uEnableTimeOffsetCalibration ||
00607        1 == uEnableTotCalibration )
00608    {
00609       cout<<"VFTX FPGA TDC slot index:  |-      ";
00610       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00611       {
00612          cout.width(2);
00613          cout<<iIndexVftx<<" ";
00614       }
00615       cout<<endl<<"VFTX FPGA TDC board index: |->     ";
00616       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00617       {
00618          cout.width(2);
00619          cout<<iVftxBoardIndex[iIndexVftx] <<" ";
00620       }
00621       cout<<endl;
00622    }
00623    if( 1 == uEnableTimeOffsetCalibration )
00624    {
00625       cout<<"Time offset calibration:            ON"<<endl;
00626       cout<<"Channel:                       |-  ";
00627       for( Int_t iIndexChannel = 0; iIndexChannel < FPGA_TDC_NBCHAN/2; iIndexChannel++)
00628       {
00629          cout.width(5);
00630          cout<<iIndexChannel<<" ";
00631       }
00632       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00633          if( 1 == uVftxCalHistosEnabled[iIndexVftx] )
00634          {
00635             if( -1 < iVftxBoardIndex[iIndexVftx] )
00636             {
00637                cout<<endl<<Form("Slot %02d Board #%02d Time offset: |-> ", iIndexVftx, iVftxBoardIndex[iIndexVftx]);
00638                for( Int_t iIndexChannel = 0; iIndexChannel < FPGA_TDC_NBCHAN/2; iIndexChannel++)
00639                {
00640                   cout.width(5);
00641                   cout<<dTimeOffset[ iVftxBoardIndex[iIndexVftx] ][iIndexChannel] <<" ";
00642                }
00643             } // if( -1 < iVftxBoardIndex[iIndexVftx] )
00644                else
00645                {
00646                   cout<<endl<<Form("Slot %02d def. mean Time offset: |-> ", iIndexVftx );
00647                   for( Int_t iIndexChannel = 0; iIndexChannel < FPGA_TDC_NBCHAN/2; iIndexChannel++)
00648                   {
00649                      cout.width(5);
00650                      cout<<dMeanTimeOffset[iIndexChannel] <<" ";
00651                   }
00652                } // else of if( -1 < iVftxBoardIndex[iIndexVftx] )
00653          } // if( 1 == uVftxCalHistosEnabled[iIndexVftx] )
00654       cout<<endl;
00655    } // if( 1 == uEnableTimeOffsetCalibration )
00656       else cout<<"Time offset calibration:            OFF"<<endl;
00657    if( 1 == uEnableTotCalibration)
00658    {
00659       cout<<"Tot offset calibration:             ON"<<endl;
00660       cout<<"Channel:                       |-  ";
00661       for( Int_t iIndexChannel = 0; iIndexChannel < FPGA_TDC_NBCHAN/2; iIndexChannel++)
00662       {
00663          cout.width(5);
00664          cout<<iIndexChannel<<" ";
00665       }
00666       for( Int_t iIndexVftx = 0; iIndexVftx < MAX_FPGA_TDC; iIndexVftx++)
00667          if( 1 == uVftxCalHistosEnabled[iIndexVftx] )
00668          {
00669             if( -1 < iVftxBoardIndex[iIndexVftx] )
00670             {
00671                cout<<endl<<Form("Slot %02d Board #%02d Tot offset:  |-> ", iIndexVftx, iVftxBoardIndex[iIndexVftx]);
00672                for( Int_t iIndexChannel = 0; iIndexChannel < FPGA_TDC_NBCHAN/2; iIndexChannel++)
00673                {
00674                   cout.width(5);
00675                   cout<<dTotOffset[ iVftxBoardIndex[iIndexVftx] ][iIndexChannel] <<" ";
00676                }
00677             } // if( -1 < iVftxBoardIndex[iIndexVftx] )
00678                else
00679                {
00680                   cout<<endl<<Form("Slot %02d def. mean Tot offset:  |-> ", iIndexVftx );
00681                   for( Int_t iIndexChannel = 0; iIndexChannel < FPGA_TDC_NBCHAN/2; iIndexChannel++)
00682                   {
00683                      cout.width(5);
00684                      cout<<dMeanTotOffset[iIndexChannel] <<" ";
00685                   }
00686                } // else of if( -1 < iVftxBoardIndex[iIndexVftx] )
00687          } // if( 1 == uVftxCalHistosEnabled[iIndexVftx] )
00688       cout<<endl;
00689    } // if( 1 == uEnableTotCalibration)
00690       else cout<<"Tot offset calibration:             OFF"<<endl;
00691 
00692    cout<<"************************************************************************"<<endl;
00693    
00694    return 0;
00695 }

Generated on Tue Dec 10 2013 04:52:21 for ROCsoft by  doxygen 1.7.1