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