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

beamtime/tof-tdctest/go4/PADRPC/TPadRpcParam.cxx (r4864/r4267)

Go to the documentation of this file.
00001 /* Generated by Together */
00002 
00003 #include "TPadRpcParam.h"
00004 #include "TGo4Log.h"
00005 
00006 #include "TGo4Version.h"
00007 #if __GO4BUILDVERSION__ > 40502
00008    #include "go4iostream.h"
00009 #else
00010    #include "Riostream.h"
00011 #endif
00012 
00013 #include "MBSUNPACK/TMbsCrateEvent.h"
00014 
00015 #define NB_DIGITS_PAD_INDEXES  5
00016 #define NB_DIGITS_PAD_OFFSETS  9
00017 
00018 /***** Default values definition *****/
00019 #define DEBUG                 0
00020 #define TDC_FOR_OFFSET_CAEN   -1
00021 #define CH_FOR_OFFSET_CAEN    -1
00022 #define TDC_FOR_OFFSET_VFTX   -1
00023 #define CH_FOR_OFFSET_VFTX    -1
00024 
00025 #define TDC_FOR_DIAMOND_CAEN  -1
00026 #define CH_FOR_DIAMOND_CAEN   -1
00027 #define TDC_FOR_DIAMOND_VFTX  -1
00028 #define CH_FOR_DIAMOND_VFTX   -1
00029 
00030 #define RATE_INT_DURATION     -1
00031 #define RATE_INT_STEP         -1
00032 
00033 #define TDC_PAD               0
00034 #define RPC_NAME_PAD         ""
00035 #define RPC_POSX_PAD          0.0
00036 #define RPC_POSY_PAD          0.0
00037 #define RPC_POSZ_PAD          0.0
00038 #define NB_PADS_X             0 // Nb of pads along X axis for the beam profile monitor
00039 #define NB_PADS_Y             0 // Nb of pads along Y axis for the beam profile monitor
00040 #define PAD_SIZE_X            0
00041 #define PAD_SIZE_Y            0
00042 #define ORIENTATION           0
00043 #define TRIGGER_SELECTION    -1
00044 
00045 #define NOISY_PAD             0
00046 #define DEAD_PAD              0
00047 #define PADS_TOT_TDC          0
00048 #define PADS_TOT_CHA          0
00049 #define PADS_TIME_TDC         0
00050 #define PADS_TIME_CHA         0
00051 
00052 #define PADS_OFFSET           0
00053 #define PADS_TOT_GAIN         1
00054 #define PADS_TOT_OFFS         0
00055 
00056 
00057 #define MATCHING_OFFSET       0
00058 /*************************************/
00059 
00060 TPadRpcParam::TPadRpcParam(const char* name) : TGo4Parameter(name)
00061 {
00062    ReadOptions();
00063    if( 0 < uNbPadsX &&  0 < uNbPadsY )
00064    {
00065       // not en empty RPC !
00066       PrintOptions(); //print out all values to see, if the setting has worked correctly
00067    }
00068 }
00069 
00070 //***********************************************************
00071 TPadRpcParam::~TPadRpcParam()
00072 {
00073 }
00074 
00075 Bool_t TPadRpcParam::ReadOptions(){
00076    // Loading default values
00077    uDebug                   = DEBUG;
00078    iOffsetTdcCaen           = TDC_FOR_OFFSET_CAEN;
00079    iOffsetChannelCaen       = CH_FOR_OFFSET_CAEN;
00080    iOffsetTdcVFTX           = TDC_FOR_OFFSET_VFTX;
00081    iOffsetChannelVFTX       = CH_FOR_OFFSET_VFTX;
00082 
00083    iDiamondTdcCaen          = TDC_FOR_DIAMOND_VFTX;
00084    iDiamondChannelCaen      = CH_FOR_DIAMOND_CAEN;
00085    iDiamondTdcVFTX          = TDC_FOR_DIAMOND_VFTX;
00086    iDiamondChannelVFTX      = CH_FOR_DIAMOND_VFTX;
00087 
00088    iRateIntegrationDuration = RATE_INT_DURATION;
00089    iRateIntegrationStep     = RATE_INT_STEP;
00090 
00091    // Strip RPCs settings
00092    uTdcTypePad              = TDC_PAD;
00093    sPadRpcName              = RPC_NAME_PAD;
00094    dPadRpcPosX              = RPC_POSX_PAD;
00095    dPadRpcPosY              = RPC_POSY_PAD;
00096    dPadRpcPosZ              = RPC_POSZ_PAD;
00097    uNbPadsX                 = NB_PADS_X;
00098    uNbPadsY                 = NB_PADS_Y;
00099    dPadSizeX                = PAD_SIZE_X;
00100    dPadSizeY                = PAD_SIZE_Y;
00101    uOrientation             = ORIENTATION;
00102    iTriggerSelection        = TRIGGER_SELECTION;
00103 
00104    for( Int_t iPadX = 0; iPadX < NB_PADS_MAX_X; iPadX ++)
00105       for( Int_t iPadY = 0; iPadY < NB_PADS_MAX_Y; iPadY ++)
00106       {
00107          uTdcPadType[iPadY][iPadX]     = TDC_PAD;
00108          uTdcPadNoisy[iPadY][iPadX]    = NOISY_PAD;
00109          uTdcPadDead[iPadY][iPadX]     = DEAD_PAD;
00110          uTdcPadTime[iPadY][iPadX]     = PADS_TIME_TDC;
00111          uChannelPadTime[iPadY][iPadX] = PADS_TIME_CHA;
00112          uTdcPadTot[iPadY][iPadX]      = PADS_TOT_TDC;
00113          uChannelPadTot[iPadY][iPadX]  = PADS_TOT_CHA;
00114 
00115          dOffsetList[iPadY][iPadX]     = PADS_OFFSET;
00116          dToTGainList[iPadY][iPadX]    = PADS_TOT_GAIN;
00117          dTotOffsetList[iPadY][iPadX]  = PADS_TOT_OFFS;
00118 
00119          dOffsetMatching[iPadY][iPadX] = MATCHING_OFFSET;
00120    }
00121    // Read the option file
00122    TString sOptionFileName = "./PadRpc_options.txt";
00123    TString sName = GetName();
00124 
00125    // Try to read the option filename from the general option files text file
00126    Bool_t bFilenameFound = kFALSE;
00127    fstream optionFilenameFile("./Option_files.txt", ios::in);
00128    // Testing if the file does exist. If not I use default values
00129    if( optionFilenameFile.fail() == true)
00130    {
00131       cout<<"************************************************************************"<<endl;
00132       cout<<" File with option filename for TPadRpcParam "<<GetName()<<" not found: using the default value ";
00133       cout<<sOptionFileName<<endl;
00134    } // if( optionFilenameFile.fail() == true)
00135       else
00136       {
00137          TString line;
00138 
00139          // New
00140          UInt_t uIndexPadRpc =((TString)sName( sName.Length()-2,2)).Atoi();
00141 
00142          // Goes through all lines
00143          while( !optionFilenameFile.eof() )
00144          {
00145            line.ReadLine(optionFilenameFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00146 
00147            if(line(0) == '#' || line(0) == '*'||
00148                (line(0) == '/' && line(1) == '/') )
00149            {
00150               //Comment in the text file
00151               ;
00152            }
00153            // New
00154            else if( kTRUE == line.Contains( Form("padrpc%02d ", uIndexPadRpc) ) )
00155            {
00156               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00157               cout<<"************************************************************************"<<endl;
00158               cout<<"Using "<<sOptionFileName<<" as source for the options of TPadRpcParam "<<GetName()<<" step"<<endl;
00159               bFilenameFound = kTRUE;
00160               break;
00161            }
00162          } // while( !optionFilenameFile.eof() )
00163          if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00164          {
00165             cout<<"************************************************************************"<<endl;
00166             cout<<"Field for TPadRpcParam "<<GetName()<<" step not found in File with option filename => Using "<<sOptionFileName<<endl;
00167          } // if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00168       } // else of if( optionFilenameFile.fail() == true)
00169 
00170    fstream setupFile(sOptionFileName, ios::in);
00171    
00172    // Testing if the option does exist. If not I use default values.
00173    if( setupFile.fail() == true)
00174    {
00175           TGo4Log::Error("TPadRpcParam %s: Setup file %s can not be opened or is missing.", GetName(), sOptionFileName.Data());
00176           TGo4Log::Error("=> Using default values!");
00177    }
00178    else
00179    {
00180       TGo4Log::Info("TPadRpcParam %s: Load Setup file %s.", GetName(), sOptionFileName.Data());
00181       TString line;
00182       
00183       // Goes through all lines
00184       while( !setupFile.eof() )
00185       {
00186          line.ReadLine(setupFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00187          if(1 == uDebug)
00188             cout<<line<<endl;
00189 
00190          if(line(0) == '#' || line(0) == '*')
00191          {
00192             //Comment in the text file
00193             ;
00194          }
00195          else if(line.Contains("debug")==kTRUE)
00196          {
00197             uDebug = ((TString)line(5,10)).Atoi();
00198             if(1 == uDebug)
00199                cout<<"Debug ON!!!!!!"<<endl;
00200          }
00201          else if(line.Contains("tdcoffscaen")==kTRUE)
00202          {
00203             iOffsetTdcCaen = ((TString)line(12,10)).Atoi();
00204             if( iOffsetTdcCaen > MAX_1290)
00205             {
00206                cout<<"Error: CAEN tdc for offset higher than max allowed -> replaced by default value: ";
00207                cout<<TDC_FOR_OFFSET_CAEN<<endl;
00208                iOffsetTdcCaen = TDC_FOR_OFFSET_CAEN;
00209             }
00210          }
00211          else if(line.Contains("chaoffscaen")==kTRUE)
00212          {
00213             iOffsetChannelCaen = ((TString)line(12,10)).Atoi();
00214             if( iOffsetChannelCaen > T1290Data::NumChan)
00215             {
00216                cout<<"Error: CAEN channel for offset higher than max allowed -> replaced by default value: ";
00217                cout<<CH_FOR_OFFSET_CAEN<<endl;
00218                iOffsetChannelCaen = CH_FOR_OFFSET_CAEN;
00219             }
00220          }
00221          else if(line.Contains("tdcoffsvftx")==kTRUE)
00222          {
00223             iOffsetTdcVFTX = ((TString)line(12,10)).Atoi();
00224             if( iOffsetTdcVFTX > MAX_FPGA_TDC)
00225             {
00226                cout<<"Error: VFTX tdc for offset higher than max allowed -> replaced by default value: ";
00227                cout<<TDC_FOR_OFFSET_VFTX<<endl;
00228                iOffsetTdcVFTX = TDC_FOR_OFFSET_VFTX;
00229             }
00230          }
00231          else if(line.Contains("chaoffsvftx")==kTRUE)
00232          {
00233             iOffsetChannelVFTX = ((TString)line(12,10)).Atoi();
00234             if( iOffsetChannelVFTX > FPGA_TDC_NBCHAN)
00235             {
00236                cout<<"Error: VFTX channel for offset higher than max allowed -> replaced by default value: ";
00237                cout<<CH_FOR_OFFSET_VFTX<<endl;
00238                iOffsetChannelVFTX = CH_FOR_OFFSET_VFTX;
00239             }
00240          }
00241          else if(line.Contains("tdcdiamcaen")==kTRUE)
00242          {
00243             iDiamondTdcCaen = ((TString)line(12,10)).Atoi();
00244             if( iDiamondTdcCaen > MAX_1290)
00245             {
00246                cout<<"Error: CAEN tdc for diamond higher than max allowed -> replaced by default value: ";
00247                cout<<TDC_FOR_DIAMOND_CAEN<<endl;
00248                iDiamondTdcCaen = TDC_FOR_DIAMOND_CAEN;
00249             }
00250          }
00251          else if(line.Contains("chadiamcaen")==kTRUE)
00252          {
00253             iDiamondChannelCaen = ((TString)line(12,10)).Atoi();
00254             if( iDiamondChannelCaen > T1290Data::NumChan)
00255             {
00256                cout<<"Error: CAEN channel for diamond higher than max allowed -> replaced by default value: ";
00257                cout<<CH_FOR_DIAMOND_CAEN<<endl;
00258                iDiamondChannelCaen = CH_FOR_DIAMOND_CAEN;
00259             }
00260          }
00261          else if(line.Contains("tdcdiamvftx")==kTRUE)
00262          {
00263             iDiamondTdcVFTX = ((TString)line(12,10)).Atoi();
00264             if( iDiamondTdcVFTX > MAX_FPGA_TDC)
00265             {
00266                cout<<"Error: VFTX tdc for diamond higher than max allowed -> replaced by default value: ";
00267                cout<<TDC_FOR_DIAMOND_VFTX<<endl;
00268                iDiamondTdcVFTX = TDC_FOR_DIAMOND_VFTX;
00269             }
00270          }
00271          else if(line.Contains("chadiamvftx")==kTRUE)
00272          {
00273             iDiamondChannelVFTX = ((TString)line(12,10)).Atoi();
00274             if( iDiamondChannelVFTX > FPGA_TDC_NBCHAN)
00275             {
00276                cout<<"Error: VFTX channel for diamond higher than max allowed -> replaced by default value: ";
00277                cout<<CH_FOR_DIAMOND_VFTX<<endl;
00278                iDiamondChannelVFTX = CH_FOR_DIAMOND_VFTX;
00279             }
00280          }
00281          else if(line.Contains("rateintdur")==kTRUE)
00282          {
00283             iRateIntegrationDuration = ((TString)line(11,10)).Atoi();
00284          }
00285          else if(line.Contains("ratestep")==kTRUE)
00286          {
00287             iRateIntegrationStep = ((TString)line(11,10)).Atoi();
00288             if( iRateIntegrationStep < 2 )
00289             {
00290                cout<<"Rate step size smaller than Go4 minimal Hist. update step of 2s, set step size to 2s"<<endl;
00291                iRateIntegrationStep = 2;
00292             }
00293             if( iRateIntegrationDuration < iRateIntegrationStep )
00294             {
00295                cout<<"Rate step size smaller than rate integration size, set step size to integration size"<<endl;
00296                iRateIntegrationStep = iRateIntegrationDuration;
00297             }
00298          }
00299          else if(line.Contains("tdctypepad")==kTRUE)
00300          {
00301             uTdcTypePad = ((TString)line(13,10)).Atoi();
00302          }
00303          else if(line.Contains("padrpcname")==kTRUE)
00304          {
00305             sPadRpcName = ((TString)line(13,20));
00306          }
00307          else if(line.Contains("padrpcposx")==kTRUE)
00308          {
00309             dPadRpcPosX = ((TString)line(13,10)).Atof();
00310          }
00311          else if(line.Contains("padrpcposy")==kTRUE)
00312          {
00313             dPadRpcPosY = ((TString)line(13,10)).Atof();
00314          }
00315          else if(line.Contains("padrpcposz")==kTRUE)
00316          {
00317             dPadRpcPosZ = ((TString)line(13,10)).Atof();
00318          }
00319          else if(line.Contains("nbpadsx")==kTRUE)
00320          {
00321             uNbPadsX = ((TString)line(9,10)).Atoi();
00322             if( uNbPadsX > NB_PADS_MAX_X)
00323             {
00324                cout<<"Error: nb pads on x axis higher than max allowed for Pad RPC "<<uNbPadsX;
00325                cout<<" -> replaced by max value: ";
00326                cout<<NB_PADS_MAX_X<<endl;
00327                uNbPadsX = NB_PADS_MAX_X;
00328             }
00329          }
00330          else if(line.Contains("nbpadsy")==kTRUE)
00331          {
00332             uNbPadsY = ((TString)line(9,10)).Atoi();
00333             if( uNbPadsY > NB_PADS_MAX_Y)
00334             {
00335                cout<<"Error: nb pads on y axis higher than max allowed for Pad RPC "<<uNbPadsY;
00336                cout<<" -> replaced by max value: ";
00337                cout<<NB_PADS_MAX_Y<<endl;
00338                uNbPadsY = NB_PADS_MAX_Y;
00339             }
00340          }
00341          else if(line.Contains("padsizex")==kTRUE)
00342          {
00343             dPadSizeX = ((TString)line(12,10)).Atof();
00344          }
00345          else if(line.Contains("padsizey")==kTRUE)
00346          {
00347             dPadSizeY = ((TString)line(12,10)).Atof();
00348          }
00349          else if(line.Contains("orientation")==kTRUE)
00350          {
00351             uOrientation = ((TString)line(13,10)).Atoi();
00352          }
00353          else if(line.Contains("triggsel")==kTRUE)
00354          {
00355             iTriggerSelection = ((TString)line(9,10)).Atoi();
00356          }
00357          else if(line.Contains("padtdctype")==kTRUE)
00358          {
00359             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00360             {
00361                if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00362                {
00363                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00364                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00365                   {
00366                      uTdcPadType[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00367                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00368                   }
00369                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00370                line.ReadLine(setupFile, kFALSE);
00371             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00372          } // else if(line.Contains("padtdctype")==kTRUE)
00373          else if(line.Contains("noisypad")==kTRUE)
00374          {
00375             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00376             {
00377                if( line.Contains( Form("noisypad%u", temp_indexY)) ==kTRUE)
00378                {
00379                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00380                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00381                   {
00382                      uTdcPadNoisy[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00383                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00384                   }
00385                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00386                line.ReadLine(setupFile, kFALSE);
00387             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00388          }
00389          else if(line.Contains("deadpad")==kTRUE)
00390          {
00391             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00392             {
00393                if( line.Contains( Form("deadpad%u", temp_indexY)) ==kTRUE)
00394                {
00395                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00396                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00397                   {
00398                      uTdcPadDead[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00399                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00400                   }
00401                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00402                line.ReadLine(setupFile, kFALSE);
00403             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00404          }
00405          else if(line.Contains("padtimetdc")==kTRUE)
00406          {
00407             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00408             {
00409                if( line.Contains( Form("padtimetdc%u", temp_indexY)) ==kTRUE)
00410                {
00411                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00412                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00413                   {
00414                      uTdcPadTime[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00415                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00416                   }
00417                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00418                line.ReadLine(setupFile, kFALSE);
00419             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00420          }
00421          else if(line.Contains("padtimecha")==kTRUE)
00422          {
00423             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00424             {
00425                if( line.Contains( Form("padtimecha%u", temp_indexY)) ==kTRUE)
00426                {
00427                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00428                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00429                   {
00430                      uChannelPadTime[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00431                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00432                   }
00433                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00434                line.ReadLine(setupFile, kFALSE);
00435             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00436          }
00437          else if(line.Contains("padtottdc")==kTRUE)
00438          {
00439             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00440             {
00441                if( line.Contains( Form("padtottdc%u", temp_indexY)) ==kTRUE)
00442                {
00443                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00444                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00445                   {
00446                      uTdcPadTot[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00447                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00448                   }
00449                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00450                line.ReadLine(setupFile, kFALSE);
00451             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00452          }
00453          else if(line.Contains("padtotcha")==kTRUE)
00454          {
00455             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00456             {
00457                if( line.Contains( Form("padtotcha%u", temp_indexY)) ==kTRUE)
00458                {
00459                   line = line(16,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);;
00460                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00461                   {
00462                      uChannelPadTot[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00463                      line = line = line(NB_DIGITS_PAD_INDEXES,NB_DIGITS_PAD_INDEXES*NB_PADS_MAX_X);
00464                   }
00465                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00466                line.ReadLine(setupFile, kFALSE);
00467             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00468          }
00469          else if(line.Contains("padsoffs")==kTRUE)
00470          {
00471            for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00472            {
00473               if( line.Contains( Form("padsoffs%u", temp_indexY)) ==kTRUE)
00474               {
00475                  line = line(16,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);;
00476                  for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00477                  {
00478                     dOffsetList[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00479                     line = line = line(NB_DIGITS_PAD_OFFSETS,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);
00480                  }
00481               } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00482               line.ReadLine(setupFile, kFALSE);
00483            } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00484          }
00485          else if(line.Contains("padtotgain")==kTRUE)
00486          {
00487             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00488             {
00489                if( line.Contains( Form("padtotgain%u", temp_indexY)) ==kTRUE)
00490                {
00491                   line = line(16,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);;
00492                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00493                   {
00494                      dToTGainList[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00495                      line = line = line(NB_DIGITS_PAD_OFFSETS,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);
00496                   }
00497                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00498                line.ReadLine(setupFile, kFALSE);
00499             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00500          }
00501          else if(line.Contains("padtotoffs")==kTRUE)
00502          {
00503             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00504             {
00505                if( line.Contains( Form("padtotoffs%u", temp_indexY)) ==kTRUE)
00506                {
00507                   line = line(16,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);;
00508                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00509                   {
00510                      dTotOffsetList[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00511                      line = line = line(NB_DIGITS_PAD_OFFSETS,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);
00512                   }
00513                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00514                line.ReadLine(setupFile, kFALSE);
00515             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00516          }
00517          else if(line.Contains("padmatchingoffs")==kTRUE)
00518          {
00519             for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00520             {
00521                if( line.Contains( Form("padmatchingoffs%u", temp_indexY)) ==kTRUE)
00522                {
00523                   line = line(16,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);;
00524                   for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00525                   {
00526                      dOffsetMatching[temp_indexY][temp_indexX] = ((TString)line(0,5)).Atoi();
00527                      line = line = line(NB_DIGITS_PAD_OFFSETS,NB_DIGITS_PAD_OFFSETS*NB_PADS_MAX_X);
00528                   }
00529                } // if( line.Contains( Form("padtdctype%u", temp_indexY)) ==kTRUE)
00530                line.ReadLine(setupFile, kFALSE);
00531             } // for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00532          }
00533       } // while( !setupFile.eof() )
00534    } //  else of if( setupFile.fail() == true)
00535    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00536       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00537          if( 1 == uTdcPadType[temp_indexY][temp_indexX] )
00538          {
00539             uTdcPadTot[temp_indexY][temp_indexX]     = uTdcPadTime[temp_indexY][temp_indexX];
00540             if( 1 == uChannelPadTime[temp_indexY][temp_indexX]%2)
00541                uChannelPadTot[temp_indexY][temp_indexX] = uChannelPadTime[temp_indexY][temp_indexX] - 1;
00542                else uChannelPadTot[temp_indexY][temp_indexX] = uChannelPadTime[temp_indexY][temp_indexX] + 1;
00543          }
00544    
00545    return kTRUE;
00546 }
00547 
00548 
00549 Int_t TPadRpcParam::PrintOptions(){
00550    cout<<"****************** PAD RPC calibration parameters **********************"<<endl;
00551    cout<<"------------- Options for pad RPC ";
00552    cout.width(20);
00553    cout<<sPadRpcName<<" --------------"<<endl;
00554    cout<<"-------------------------------------------------"<<endl;
00555    if(1 == uDebug)
00556       cout<<"  Debug ON!!!!!!"<<endl;
00557       else cout<<"  Debug OFF"<<endl;
00558 
00559    if( -1 < iOffsetTdcCaen && -1 < iOffsetChannelCaen &&
00560        -1 < iOffsetTdcVFTX && -1 < iOffsetChannelVFTX )
00561    {
00562       cout<<"  Chan. used for time offset: "<<iOffsetChannelCaen;
00563       cout<<" in TDC "<<iOffsetTdcCaen<<" in CAEN"<<endl;
00564       cout<<"  Chan. used for time offset: "<<iOffsetChannelVFTX;
00565       cout<<" in TDC "<<iOffsetTdcVFTX<<" in VFTX"<<endl;
00566    }
00567    if( -1 < iRateIntegrationDuration && -1 < iRateIntegrationStep)
00568    {
00569       cout<<"  Rate hist. reset spacing:   "<<iRateIntegrationDuration<<" s"<<endl;
00570       cout<<"  Rate hist. update spacing:  "<<iRateIntegrationStep<<" s"<<endl;
00571    }
00572    if( 0 == uTdcTypePad )
00573    {
00574       cout<<"  TDC type:                  CAEN"<<endl;
00575    }
00576    else if( 1 == uTdcTypePad )
00577    {
00578       cout<<"  TDC type:                  VFTX"<<endl;
00579    }
00580    else if( 2 == uTdcTypePad )
00581    {
00582       cout<<"  TDC type:                  MIXED"<<endl;
00583    }
00584    cout<<"  Position:                  X= "<<dPadRpcPosX;
00585    cout<<" Y= "<<dPadRpcPosY<<" Z= "<<dPadRpcPosZ;
00586    cout<<endl;
00587    cout<<"  Nb pads on X axis:         "<<uNbPadsX<<endl;
00588    cout<<"  Nb pads on Y axis:         "<<uNbPadsY<<endl;
00589    cout<<"  Pad size in X (incl gap.): "<<dPadSizeX<<" cm"<<endl;
00590    cout<<"  Pad size in Y (incl gap.): "<<dPadSizeY<<" cm"<<endl;
00591    if( 0 == uOrientation )
00592    {
00593       cout<<"  RPC orientation:           Horizontal"<<endl;
00594    }
00595    else if( 1 == uOrientation )
00596    {
00597       cout<<"  RPC orientation:           Vertical"<<endl;
00598    }
00599    if( -1 == iTriggerSelection )
00600       cout<<"  Trigger selection:         OFF"<<endl;
00601       else cout<<"  Trigger selection:         Trigger "<<iTriggerSelection<<endl;
00602    cout<<"-------------------------------------------------"<<endl;
00603    cout<<"  X Pad#:            |-      ";
00604    for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00605    {
00606       cout.width(NB_DIGITS_PAD_INDEXES - 1);
00607       cout<<temp_indexX<<" ";
00608    }
00609    if( 2 == uTdcTypePad )
00610    {
00611       for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00612       {
00613          cout<<endl<<"  Tdc Type row #"<<temp_indexY<<"    |->     ";
00614          for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00615          {
00616             cout.width(NB_DIGITS_PAD_INDEXES - 1);
00617             cout<<uTdcPadType[temp_indexY][temp_indexX]<<" ";
00618          }
00619       }
00620    }
00621    cout<<endl<<"              ++++++++++++++++++++               ";
00622    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00623    {
00624       cout<<endl<<" Noisy Strip? row #"<<temp_indexY<<" |->     ";
00625       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00626       {
00627          cout.width(NB_DIGITS_PAD_INDEXES - 1);
00628          cout<<uTdcPadNoisy[temp_indexY][temp_indexX]<<" ";
00629       }
00630    }
00631    cout<<endl<<"              ++++++++++++++++++++               ";
00632    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00633    {
00634       cout<<endl<<" Dead Strip? row #"<<temp_indexY<<"  |->     ";
00635       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00636       {
00637          cout.width(NB_DIGITS_PAD_INDEXES - 1);
00638          cout<<uTdcPadDead[temp_indexY][temp_indexX]<<" ";
00639       }
00640    }
00641    cout<<endl<<"              ++++++++++++++++++++               ";
00642    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00643    {
00644       cout<<endl<<" Time Tdc row #"<<temp_indexY<<"     |->     ";
00645       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00646       {
00647          cout.width(NB_DIGITS_PAD_INDEXES - 1);
00648          cout<<uTdcPadTime[temp_indexY][temp_indexX]<<" ";
00649       }
00650    }
00651    cout<<endl<<"              ++++++++++++++++++++               ";
00652    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00653    {
00654       cout<<endl<<" Time channel row #"<<temp_indexY<<" |->     ";
00655       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00656       {
00657          cout.width(NB_DIGITS_PAD_INDEXES - 1);
00658          cout<<uChannelPadTime[temp_indexY][temp_indexX]<<" ";
00659       }
00660    }
00661    cout<<endl<<"              ++++++++++++++++++++               ";
00662    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00663    {
00664       cout<<endl<<" Tot Tdc row #"<<temp_indexY<<"      |->     ";
00665       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00666       {
00667          cout.width(NB_DIGITS_PAD_INDEXES - 1);
00668          cout<<uTdcPadTot[temp_indexY][temp_indexX]<<" ";
00669       }
00670    }
00671    cout<<endl<<"              ++++++++++++++++++++               ";
00672    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00673    {
00674       cout<<endl<<" Tot channel row #"<<temp_indexY<<"  |->     ";
00675       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00676       {
00677          cout.width(NB_DIGITS_PAD_INDEXES - 1);
00678          cout<<uChannelPadTot[temp_indexY][temp_indexX]<<" ";
00679       }
00680    }
00681    cout<<endl;
00682    cout<<"-------------------------------------------------"<<endl;
00683    cout<<"  X Pad#:         |-      ";
00684    for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00685    {
00686       cout.width(NB_DIGITS_PAD_OFFSETS - 1);
00687       cout<<temp_indexX<<" ";
00688    }
00689    cout<<endl<<"              ++++++++++++++++++++               ";
00690    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00691    {
00692       cout<<endl<<" Pad Offset #"<<temp_indexY<<"    |->     ";
00693       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00694       {
00695          cout.width(NB_DIGITS_PAD_OFFSETS - 1);
00696          cout<<dOffsetList[temp_indexY][temp_indexX]<<" ";
00697       }
00698    }
00699    cout<<endl<<"              ++++++++++++++++++++               ";
00700    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00701    {
00702       cout<<endl<<"  Tot Gain #"<<temp_indexY<<"     |->     ";
00703       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00704       {
00705          cout.width(NB_DIGITS_PAD_OFFSETS - 1);
00706          cout<<dToTGainList[temp_indexY][temp_indexX]<<" ";
00707       }
00708    }
00709    cout<<endl<<"              ++++++++++++++++++++               ";
00710    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00711    {
00712       cout<<endl<<"  Tot offset #"<<temp_indexY<<"   |->     ";
00713       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00714       {
00715          cout.width(NB_DIGITS_PAD_OFFSETS - 1);
00716          cout<<dTotOffsetList[temp_indexY][temp_indexX]<<" ";
00717       }
00718    }
00719    cout<<endl;
00720    cout<<"-------------------------------------------------"<<endl;
00721    cout<<"  X Pad#:         |-      ";
00722    for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00723    {
00724       cout.width(NB_DIGITS_PAD_OFFSETS - 1);
00725       cout<<temp_indexX<<" ";
00726    }
00727    for(UInt_t temp_indexY = 0; temp_indexY < uNbPadsY; temp_indexY++)
00728    {
00729       cout<<endl<<"  Matching Off #"<<temp_indexY<<" |->     ";
00730       for(UInt_t temp_indexX = 0; temp_indexX < uNbPadsX; temp_indexX++)
00731       {
00732          cout.width(NB_DIGITS_PAD_OFFSETS - 1);
00733          cout<<dOffsetMatching[temp_indexY][temp_indexX]<<" ";
00734       }
00735    }
00736    cout<<endl;
00737    cout<<"************************************************************************"<<endl;
00738    
00739    return 0;
00740 }
00741 

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