00001
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
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_STRIP 0
00034 #define RPC_NAME_STRIP ""
00035 #define RPC_POSX_STRIP 0.0
00036 #define RPC_POSY_STRIP 0.0
00037 #define RPC_POSZ_STRIP 0.0
00038 #define NB_STRIPS 0 // Nb of strips for the beam profile monitor
00039 #define STRIP_WIDTH 0
00040 #define STRIP_LENGTH 0
00041 #define TIME_CONV 10.0
00042 #define ORIENTATION 0
00043 #define BEAM_PROFILE_SIZE 0
00044 #define TRIGGER_SELECTION -1
00045
00046 #define NOISY_STRIP 0
00047 #define DEAD_STRIP 0
00048 #define STRIPS_LEFT_TOT_TDC 0
00049 #define STRIPS_LEFT_TOT_CHA 0
00050 #define STRIPS_LEFT_TIME_TDC 0
00051 #define STRIPS_LEFT_TIME_CHA 0
00052 #define STRIPS_RIGHT_TIME_TDC 0
00053 #define STRIPS_RIGHT_TIME_CHA 0
00054 #define STRIPS_RIGHT_TOT_TDC 0
00055 #define STRIPS_RIGHT_TOT_CHA 0
00056
00057 #define STRIPS_PROFILE_OFFS 0
00058 #define STRIPS_REFERENCE_OFFS 0
00059 #define STRIPS_OFFSET_LEFT 0
00060 #define STRIPS_OFFSET_RIGHT 0
00061
00062 #define STRIPS_TOT_GAIN_LEFT 1
00063 #define STRIPS_TOT_OFFS_LEFT 0
00064 #define STRIPS_TOT_GAIN_RIGHT 1
00065 #define STRIPS_TOT_OFFS_RIGHT 0
00066
00067 #define INITIAL_CALIB_OFFSET 0
00068
00069 #define MATCHING_OFFSET 0
00070
00071
00072 TRpcParam::TRpcParam(const char* name) : TGo4Parameter(name)
00073 {
00074 ReadOptions();
00075 if( 0 < uNbStrips )
00076 {
00077
00078 CalculateLeftRightOffset();
00079 PrintOptions();
00080 }
00081 }
00082
00083
00084 TRpcParam::~TRpcParam()
00085 {
00086 }
00087
00088 Bool_t TRpcParam::ReadOptions(){
00089
00090 uDebug = DEBUG;
00091 iOffsetTdcCaen = TDC_FOR_OFFSET_CAEN;
00092 iOffsetChannelCaen = CH_FOR_OFFSET_CAEN;
00093 iOffsetTdcVFTX = TDC_FOR_OFFSET_VFTX;
00094 iOffsetChannelVFTX = CH_FOR_OFFSET_VFTX;
00095
00096 iDiamondTdcCaen = TDC_FOR_DIAMOND_VFTX;
00097 iDiamondChannelCaen = CH_FOR_DIAMOND_CAEN;
00098 iDiamondTdcVFTX = TDC_FOR_DIAMOND_VFTX;
00099 iDiamondChannelVFTX = CH_FOR_DIAMOND_VFTX;
00100
00101 iRateIntegrationDuration = RATE_INT_DURATION;
00102 iRateIntegrationStep = RATE_INT_STEP;
00103
00104
00105 uTdcTypeStrip = TDC_STRIP;
00106 sStripRpcName = RPC_NAME_STRIP;
00107 dStripRpcPosX = RPC_POSX_STRIP;
00108 dStripRpcPosY = RPC_POSY_STRIP;
00109 dStripRpcPosZ = RPC_POSZ_STRIP;
00110 uNbStrips = NB_STRIPS;
00111 dStripWidth = STRIP_WIDTH;
00112 dStripLength = STRIP_LENGTH;
00113 dTimeConv = TIME_CONV;
00114 uOrientation = ORIENTATION;
00115 iBeamProfileSize = BEAM_PROFILE_SIZE;
00116 iTriggerSelection = TRIGGER_SELECTION;
00117
00118 for( Int_t iStrip = 0; iStrip < NB_STRIPS_MAX; iStrip ++)
00119 {
00120 uTdcStripType[iStrip] = TDC_STRIP;
00121 uTdcStripNoisy[iStrip] = NOISY_STRIP;
00122 uTdcStripDead[iStrip] = DEAD_STRIP;
00123 uTdcStripLeftTot[iStrip] = STRIPS_LEFT_TOT_TDC;
00124 uChannelStripLeftTot[iStrip] = STRIPS_LEFT_TOT_CHA;
00125 uTdcStripLeftTime[iStrip] = STRIPS_LEFT_TIME_TDC;
00126 uChannelStripLeftTime[iStrip] = STRIPS_LEFT_TIME_CHA;
00127 uTdcStripRightTime[iStrip] = STRIPS_RIGHT_TIME_TDC;
00128 uChannelStripRightTime[iStrip] = STRIPS_RIGHT_TIME_CHA;
00129 uTdcStripRightTot[iStrip] = STRIPS_RIGHT_TOT_TDC;
00130 uChannelStripRightTot[iStrip] = STRIPS_RIGHT_TOT_CHA;
00131
00132 dProfOffsetList[iStrip] = STRIPS_REFERENCE_OFFS;
00133 dRefOffsetList[iStrip] = STRIPS_REFERENCE_OFFS;
00134 dOffsetListLeft[iStrip] = STRIPS_OFFSET_LEFT;
00135 dOffsetListRight[iStrip] = STRIPS_OFFSET_RIGHT;
00136
00137 dToTGainListLeft[iStrip] = STRIPS_TOT_GAIN_LEFT;
00138 dTotOffsetListLeft[iStrip] = STRIPS_TOT_OFFS_LEFT;
00139 dToTGainListRight[iStrip] = STRIPS_TOT_GAIN_RIGHT;
00140 dTotOffsetListRight[iStrip] = STRIPS_TOT_OFFS_RIGHT;
00141
00142 dOffsetMatching[iStrip] = MATCHING_OFFSET;
00143 }
00144 uInitialOffsetCalib = INITIAL_CALIB_OFFSET;
00145 dLowerBoundFitBeamProfile = 0;
00146 dUpperBoundFitBeamProfile = 0;
00147 dLowerBoundFitRefProfile = 0;
00148 dUpperBoundFitRefProfile = 0;
00149 for(Int_t iFitParam = 0; iFitParam < 4 ; iFitParam++)
00150 {
00151 dInitialValueFitParBeamProfile[iFitParam] = 0;
00152 dInitialValueFitParRefProfile[iFitParam] = 0;
00153 }
00154
00155
00156 TString sOptionFileName = "./Rpc_options.txt";
00157 TString sName = GetName();
00158 if( sName.EqualTo("RpcPar_Hd") )
00159 sOptionFileName = "./RpcHd_options.txt";
00160 else if( sName.EqualTo("RpcPar_Buc_Ref") )
00161 sOptionFileName = "./RpcBuc_options.txt";
00162 else if( sName.EqualTo("RpcPar_Buc_Mod") )
00163 sOptionFileName = "./RpcBucModule_options.txt";
00164
00165
00166 Bool_t bFilenameFound = kFALSE;
00167 fstream optionFilenameFile("./Option_files.txt", ios::in);
00168
00169 if( optionFilenameFile.fail() == true)
00170 {
00171 cout<<"************************************************************************"<<endl;
00172 cout<<" File with option filename for TRpcParam "<<GetName()<<" not found: using the default value ";
00173 cout<<sOptionFileName<<endl;
00174 }
00175 else
00176 {
00177 TString line;
00178
00179
00180 while( !optionFilenameFile.eof() )
00181 {
00182 line.ReadLine(optionFilenameFile, kFALSE);
00183
00184 if(line(0) == '#' || line(0) == '*'||
00185 (line(0) == '/' && line(1) == '/') )
00186 {
00187
00188 ;
00189 }
00190 else if( sName.EqualTo("RpcPar_Hd") && line.Contains("rpchd")==kTRUE)
00191 {
00192 sOptionFileName = ((TString)line(11, line.Sizeof()-11 ));
00193 cout<<"************************************************************************"<<endl;
00194 cout<<"Using "<<sOptionFileName<<" as source for the options of TRpcParam "<<GetName()<<" step"<<endl;
00195 bFilenameFound = kTRUE;
00196 break;
00197 }
00198 else if( sName.EqualTo("RpcPar_Buc_Ref") && line.Contains("rpcbucref")==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_Mod1") && line.Contains("rpcbucmod1")==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_Mod2") && line.Contains("rpcbucmod2")==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_Mod3") && line.Contains("rpcbucmod3")==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_Mod4") && line.Contains("rpcbucmod4")==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 }
00239 if( optionFilenameFile.eof() && kFALSE == bFilenameFound )
00240 {
00241 cout<<"************************************************************************"<<endl;
00242 cout<<"Field for TRpcParam "<<GetName()<<" step not found in File with option filename => Using "<<sOptionFileName<<endl;
00243 }
00244 }
00245
00246 fstream setupFile(sOptionFileName, ios::in);
00247
00248
00249 if( setupFile.fail() == true)
00250 {
00251 TGo4Log::Error("TRpcParam %s: Setup file %s can not be opened or is missing.", GetName(), sOptionFileName.Data());
00252 TGo4Log::Error("=> Using default values!");
00253 }
00254 else
00255 {
00256 TGo4Log::Info("TRpcParam %s: Load Setup file %s.", GetName(), sOptionFileName.Data());
00257 TString line;
00258
00259
00260 while( !setupFile.eof() )
00261 {
00262 line.ReadLine(setupFile, kFALSE);
00263 if(1 == uDebug)
00264 cout<<line<<endl;
00265
00266 if(line(0) == '#' || line(0) == '*')
00267 {
00268
00269 ;
00270 }
00271 else if(line.Contains("debug")==kTRUE)
00272 {
00273 uDebug = ((TString)line(5,10)).Atoi();
00274 if(1 == uDebug)
00275 cout<<"Debug ON!!!!!!"<<endl;
00276 }
00277 else if(line.Contains("tdcoffscaen")==kTRUE)
00278 {
00279 iOffsetTdcCaen = ((TString)line(12,10)).Atoi();
00280 if( iOffsetTdcCaen > MAX_1290)
00281 {
00282 cout<<"Error: CAEN tdc for offset higher than max allowed -> replaced by default value: ";
00283 cout<<TDC_FOR_OFFSET_CAEN<<endl;
00284 iOffsetTdcCaen = TDC_FOR_OFFSET_CAEN;
00285 }
00286 }
00287 else if(line.Contains("chaoffscaen")==kTRUE)
00288 {
00289 iOffsetChannelCaen = ((TString)line(12,10)).Atoi();
00290 if( iOffsetChannelCaen > T1290Data::NumChan)
00291 {
00292 cout<<"Error: CAEN channel for offset higher than max allowed -> replaced by default value: ";
00293 cout<<CH_FOR_OFFSET_CAEN<<endl;
00294 iOffsetChannelCaen = CH_FOR_OFFSET_CAEN;
00295 }
00296 }
00297 else if(line.Contains("tdcoffsvftx")==kTRUE)
00298 {
00299 iOffsetTdcVFTX = ((TString)line(12,10)).Atoi();
00300 if( iOffsetTdcVFTX > MAX_FPGA_TDC)
00301 {
00302 cout<<"Error: VFTX tdc for offset higher than max allowed -> replaced by default value: ";
00303 cout<<TDC_FOR_OFFSET_VFTX<<endl;
00304 iOffsetTdcVFTX = TDC_FOR_OFFSET_VFTX;
00305 }
00306 }
00307 else if(line.Contains("chaoffsvftx")==kTRUE)
00308 {
00309 iOffsetChannelVFTX = ((TString)line(12,10)).Atoi();
00310 if( iOffsetChannelVFTX > FPGA_TDC_NBCHAN)
00311 {
00312 cout<<"Error: VFTX channel for offset higher than max allowed -> replaced by default value: ";
00313 cout<<CH_FOR_OFFSET_VFTX<<endl;
00314 iOffsetChannelVFTX = CH_FOR_OFFSET_VFTX;
00315 }
00316 }
00317 else if(line.Contains("tdcdiamcaen")==kTRUE)
00318 {
00319 iDiamondTdcCaen = ((TString)line(12,10)).Atoi();
00320 if( iDiamondTdcCaen > MAX_1290)
00321 {
00322 cout<<"Error: CAEN tdc for diamond higher than max allowed -> replaced by default value: ";
00323 cout<<TDC_FOR_DIAMOND_CAEN<<endl;
00324 iDiamondTdcCaen = TDC_FOR_DIAMOND_CAEN;
00325 }
00326 }
00327 else if(line.Contains("chadiamcaen")==kTRUE)
00328 {
00329 iDiamondChannelCaen = ((TString)line(12,10)).Atoi();
00330 if( iDiamondChannelCaen > T1290Data::NumChan)
00331 {
00332 cout<<"Error: CAEN channel for diamond higher than max allowed -> replaced by default value: ";
00333 cout<<CH_FOR_DIAMOND_CAEN<<endl;
00334 iDiamondChannelCaen = CH_FOR_DIAMOND_CAEN;
00335 }
00336 }
00337 else if(line.Contains("tdcdiamvftx")==kTRUE)
00338 {
00339 iDiamondTdcVFTX = ((TString)line(12,10)).Atoi();
00340 if( iDiamondTdcVFTX > MAX_FPGA_TDC)
00341 {
00342 cout<<"Error: VFTX tdc for diamond higher than max allowed -> replaced by default value: ";
00343 cout<<TDC_FOR_DIAMOND_VFTX<<endl;
00344 iDiamondTdcVFTX = TDC_FOR_DIAMOND_VFTX;
00345 }
00346 }
00347 else if(line.Contains("chadiamvftx")==kTRUE)
00348 {
00349 iDiamondChannelVFTX = ((TString)line(12,10)).Atoi();
00350 if( iDiamondChannelVFTX > FPGA_TDC_NBCHAN)
00351 {
00352 cout<<"Error: VFTX channel for diamond higher than max allowed -> replaced by default value: ";
00353 cout<<CH_FOR_DIAMOND_VFTX<<endl;
00354 iDiamondChannelVFTX = CH_FOR_DIAMOND_VFTX;
00355 }
00356 }
00357 else if(line.Contains("rateintdur")==kTRUE)
00358 {
00359 iRateIntegrationDuration = ((TString)line(11,10)).Atoi();
00360 }
00361 else if(line.Contains("ratestep")==kTRUE)
00362 {
00363 iRateIntegrationStep = ((TString)line(11,10)).Atoi();
00364 if( iRateIntegrationStep < 2 )
00365 {
00366 cout<<"Rate step size smaller than Go4 minimal Hist. update step of 2s, set step size to 2s"<<endl;
00367 iRateIntegrationStep = 2;
00368 }
00369 if( iRateIntegrationDuration < iRateIntegrationStep )
00370 {
00371 cout<<"Rate step size smaller than rate integration size, set step size to integration size"<<endl;
00372 iRateIntegrationStep = iRateIntegrationDuration;
00373 }
00374 }
00375 else if(line.Contains("tdctypestrip")==kTRUE)
00376 {
00377 uTdcTypeStrip = ((TString)line(13,10)).Atoi();
00378 }
00379 else if(line.Contains("striprpcname")==kTRUE)
00380 {
00381 sStripRpcName = ((TString)line(13,20));
00382 }
00383 else if(line.Contains("striprpcposx")==kTRUE)
00384 {
00385 dStripRpcPosX = ((TString)line(13,10)).Atof();
00386 }
00387 else if(line.Contains("striprpcposy")==kTRUE)
00388 {
00389 dStripRpcPosY = ((TString)line(13,10)).Atof();
00390 }
00391 else if(line.Contains("striprpcposz")==kTRUE)
00392 {
00393 dStripRpcPosZ = ((TString)line(13,10)).Atof();
00394 }
00395 else if(line.Contains("nbstrips")==kTRUE)
00396 {
00397 uNbStrips = ((TString)line(9,10)).Atoi();
00398 if( uNbStrips > NB_STRIPS_MAX)
00399 {
00400 cout<<"Error: nb strips higher than max allowed for RPC "<<uNbStrips;
00401 cout<<" -> replaced by max value: ";
00402 cout<<NB_STRIPS_MAX<<endl;
00403 uNbStrips = NB_STRIPS_MAX;
00404 }
00405 }
00406 else if(line.Contains("stripwidth")==kTRUE)
00407 {
00408 dStripWidth = ((TString)line(12,10)).Atof();
00409 }
00410 else if(line.Contains("striplengt")==kTRUE)
00411 {
00412 dStripLength = ((TString)line(12,10)).Atof();
00413 }
00414 else if(line.Contains("timeconvcm")==kTRUE)
00415 {
00416 dTimeConv = ((TString)line(12,10)).Atof();
00417 }
00418 else if(line.Contains("orientation")==kTRUE)
00419 {
00420 uOrientation = ((TString)line(13,10)).Atoi();
00421 }
00422 else if(line.Contains("beamsize")==kTRUE)
00423 {
00424 iBeamProfileSize = ((TString)line(9,10)).Atoi();
00425 }
00426 else if(line.Contains("triggsel")==kTRUE)
00427 {
00428 iTriggerSelection = ((TString)line(9,10)).Atoi();
00429 }
00430 else if(line.Contains("strtdctype")==kTRUE)
00431 {
00432 line = line(16,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00433 if( uNbStrips == 0 && line.Sizeof() )
00434 {
00435 if( 1 == uDebug )
00436 {
00437 cout<<"Warning: nbStrips is 0 and strips tdc type array not empty: skip filling"<<line<<endl;
00438 cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00439 }
00440 }
00441 else
00442 {
00443 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00444 {
00445 uTdcStripType[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_INDEXES)).Atoi();
00446 line = line(NB_DIGITS_STRIP_INDEXES,NB_DIGITS_STRIP_INDEXES*NB_STRIPS_MAX);
00447 }
00448 }
00449 }
00450 else if(line.Contains("noisystrip")==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 noisy strips 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 uTdcStripNoisy[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("deadstrip")==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 dead 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 uTdcStripDead[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("strlefttottdc")==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 left strips Tot TDC 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 uTdcStripLeftTot[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("strlefttotcha")==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 Channel 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 uChannelStripLeftTot[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("strlefttimetdc")==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 Time TDC 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 uTdcStripLeftTime[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("strlefttimecha")==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 channel 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 uChannelStripLeftTime[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("strrighttimetdc")==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 right strips Time TDC 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 uTdcStripRightTime[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("strrighttimecha")==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 channel 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 uChannelStripRightTime[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("strrighttottdc")==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 Tot TDC 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 uTdcStripRightTot[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("strrighttotcha")==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 channel 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 uChannelStripRightTot[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("stripsoffs")==kTRUE)
00651 {
00652 line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00653 if( uNbStrips == 0 && line.Sizeof() )
00654 {
00655 if( 1 == uDebug )
00656 {
00657 cout<<"Warning: nbStrips is 0 and strips profile offsets 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 dProfOffsetList[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00666 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00667 }
00668 }
00669 }
00670 else if(line.Contains("reftimeoff")==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 reference 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 dRefOffsetList[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("stripsoffsleft")==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 left 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 dOffsetListLeft[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("stripsoffsright")==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 right 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 dOffsetListRight[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("strtotgainleft")==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 left tot gain 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 dToTGainListLeft[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("strtotoffsleft")==kTRUE)
00751 {
00752 line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00753 if( uNbStrips == 0 && line.Sizeof() )
00754 {
00755 if( 1 == uDebug )
00756 {
00757 cout<<"Warning: nbStrips is 0 and strips left tot offsets array not empty: skip filling"<<line<<endl;
00758 cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00759 }
00760 }
00761 else
00762 {
00763 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00764 {
00765 dTotOffsetListLeft[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00766 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00767 }
00768 }
00769 }
00770 else if(line.Contains("strtotgainright")==kTRUE)
00771 {
00772 line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00773 if( uNbStrips == 0 && line.Sizeof() )
00774 {
00775 if( 1 == uDebug )
00776 {
00777 cout<<"Warning: nbStrips is 0 and strips right tot gain array not empty: skip filling"<<line<<endl;
00778 cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00779 }
00780 }
00781 else
00782 {
00783 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00784 {
00785 dToTGainListRight[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00786 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00787 }
00788 }
00789 }
00790 else if(line.Contains("strtotoffsright")==kTRUE)
00791 {
00792 line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00793 if( uNbStrips == 0 && line.Sizeof() )
00794 {
00795 if( 1 == uDebug )
00796 {
00797 cout<<"Warning: nbStrips is 0 and strips right tot offsets array not empty: skip filling"<<line<<endl;
00798 cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00799 }
00800 }
00801 else
00802 {
00803 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00804 {
00805 dTotOffsetListRight[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00806 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00807 }
00808 }
00809 }
00810 else if(line.Contains("initoffscal")==kTRUE)
00811 {
00812 uInitialOffsetCalib = ((TString)line(13,10)).Atof();
00813 }
00814 else if(line.Contains("lowlimfitbea")==kTRUE)
00815 {
00816 dLowerBoundFitBeamProfile = ((TString)line(13,10)).Atof();
00817 }
00818 else if(line.Contains("upplimfitbea")==kTRUE)
00819 {
00820 dUpperBoundFitBeamProfile = ((TString)line(13,10)).Atof();
00821 }
00822 else if(line.Contains("lowlimfitref")==kTRUE)
00823 {
00824 dLowerBoundFitRefProfile = ((TString)line(13,10)).Atof();
00825 }
00826 else if(line.Contains("upplimfitref")==kTRUE)
00827 {
00828 dUpperBoundFitRefProfile = ((TString)line(13,10)).Atof();
00829 }
00830 else if(line.Contains("initvalfitparbe")==kTRUE)
00831 {
00832 line = line(16,NB_DIGITS_STRIP_OFFSETS*4);
00833 for(Int_t iFitParam = 0; iFitParam < 4 ; iFitParam++)
00834 {
00835 if( 1 == uDebug )
00836 cout<<"initvalfitparbe "<<iFitParam<<" "<<line<<endl;
00837 dInitialValueFitParBeamProfile[iFitParam] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00838 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*4);
00839 }
00840 }
00841 else if(line.Contains("initvalfitparre")==kTRUE)
00842 {
00843 line = line(16,NB_DIGITS_STRIP_OFFSETS*4);
00844 for(Int_t iFitParam = 0; iFitParam < 4 ; iFitParam++)
00845 {
00846 dInitialValueFitParRefProfile[iFitParam] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00847 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*4);
00848 }
00849 }
00850 else if(line.Contains("strmatchingoffs")==kTRUE)
00851 {
00852 line = line(16,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00853 if( uNbStrips == 0 && line.Sizeof() )
00854 {
00855 if( 1 == uDebug )
00856 {
00857 cout<<"Warning: nbStrips is 0 and strips matching offsets array not empty: skip filling"<<line<<endl;
00858 cout<<"(if line were inverted in the option file, it could be the error)"<<endl;
00859 }
00860 }
00861 else
00862 {
00863 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00864 {
00865 dOffsetMatching[temp_index] = ((TString)line(0,NB_DIGITS_STRIP_OFFSETS)).Atof();
00866 line = line(NB_DIGITS_STRIP_OFFSETS,NB_DIGITS_STRIP_OFFSETS*NB_STRIPS_MAX);
00867 }
00868 }
00869 }
00870 }
00871 }
00872 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00873 if( 1 == uTdcStripType[temp_index] )
00874 {
00875 uTdcStripLeftTot[temp_index] = uTdcStripLeftTime[temp_index];
00876 if( 1 == uChannelStripLeftTime[temp_index]%2)
00877 uChannelStripLeftTot[temp_index] = uChannelStripLeftTime[temp_index] - 1;
00878 else uChannelStripLeftTot[temp_index] = uChannelStripLeftTime[temp_index] + 1;
00879 uTdcStripRightTot[temp_index] = uTdcStripRightTime[temp_index];
00880 if( 1 == uChannelStripRightTime[temp_index]%2)
00881 uChannelStripRightTot[temp_index] = uChannelStripRightTime[temp_index] - 1;
00882 else uChannelStripRightTot[temp_index] = uChannelStripRightTime[temp_index] + 1;
00883 }
00884
00885 return kTRUE;
00886 }
00887
00888
00889 Int_t TRpcParam::PrintOptions(){
00890 cout<<"********************* RPC calibration parameters **********************"<<endl;
00891 cout<<"------------- Options for strip RPC ";
00892 cout.width(20);
00893 cout<<sStripRpcName<<" --------------"<<endl;
00894 cout<<"-------------------------------------------------"<<endl;
00895 if(1 == uDebug)
00896 cout<<" Debug ON!!!!!!"<<endl;
00897 else cout<<" Debug OFF"<<endl;
00898
00899 if( -1 < iOffsetTdcCaen && -1 < iOffsetChannelCaen &&
00900 -1 < iOffsetTdcVFTX && -1 < iOffsetChannelVFTX )
00901 {
00902 cout<<" Chan. used for time offset: "<<iOffsetChannelCaen;
00903 cout<<" in TDC "<<iOffsetTdcCaen<<" in CAEN"<<endl;
00904 cout<<" Chan. used for time offset: "<<iOffsetChannelVFTX;
00905 cout<<" in TDC "<<iOffsetTdcVFTX<<" in VFTX"<<endl;
00906 }
00907 if( -1 < iRateIntegrationDuration && -1 < iRateIntegrationStep)
00908 {
00909 cout<<" Rate hist. reset spacing: "<<iRateIntegrationDuration<<" s"<<endl;
00910 cout<<" Rate hist. update spacing: "<<iRateIntegrationStep<<" s"<<endl;
00911 }
00912 if( 0 == uTdcTypeStrip )
00913 {
00914 cout<<" TDC type: CAEN"<<endl;
00915 }
00916 else if( 1 == uTdcTypeStrip )
00917 {
00918 cout<<" TDC type: VFTX"<<endl;
00919 }
00920 else if( 2 == uTdcTypeStrip )
00921 {
00922 cout<<" TDC type: MIXED"<<endl;
00923 }
00924 cout<<" Position: X= "<<dStripRpcPosX;
00925 cout<<" Y= "<<dStripRpcPosY<<" Z= "<<dStripRpcPosZ;
00926 cout<<endl;
00927 cout<<" Nb strips in beam profile: "<<uNbStrips<<endl;
00928 cout<<" Strip width (incl gap.): "<<dStripWidth<<" cm"<<endl;
00929 cout<<" Strip length: "<<dStripLength<<" cm"<<endl;
00930 cout<<" Time Convertion factor: "<<dTimeConv<<" cm/ns"<<endl;
00931 if( 0 == uOrientation )
00932 {
00933 cout<<" Strips orientation: Horizontal"<<endl;
00934 }
00935 else if( 1 == uOrientation )
00936 {
00937 cout<<" Strips orientation: Vertical"<<endl;
00938 }
00939 cout<<" Size of beam profile in X: "<<iBeamProfileSize<<" cm "<<endl;
00940 if( -1 == iTriggerSelection )
00941 cout<<" Trigger selection: OFF"<<endl;
00942 else cout<<" Trigger selection: Trigger "<<iTriggerSelection<<endl;
00943 cout<<"-------------------------------------------------"<<endl;
00944 cout<<" Strip channel: |- ";
00945 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00946 {
00947 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00948 cout<<temp_index<<" ";
00949 }
00950 if( 2 == uTdcTypeStrip )
00951 {
00952 cout<<endl<<" Tdc Type |-> ";
00953 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00954 {
00955 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00956 cout<<uTdcStripType[temp_index]<<" ";
00957 }
00958 }
00959 cout<<endl<<" Noisy Strip? |-> ";
00960 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00961 {
00962 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00963 cout<<uTdcStripNoisy[temp_index]<<" ";
00964 }
00965 cout<<endl<<" Dead Strip? |-> ";
00966 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00967 {
00968 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00969 cout<<uTdcStripDead[temp_index]<<" ";
00970 }
00971 cout<<endl<<" Tdc Tot Left |-> ";
00972 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00973 {
00974 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00975 cout<<uTdcStripLeftTot[temp_index]<<" ";
00976 }
00977 cout<<endl<<" Channel Tot Left |-> ";
00978 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00979 {
00980 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00981 cout<<uChannelStripLeftTot[temp_index]<<" ";
00982 }
00983 cout<<endl<<" Tdc Time Left |-> ";
00984 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00985 {
00986 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00987 cout<<uTdcStripLeftTime[temp_index]<<" ";
00988 }
00989 cout<<endl<<" Channel Time Left |-> ";
00990 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00991 {
00992 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00993 cout<<uChannelStripLeftTime[temp_index]<<" ";
00994 }
00995 cout<<endl<<" Tdc Time Right |-> ";
00996 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
00997 {
00998 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
00999 cout<<uTdcStripRightTime[temp_index]<<" ";
01000 }
01001 cout<<endl<<" Channel Time Right |-> ";
01002 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01003 {
01004 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01005 cout<<uChannelStripRightTime[temp_index]<<" ";
01006 }
01007 cout<<endl<<" Tdc Tot Right |-> ";
01008 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01009 {
01010 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01011 cout<<uTdcStripRightTot[temp_index]<<" ";
01012 }
01013 cout<<endl<<" Channel Tot Right |-> ";
01014 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01015 {
01016 cout.width(NB_DIGITS_STRIP_INDEXES - 1);
01017 cout<<uChannelStripRightTot[temp_index]<<" ";
01018 }
01019 cout<<endl;
01020 cout<<"-------------------------------------------------"<<endl;
01021 cout<<" Strip channel: |- ";
01022 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01023 {
01024 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01025 cout<<temp_index<<" ";
01026 }
01027 cout<<endl<<" Beam Profile Offset|-> ";
01028 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01029 {
01030 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01031 cout<<dRefOffsetList[temp_index]<<" ";
01032 }
01033 cout<<endl<<" Reference Offset |-> ";
01034 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01035 {
01036 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01037 cout<<dRefOffsetList[temp_index]<<" ";
01038 }
01039 cout<<endl<<" Time Offset Left |-> ";
01040 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01041 {
01042 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01043 cout<<dOffsetListLeft[temp_index]<<" ";
01044 }
01045 cout<<endl<<" Time Offset Right |-> ";
01046 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01047 {
01048 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01049 cout<<dOffsetListRight[temp_index]<<" ";
01050 }
01051
01052 cout<<endl<<" Tot Gain Left |-> ";
01053 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01054 {
01055 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01056 cout<<dToTGainListLeft[temp_index]<<" ";
01057 }
01058 cout<<endl<<" Tot Offset Left |-> ";
01059 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01060 {
01061 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01062 cout<<dTotOffsetListLeft[temp_index]<<" ";
01063 }
01064 cout<<endl<<" Tot Gain Right |-> ";
01065 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01066 {
01067 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01068 cout<<dToTGainListRight[temp_index]<<" ";
01069 }
01070 cout<<endl<<" Tot Offset Right |-> ";
01071 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01072 {
01073 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01074 cout<<dTotOffsetListRight[temp_index]<<" ";
01075 }
01076 cout<<endl;
01077 cout<<"-------------------------------------------------"<<endl;
01078 if( 0 <= uInitialOffsetCalib )
01079 cout<<" Initial offset calibration: "<<uInitialOffsetCalib<<endl;
01080 else cout<<" Initial offset calibration: OFF"<<endl;
01081 cout<<" Lower lim. Fit funct. beam:"<<dLowerBoundFitBeamProfile<<endl;
01082 cout<<" Upper lim. Fit funct. beam:"<<dUpperBoundFitBeamProfile<<endl;
01083 cout<<" Lower lim. Fit funct. Ref: "<<dLowerBoundFitRefProfile<<endl;
01084 cout<<" Upper lim. Fit funct. Ref: "<<dUpperBoundFitRefProfile<<endl;
01085
01086 cout<<" Fit Parameter: |- ";
01087 for( Int_t iInitialParam = 0; iInitialParam < 4; iInitialParam++)
01088 {
01089 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01090 cout<<iInitialParam<<" ";
01091 }
01092 cout<<endl<<" Initial value Beam |-> ";
01093 for( Int_t iInitialParam = 0; iInitialParam < 4; iInitialParam++)
01094 {
01095 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01096 cout<<dInitialValueFitParBeamProfile[iInitialParam]<<" ";
01097 }
01098 cout<<endl<<" Initial value Ref |-> ";
01099 for( Int_t iInitialParam = 0; iInitialParam < 4; iInitialParam++)
01100 {
01101 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01102 cout<<dInitialValueFitParRefProfile[iInitialParam]<<" ";
01103 }
01104 cout<<endl;
01105 cout<<"-------------------------------------------------"<<endl;
01106 cout<<" Strip channel: |- ";
01107 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01108 {
01109 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01110 cout<<temp_index<<" ";
01111 }
01112 cout<<endl<<" Matching Offset |-> ";
01113 for(UInt_t temp_index = 0; temp_index < uNbStrips; temp_index++)
01114 {
01115 cout.width(NB_DIGITS_STRIP_OFFSETS - 1);
01116 cout<<dOffsetMatching[temp_index]<<" ";
01117 }
01118 cout<<endl;
01119 cout<<"************************************************************************"<<endl;
01120
01121 return 0;
01122 }
01123
01124
01125
01126
01127
01128 Bool_t TRpcParam::CalculateLeftRightOffset()
01129 {
01130 for( UInt_t uStrip = 0; uStrip < uNbStrips; uStrip++)
01131 {
01132 dOffsetListLeft[uStrip] = 0.5*( (dProfOffsetList[uStrip])+2.*(dRefOffsetList[uStrip]));
01133 dOffsetListRight[uStrip] = 0.5*(-(dProfOffsetList[uStrip])+2.*(dRefOffsetList[uStrip]));
01134 }
01135 return kTRUE;
01136 }