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

beamtime/gsi-aug12/prod/go4/RPC/TRpcParam.cxx (r4864/r3937)

Go to the documentation of this file.
00001 /* Generated by Together */
00002 
00003 #include "TRpcParam.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_STRIP_INDEXES  5
00016 #define NB_DIGITS_STRIP_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 USE_COARSE_CORR_TIME  0
00034 
00035 #define TDC_STRIP             0
00036 #define RPC_NAME_STRIP        ""
00037 #define RPC_POSX_STRIP        0.0
00038 #define RPC_POSY_STRIP        0.0
00039 #define RPC_POSZ_STRIP        0.0
00040 #define NB_STRIPS             0 // Nb of strips for the beam profile monitor
00041 #define STRIP_WIDTH           0
00042 #define STRIP_LENGTH          0
00043 #define TIME_CONV            10.0
00044 #define MAX_DIST_HITS         5.0
00045 #define REJECT_MULTI_HITS     0
00046 #define ORIENTATION           0
00047 #define BEAM_PROFILE_SIZE     0
00048 #define TRIGGER_SELECTION    -1
00049 
00050 #define NOISY_STRIP           0
00051 #define DEAD_STRIP            0
00052 #define STRIPS_LEFT_TOT_TDC   0
00053 #define STRIPS_LEFT_TOT_CHA   0
00054 #define STRIPS_LEFT_TIME_TDC  0
00055 #define STRIPS_LEFT_TIME_CHA  0
00056 #define STRIPS_RIGHT_TIME_TDC 0
00057 #define STRIPS_RIGHT_TIME_CHA 0
00058 #define STRIPS_RIGHT_TOT_TDC  0
00059 #define STRIPS_RIGHT_TOT_CHA  0
00060 
00061 #define STRIPS_PROFILE_OFFS   0
00062 #define STRIPS_REFERENCE_OFFS 0
00063 #define STRIPS_OFFSET_LEFT    0
00064 #define STRIPS_OFFSET_RIGHT   0
00065 
00066 #define USE_CENTER_OF_GRAVITY 0
00067 #define STRIPS_TOT_GAIN_LEFT  1
00068 #define STRIPS_TOT_OFFS_LEFT  0
00069 #define STRIPS_TOT_GAIN_RIGHT 1
00070 #define STRIPS_TOT_OFFS_RIGHT 0
00071 
00072 #define INITIAL_CALIB_OFFSET  0
00073 
00074 #define MATCHING_OFFSET       0
00075 /*************************************/
00076 
00077 TRpcParam::TRpcParam(const char* name) : TGo4Parameter(name)
00078 {
00079    ReadOptions();
00080    if( 0 < uNbStrips )
00081    {
00082       // not en empty RPC !
00083       CalculateLeftRightOffset();
00084       PrintOptions(); //print out all values to see, if the setting has worked correctly
00085    }
00086 }
00087 
00088 //***********************************************************
00089 TRpcParam::~TRpcParam()
00090 {
00091 }
00092 
00093 Bool_t TRpcParam::ReadOptions(){
00094    // Loading default values
00095    uDebug                   = DEBUG;
00096    iOffsetTdcCaen           = TDC_FOR_OFFSET_CAEN;
00097    iOffsetChannelCaen       = CH_FOR_OFFSET_CAEN;
00098    iOffsetTdcVFTX           = TDC_FOR_OFFSET_VFTX;
00099    iOffsetChannelVFTX       = CH_FOR_OFFSET_VFTX;
00100 
00101    iDiamondTdcCaen          = TDC_FOR_DIAMOND_VFTX;
00102    iDiamondChannelCaen      = CH_FOR_DIAMOND_CAEN;
00103    iDiamondTdcVFTX          = TDC_FOR_DIAMOND_VFTX;
00104    iDiamondChannelVFTX      = CH_FOR_DIAMOND_VFTX;
00105 
00106    iRateIntegrationDuration = RATE_INT_DURATION;
00107    iRateIntegrationStep     = RATE_INT_STEP;
00108    uUseCoarseCorrectedTime  = USE_COARSE_CORR_TIME;
00109    // Strip RPCs settings
00110    uTdcTypeStrip            = TDC_STRIP;
00111    sStripRpcName            = RPC_NAME_STRIP;
00112    dStripRpcPosX            = RPC_POSX_STRIP;
00113    dStripRpcPosY            = RPC_POSY_STRIP;
00114    dStripRpcPosZ            = RPC_POSZ_STRIP;
00115    uNbStrips                = NB_STRIPS;
00116    dStripWidth              = STRIP_WIDTH;
00117    dStripLength             = STRIP_LENGTH;
00118    dTimeConv                = TIME_CONV;
00119    dStripHitMaxDistance     = MAX_DIST_HITS;
00120    uRejectMultipleHits      = REJECT_MULTI_HITS;
00121    uOrientation             = ORIENTATION;
00122    iBeamProfileSize         = BEAM_PROFILE_SIZE;
00123    iTriggerSelection        = TRIGGER_SELECTION;
00124    uUseChargeGravityCenter  = USE_CENTER_OF_GRAVITY;
00125 
00126    for( Int_t iStrip = 0; iStrip < NB_STRIPS_MAX; iStrip ++)
00127    {
00128       uTdcStripType[iStrip]          = TDC_STRIP;
00129       uTdcStripNoisy[iStrip]         = NOISY_STRIP;
00130       uTdcStripDead[iStrip]          = DEAD_STRIP;
00131       uTdcStripLeftTot[iStrip]       = STRIPS_LEFT_TOT_TDC;
00132       uChannelStripLeftTot[iStrip]   = STRIPS_LEFT_TOT_CHA;
00133       uTdcStripLeftTime[iStrip]      = STRIPS_LEFT_TIME_TDC;
00134       uChannelStripLeftTime[iStrip]  = STRIPS_LEFT_TIME_CHA;
00135       uTdcStripRightTime[iStrip]     = STRIPS_RIGHT_TIME_TDC;
00136       uChannelStripRightTime[iStrip] = STRIPS_RIGHT_TIME_CHA;
00137       uTdcStripRightTot[iStrip]      = STRIPS_RIGHT_TOT_TDC;
00138       uChannelStripRightTot[iStrip]  = STRIPS_RIGHT_TOT_CHA;
00139 
00140       dProfOffsetList[iStrip]        = STRIPS_REFERENCE_OFFS;
00141       dRefOffsetList[iStrip]         = STRIPS_REFERENCE_OFFS;
00142       dOffsetListLeft[iStrip]        = STRIPS_OFFSET_LEFT;
00143       dOffsetListRight[iStrip]       = STRIPS_OFFSET_RIGHT;
00144 
00145       dToTGainListLeft[iStrip]       = STRIPS_TOT_GAIN_LEFT;
00146       dTotOffsetListLeft[iStrip]     = STRIPS_TOT_OFFS_LEFT;
00147       dToTGainListRight[iStrip]      = STRIPS_TOT_GAIN_RIGHT;
00148       dTotOffsetListRight[iStrip]    = STRIPS_TOT_OFFS_RIGHT;
00149 
00150       dOffsetMatching[iStrip] = MATCHING_OFFSET;
00151    }
00152    uInitialOffsetCalib               = INITIAL_CALIB_OFFSET;
00153    dLowerBoundFitBeamProfile         = 0;
00154    dUpperBoundFitBeamProfile         = 0;
00155    dLowerBoundFitRefProfile          = 0;
00156    dUpperBoundFitRefProfile          = 0;
00157    for(Int_t iFitParam = 0; iFitParam < 4 ; iFitParam++)
00158    {
00159       dInitialValueFitParBeamProfile[iFitParam] = 0;
00160       dInitialValueFitParRefProfile[iFitParam]  = 0;
00161    }
00162    
00163    // Read the option file
00164    TString sOptionFileName = "./Rpc_options.txt";
00165    TString sName = GetName();
00166    if( sName.EqualTo("RpcPar_Hd") )
00167            sOptionFileName = "./RpcHd_options.txt";
00168    else if( sName.EqualTo("RpcPar_Buc_Ref") )
00169            sOptionFileName = "./RpcBuc_options.txt";
00170    else if( sName.EqualTo("RpcPar_Buc_Mod") )
00171       sOptionFileName = "./RpcBucModule_options.txt";
00172 
00173    // Try to read the option filename from the general option files text file
00174    Bool_t bFilenameFound = kFALSE;
00175    fstream optionFilenameFile("./Option_files.txt", ios::in);
00176    // Testing if the file does exist. If not I use default values
00177    if( optionFilenameFile.fail() == true)
00178    {
00179       cout<<"************************************************************************"<<endl;
00180       cout<<" File with option filename for TRpcParam "<<GetName()<<" not found: using the default value ";
00181       cout<<sOptionFileName<<endl;
00182    } // if( optionFilenameFile.fail() == true)
00183       else
00184       {
00185          TString line;
00186 
00187          // Goes through all lines
00188          while( !optionFilenameFile.eof() )
00189          {
00190            line.ReadLine(optionFilenameFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00191 
00192            if(line(0) == '#' || line(0) == '*'||
00193                (line(0) == '/' && line(1) == '/') )
00194            {
00195               //Comment in the text file
00196               ;
00197            }
00198            else if( sName.EqualTo("RpcPar_Hd") && line.Contains("rpchd")==kTRUE)
00199            {
00200               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00201               cout<<"************************************************************************"<<endl;
00202               cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00203               bFilenameFound = kTRUE;
00204               break;
00205            }
00206            else if( sName.EqualTo("RpcPar_Buc_Ref") && line.Contains("rpcbucref")==kTRUE)
00207            {
00208               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00209               cout<<"************************************************************************"<<endl;
00210               cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00211               bFilenameFound = kTRUE;
00212               break;
00213            }
00214            else if( sName.EqualTo("RpcPar_Buc_Mod1") && line.Contains("rpcbucmod1")==kTRUE)
00215            {
00216               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00217               cout<<"************************************************************************"<<endl;
00218               cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00219               bFilenameFound = kTRUE;
00220               break;
00221            }
00222            else if( sName.EqualTo("RpcPar_Buc_Mod2") && line.Contains("rpcbucmod2")==kTRUE)
00223            {
00224               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00225               cout<<"************************************************************************"<<endl;
00226               cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00227               bFilenameFound = kTRUE;
00228               break;
00229            }
00230            else if( sName.EqualTo("RpcPar_Buc_Mod3") && line.Contains("rpcbucmod3")==kTRUE)
00231            {
00232               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00233               cout<<"************************************************************************"<<endl;
00234               cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00235               bFilenameFound = kTRUE;
00236               break;
00237            }
00238            else if( sName.EqualTo("RpcPar_Buc_Mod4") && line.Contains("rpcbucmod4")==kTRUE)
00239            {
00240               sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00241               cout<<"************************************************************************"<<endl;
00242               cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00243               bFilenameFound = kTRUE;
00244               break;
00245            }
00246          } // while( !optionFilenameFile.eof() )
00247          if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00248          {
00249             cout<<"************************************************************************"<<endl;
00250             cout<<"Field for TRpcParam "<<GetName()<<" step not found in File with option filename => Using "<<sOptionFileName<<endl;
00251          } // if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00252       } // else of if( optionFilenameFile.fail() == true)
00253 
00254    fstream setupFile(sOptionFileName, ios::in);
00255    
00256    // Testing if the option does exist. If not I use default values.
00257    if( setupFile.fail() == true)
00258    {
00259           TGo4Log::Error("TRpcParam %s: Setup file %s can not be opened or is missing.", GetName(), sOptionFileName.Data());
00260           TGo4Log::Error("=> Using default values!");
00261    }
00262    else
00263    {
00264       TGo4Log::Info("TRpcParam %s: Load Setup file %s.", GetName(), sOptionFileName.Data());
00265       TString line;
00266       
00267       // Goes through all lines
00268       while( !setupFile.eof() )
00269       {
00270          line.ReadLine(setupFile, kFALSE); // Read a line of the option file and set the iterator automatically to the next line
00271          if(1 == uDebug)
00272             cout<<line<<endl;
00273 
00274          if(line(0) == '#' || line(0) == '*')
00275          {
00276             //Comment in the text file
00277             ;
00278          }
00279          else if(line.Contains("debug")==kTRUE)
00280          {
00281             uDebug = ((TString)line(5,10)).Atoi();
00282             if(1 == uDebug)
00283                cout<<"Debug ON!!!!!!"<<endl;
00284          }
00285          else if(line.Contains("tdcoffscaen")==kTRUE)
00286          {
00287             iOffsetTdcCaen = ((TString)line(12,10)).Atoi();
00288             if( iOffsetTdcCaen > MAX_1290)
00289             {
00290                cout<<"Error: CAEN tdc for offset higher than max allowed -> replaced by default value: ";
00291                cout<<TDC_FOR_OFFSET_CAEN<<endl;
00292                iOffsetTdcCaen = TDC_FOR_OFFSET_CAEN;
00293             }
00294          }
00295          else if(line.Contains("chaoffscaen")==kTRUE)
00296          {
00297             iOffsetChannelCaen = ((TString)line(12,10)).Atoi();
00298             if( iOffsetChannelCaen > T1290Data::NumChan)
00299             {
00300                cout<<"Error: CAEN channel for offset higher than max allowed -> replaced by default value: ";
00301                cout<<CH_FOR_OFFSET_CAEN<<endl;
00302                iOffsetChannelCaen = CH_FOR_OFFSET_CAEN;
00303             }
00304          }
00305          else if(line.Contains("tdcoffsvftx")==kTRUE)
00306          {
00307             iOffsetTdcVFTX = ((TString)line(12,10)).Atoi();
00308             if( iOffsetTdcVFTX > MAX_FPGA_TDC)
00309             {
00310                cout<<"Error: VFTX tdc for offset higher than max allowed -> replaced by default value: ";
00311                cout<<TDC_FOR_OFFSET_VFTX<<endl;
00312                iOffsetTdcVFTX = TDC_FOR_OFFSET_VFTX;
00313             }
00314          }
00315          else if(line.Contains("chaoffsvftx")==kTRUE)
00316          {
00317             iOffsetChannelVFTX = ((TString)line(12,10)).Atoi();
00318             if( iOffsetChannelVFTX > FPGA_TDC_NBCHAN)
00319             {
00320                cout<<"Error: VFTX channel for offset higher than max allowed -> replaced by default value: ";
00321                cout<<CH_FOR_OFFSET_VFTX<<endl;
00322                iOffsetChannelVFTX = CH_FOR_OFFSET_VFTX;
00323             }
00324          }
00325          else if(line.Contains("tdcdiamcaen")==kTRUE)
00326          {
00327             iDiamondTdcCaen = ((TString)line(12,10)).Atoi();
00328             if( iDiamondTdcCaen > MAX_1290)
00329             {
00330                cout<<"Error: CAEN tdc for diamond higher than max allowed -> replaced by default value: ";
00331                cout<<TDC_FOR_DIAMOND_CAEN<<endl;
00332                iDiamondTdcCaen = TDC_FOR_DIAMOND_CAEN;
00333             }
00334          }
00335          else if(line.Contains("chadiamcaen")==kTRUE)
00336          {
00337             iDiamondChannelCaen = ((TString)line(12,10)).Atoi();
00338             if( iDiamondChannelCaen > T1290Data::NumChan)
00339             {
00340                cout<<"Error: CAEN channel for diamond higher than max allowed -> replaced by default value: ";
00341                cout<<CH_FOR_DIAMOND_CAEN<<endl;
00342                iDiamondChannelCaen = CH_FOR_DIAMOND_CAEN;
00343             }
00344          }
00345          else if(line.Contains("tdcdiamvftx")==kTRUE)
00346          {
00347             iDiamondTdcVFTX = ((TString)line(12,10)).Atoi();
00348             if( iDiamondTdcVFTX > MAX_FPGA_TDC)
00349             {
00350                cout<<"Error: VFTX tdc for diamond higher than max allowed -> replaced by default value: ";
00351                cout<<TDC_FOR_DIAMOND_VFTX<<endl;
00352                iDiamondTdcVFTX = TDC_FOR_DIAMOND_VFTX;
00353             }
00354          }
00355          else if(line.Contains("chadiamvftx")==kTRUE)
00356          {
00357             iDiamondChannelVFTX = ((TString)line(12,10)).Atoi();
00358             if( iDiamondChannelVFTX > FPGA_TDC_NBCHAN)
00359             {
00360                cout<<"Error: VFTX channel for diamond higher than max allowed -> replaced by default value: ";
00361                cout<<CH_FOR_DIAMOND_VFTX<<endl;
00362                iDiamondChannelVFTX = CH_FOR_DIAMOND_VFTX;
00363             }
00364          }
00365          else if(line.Contains("rateintdur")==kTRUE)
00366          {
00367             iRateIntegrationDuration = ((TString)line(11,10)).Atoi();
00368          }
00369          else if(line.Contains("ratestep")==kTRUE)
00370          {
00371             iRateIntegrationStep = ((TString)line(11,10)).Atoi();
00372             if( iRateIntegrationStep < 2 )
00373             {
00374                cout<<"Rate step size smaller than Go4 minimal Hist. update step of 2s, set step size to 2s"<<endl;
00375                iRateIntegrationStep = 2;
00376             }
00377             if( iRateIntegrationDuration < iRateIntegrationStep )
00378             {
00379                cout<<"Rate step size smaller than rate integration size, set step size to integration size"<<endl;
00380                iRateIntegrationStep = iRateIntegrationDuration;
00381             }
00382          }
00383          else if(line.Contains("coarsecorrt")==kTRUE)
00384          {
00385             uUseCoarseCorrectedTime = ((TString)line(13,10)).Atoi();
00386          }
00387          else if(line.Contains("tdctypestrip")==kTRUE)
00388          {
00389             uTdcTypeStrip = ((TString)line(13,10)).Atoi();
00390          }
00391          else if(line.Contains("striprpcname")==kTRUE)
00392          {
00393             sStripRpcName = ((TString)line(13,20));
00394          }
00395          else if(line.Contains("striprpcposx")==kTRUE)
00396          {
00397             dStripRpcPosX = ((TString)line(13,10)).Atof();
00398          }
00399          else if(line.Contains("striprpcposy")==kTRUE)
00400          {
00401             dStripRpcPosY = ((TString)line(13,10)).Atof();
00402          }
00403          else if(line.Contains("striprpcposz")==kTRUE)
00404          {
00405             dStripRpcPosZ = ((TString)line(13,10)).Atof();
00406          }
00407          else if(line.Contains("nbstrips")==kTRUE)
00408          {
00409             uNbStrips = ((TString)line(9,10)).Atoi();
00410             if( uNbStrips > NB_STRIPS_MAX)
00411             {
00412                cout<<"Error: nb strips higher than max allowed for RPC "<<uNbStrips;
00413                cout<<" -> replaced by max value: ";
00414                cout<<NB_STRIPS_MAX<<endl;
00415                uNbStrips = NB_STRIPS_MAX;
00416             }
00417          }
00418          else if(line.Contains("stripwidth")==kTRUE)
00419          {
00420             dStripWidth = ((TString)line(12,10)).Atof();
00421          }
00422          else if(line.Contains("striplengt")==kTRUE)
00423          {
00424             dStripLength = ((TString)line(12,10)).Atof();
00425          }
00426          else if(line.Contains("timeconvcm")==kTRUE)
00427          {
00428             dTimeConv = ((TString)line(12,10)).Atof();
00429          }
00430          else if(line.Contains("hitsmaxdist")==kTRUE)
00431          {
00432             dStripHitMaxDistance = ((TString)line(12,10)).Atof();
00433          }
00434          else if(line.Contains("rejectmulti")==kTRUE)
00435          {
00436             uRejectMultipleHits = ((TString)line(13,10)).Atoi();
00437          }
00438          else if(line.Contains("orientation")==kTRUE)
00439          {
00440             uOrientation = ((TString)line(13,10)).Atoi();
00441          }
00442          else if(line.Contains("beamsize")==kTRUE)
00443          {
00444             iBeamProfileSize = ((TString)line(9,10)).Atoi();
00445          }
00446          else if(line.Contains("triggsel")==kTRUE)
00447          {
00448             iTriggerSelection = ((TString)line(9,10)).Atoi();
00449          }
00450          else if(line.Contains("strtdctype")==kTRUE)
00451          {
00452             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00453             if( uNbStrips == 0 && line.Sizeof() )
00454             {
00455                if( 1 == uDebug )
00456                {
00457                cout<<"Warning: nbStrips is 0 and strips tdc type array not empty: skip filling"<<line<<endl;
00458                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00459                }
00460             }
00461             else
00462             {
00463                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00464                {
00465                   uTdcStripType[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00466                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00467                }
00468             }
00469          }
00470          else if(line.Contains("noisystrip")==kTRUE)
00471          {
00472             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00473             if( uNbStrips == 0 && line.Sizeof() )
00474             {
00475                if( 1 == uDebug )
00476                {
00477                cout<<"Warning: nbStrips is 0 and noisy strips array not empty: skip filling"<<line<<endl;
00478                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00479                }
00480             }
00481             else
00482             {
00483                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00484                {
00485                   uTdcStripNoisy[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00486                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00487                }
00488             }
00489          }
00490          else if(line.Contains("deadstrip")==kTRUE)
00491          {
00492             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00493             if( uNbStrips == 0 && line.Sizeof() )
00494             {
00495                if( 1 == uDebug )
00496                {
00497                cout<<"Warning: nbStrips is 0 and dead strips array not empty: skip filling"<<line<<endl;
00498                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00499                }
00500             }
00501             else
00502             {
00503                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00504                {
00505                   uTdcStripDead[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00506                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00507                }
00508             }
00509          }
00510          else if(line.Contains("strlefttottdc")==kTRUE)
00511          {
00512             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00513             if( uNbStrips == 0 && line.Sizeof() )
00514             {
00515                if( 1 == uDebug )
00516                {
00517                cout<<"Warning: nbStrips is 0 and left strips Tot TDC array not empty: skip filling"<<line<<endl;
00518                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00519                }
00520             }
00521             else
00522             {
00523                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00524                {
00525                   uTdcStripLeftTot[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00526                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00527                }
00528             }
00529          }
00530          else if(line.Contains("strlefttotcha")==kTRUE)
00531          {
00532             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00533             if( uNbStrips == 0 && line.Sizeof() )
00534             {
00535                if( 1 == uDebug )
00536                {
00537                cout<<"Warning: nbStrips is 0 and left strips Tot Channel array not empty: skip filling"<<line<<endl;
00538                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00539                }
00540             }
00541             else
00542             {
00543                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00544                {
00545                   uChannelStripLeftTot[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00546                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00547                }
00548             }
00549          }
00550          else if(line.Contains("strlefttimetdc")==kTRUE)
00551          {
00552             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00553             if( uNbStrips == 0 && line.Sizeof() )
00554             {
00555                if( 1 == uDebug )
00556                {
00557                cout<<"Warning: nbStrips is 0 and left strips Time TDC array not empty: skip filling"<<line<<endl;
00558                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00559                }
00560             }
00561             else
00562             {
00563                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00564                {
00565                   uTdcStripLeftTime[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00566                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00567                }
00568             }
00569          }
00570          else if(line.Contains("strlefttimecha")==kTRUE)
00571          {
00572             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00573             if( uNbStrips == 0 && line.Sizeof() )
00574             {
00575                if( 1 == uDebug )
00576                {
00577                cout<<"Warning: nbStrips is 0 and left strips Time channel array not empty: skip filling"<<line<<endl;
00578                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00579                }
00580             }
00581             else
00582             {
00583                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00584                {
00585                   uChannelStripLeftTime[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00586                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00587                }
00588             }
00589          }
00590          else if(line.Contains("strrighttimetdc")==kTRUE)
00591          {
00592             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00593             if( uNbStrips == 0 && line.Sizeof() )
00594             {
00595                if( 1 == uDebug )
00596                {
00597                cout<<"Warning: nbStrips is 0 and right strips Time TDC array not empty: skip filling"<<line<<endl;
00598                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00599                }
00600             }
00601             else
00602             {
00603                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00604                {
00605                   uTdcStripRightTime[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00606                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00607                }
00608             }
00609          }
00610          else if(line.Contains("strrighttimecha")==kTRUE)
00611          {
00612             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00613             if( uNbStrips == 0 && line.Sizeof() )
00614             {
00615                if( 1 == uDebug )
00616                {
00617                cout<<"Warning: nbStrips is 0 and right strips Time channel array not empty: skip filling"<<line<<endl;
00618                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00619                }
00620             }
00621             else
00622             {
00623                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00624                {
00625                   uChannelStripRightTime[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00626                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00627                }
00628             }
00629          }
00630          else if(line.Contains("strrighttottdc")==kTRUE)
00631          {
00632             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00633             if( uNbStrips == 0 && line.Sizeof() )
00634             {
00635                if( 1 == uDebug )
00636                {
00637                cout<<"Warning: nbStrips is 0 and right strips Tot TDC array not empty: skip filling"<<line<<endl;
00638                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00639                }
00640             }
00641             else
00642             {
00643                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00644                {
00645                   uTdcStripRightTot[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00646                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00647                }
00648             }
00649          }
00650          else if(line.Contains("strrighttotcha")==kTRUE)
00651          {
00652             line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00653             if( uNbStrips == 0 && line.Sizeof() )
00654             {
00655                if( 1 == uDebug )
00656                {
00657                cout<<"Warning: nbStrips is 0 and right strips Tot channel array not empty: skip filling"<<line<<endl;
00658                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00659                }
00660             }
00661             else
00662             {
00663                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00664                {
00665                   uChannelStripRightTot[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00666                   line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00667                }
00668             }
00669          }
00670          else if(line.Contains("stripsoffs")==kTRUE)
00671          {
00672            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00673            if( uNbStrips == 0 && line.Sizeof() )
00674             {
00675                if( 1 == uDebug )
00676                {
00677                cout<<"Warning: nbStrips is 0 and strips profile offsets array not empty: skip filling"<<line<<endl;
00678                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00679                }
00680             }
00681             else
00682             {
00683                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00684                {
00685                   dProfOffsetList[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00686                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00687                }
00688             }
00689          }
00690          else if(line.Contains("reftimeoff")==kTRUE)
00691          {
00692            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00693            if( uNbStrips == 0 && line.Sizeof() )
00694             {
00695                if( 1 == uDebug )
00696                {
00697                cout<<"Warning: nbStrips is 0 and strips reference offsets array not empty: skip filling"<<line<<endl;
00698                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00699                }
00700             }
00701             else
00702             {
00703                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00704                {
00705                   dRefOffsetList[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00706                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00707                }
00708             }
00709          }
00710          else if(line.Contains("stripsoffsleft")==kTRUE)
00711          {
00712            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00713            if( uNbStrips == 0 && line.Sizeof() )
00714             {
00715                if( 1 == uDebug )
00716                {
00717                cout<<"Warning: nbStrips is 0 and strips left offsets array not empty: skip filling"<<line<<endl;
00718                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00719                }
00720             }
00721             else
00722             {
00723                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00724                {
00725                   dOffsetListLeft[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00726                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00727                }
00728             }
00729          }
00730          else if(line.Contains("stripsoffsright")==kTRUE)
00731          {
00732            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00733            if( uNbStrips == 0 && line.Sizeof() )
00734             {
00735                if( 1 == uDebug )
00736                {
00737                cout<<"Warning: nbStrips is 0 and strips right offsets array not empty: skip filling"<<line<<endl;
00738                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00739                }
00740             }
00741             else
00742             {
00743                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00744                {
00745                   dOffsetListRight[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00746                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00747                }
00748             }
00749          }
00750          else if(line.Contains("totgravcentr")==kTRUE)
00751          {
00752             uUseChargeGravityCenter = ((TString)line(13,10)).Atoi();
00753          }
00754          else if(line.Contains("strtotgainleft")==kTRUE)
00755          {
00756            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00757            if( uNbStrips == 0 && line.Sizeof() )
00758             {
00759                if( 1 == uDebug )
00760                {
00761                cout<<"Warning: nbStrips is 0 and strips left tot gain array not empty: skip filling"<<line<<endl;
00762                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00763                }
00764             }
00765             else
00766             {
00767                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00768                {
00769                   dToTGainListLeft[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00770                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00771                }
00772             }
00773          }
00774          else if(line.Contains("strtotoffsleft")==kTRUE)
00775          {
00776            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00777            if( uNbStrips == 0 && line.Sizeof() )
00778             {
00779                if( 1 == uDebug )
00780                {
00781                cout<<"Warning: nbStrips is 0 and strips left tot offsets array not empty: skip filling"<<line<<endl;
00782                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00783                }
00784             }
00785             else
00786             {
00787                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00788                {
00789                   dTotOffsetListLeft[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00790                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00791                }
00792             }
00793          }
00794          else if(line.Contains("strtotgainright")==kTRUE)
00795          {
00796            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00797            if( uNbStrips == 0 && line.Sizeof() )
00798             {
00799                if( 1 == uDebug )
00800                {
00801                cout<<"Warning: nbStrips is 0 and strips right tot gain array not empty: skip filling"<<line<<endl;
00802                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00803                }
00804             }
00805             else
00806             {
00807                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00808                {
00809                   dToTGainListRight[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00810                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00811                }
00812             }
00813          }
00814          else if(line.Contains("strtotoffsright")==kTRUE)
00815          {
00816            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00817            if( uNbStrips == 0 && line.Sizeof() )
00818             {
00819                if( 1 == uDebug )
00820                {
00821                cout<<"Warning: nbStrips is 0 and strips right tot offsets array not empty: skip filling"<<line<<endl;
00822                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00823                }
00824             }
00825             else
00826             {
00827                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00828                {
00829                   dTotOffsetListRight[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00830                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00831                }
00832             }
00833          }
00834          else if(line.Contains("initoffscal")==kTRUE)
00835          {
00836             uInitialOffsetCalib = ((TString)line(13,10)).Atof();
00837          }
00838          else if(line.Contains("lowlimfitbea")==kTRUE)
00839          {
00840             dLowerBoundFitBeamProfile = ((TString)line(13,10)).Atof();
00841          }
00842          else if(line.Contains("upplimfitbea")==kTRUE)
00843          {
00844             dUpperBoundFitBeamProfile = ((TString)line(13,10)).Atof();
00845          }
00846          else if(line.Contains("lowlimfitref")==kTRUE)
00847          {
00848             dLowerBoundFitRefProfile = ((TString)line(13,10)).Atof();
00849          }
00850          else if(line.Contains("upplimfitref")==kTRUE)
00851          {
00852             dUpperBoundFitRefProfile = ((TString)line(13,10)).Atof();
00853          }
00854          else if(line.Contains("initvalfitparbe")==kTRUE)
00855          {
00856             line = line(16,NB_DIGITS_STRIP_OFFSETS*4);
00857             for(Int_t iFitParam = 0; iFitParam < 4 ; iFitParam++)
00858             {
00859                if( 1 == uDebug )
00860                   cout<<"initvalfitparbe "<<iFitParam<<" "<<line<<endl;
00861                dInitialValueFitParBeamProfile[iFitParam] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00862                line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*4);
00863             }
00864          }
00865          else if(line.Contains("initvalfitparre")==kTRUE)
00866          {
00867             line = line(16,NB_DIGITS_STRIP_OFFSETS*4);
00868             for(Int_t iFitParam = 0; iFitParam < 4 ; iFitParam++)
00869             {
00870                dInitialValueFitParRefProfile[iFitParam] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00871                line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*4);
00872             }
00873          }
00874          else if(line.Contains("strmatchingoffs")==kTRUE)
00875          {
00876            line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00877            if( uNbStrips == 0 && line.Sizeof() )
00878             {
00879                if( 1 == uDebug )
00880                {
00881                cout<<"Warning: nbStrips is 0 and strips matching offsets array not empty: skip filling"<<line<<endl;
00882                cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00883                }
00884             }
00885             else
00886             {
00887                for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00888                {
00889                   dOffsetMatching[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00890                   line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00891                }
00892             }
00893          }
00894       } // while( !setupFile.eof() )
00895    } //  else of if( setupFile.fail() == true)
00896    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00897       if( 1 == uTdcStripType[temp_index] )
00898       {
00899          uTdcStripLeftTot[temp_index]     = uTdcStripLeftTime[temp_index];
00900          if( 1 == uChannelStripLeftTime[temp_index]%2)
00901             uChannelStripLeftTot[temp_index] = uChannelStripLeftTime[temp_index] - 1;
00902             else uChannelStripLeftTot[temp_index] = uChannelStripLeftTime[temp_index] + 1;
00903          uTdcStripRightTot[temp_index]     = uTdcStripRightTime[temp_index];
00904          if( 1 == uChannelStripRightTime[temp_index]%2)
00905             uChannelStripRightTot[temp_index] = uChannelStripRightTime[temp_index] - 1;
00906             else uChannelStripRightTot[temp_index] = uChannelStripRightTime[temp_index] + 1;
00907       }
00908    
00909    return kTRUE;
00910 }
00911 
00912 
00913 Int_t TRpcParam::PrintOptions(){
00914    cout<<"********************* RPC calibration parameters **********************"<<endl;
00915    cout<<"------------- Options for strip RPC ";
00916    cout.width(20);
00917    cout<<sStripRpcName<<" --------------"<<endl;
00918    cout<<"-------------------------------------------------"<<endl;
00919    if(1 == uDebug)
00920       cout<<"  Debug ON!!!!!!"<<endl;
00921       else cout<<"  Debug OFF"<<endl;
00922 
00923    if( -1 < iOffsetTdcCaen && -1 < iOffsetChannelCaen &&
00924        -1 < iOffsetTdcVFTX && -1 < iOffsetChannelVFTX )
00925    {
00926       cout<<"  Chan. used for time offset: "<<iOffsetChannelCaen;
00927       cout<<" in TDC "<<iOffsetTdcCaen<<" in CAEN"<<endl;
00928       cout<<"  Chan. used for time offset: "<<iOffsetChannelVFTX;
00929       cout<<" in TDC "<<iOffsetTdcVFTX<<" in VFTX"<<endl;
00930    }
00931    if( -1 < iRateIntegrationDuration && -1 < iRateIntegrationStep)
00932    {
00933       cout<<"  Rate hist. reset spacing:   "<<iRateIntegrationDuration<<" s"<<endl;
00934       cout<<"  Rate hist. update spacing:  "<<iRateIntegrationStep<<" s"<<endl;
00935    }
00936    if( 1 == uUseCoarseCorrectedTime )
00937       cout<<"  Coarse time cycle correc.: ON"<<endl;
00938       else cout<<"  Coarse time cycle correc.: OFF"<<endl;
00939 
00940    if( 0 == uTdcTypeStrip )
00941    {
00942       cout<<"  TDC type:                  CAEN"<<endl;
00943    }
00944    else if( 1 == uTdcTypeStrip )
00945    {
00946       cout<<"  TDC type:                  VFTX"<<endl;
00947    }
00948    else if( 2 == uTdcTypeStrip )
00949    {
00950       cout<<"  TDC type:                  MIXED"<<endl;
00951    }
00952    cout<<"  Position:                  X= "<<dStripRpcPosX;
00953    cout<<" Y= "<<dStripRpcPosY<<" Z= "<<dStripRpcPosZ;
00954    cout<<endl;
00955    cout<<"  Nb strips in beam profile: "<<uNbStrips<<endl;
00956    cout<<"  Strip width (incl gap.):   "<<dStripWidth<<" cm"<<endl;
00957    cout<<"  Strip length:              "<<dStripLength<<" cm"<<endl;
00958    cout<<"  Time Convertion factor:    "<<dTimeConv<<" cm/ns"<<endl;
00959    cout<<"  Max Hit dist for cluster:  "<<dStripHitMaxDistance<<" cm"<<endl;
00960    if( 1 == uRejectMultipleHits )
00961       cout<<"  Multiple TDC hits reject.: ON"<<endl;
00962       else cout<<"  Multiple TDC hits reject.: OFF"<<endl;
00963    if( 0 == uOrientation )
00964    {
00965       cout<<"  Strips orientation:        Horizontal"<<endl;
00966    }
00967    else if( 1 == uOrientation )
00968    {
00969       cout<<"  Strips orientation:        Vertical"<<endl;
00970    }
00971    cout<<"  Size of beam profile in X: "<<iBeamProfileSize<<" cm "<<endl;
00972    if( -1 == iTriggerSelection )
00973       cout<<"  Trigger selection:         OFF"<<endl;
00974       else cout<<"  Trigger selection:         Trigger "<<iTriggerSelection<<endl;
00975    cout<<"-------------------------------------------------"<<endl;
00976    cout<<"  Strip channel:     |-      ";
00977    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00978    {
00979       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00980       cout<<temp_index<<" ";
00981    }
00982    if( 2 == uTdcTypeStrip )
00983    {
00984       cout<<endl<<"  Tdc Type           |->     ";
00985       for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00986       {
00987          cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00988          cout<<uTdcStripType[temp_index]<<" ";
00989       }
00990    }
00991    cout<<endl<<"  Noisy Strip?       |->     ";
00992    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00993    {
00994       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00995       cout<<uTdcStripNoisy[temp_index]<<" ";
00996    }
00997    cout<<endl<<"  Dead Strip?        |->     ";
00998    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00999    {
01000       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01001       cout<<uTdcStripDead[temp_index]<<" ";
01002    }
01003    cout<<endl<<"  Tdc Tot Left       |->     ";
01004    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01005    {
01006       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01007       cout<<uTdcStripLeftTot[temp_index]<<" ";
01008    }
01009    cout<<endl<<"  Channel Tot Left   |->     ";
01010    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01011    {
01012       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01013       cout<<uChannelStripLeftTot[temp_index]<<" ";
01014    }
01015    cout<<endl<<"  Tdc Time Left      |->     ";
01016    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01017    {
01018       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01019       cout<<uTdcStripLeftTime[temp_index]<<" ";
01020    }
01021    cout<<endl<<"  Channel Time Left  |->     ";
01022    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01023    {
01024       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01025       cout<<uChannelStripLeftTime[temp_index]<<" ";
01026    }
01027    cout<<endl<<"  Tdc Time Right     |->     ";
01028    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01029    {
01030       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01031       cout<<uTdcStripRightTime[temp_index]<<" ";
01032    }
01033    cout<<endl<<"  Channel Time Right |->     ";
01034    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01035    {
01036       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01037       cout<<uChannelStripRightTime[temp_index]<<" ";
01038    }
01039    cout<<endl<<"  Tdc Tot Right      |->     ";
01040    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01041    {
01042       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01043       cout<<uTdcStripRightTot[temp_index]<<" ";
01044    }
01045    cout<<endl<<"  Channel Tot Right  |->     ";
01046    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01047    {
01048       cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01049       cout<<uChannelStripRightTot[temp_index]<<" ";
01050    }
01051    cout<<endl;
01052    cout<<"-------------------------------------------------"<<endl;
01053    cout<<"  Strip channel:     |-      ";
01054    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01055    {
01056       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01057       cout<<temp_index<<" ";
01058    }
01059    cout<<endl<<"  Beam Profile Offset|->     ";
01060    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01061    {
01062       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01063       cout<<dRefOffsetList[temp_index]<<" ";
01064    }
01065    cout<<endl<<"  Reference Offset   |->     ";
01066    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01067    {
01068       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01069       cout<<dRefOffsetList[temp_index]<<" ";
01070    }
01071    cout<<endl<<"  Time Offset Left   |->     ";
01072    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01073    {
01074       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01075       cout<<dOffsetListLeft[temp_index]<<" ";
01076    }
01077    cout<<endl<<"  Time Offset Right  |->     ";
01078    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01079    {
01080       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01081       cout<<dOffsetListRight[temp_index]<<" ";
01082    }
01083    cout<<endl;
01084    cout<<"-------------------------------------------------"<<endl;
01085    if( 1 == uUseChargeGravityCenter )
01086       cout<<"  Cluster center of gravity: ON"<<endl;
01087       else cout<<"  Cluster center of gravity: OFF"<<endl;
01088    cout<<"  Strip channel:     |-      ";
01089    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01090    {
01091       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01092       cout<<temp_index<<" ";
01093    }
01094    cout<<endl<<"  Tot Gain Left      |->     ";
01095    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01096    {
01097       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01098       cout<<dToTGainListLeft[temp_index]<<" ";
01099    }
01100    cout<<endl<<"  Tot Offset Left    |->     ";
01101    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01102    {
01103       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01104       cout<<dTotOffsetListLeft[temp_index]<<" ";
01105    }
01106    cout<<endl<<"  Tot Gain Right     |->     ";
01107    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01108    {
01109       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01110       cout<<dToTGainListRight[temp_index]<<" ";
01111    }
01112    cout<<endl<<"  Tot Offset Right   |->     ";
01113    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01114    {
01115       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01116       cout<<dTotOffsetListRight[temp_index]<<" ";
01117    }
01118    cout<<endl;
01119    cout<<"-------------------------------------------------"<<endl;
01120    if( 0 <= uInitialOffsetCalib )
01121       cout<<"  Initial offset calibration: "<<uInitialOffsetCalib<<endl;
01122       else cout<<"  Initial offset calibration: OFF"<<endl;
01123    cout<<"  Lower lim. Fit funct. beam:"<<dLowerBoundFitBeamProfile<<endl;
01124    cout<<"  Upper lim. Fit funct. beam:"<<dUpperBoundFitBeamProfile<<endl;
01125    cout<<"  Lower lim. Fit funct. Ref: "<<dLowerBoundFitRefProfile<<endl;
01126    cout<<"  Upper lim. Fit funct. Ref: "<<dUpperBoundFitRefProfile<<endl;
01127 
01128    cout<<"  Fit Parameter:     |-      ";
01129    for( Int_t iInitialParam = 0; iInitialParam < 4; iInitialParam++)
01130    {
01131       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01132       cout<<iInitialParam<<" ";
01133    }
01134    cout<<endl<<"  Initial value Beam |->     ";
01135    for( Int_t iInitialParam = 0; iInitialParam < 4; iInitialParam++)
01136    {
01137       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01138       cout<<dInitialValueFitParBeamProfile[iInitialParam]<<" ";
01139    }
01140    cout<<endl<<"  Initial value Ref  |->     ";
01141    for( Int_t iInitialParam = 0; iInitialParam < 4; iInitialParam++)
01142    {
01143       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01144       cout<<dInitialValueFitParRefProfile[iInitialParam]<<" ";
01145    }
01146    cout<<endl;
01147    cout<<"-------------------------------------------------"<<endl;
01148    cout<<"  Strip channel:     |-      ";
01149    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01150    {
01151       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01152       cout<<temp_index<<" ";
01153    }
01154    cout<<endl<<"  Matching Offset    |->     ";
01155    for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01156    {
01157       cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01158       cout<<dOffsetMatching[temp_index]<<" ";
01159    }
01160    cout<<endl;
01161    cout<<"************************************************************************"<<endl;
01162    
01163    return 0;
01164 }
01165 
01166 /*
01167  * Compute the time offsets in ps for the left and right end of the strips using
01168  * the full offset used to center the beam profile and reference profile histograms
01169  */
01170 Bool_t TRpcParam::CalculateLeftRightOffset()
01171 {
01172    for( UInt_t uStrip = 0; uStrip < uNbStrips; uStrip++)
01173    {
01174       dOffsetListLeft[uStrip]  = 0.5*( (dProfOffsetList[uStrip])+2.*(dRefOffsetList[uStrip]));
01175       dOffsetListRight[uStrip] = 0.5*(-(dProfOffsetList[uStrip])+2.*(dRefOffsetList[uStrip]));
01176    }
01177    return kTRUE;
01178 }

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