Changeset 7189
- Timestamp:
- 07/14/05 16:03:32 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7188 r7189 20 20 21 21 -*-*- END OF LINE -*-*- 22 2005/07/14 Thomas Bretz 23 24 * mbadpixels/MBadPixelCam.[h,cc]: 25 - added new function GetNumSuitable 26 27 * mcalib/MCalibrationChargeCalc.cc: 28 simplified FinalizeUnsuitablePixels() 29 30 22 31 23 32 2005/07/13 Abelardo Moralejo (2005/07/12) … … 64 73 also absolute calibration (=SIZE in phes) is made. 65 74 75 * mcalib/MCalibrateData.cc 76 - In PreProcess, changed initialization of fRenormFactor. Formerly 77 it was fixed to MCalibrationQEPix::gkDefaultAverageQE. Now we check 78 first if there is a valid average QE for inner pixels in 79 MCalibrationQECam, and if so, we inititalize fRenormFactor with it. 80 Else, the default gkDefaultAverageQE is taken. fRenormFactor is 81 used to convert back from photons to "equivalent inner pixel phes" 82 in the (now default) case of calibrating in phes. 83 66 84 67 85 … … 287 305 - check for existence of pointer fRawEvt in PostProcess. 288 306 307 * mcalib/MCalibrationChargeCalc.[h,cc] 308 - implement possibility to set reference number of photo-electrons from 309 outside (stored in fExternalNumPhes). 310 311 * mcalib/MCalibrateData.[h,cc], mcalib/MCalibCalcFromPast.cc, 312 mjobs/MJCalibrateSignal.cc: 313 - write calibration constants now in separate 314 MCalibrationIntensityConstCam. This is necessary since with the 315 introduction of the averageing of mean photo-electrons, the 316 MCalibrationIntensityChargeCam does not hold the correct conv. 317 factors any more. 318 319 * mcalib/MCalibrateData.[h,cc] 320 - get also pointers to the IntensityCams and use them if exist 321 (previously, only the first calibration cam was used together 322 with the updatecam.) 323 324 325 326 2005/07/13 Markus Gaug (2005/06/17) 327 328 * mcalib/MCalibrationIntensityCam.[h,cc] 329 - take out some un-used or commented code (variables fOffsets and 330 fSlopes). These data members were not in the streamter either. 331 - put some of the most-used code from the .cc file into the .h file 332 - add new function: SetCam(). 333 289 334 290 335 … … 305 350 - In CalibrateData, the sigma is used for the statistical error of the 306 351 converted signal to equiv. high-gain charges. 352 353 * mcalib/MCalibCalcFromPast.[h,cc] 354 - implement the mean photo-electron averageing for a desired number of 355 calibration updates. 356 357 * mcalib/MCalibrateData.cc 358 - use MCalibrationChargePix::GetConversionHiLoSigma() to calculate the 359 error (was previously MCalibrationChargePix::GetConversionHiLoErr(). 360 361 * callisto.cc 362 - calculate first fixed window pedestal in MJPedestalY2, 363 then sliding window pedestal in MJPedestalY3 (order reversed). 364 307 365 308 366 … … 347 405 now, depending on the study, one wants to make. 348 406 407 * mcalib/MCalibrationChargeCalc.[h,cc] 408 - set a limit to the number of un-suitable and un-reliables pixels 409 for the run to succeed: 0.1 unsuitables and 0.3 un-reliables 410 - set UseExtractorRes to kTRUE, will raise the number of 411 photo-electrons for the spline extractor by 1-2% (correctly). 412 - re-normalize the pedestal RMS of the event-by-event averaged 413 area events to the sqrt of the number of used pixels. 414 - re-normalize the sigma of the event-by-event averaged area events 415 by 1/F-Factor. 416 - introduce switch to choose if un-reliables should be used for the 417 calculation of mean number of phes (default: kTRUE). 418 - print out the number of high-gain saturated pixels. 419 420 421 422 2005/07/13 Markus Gaug (2005/06/10) 423 424 * mjobs/MJCalibrateSignal.[h,cc] 425 - skip also the PIN Diode events from the data calibration. 426 349 427 350 428 … … 357 435 - introduce flags to steer the setting of unreliability like done 358 436 in MCalibrationChargeCalc. Can be steered from the conf-file. 437 438 * mbadpixels/MBadPixelsIntensityCam.[h,cc] 439 - implement two Get and Draw-functions to display bad pixels over 440 time like in the mcalib/MCalibrationIntensityChargeCam 441 442 443 444 2005/07/13 Markus Gaug (2005/06/03) 445 446 * mhcalib/MHCalibrationPulseTimeCam.cc 447 - fill arrays only if IsOscillations() was asked. This is a speed 448 bug and could cause important memory leaks. It does not affect the 449 outcome of an analysis, however. 359 450 360 451 -
trunk/MagicSoft/Mars/NEWS
r7188 r7189 76 76 a good precision is needed. 77 77 78 - callisto: Set UseExtractorRes to kTRUE, will raise the number of 79 photo-electrons for the spline extractor by 1-2% (correctly). 80 78 81 - star: fixed a bug which caused MEffectiveOnTime containers not to 79 82 be written. In the worst case they were skipped almost all, in the … … 96 99 97 100 - ganymed: optimized palettes for MHDisp 101 102 - ganymed: Fixed an important bug when using ThetaSq as fit function: 103 The result for the sigma of the gauss(sqrt(x)) fit was a factor 104 sqrt(2) to large 98 105 99 106 - sponde: the zenith angle distribution is now weighted instead of -
trunk/MagicSoft/Mars/callisto.cc
r7179 r7189 358 358 job1.SetExtractionFundamental(); 359 359 // job1.SetPathOut(kOutpathC); // not yet needed 360 // job1.SetPathIn(kInpathC); // not yet needed360 // job1.SetPathIn(kInpathC); // DO NOT CALL IT. IT WOULD READ THE XEXTRACTOR FROM calib-file 361 361 362 362 if (!job1.Process()) … … 387 387 job2.SetDeadPixelCheck(); 388 388 // job1.SetPathOut(kOutpathC); // not yet needed 389 // job1.SetPathIn(kInpathC); // not yet needed389 // job1.SetPathIn(kInpathC); // DO NOT CALL IT. IT WOULD READ THE XEXTRACTOR FROM calib-file 390 390 391 391 //job2.SetExtractorResolution(); … … 488 488 job1.SetOverwrite(kOverwrite); 489 489 job1.SetPathData(kInpathD); 490 job1.SetPathIn(kInpathY); 490 job1.SetPathIn(kInpathY); // --> READ Extractor from calib-file 491 491 job1.SetDataType(kDataType); 492 492 //job1.SetPathOut(kOutpathY); // not yet needed … … 525 525 526 526 job2.SetUseData(); 527 job2.SetExtractionWithExtractor ();527 job2.SetExtractionWithExtractorRndm(); 528 528 job2.SetExtractor(job1.GetExtractor()); 529 529 job2.SetPedestals(job1.GetPedestalCam()); … … 563 563 564 564 job3.SetUseData(); 565 job3.SetExtractionWithExtractor Rndm();566 job3.SetExtractor(job 1.GetExtractor());565 job3.SetExtractionWithExtractor(); 566 job3.SetExtractor(job2.GetExtractor()); 567 567 job3.SetPedestals(job1.GetPedestalCam()); 568 568 job3.SetBadPixels(job1.GetBadPixels()); -
trunk/MagicSoft/Mars/callisto.rc
r7188 r7189 376 376 377 377 # ------------------------------------------------------------------------- 378 # use the entire results obtained with the F-Factor method (including a 379 # new number of mean photo-electrons) 378 # Configure the interlaced calibration updates 380 379 # ------------------------------------------------------------------------- 381 380 #MJCalibrateSignal.MCalibCalcFromPast.UpdateWithFFactorMethod: yes 381 #MJCalibrateSignal.MCalibCalcFromPast.NumEventsDump: 500 382 #MJCalibrateSignal.MCalibCalcFromPast.UpdateNumPhes: yes 383 #MJCalibrateSignal.MCalibCalcFromPast.NumPhesDump: 10 384 #MJCalibrateSignal.MCalibrationChargeCalc.Debug: no 382 385 383 386 # ------------------------------------------------------------------------- … … 431 434 #MJCalibrateSignal.MHCalibrationChargeCam.HiGainLast: 1899.5 432 435 MJCalibrateSignal.MHCalibrationChargeCam.LoGainNbins: 250 433 #MJCalibrateSignal.MHCalibrationChargeCam.LoGainFirst: -99. 434 #MJCalibrateSignal.MHCalibrationChargeCam.LoGainLast: 901. 436 MJCalibrateSignal.MHCalibrationChargeCam.LoGainFirst: -98 437 MJCalibrateSignal.MHCalibrationChargeCam.LoGainLast: 902 435 438 #MJCalibrateSignal.MHCalibrationChargeCam.TimeLowerLimit: 1. 436 439 #MJCalibrateSignal.MHCalibrationChargeCam.TimeUpperLimit: 3. -
trunk/MagicSoft/Mars/callisto_Dec04Jan05.rc
r7127 r7189 88 88 #MJPedestalC1.ExtractSignal.Resolution: 0.05 89 89 #MJPedestalC1.ExtractSignal.RiseTimeHiGain: 0.5 90 MJPedestalC1.ExtractSignal.FallTimeHiGain: 0.590 #MJPedestalC1.ExtractSignal.FallTimeHiGain: 0.5 91 91 #MJPedestalC1.ExtractSignal.LoGainStretch: 1.5 92 92 #MJPedestalC1.ExtractSignal.ExtractionType: Integral <default> … … 339 339 #MJPedestalY2.PulsePosCheck: yes 340 340 MJPedestalY2.ExtractWinLeft: 3.0 341 MJPedestalY2.ExtractWinRight: 2. 0341 MJPedestalY2.ExtractWinRight: 2.5 342 342 #MJCalibrateSignal.ModifiedExtractWin: yes 343 343 # ------------------------------------------------------------------------- … … 389 389 390 390 # ------------------------------------------------------------------------- 391 # Use this if you want to change to time from run headers instead of event time 392 # ------------------------------------------------------------------------- 393 #MJCalibrateSignal.MPointingPosInterpolate.TimeMode: eventtime, runtime 391 # Configure the interlaced calibration updates 392 # ------------------------------------------------------------------------- 393 #MJCalibrateSignal.MCalibCalcFromPast.UpdateWithFFactorMethod: yes 394 #MJCalibrateSignal.MCalibCalcFromPast.NumEventsDump: 500 395 #MJCalibrateSignal.MCalibCalcFromPast.UpdateNumPhes: yes 396 #MJCalibrateSignal.MCalibCalcFromPast.NumPhesDump: 10 397 #MJCalibrateSignal.MCalibrationChargeCalc.Debug: no 394 398 395 399 # ------------------------------------------------------------------------- … … 440 444 #MJCalibrateSignal.MHCalibrationChargeCam.HiGainLast: 1899.5 441 445 MJCalibrateSignal.MHCalibrationChargeCam.LoGainNbins: 250 442 #MJCalibrateSignal.MHCalibrationChargeCam.LoGainFirst: -100.5 443 #MJCalibrateSignal.MHCalibrationChargeCam.LoGainLast: 899.5 446 MJCalibrateSignal.MHCalibrationChargeCam.LoGainFirst: -98 447 MJCalibrateSignal.MHCalibrationChargeCam.LoGainLast: 902 444 448 #MJCalibrateSignal.MHCalibrationChargeCam.TimeLowerLimit: 1. 445 449 #MJCalibrateSignal.MHCalibrationChargeCam.TimeUpperLimit: 3. -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
r7095 r7189 180 180 // -------------------------------------------------------------------------- 181 181 // 182 // Calculate the number of pixels with the given type-flags.182 // Calculate the number of pixels without the given type-flags. 183 183 // 184 184 // The second argument aidx is the area index (see MGeomCam, MGeomPix) … … 187 187 // Returns -1 if the geometry doesn't match. 188 188 // 189 Short_t MBadPixelsCam::GetNum Unsuitable(MBadPixelsPix::UnsuitableType_t type, const MGeomCam *geom, Int_t aidx) const189 Short_t MBadPixelsCam::GetNumSuitable(MBadPixelsPix::UnsuitableType_t type, const MGeomCam *geom, Int_t aidx) const 190 190 { 191 191 const UInt_t n = GetSize(); 192 192 193 if (aidx>=0 && geom->GetNumPixels()!=n)193 if (aidx>=0 && (!geom || geom->GetNumPixels()!=n)) 194 194 { 195 195 *fLog << err << GetDescriptor() << "ERROR - Geometry (" << geom->ClassName() << ") size mismatch!" << endl; … … 200 200 for (UInt_t i=0; i<n; i++) 201 201 { 202 if (aidx>=0 && (*geom)[i].GetAidx()!=aidx) 202 if (aidx>=0 && geom && (*geom)[i].GetAidx()!=aidx) 203 continue; 204 205 if (!(*this)[i].IsUnsuitable(type)) 206 rc++; 207 } 208 return rc; 209 } 210 211 // -------------------------------------------------------------------------- 212 // 213 // Calculate the number of pixels with the given type-flags. 214 // 215 // The second argument aidx is the area index (see MGeomCam, MGeomPix) 216 // The default (or any value less than 0) means: all 217 // 218 // Returns -1 if the geometry doesn't match. 219 // 220 Short_t MBadPixelsCam::GetNumUnsuitable(MBadPixelsPix::UnsuitableType_t type, const MGeomCam *geom, Int_t aidx) const 221 { 222 const UInt_t n = GetSize(); 223 224 if (aidx>=0 && geom && geom->GetNumPixels()!=n) 225 { 226 *fLog << err << GetDescriptor() << "ERROR - Geometry (" << geom->ClassName() << ") size mismatch!" << endl; 227 return -1; 228 } 229 230 Short_t rc = 0; 231 for (UInt_t i=0; i<n; i++) 232 { 233 if (aidx>=0 && geom && (*geom)[i].GetAidx()!=aidx) 203 234 continue; 204 235 … … 334 365 void MBadPixelsCam::Print(Option_t *o) const 335 366 { 336 337 367 *fLog << all << GetDescriptor() << ":" << endl; 338 368 *fLog << "Pixels without problems:" << endl; … … 477 507 void MBadPixelsCam::PrintBadPixels( MBadPixelsPix::UncalibratedType_t typ, const char *text) const 478 508 { 479 480 481 509 *fLog << "Pixels with " << text << ": " << endl; 482 510 UInt_t count = 0; -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h
r5463 r7189 42 42 Short_t GetNumUnsuitable(MBadPixelsPix::UnsuitableType_t type, const MGeomCam *geom, Int_t aidx=-1) const; 43 43 Short_t GetNumUnsuitable(MBadPixelsPix::UnsuitableType_t type) const { return GetNumUnsuitable(type, 0); } 44 Short_t GetNumSuitable(MBadPixelsPix::UnsuitableType_t type, const MGeomCam *geom, Int_t aidx=-1) const; 45 Short_t GetNumSuitable(MBadPixelsPix::UnsuitableType_t type) const { return GetNumSuitable(type, 0); } 44 46 Short_t GetNumIsolated(MBadPixelsPix::UnsuitableType_t type, const MGeomCam &geom, Int_t aidx=-1) const; 45 47 Short_t GetNumIsolated(const MGeomCam &geom, Int_t aidx=-1) const { return GetNumIsolated(MBadPixelsPix::kUnsuitableRun, geom, aidx); } -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.cc
r5052 r7189 44 44 45 45 #include <TOrdCollection.h> 46 47 #include "MGeomCam.h" 46 #include <TGraph.h> 47 48 #include "MGeomPix.h" 49 #include "MHCamera.h" 50 #include "MLogManip.h" 48 51 49 52 ClassImp(MBadPixelsIntensityCam); … … 268 271 } 269 272 273 274 // ------------------------------------------------------------------- 275 // 276 // Returns a TGraph with the number of uncalibrated type pixels per area index 277 // vs. the calibration camera. 278 // 279 TGraph *MBadPixelsIntensityCam::GetUncalibratedPerAreaVsTime(const MBadPixelsPix::UncalibratedType_t typ, 280 const Int_t aidx, const MGeomCam &geom) 281 { 282 283 const Int_t size = GetSize(); 284 285 if (size == 0) 286 return NULL; 287 288 TArrayF uncal(size); 289 TArrayF time(size); 290 291 for (Int_t i=0;i<GetSize();i++) 292 { 293 // 294 // Get the calibration cam from the intensity cam 295 // 296 MBadPixelsCam *cam = GetCam(i); 297 298 // 299 // Get the calibration pix from the calibration cam 300 // 301 for (Int_t j=0; j<cam->GetSize(); j++) 302 { 303 304 if (geom[j].GetAidx() != aidx && aidx > -1) 305 continue; 306 307 const MBadPixelsPix &pix = (*cam)[j]; 308 // 309 // Don't use bad pixels 310 // 311 if (pix.IsUncalibrated(typ)) 312 uncal[i]++; 313 } 314 time[i] = i; 315 } 316 317 TGraph *gr = new TGraph(size,time.GetArray(),uncal.GetArray()); 318 319 gr->SetTitle(Form("Uncalibrated Pixels Area %d",aidx)); 320 gr->GetXaxis()->SetTitle("Camera Nr."); 321 gr->GetYaxis()->SetTitle("<N_{uncal}> [1]"); 322 return gr; 323 } 324 325 TGraph *MBadPixelsIntensityCam::GetUnsuitablePerAreaVsTime(const MBadPixelsPix::UnsuitableType_t typ, const Int_t aidx, const MGeomCam &geom) 326 { 327 const Int_t size = GetSize(); 328 329 if (size == 0) 330 return NULL; 331 332 TArrayF unsuit(size); 333 TArrayF time(size); 334 335 for (Int_t i=0;i<GetSize();i++) 336 { 337 // 338 // Get the calibration cam from the intensity cam 339 // 340 MBadPixelsCam *cam = GetCam(i); 341 342 // 343 // Get the calibration pix from the calibration cam 344 // 345 for (Int_t j=0; j<cam->GetSize(); j++) 346 { 347 if (geom[j].GetAidx() != aidx && aidx > -1) 348 continue; 349 350 const MBadPixelsPix &pix = (*cam)[j]; 351 // 352 // Don't use bad pixels 353 // 354 if (pix.IsUnsuitable(typ)) 355 unsuit[i]++; 356 } 357 time[i] = i; 358 } 359 360 TGraph *gr = new TGraph(size,time.GetArray(),unsuit.GetArray()); 361 362 gr->SetTitle(Form("Unsuitable Pixels Area %d",aidx)); 363 gr->GetXaxis()->SetTitle("Camera Nr."); 364 gr->GetYaxis()->SetTitle("<N_{unsuit}> [1]"); 365 return gr; 366 } 367 368 MHCamera *MBadPixelsIntensityCam::GetUnsuitableSpectrum(const MBadPixelsPix::UnsuitableType_t typ, const MGeomCam &geom) 369 { 370 const Int_t size = GetSize(); 371 372 if (size == 0) 373 return NULL; 374 375 TString title; 376 TString axist; 377 378 switch (typ) 379 { 380 case MBadPixelsPix::kUnsuitableRun: 381 title = "Unsuitable Pixels"; 382 break; 383 case MBadPixelsPix::kUnreliableRun: 384 title = "Unreliable Pixels"; 385 break; 386 default: 387 *fLog << warn << "Could not determine unsuitable type ... abort " << endl; 388 return NULL; 389 } 390 391 MHCamera *camunsuit = new MHCamera(geom,"Unsuitables",title.Data()); 392 393 for (Int_t i=0;i<GetSize();i++) 394 { 395 // 396 // Get the calibration cam from the intensity cam 397 // 398 MBadPixelsCam *cam = GetCam(i); 399 400 // 401 // Get the calibration pix from the calibration cam 402 // 403 for (Int_t j=0; j<cam->GetSize(); j++) 404 { 405 const MBadPixelsPix &pix = (*cam)[j]; 406 // 407 // Don't use bad pixels 408 // 409 if (pix.IsUnsuitable(typ)) 410 { 411 camunsuit->Fill(j,1); 412 camunsuit->SetUsed(j); 413 } 414 } 415 } 416 417 return camunsuit; 418 } 419 420 MHCamera *MBadPixelsIntensityCam::GetUncalibratedSpectrum(const MBadPixelsPix::UncalibratedType_t typ, const MGeomCam &geom) 421 { 422 423 const Int_t size = GetSize(); 424 425 if (size == 0) 426 return NULL; 427 428 TString title; 429 TString axist; 430 431 switch (typ) 432 { 433 case MBadPixelsPix::kPreviouslyExcluded: 434 title = "PreviouslyExcluded"; 435 break; 436 case MBadPixelsPix::kHiGainNotFitted: 437 title = "HiGainNotFitted"; 438 break; 439 case MBadPixelsPix::kLoGainNotFitted: 440 title = "LoGainNotFitted"; 441 break; 442 case MBadPixelsPix::kRelTimeNotFitted: 443 title = "RelTimeNotFitted"; 444 break; 445 case MBadPixelsPix::kHiGainOscillating: 446 title = "HiGainOscillating"; 447 break; 448 case MBadPixelsPix::kLoGainOscillating: 449 title = "LoGainOscillating"; 450 break; 451 case MBadPixelsPix::kRelTimeOscillating: 452 title = "RelTimeOscillating"; 453 break; 454 case MBadPixelsPix::kLoGainSaturation: 455 title = "LoGainSaturation"; 456 break; 457 case MBadPixelsPix::kChargeIsPedestal: 458 title = "ChargeIsPedestal"; 459 break; 460 case MBadPixelsPix::kChargeErrNotValid: 461 title = "ChargeErrNotValid"; 462 break; 463 case MBadPixelsPix::kChargeRelErrNotValid: 464 title = "ChargeRelErrNotValid"; 465 break; 466 case MBadPixelsPix::kChargeSigmaNotValid: 467 title = "ChargeSigmaNotValid"; 468 break; 469 case MBadPixelsPix::kMeanTimeInFirstBin: 470 title = "MeanTimeInFirstBin"; 471 break; 472 case MBadPixelsPix::kMeanTimeInLast2Bins: 473 title = "MeanTimeInLast2Bins"; 474 break; 475 case MBadPixelsPix::kDeviatingNumPhes: 476 title = "DeviatingNumPhes"; 477 break; 478 case MBadPixelsPix::kDeviatingNumPhots: 479 title = "DeviatingNumPhots"; 480 break; 481 case MBadPixelsPix::kDeviatingFFactor: 482 title = "DeviatingFFactor"; 483 break; 484 case MBadPixelsPix::kDeviatingTimeResolution: 485 title = "DeviatingTimeResolution"; 486 break; 487 case MBadPixelsPix::kConversionHiLoNotValid: 488 title = "ConversionHiLoNotValid"; 489 break; 490 case MBadPixelsPix::kHiGainOverFlow: 491 title = "HiGainOverFlow"; 492 break; 493 case MBadPixelsPix::kLoGainOverFlow: 494 title = "LoGainOverFlow"; 495 break; 496 case MBadPixelsPix::kHiLoNotFitted: 497 title = "HiLoNotFitted"; 498 break; 499 case MBadPixelsPix::kHiLoOscillating: 500 title = "HiLoOscillating"; 501 break; 502 case MBadPixelsPix::kDeadPedestalRms: 503 title = "DeadPedestalRms"; 504 break; 505 case MBadPixelsPix::kFluctuatingArrivalTimes: 506 title = "FluctuatingArrivalTimes"; 507 break; 508 default: 509 *fLog << warn << "Could not determine uncalibrated type ... abort " << endl; 510 return NULL; 511 } 512 513 MHCamera *camuncal = new MHCamera(geom,"Uncalibrated",title.Data()); 514 515 for (Int_t i=0;i<GetSize();i++) 516 { 517 // 518 // Get the calibration cam from the intensity cam 519 // 520 MBadPixelsCam *cam = GetCam(i); 521 522 // 523 // Get the calibration pix from the calibration cam 524 // 525 for (Int_t j=0; j<cam->GetSize(); j++) 526 { 527 const MBadPixelsPix &pix = (*cam)[j]; 528 // 529 // Don't use bad pixels 530 // 531 if (pix.IsUncalibrated(typ)) 532 { 533 camuncal->Fill(j,1); 534 camuncal->SetUsed(j); 535 } 536 } 537 } 538 539 return camuncal; 540 } 541 542 543 544 void MBadPixelsIntensityCam::DrawUnsuitablePerAreaVsTime(const MBadPixelsPix::UnsuitableType_t typ, const Int_t aidx, const MGeomCam &geom) 545 { 546 TGraph *gr = GetUnsuitablePerAreaVsTime(typ,aidx,geom); 547 gr->SetBit(kCanDelete); 548 gr->Draw("A*"); 549 } 550 551 void MBadPixelsIntensityCam::DrawUncalibratedPerAreaVsTime(const MBadPixelsPix::UncalibratedType_t typ, const Int_t aidx, const MGeomCam &geom) 552 { 553 TGraph *gr = GetUncalibratedPerAreaVsTime(typ,aidx,geom); 554 gr->SetBit(kCanDelete); 555 gr->Draw("A*"); 556 } -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.h
r5052 r7189 11 11 #include "MBadPixelsCam.h" 12 12 #endif 13 #ifndef MARS_MGeomCamMagic 14 #include "MGeomCamMagic.h" 15 #endif 13 16 14 17 class TOrdCollection; 15 class MGeomCam; 18 class TGraph; 19 class MHCamera; 16 20 class MBadPixelsIntensityCam : public MParContainer, public MCamEvent 17 21 { … … 74 78 void DrawPixelContent( Int_t num) const; 75 79 80 TGraph *GetUncalibratedPerAreaVsTime( const MBadPixelsPix::UncalibratedType_t typ, 81 const Int_t aidx=-1, const MGeomCam &geom=MGeomCamMagic()); 82 TGraph *GetUnsuitablePerAreaVsTime( const MBadPixelsPix::UnsuitableType_t typ, 83 const Int_t aidx=-1, const MGeomCam &geom=MGeomCamMagic()); 84 85 MHCamera *GetUnsuitableSpectrum( const MBadPixelsPix::UnsuitableType_t typ, const MGeomCam &geom=MGeomCamMagic()); 86 87 MHCamera *GetUncalibratedSpectrum( const MBadPixelsPix::UncalibratedType_t typ, const MGeomCam &geom=MGeomCamMagic()); 88 89 void DrawUncalibratedPerAreaVsTime( const MBadPixelsPix::UncalibratedType_t typ, 90 const Int_t aidx=-1, const MGeomCam &geom=MGeomCamMagic()); // *MENU* 91 void DrawUnsuitablePerAreaVsTime( const MBadPixelsPix::UnsuitableType_t typ, 92 const Int_t aidx=-1, const MGeomCam &geom=MGeomCamMagic()); // *MENU* 93 94 95 76 96 ClassDef(MBadPixelsIntensityCam, 1) // Base Container Intensity BadPixels Results 77 97 }; -
trunk/MagicSoft/Mars/mbadpixels/Makefile
r4957 r7189 21 21 INCLUDES = -I. -I../mbase -I../manalysis -I../mgeom -I../mgui \ 22 22 -I../mmc -I../mpedestal -I../msignal -I../mpointing \ 23 -I../mhbase 23 -I../mhbase -I../mhist 24 24 # MBadPixelsCalc (manalysis): MPedPhotCam, MSigmabar 25 25 # MBadPixelsCalc (mgeom): MGeomCam -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
r7053 r7189 32 32 // MCalibrationIntensityChargeCam 33 33 // MCalibrationIntensityRelTimeCam 34 // MCalibrationIntensityConstCam 34 35 // MBadPixelsIntensityCam 35 36 // … … 37 38 // MCalibrationIntensityChargeCam 38 39 // MCalibrationIntensityRelTimeCam 39 // MBadPixelsIntensityCam 40 // MBadPixelsIntensityCam 41 // 42 // Class version 2: 43 // + UInt_t fNumPhesDump; // Number of cams after which the number of phes gets averaged 44 // + Float_t fMeanPhes; 45 // + Float_t fMeanPhesRelVar; 46 // + Bool_t fUpdateNumPhes; // Update the number of photo-electrons only after fNumPhesDump number of Cams 47 // + TArrayF fPhes; 48 // + TArrayF fPhesVar; 40 49 // 41 50 ////////////////////////////////////////////////////////////////////////////// … … 55 64 #include "MCalibrationIntensityQECam.h" 56 65 #include "MCalibrationIntensityRelTimeCam.h" 66 #include "MCalibrationIntensityConstCam.h" 57 67 58 68 #include "MBadPixelsIntensityCam.h" 59 69 70 #include "MCalibrationChargePix.h" 60 71 #include "MCalibrationChargeCalc.h" 61 72 #include "MCalibrationRelTimeCalc.h" … … 67 78 68 79 const UInt_t MCalibCalcFromPast::fgNumEventsDump = 500; 80 const UInt_t MCalibCalcFromPast::fgNumPhesDump = 10; 69 81 70 82 // -------------------------------------------------------------------------- … … 74 86 // Sets: 75 87 // - fNumEventsDump to fgNumEventsDump 88 // - fNumPhesDump to fgNumPhesDump 76 89 // 77 90 MCalibCalcFromPast::MCalibCalcFromPast(const char *name, const char *title) 78 91 : fGeom(NULL), fParList(NULL), fRunHeader(NULL), 79 fIntensCharge(NULL), fIntensBlind(NULL), fIntensQE(NULL),80 fIntensRelTime(NULL), fIntensBad(NULL), fChargeCalc(NULL),81 fRelTimeCalc(NULL), fCalibrate(NULL), fNumEvents(0), fNumCam(0),82 fUpdateWithFFactorMethod(kFALSE)92 fIntensCharge(NULL), fIntensBlind(NULL), fIntensRelTime(NULL), fIntensConst(NULL), 93 fIntensBad(NULL), 94 fChargeCalc(NULL), fRelTimeCalc(NULL), fCalibrate(NULL), 95 fNumCam(0), fNumEvents(0), fUpdateWithFFactorMethod(kTRUE), fUpdateNumPhes(kTRUE) 83 96 { 84 97 … … 87 100 88 101 SetNumEventsDump(); 102 SetNumPhesDump (); 89 103 } 90 104 … … 150 164 fIntensCharge = (MCalibrationIntensityChargeCam*)pList->FindCreateObj("MCalibrationIntensityChargeCam"); 151 165 fIntensQE = (MCalibrationIntensityQECam*) pList->FindCreateObj("MCalibrationIntensityQECam"); 166 fIntensConst = (MCalibrationIntensityConstCam*) pList->FindCreateObj("MCalibrationIntensityConstCam"); 167 168 MCalibrationChargeCam *chargeinit = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam"); 169 MCalibrationQECam *qeinit = (MCalibrationQECam*) pList->FindObject("MCalibrationQECam"); 170 171 if (chargeinit) 172 fIntensCharge->SetCam(chargeinit,0); 173 else 174 *fLog << "Could not find initial MCalibrationChargeCam, cannot initialize intensity cam" << endl; 175 176 if (qeinit) 177 fIntensQE->SetCam(qeinit,0); 178 else 179 *fLog << "Could not find initial MCalibrationQECam, cannot initialize intensity cam" << endl; 180 181 fIntensConst->GetCam()->Init(*fGeom); 152 182 153 183 if (!fChargeCalc) … … 212 242 fNumCam = 0; 213 243 fNumEvents = 0; 244 fNumPhes = 0; 245 246 fChargeCalc->SetUseExternalNumPhes(kFALSE); 247 248 if (fUpdateNumPhes) 249 { 250 fPhes.Set(fNumPhesDump); 251 fPhesVar.Set(fNumPhesDump); 252 } 214 253 215 254 return kTRUE; … … 231 270 232 271 fNumEvents = 0; 272 ReInitialize(); 273 233 274 // 234 275 // Finalize Possible calibration histogram classes... … … 246 287 *fLog << inf << "Finalize calibration calculations..." << endl; 247 288 if (fChargeCalc) 248 fChargeCalc->Finalize(); 289 { 290 fChargeCalc->Finalize(); 291 if (fUpdateNumPhes) 292 { 293 MCalibrationChargePix &avpix =(MCalibrationChargePix&)fIntensCharge->GetCam()->GetAverageArea(0); 294 fPhes [fNumPhes] = avpix.GetPheFFactorMethod(); 295 fPhesVar[fNumPhes] = avpix.GetPheFFactorMethodVar(); 296 297 fNumPhes++; 298 299 if (fNumPhes == fNumPhesDump) 300 { 301 fNumPhes = 0; 302 if (!UpdateMeanPhes()) 303 { 304 *fLog << warn << "Could not update mean number of photo-electrons. " 305 << "Skip it until next update" << endl; 306 fChargeCalc->SetUseExternalNumPhes(kFALSE); 307 } 308 else 309 { 310 *fLog << inf << "New averaged number photo-electrons: " << fMeanPhes << endl; 311 fChargeCalc->SetExternalNumPhes ( fMeanPhes ); 312 fChargeCalc->SetExternalNumPhesRelVar( fMeanPhesRelVar ); 313 fChargeCalc->SetUseExternalNumPhes(); 314 } 315 } 316 } 317 } 318 249 319 if (fRelTimeCalc) 250 320 fRelTimeCalc->Finalize(); 321 251 322 if (fCalibrate) 252 fCalibrate->UpdateConversionFactors(fUpdateWithFFactorMethod ? NULL : 253 (MCalibrationChargeCam*)fIntensCharge->GetCam()); 254 255 ReInitialize(); 323 fCalibrate->UpdateConversionFactors(fUpdateWithFFactorMethod ? NULL 324 : (MCalibrationChargeCam*)fIntensCharge->GetCam() ); 325 256 326 return kTRUE; 257 327 } … … 289 359 fNumCam++; 290 360 291 *fLog << inf << "MCalibCalcFromPast::ReInitialize #" << fNumCam << " ";361 *fLog << inf << "MCalibCalcFromPast::ReInitialize #" << fNumCam << ": "; 292 362 293 363 const Int_t runnumber = fRunHeader->GetRunNumber(); … … 331 401 } 332 402 403 404 Bool_t MCalibCalcFromPast::UpdateMeanPhes() 405 { 406 Float_t sumw = 0.; 407 Float_t sum = 0.; 408 409 for (Int_t i=0; i<fPhes.GetSize(); i++) 410 { 411 const Float_t weight = 1./fPhesVar[i]; 412 sum += fPhes[i]*weight; 413 sumw += weight; 414 } 415 416 if (sumw < 0.000001) 417 return kFALSE; 418 419 if (sum < 0.000001) 420 return kFALSE; 421 422 fMeanPhes = sum/sumw; 423 fMeanPhesRelVar = sumw/sum/sum; 424 425 return kTRUE; 426 } 427 333 428 // -------------------------------------------------------------------------- 334 429 // … … 336 431 // MCalibCalcFromPast.UpdateWithFFactorMethod: Off, On 337 432 // MCalibCalcFromPast.NumEventsDump: 500 433 // MCalibCalcFromPast.UpdateNumPhes: yes/no 434 // MCalibCalcFromPast.NumPhesDump: 10 338 435 // 339 436 Int_t MCalibCalcFromPast::ReadEnv(const TEnv &env, TString prefix, Bool_t print) … … 352 449 } 353 450 451 if (IsEnvDefined(env, prefix, "UpdateNumPhes", print)) 452 { 453 TString s = GetEnvValue(env, prefix, "UpdateNumPhes", ""); 454 s.ToLower(); 455 if (s.BeginsWith("no")) 456 SetUpdateNumPhes(kFALSE); 457 if (s.BeginsWith("yes")) 458 SetUpdateNumPhes(kTRUE); 459 rc = kTRUE; 460 } 461 462 if (IsEnvDefined(env, prefix, "NumPhesDump", print)) 463 { 464 SetNumPhesDump(GetEnvValue(env, prefix, "NumPhesDump", (Int_t)fNumPhesDump)); 465 rc = kTRUE; 466 } 467 468 469 354 470 return rc; 355 471 } -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.h
r7005 r7189 4 4 #ifndef MARS_MTask 5 5 #include "MTask.h" 6 #endif 7 8 #ifndef ROOT_TArrayF 9 #include <TArrayF.h> 6 10 #endif 7 11 … … 17 21 class MCalibrationIntensityQECam; 18 22 class MCalibrationIntensityRelTimeCam; 23 class MCalibrationIntensityConstCam; 19 24 class MBadPixelsIntensityCam; 20 25 … … 22 27 { 23 28 private: 24 25 29 static const UInt_t fgNumEventsDump; //! Default for fNumEventsDump 30 static const UInt_t fgNumPhesDump; //! Default for fNumPhesDump 26 31 27 32 MGeomCam *fGeom; //! Camera Geometry … … 32 37 MCalibrationIntensityQECam *fIntensQE; //! Intensity QE Cam (to be created) 33 38 MCalibrationIntensityRelTimeCam *fIntensRelTime; //! Intensity Rel. Time Cam (to be created) 39 MCalibrationIntensityConstCam *fIntensConst; //! Intensity Rel. Time Cam (to be created) 34 40 MBadPixelsIntensityCam *fIntensBad; //! Intensity Bad Pixels Cam (to be created) 35 41 … … 38 44 MCalibrateData *fCalibrate; //! Data Calibration Task 39 45 46 UInt_t fNumCam; //! Number of currently used Calibration Cam 40 47 UInt_t fNumEventsDump; // Number of event after which the MCalibrationCams gets updated 41 48 UInt_t fNumEvents; //! Event counter only for calibration events 42 UInt_t fNumCam; //! Number of currently used Calibration Cam 49 UInt_t fNumPhesDump; // Number of cams after which the number of phes gets averaged 50 UInt_t fNumPhes; //! Event counter for photo-electron updates 51 52 Float_t fMeanPhes; 53 Float_t fMeanPhesRelVar; 43 54 44 55 Bool_t fUpdateWithFFactorMethod; // Update the interlaced calib events with the full F-Factor method 56 Bool_t fUpdateNumPhes; // Update the number of photo-electrons only after fNumPhesDump number of Cams 45 57 58 TArrayF fPhes; 59 TArrayF fPhesVar; 60 61 // MTask 46 62 Int_t PreProcess(MParList *pList); 47 63 Int_t Process(); 48 64 Int_t PostProcess(); 49 65 66 // MCalibCalcFromPast 50 67 Bool_t ReInitialize(); 51 68 Bool_t Finalize(const char* name); 52 69 70 Bool_t UpdateMeanPhes(); 71 72 // MParContainer 53 73 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 54 74 55 75 public: 76 MCalibCalcFromPast(const char *name=NULL, const char *title=NULL); 56 77 57 MCalibCalcFromPast(const char *name=NULL, const char *title=NULL); 58 ~MCalibCalcFromPast() {} 59 78 // Getter 60 79 UInt_t GetNumEventsDump() const { return fNumEventsDump; } 61 80 81 // Setter 62 82 void SetNumEventsDump( const UInt_t i=fgNumEventsDump ) { fNumEventsDump = i; } 83 void SetNumPhesDump ( const UInt_t i=fgNumPhesDump ) { fNumPhesDump = i; } 63 84 64 85 void SetCalibrate ( MCalibrateData *c ) { fCalibrate = c; } 65 86 void SetChargeCalc ( MCalibrationChargeCalc *c ) { fChargeCalc = c; } 66 87 void SetRelTimeCalc ( MCalibrationRelTimeCalc *c ) { fRelTimeCalc = c; } 88 void SetUpdateNumPhes ( const Bool_t b=kTRUE ) { fUpdateNumPhes = b; } 67 89 68 90 void SetUpdateWithFFactorMethod(const Bool_t b=kTRUE){ fUpdateWithFFactorMethod = b; } 69 91 70 ClassDef(MCalibCalcFromPast, 1) // Task to steer the processing of interlace calibration events92 ClassDef(MCalibCalcFromPast, 2) // Task to steer the processing of interlace calibration events 71 93 }; 72 94 -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r7122 r7189 92 92 // 93 93 // See also: MJCalibration, MJPedestal, MJExtractSignal, MJExtractCalibTest 94 // 94 // 95 95 ////////////////////////////////////////////////////////////////////////////// 96 96 #include "MCalibrateData.h" … … 112 112 #include "MPedestalPix.h" 113 113 114 #include "MCalibrationIntensityChargeCam.h" 114 115 #include "MCalibrationChargeCam.h" 115 116 #include "MCalibrationChargePix.h" 116 117 118 #include "MCalibrationIntensityQECam.h" 117 119 #include "MCalibrationQECam.h" 118 120 #include "MCalibrationQEPix.h" 119 121 122 #include "MCalibrationIntensityConstCam.h" 120 123 #include "MCalibConstCam.h" 121 124 #include "MCalibConstPix.h" … … 152 155 // 153 156 MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title) 154 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), 155 fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), fCalibConstCam(NULL), 156 fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.), fScaleFactor(1.) 157 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), fIntensCalib(NULL), 158 fQEs(NULL), fIntensQE(NULL), fSignals(NULL), fCerPhotEvt(NULL), fCalibConstCam(NULL), 159 fIntensConst(NULL), fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.), 160 fScaleFactor(1.) 157 161 { 158 162 … … 226 230 return kFALSE; 227 231 228 fCalibConstCam = (MCalibConstCam*)pList->FindCreateObj(AddSerialNumber("MCalibConstCam")); 229 if (!fCalibConstCam) 230 return kFALSE; 232 fIntensConst = (MCalibrationIntensityConstCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityConstCam")); 233 if (fIntensConst) 234 *fLog << inf << "Found MCalibrationIntensityConstCam ... " << endl; 235 else 236 { 237 fCalibConstCam = (MCalibConstCam*)pList->FindCreateObj(AddSerialNumber("MCalibConstCam")); 238 if (!fCalibConstCam) 239 return kFALSE; 240 } 231 241 } 232 242 … … 235 245 if (fCalibrationMode>kNone) 236 246 { 247 fIntensCalib = (MCalibrationIntensityChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityChargeCam")); 248 if (fIntensCalib) 249 *fLog << inf << "Found MCalibrationIntensityChargeCam ... " << endl; 250 237 251 fCalibrations = (MCalibrationChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); 238 252 if (!fCalibrations) … … 241 255 return kFALSE; 242 256 } 257 258 fIntensQE = (MCalibrationIntensityQECam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityQECam")); 259 if (fIntensQE) 260 *fLog << inf << "Found MCalibrationIntensityQECam ... " << endl; 243 261 244 262 fQEs = (MCalibrationQECam*)pList->FindObject(AddSerialNumber("MCalibrationQECam")); … … 290 308 { 291 309 case kPhe: 292 fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE; 293 break; 310 // 311 // Average QE for C-photons, for pixels in the inner pixel region ("area 0"), 312 // used later to convert from C-photons into "equivalent phes": 313 // 314 if (fQEs->GetAverageAreas() > 0) 315 { 316 MCalibrationQEPix& avqepix = (MCalibrationQEPix&)(fQEs->GetAverageArea(0)); 317 fRenormFactor = avqepix.GetAverageQE(); 318 } 319 else // Average areas not yet initialized, use default value 320 fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE; 321 322 fRenormFactor = MCalibrationQEPix::gkDefaultAverageQE; 323 break; 294 324 case kPhot: 295 fRenormFactor = 1.;296 break;325 fRenormFactor = 1.; 326 break; 297 327 } 298 328 … … 346 376 } 347 377 348 if(fCalibrationMode == kBlindPixel && !fQEs->IsBlindPixelMethodValid()) 378 const MCalibrationQECam *qecam = fIntensQE ? (MCalibrationQECam*)fIntensQE->GetCam() : fQEs; 379 if(fCalibrationMode == kBlindPixel && !qecam->IsBlindPixelMethodValid()) 349 380 { 350 381 *fLog << warn << "Blind pixel calibration method not valid, switching to F-factor method" << endl; … … 352 383 } 353 384 354 if(fCalibrationMode == kPinDiode && ! fQEs->IsPINDiodeMethodValid())385 if(fCalibrationMode == kPinDiode && !qecam->IsPINDiodeMethodValid()) 355 386 { 356 387 *fLog << warn << "PIN diode calibration method not valid, switching to F-factor method" << endl; … … 358 389 } 359 390 360 if(fCalibrationMode == kCombined && ! fQEs->IsCombinedMethodValid())391 if(fCalibrationMode == kCombined && !qecam->IsCombinedMethodValid()) 361 392 { 362 393 *fLog << warn << "Combined calibration method not valid, switching to F-factor method" << endl; … … 419 450 420 451 if (fCalibrationMode > kNone) 421 { 422 423 if (fCalibrations->GetSize() != npixels) 424 { 452 { 453 454 const MCalibrationCam *chargecam = fIntensCalib ? fIntensCalib->GetCam() : fCalibrations; 455 if (chargecam->GetSize() != npixels) 456 { 425 457 *fLog << "Size mismatch between MGeomCam and MCalibrationChargeCam... abort!" << endl; 426 458 return kFALSE; 427 428 459 } 460 429 461 if (fBadPixels->GetSize() != npixels) 430 462 { 431 463 *fLog << "Size mismatch between MGeomCam and MBadPixelsCam... abort!" << endl; 432 464 return kFALSE; 433 465 } 434 466 } 435 467 … … 466 498 fHiLoConv.Reset(); 467 499 fHiLoConvErr.Reset(); 468 500 501 MCalibConstCam *constcam = fIntensConst ? fIntensConst->GetCam() : fCalibConstCam; 502 503 MCalibrationChargeCam *chargecam = NULL; 504 MCalibrationQECam *qecam = NULL; 505 if (updatecam) 506 { 507 chargecam = fCalibrations; 508 qecam = fQEs; 509 } 510 else 511 { 512 chargecam = fIntensCalib ? (MCalibrationChargeCam*)fIntensCalib->GetCam() : fCalibrations; 513 qecam = fIntensQE ? (MCalibrationQECam*) fIntensQE->GetCam() : fQEs; 514 } 515 469 516 // 470 517 // For the moment, we use only a dummy zenith for the calibration: … … 488 535 Float_t calibUpdate = 1.; 489 536 490 MCalibConstPix &cpix = (* fCalibConstCam)[pixidx];537 MCalibConstPix &cpix = (*constcam)[pixidx]; 491 538 492 539 if(fCalibrationMode!=kNone) … … 499 546 } 500 547 501 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx];502 MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCalibrations->GetAverageArea(0);503 504 hiloconv = pix.GetConversionHiLo ();505 hiloconverr= pix.GetConversionHiLo Err();548 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[pixidx]; 549 const MCalibrationChargePix &avpix = (MCalibrationChargePix&)chargecam->GetAverageArea(0); 550 551 hiloconv = pix.GetConversionHiLo (); 552 hiloconverr= pix.GetConversionHiLoSigma(); 506 553 507 554 calibConv = pix.GetMeanConvFADC2Phe(); … … 509 556 calibFFactor = pix.GetMeanFFactorFADC2Phot(); 510 557 511 MCalibrationQEPix &qe = (MCalibrationQEPix&) (*fQEs)[pixidx];558 const MCalibrationQEPix &qe = (MCalibrationQEPix&)(*qecam)[pixidx]; 512 559 513 560 if (updatecam) … … 613 660 calibConv /= calibQE; 614 661 615 if (calibConv != 0. && calibQE != 0.)662 if (calibConv > 0.00001 && calibQE > 0.00001) 616 663 { 617 664 calibConvVar = calibConvVar/(calibConv*calibConv) + calibQEVar/(calibQE*calibQE); … … 632 679 calibConv = -1.; 633 680 calibFFactor = -1.; 681 *fLog << warn << "Conversion factor of Pixel " << pixidx << " out of range " << endl; 634 682 } 635 683 cpix.SetCalibConst(calibConv); -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
r7122 r7189 13 13 class MBadPixelsCam; 14 14 class MPedestalCam; 15 class MCalibrationChargeCam;16 class MCalibrationQECam;17 class MExtractedSignalCam;18 19 15 class MPedPhotCam; 20 16 class MSignalCam; 21 17 class MCalibConstCam; 18 class MExtractedSignalCam; 19 20 class MCalibrationChargeCam; 21 class MCalibrationQECam; 22 23 class MCalibrationIntensityChargeCam; 24 class MCalibrationIntensityQECam; 25 class MCalibrationIntensityConstCam; 22 26 23 27 class MCalibrateData : public MTask … … 58 62 Float_t fCalibConvMaxLimit; // Maximum limit for conv. factor 59 63 60 MGeomCam *fGeomCam; //! Camera geometry container 61 MBadPixelsCam *fBadPixels; //! Bad Pixels information 62 MCalibrationChargeCam *fCalibrations; //! Calibration constants 63 MCalibrationQECam *fQEs; //! Quantum efficiencies 64 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts 65 MSignalCam *fCerPhotEvt; //! Cerenkov Photon Event used for calculation 66 MCalibConstCam *fCalibConstCam; //! Temporary calib consts storage 64 MGeomCam *fGeomCam; //! Camera geometry container 65 MBadPixelsCam *fBadPixels; //! Bad Pixels information 66 MCalibrationChargeCam *fCalibrations; //! Calibration constants 67 MCalibrationIntensityChargeCam *fIntensCalib; //! Calibration constants from interlaced calib. 68 MCalibrationQECam *fQEs; //! Quantum efficiencies 69 MCalibrationIntensityQECam *fIntensQE; //! Quantum efficiencies from interlaced calib. 70 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts 71 MSignalCam *fCerPhotEvt; //! Cerenkov Photon Event used for calculation 72 MCalibConstCam *fCalibConstCam; //! Temporary calib consts storage 73 MCalibrationIntensityConstCam *fIntensConst; //! Temporary calib consts storage 67 74 68 75 CalibrationMode_t fCalibrationMode; // Flag defining the calibration mode (CalibrationMode_t) -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r7126 r7189 184 184 // + Float_t fPheErrUpperLimit; // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas) 185 185 // 186 // 186 187 // ClassVersion 3: 187 188 // + Bool_t fUseExtractorRes; // Include extractor resolution in F-Factor method 189 // 190 // ClassVersion 3: 191 // + Float_t fUnsuitablesLimit; // Limit for relative number of unsuitable pixels 192 // + Float_t fUnreliablesLimit; // Limit for relative number of unreliable pixels 193 // + Float_t fExternalNumPhes; // External mean number of photo-electrons set from outside 194 // + Float_t fExternalNumPhesRelVar; // External rel. var. number of photo-electrons set from outside 188 195 // 189 196 ////////////////////////////////////////////////////////////////////////////// … … 198 205 199 206 #include "MParList.h" 200 201 #include "MStatusDisplay.h"202 207 203 208 #include "MCalibrationPattern.h" … … 247 252 const Float_t MCalibrationChargeCalc::fgFFactorErrLimit = 4.5; 248 253 const Float_t MCalibrationChargeCalc::fgArrTimeRmsLimit = 3.5; 254 const Float_t MCalibrationChargeCalc::fgUnsuitablesLimit = 0.1; 255 const Float_t MCalibrationChargeCalc::fgUnreliablesLimit = 0.3; 249 256 const TString MCalibrationChargeCalc::fgNamePedestalCam = "MPedestalCam"; 250 257 … … 263 270 // 264 271 // Initializes: 265 // - fArrTimeRmsLimit to fgArrTimeRmsLimit 266 // - fChargeLimit to fgChargeLimit 267 // - fChargeErrLimit to fgChargeErrLimit 268 // - fChargeRelErrLimit to fgChargeRelErrLimit 269 // - fFFactorErrLimit to fgFFactorErrLimit 270 // - fLambdaCheckLimit to fgLambdaCheckLimit 271 // - fLambdaErrLimit to fgLambdaErrLimit 272 // - fNamePedestalCam to fgNamePedestalCam 273 // - fPheErrLowerLimit to fgPheErrLowerLimit 274 // - fPheErrUpperLimit to fgPheErrUpperLimit 275 // - fPulserColor to MCalibrationCam::kCT1 276 // - fOutputPath to "." 277 // - fOutputFile to "ChargeCalibStat.txt" 278 // - flag debug to kFALSE 272 // - fArrTimeRmsLimit to fgArrTimeRmsLimit 273 // - fChargeLimit to fgChargeLimit 274 // - fChargeErrLimit to fgChargeErrLimit 275 // - fChargeRelErrLimit to fgChargeRelErrLimit 276 // - fFFactorErrLimit to fgFFactorErrLimit 277 // - fLambdaCheckLimit to fgLambdaCheckLimit 278 // - fLambdaErrLimit to fgLambdaErrLimit 279 // - fNamePedestalCam to fgNamePedestalCam 280 // - fPheErrLowerLimit to fgPheErrLowerLimit 281 // - fPheErrUpperLimit to fgPheErrUpperLimit 282 // - fPulserColor to MCalibrationCam::kCT1 283 // - fOutputPath to "." 284 // - fOutputFile to "ChargeCalibStat.txt" 285 // - flag debug to kFALSE 286 // - IsUseExtractorRes to kFALSE 287 // - IsUseExternalNumPhes to kFALSE 288 // - fExternalNumPhes to 0. 289 // - fExternalNumPhesRelVar to 0. 279 290 // 280 291 // Sets all checks … … 284 295 // 285 296 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 286 : fUseExtractorRes(kFALSE), 287 fGeom(NULL), fSignal(NULL), fCalibPattern(NULL), fExtractor(NULL) 297 : fGeom(NULL), fSignal(NULL), fCalibPattern(NULL), fExtractor(NULL) 288 298 { 289 299 … … 309 319 SetPheErrLowerLimit (); 310 320 SetPheErrUpperLimit (); 321 SetUnsuitablesLimit (); 322 SetUnreliablesLimit (); 323 SetUseExtractorRes (); 324 SetUseUnreliables (); 325 SetUseExternalNumPhes(kFALSE); 326 327 SetExternalNumPhes (); 328 SetExternalNumPhesRelVar(); 311 329 312 330 SetCheckArrivalTimes (); … … 560 578 } 561 579 580 fResultFlags.Set(fGeom->GetNumAreas()); 581 562 582 return kTRUE; 563 583 } … … 777 797 { 778 798 779 const MPedestalPix 799 const MPedestalPix &ped = fPedestals->GetAverageArea(aidx); 780 800 MCalibrationChargePix &pix = (MCalibrationChargePix&)chargecam->GetAverageArea(aidx); 801 const MArrayI &arr = fHCam->GetAverageAreaNum(); 781 802 782 803 FinalizePedestals(ped,pix,aidx); 804 805 // 806 // Correct for sqrt(number of valid pixels) in the pedestal RMS 807 // (already done for calibration sigma in MHCalibrationCam::CalcAverageSigma() 808 // 809 pix.SetPedRMS(pix.GetPedRms()*TMath::Sqrt((Float_t)arr[aidx]), 810 pix.GetPedRmsErr()*TMath::Sqrt((Float_t)arr[aidx])); 811 pix.SetSigma (pix.GetSigma()/pix.GetFFactorFADC2Phe()); 812 783 813 FinalizeCharges(pix, chargecam->GetAverageBadArea(aidx),"area id"); 784 814 FinalizeArrivalTimes(pix, chargecam->GetAverageBadArea(aidx), "area id"); … … 847 877 } 848 878 849 //850 // Finalize calibration statistics851 //852 FinalizeUnsuitablePixels();853 854 chargecam->SetReadyToSave();855 qecam ->SetReadyToSave();856 badcam ->SetReadyToSave();857 858 if (blindcam)859 blindcam->SetReadyToSave();860 if (fPINDiode)861 fPINDiode->SetReadyToSave();862 863 879 *fLog << inf << endl; 864 880 *fLog << GetDescriptor() << ": Fatal errors statistics:" << endl; … … 884 900 PrintUncalibrated(MBadPixelsPix::kDeviatingNumPhes, 885 901 "Deviating number of phes: "); 902 PrintUncalibrated(MBadPixelsPix::kLoGainBlackout, 903 "Too many blackout events in low gain: "); 886 904 PrintUncalibrated(MBadPixelsPix::kPreviouslyExcluded, 887 905 "Previously excluded: "); … … 906 924 SetLogStream(oldlog); 907 925 908 return kTRUE; 926 chargecam->SetReadyToSave(); 927 qecam ->SetReadyToSave(); 928 badcam ->SetReadyToSave(); 929 930 if (blindcam) 931 blindcam->SetReadyToSave(); 932 if (fPINDiode) 933 fPINDiode->SetReadyToSave(); 934 935 // 936 // Finalize calibration statistics 937 // 938 return FinalizeUnsuitablePixels(); 909 939 } 910 940 … … 1042 1072 } 1043 1073 1044 if (! fUseExtractorRes)1074 if (!IsUseExtractorRes()) 1045 1075 return kTRUE; 1046 1076 … … 1059 1089 : resinphes/cal.GetMeanConvFADC2Phe(); 1060 1090 1061 if (resinfadc > 1.5*cal.GetPedRms() ) 1062 { 1063 *fLog << warn << " Extractor Resolution: " << resinfadc << " bigger than Pedestal RMS " << cal.GetPedRms() << endl; 1064 resinfadc = cal.GetPedRms(); 1091 if (resinfadc > 3.0*cal.GetPedRms() ) 1092 { 1093 *fLog << warn << " Extractor Resolution: " << resinfadc << " bigger than 3 Pedestal RMS " 1094 << cal.GetPedRms() << endl; 1095 resinfadc = 3.0*cal.GetPedRms(); 1065 1096 } 1066 1097 … … 1152 1183 if (bad.IsUncalibrated( MBadPixelsPix::kChargeIsPedestal)) 1153 1184 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1154 1155 if (bad.IsUncalibrated( MBadPixelsPix::kChargeErrNotValid ))1156 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun );1157 1158 if (bad.IsUncalibrated( MBadPixelsPix::kChargeRelErrNotValid ))1159 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun );1160 1185 } 1161 1186 … … 1268 1293 if (bad.IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid)) 1269 1294 continue; 1270 1295 1296 if (!IsUseUnreliables()) 1297 if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 1298 continue; 1299 1271 1300 const Float_t nphe = pix.GetPheFFactorMethod(); 1272 1301 const Int_t aidx = (*fGeom)[i].GetAidx(); … … 1322 1351 if (ndf < 5) 1323 1352 { 1324 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the number of photo-electrons " 1325 << "in the camera with area index: " << i << endl; 1326 *fLog << warn << GetDescriptor() << ": Number of dof.: " << ndf << " is smaller than 5 " << endl; 1327 *fLog << warn << GetDescriptor() << ": Will use the simple mean and rms " << endl; 1328 delete hist; 1329 continue; 1353 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the number of photo-electrons " << endl; 1354 *fLog << " in the camera with area index: " << i << endl; 1355 *fLog << " Number of dof.: " << ndf << " is smaller than 5 " << endl; 1356 *fLog << " Will use the simple mean and rms " << endl; 1357 delete hist; 1358 SetPheFitOK(i,kFALSE); 1359 continue; 1330 1360 } 1331 1361 … … 1334 1364 if (prob < 0.001) 1335 1365 { 1336 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the number of photo-electrons "1337 << "in the camera with area index: " << i << endl;1338 *fLog << warn << GetDescriptor() << ": Fit probability " << prob1339 << " is smaller than 0.001" << endl;1340 *fLog << warn << GetDescriptor() << ": Will use the simple mean and rms " << endl;1341 delete hist;1342 continue;1366 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the number of photo-electrons " << endl; 1367 *fLog << " in the camera with area index: " << i << endl; 1368 *fLog << " Fit probability " << prob << " is smaller than 0.001 " << endl; 1369 *fLog << " Will use the simple mean and rms " << endl; 1370 delete hist; 1371 SetPheFitOK(i,kFALSE); 1372 continue; 1343 1373 } 1344 1374 1345 1375 if (mean < 0.) 1346 1376 { 1347 *fLog << inf << GetDescriptor() << ": Fitted mean number of photo-electrons " 1348 << "with area idx " << i << ": " << mean << " is smaller than 0. " << endl; 1349 *fLog << warn << GetDescriptor() << ": Will use the simple mean and rms " << endl; 1350 delete hist; 1351 continue; 1377 *fLog << inf << GetDescriptor() << ": Fitted mean number of photo-electrons " << endl; 1378 *fLog << " with area idx " << i << ": " << mean << " is smaller than 0. " << endl; 1379 *fLog << warn << " Will use the simple mean and rms " << endl; 1380 SetPheFitOK(i,kFALSE); 1381 delete hist; 1382 continue; 1352 1383 } 1353 1384 … … 1359 1390 1360 1391 delete hist; 1392 1393 SetPheFitOK(i,kTRUE); 1361 1394 } 1362 1395 … … 1383 1416 if (bad.IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid)) 1384 1417 continue; 1418 1419 if (!IsUseUnreliables()) 1420 if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 1421 continue; 1385 1422 1386 1423 const Float_t nvar = pix.GetPheFFactorMethodVar(); … … 1730 1767 MCalibrationQEPix &qepix = (MCalibrationQEPix&) qecam->GetAverageArea(0); 1731 1768 1732 const Float_t avphotons = avpix.GetPheFFactorMethod() 1769 if (IsDebug()) 1770 *fLog << dbginf << "External Phes: " << fExternalNumPhes 1771 << " Internal Phes: " << avpix.GetPheFFactorMethod() << endl; 1772 1773 const Float_t avphotons = ( IsUseExternalNumPhes() 1774 ? fExternalNumPhes 1775 : avpix.GetPheFFactorMethod() ) 1733 1776 / qepix.GetDefaultQE(fPulserColor) 1734 1777 / qepix.GetPMTCollectionEff() … … 1736 1779 / qecam->GetPlexiglassQE(); 1737 1780 1738 const Float_t avphotrelvar = avpix.GetPheFFactorMethodRelVar() 1781 const Float_t avphotrelvar = ( IsUseExternalNumPhes() 1782 ? fExternalNumPhesRelVar 1783 : avpix.GetPheFFactorMethodRelVar() ) 1739 1784 + qepix.GetDefaultQERelVar(fPulserColor) / fNumInnerFFactorMethodUsed 1740 1785 + qepix.GetPMTCollectionEffRelVar() … … 1846 1891 if (ndf < 2) 1847 1892 { 1848 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the F-Factor " 1849 << "in the camera with area index: " << i << endl;1850 *fLog << " Number of dof.: " << ndf << " is smaller than 2 " << endl;1851 *fLog << " Will use the simple mean and rms." << endl;1893 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the F-Factor " << endl; 1894 *fLog << " in the camera with area index: " << i << endl; 1895 *fLog << " Number of dof.: " << ndf << " is smaller than 2 " << endl; 1896 *fLog << " Will use the simple mean and rms." << endl; 1852 1897 delete hist; 1898 SetFFactorFitOK(i,kFALSE); 1853 1899 continue; 1854 1900 } … … 1858 1904 if (prob < 0.001) 1859 1905 { 1860 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the F-Factor " 1861 << "in the camera with area index: " << i << endl; 1862 *fLog << "Fit probability " << prob 1863 << " is smaller than 0.001 " << endl; 1864 *fLog << "Will use the simple mean and rms." << endl; 1906 *fLog << warn << GetDescriptor() << ": Cannot use a Gauss fit to the F-Factor " << endl; 1907 *fLog << " in the camera with area index: " << i << endl; 1908 *fLog << " Fit probability " << prob << " is smaller than 0.001 " << endl; 1909 *fLog << " Will use the simple mean and rms." << endl; 1865 1910 delete hist; 1866 continue; 1911 SetFFactorFitOK(i,kFALSE); 1912 continue; 1867 1913 } 1868 1914 1869 1915 *fLog << inf << GetDescriptor() << ": Mean F-Factor " 1870 << "with area index #" << i << ": " 1871 << Form("%4.2f+-%4.2f",mean,sigma) << endl; 1916 << "with area index #" << i << ": " << Form("%4.2f+-%4.2f",mean,sigma) << endl; 1872 1917 1873 1918 lowlim [i] = 1.; … … 1875 1920 1876 1921 delete hist; 1922 1923 SetFFactorFitOK(i,kTRUE); 1877 1924 } 1878 1925 … … 2134 2181 // - store numbers of bad pixels of each type in fCam or fIntensCam 2135 2182 // 2136 voidMCalibrationChargeCalc::FinalizeUnsuitablePixels()2183 Bool_t MCalibrationChargeCalc::FinalizeUnsuitablePixels() 2137 2184 { 2138 2185 … … 2143 2190 const Int_t nareas = fGeom->GetNumAreas(); 2144 2191 2192 TArrayI suit(nareas); 2193 TArrayI unsuit(nareas); 2194 TArrayI unrel(nareas); 2195 2196 const MBadPixelsCam *badcam = fIntensBad ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels; 2197 MCalibrationChargeCam *chargecam = fIntensCam ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam; 2198 2199 Int_t unsuitcnt=0; 2200 Int_t unrelcnt =0; 2201 2202 // Count number of succesfully calibrated pixels 2203 for (Int_t aidx=0; aidx<nareas; aidx++) 2204 { 2205 suit[aidx] = badcam->GetNumSuitable(MBadPixelsPix::kUnsuitableRun, fGeom, aidx); 2206 unsuit[aidx] = badcam->GetNumUnsuitable(MBadPixelsPix::kUnsuitableRun, fGeom, aidx); 2207 unrel[aidx] = badcam->GetNumUnsuitable(MBadPixelsPix::kUnreliableRun, fGeom, aidx); 2208 2209 unsuitcnt += unsuit[aidx]; 2210 unrelcnt += unrel[aidx]; 2211 2212 chargecam->SetNumUnsuitable(unsuit[aidx], aidx); 2213 chargecam->SetNumUnreliable(unrel[aidx], aidx); 2214 } 2215 2145 2216 TArrayI counts(nareas); 2146 2147 MBadPixelsCam *badcam = fIntensBad 2148 ? (MBadPixelsCam*)fIntensBad->GetCam() : fBadPixels; 2149 MCalibrationChargeCam *chargecam = fIntensCam 2150 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam; 2151 2152 for (Int_t i=0; i<badcam->GetSize(); i++) 2153 { 2154 MBadPixelsPix &bad = (*badcam)[i]; 2155 if (!bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 2156 { 2217 for (Int_t i=0; i<chargecam->GetSize(); i++) 2218 { 2219 MCalibrationPix &pix = (*chargecam)[i]; 2220 if (pix.IsHiGainSaturation()) 2221 { 2157 2222 const Int_t aidx = (*fGeom)[i].GetAidx(); 2158 2223 counts[aidx]++; 2159 2160 2224 } 2225 } 2161 2226 2162 2227 if (fGeom->InheritsFrom("MGeomCamMagic")) 2163 *fLog << " " << setw(7) << "Successfully calibrated Pixels: " 2164 << Form("%s%3i%s%3i","Inner: ",counts[0]," Outer: ",counts[1]) << endl; 2165 2166 counts.Reset(); 2167 2168 for (Int_t i=0; i<badcam->GetSize(); i++) 2169 { 2170 MBadPixelsPix &bad = (*badcam)[i]; 2171 2172 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 2173 { 2174 const Int_t aidx = (*fGeom)[i].GetAidx(); 2175 counts[aidx]++; 2176 } 2177 } 2178 2179 for (Int_t aidx=0; aidx<nareas; aidx++) 2180 chargecam->SetNumUnsuitable(counts[aidx], aidx); 2181 2182 if (fGeom->InheritsFrom("MGeomCamMagic")) 2183 *fLog << " " << setw(7) << "Uncalibrated Pixels: " 2184 << Form("%s%3i%s%3i","Inner: ",counts[0]," Outer: ",counts[1]) << endl; 2185 2186 counts.Reset(); 2187 2188 for (Int_t i=0; i<badcam->GetSize(); i++) 2189 { 2190 2191 MBadPixelsPix &bad = (*badcam)[i]; 2192 2193 if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 2194 { 2195 const Int_t aidx = (*fGeom)[i].GetAidx(); 2196 counts[aidx]++; 2197 } 2198 } 2199 2200 for (Int_t aidx=0; aidx<nareas; aidx++) 2201 chargecam->SetNumUnreliable(counts[aidx], aidx); 2202 2203 *fLog << " " << setw(7) << "Unreliable Pixels: " 2204 << Form("%s%3i%s%3i","Inner: ",counts[0]," Outer: ",counts[1]) << endl; 2205 2228 { 2229 *fLog << " Successfully calibrated Pixels: Inner: " 2230 << Form("%3i",suit[0]) << " Outer: " << Form("%3i",suit[1]) << endl; 2231 *fLog << " Uncalibrated Pixels: Inner: " 2232 << Form("%3i",unsuit[0]) << " Outer: " << Form("%3i",unsuit[1]) << endl; 2233 *fLog << " Unreliable Pixels: Inner: " 2234 << Form("%3i",unrel[0]) << " Outer: " << Form("%3i",unrel[1]) << endl; 2235 *fLog << " High-gain saturated Pixels: Inner: " 2236 << Form("%3i",counts[0]) << " Outer: " << Form("%3i",counts[1]) << endl; 2237 *fLog << endl; 2238 } 2239 2240 return kTRUE; 2241 2242 if (unsuitcnt > fUnsuitablesLimit*fGeom->GetNumPixels()) 2243 { 2244 *fLog << err << "Number of unsuitable pixels: " << 100.*unsuitcnt/fGeom->GetNumPixels() 2245 << "% exceeds limit of " << fUnsuitablesLimit*100 << "%" << endl; 2246 return kFALSE; 2247 } 2248 2249 if (unrelcnt > fUnreliablesLimit*fGeom->GetNumPixels()) 2250 { 2251 *fLog << err << "Relative number of unreliable pixels: " << 100.*unrelcnt/fGeom->GetNumPixels() 2252 << "% exceeds limit of " << fUnreliablesLimit*100 << "%" << endl; 2253 return kFALSE; 2254 } 2255 return kTRUE; 2206 2256 } 2207 2257 … … 2232 2282 } 2233 2283 2234 *fLog << " " << setw(7) << text 2235 << Form("%s%3i%s%3i","Inner: ",countinner," Outer: ",countouter) << endl;2284 *fLog << " " << setw(7) << text << "Inner: " << Form("%3i",countinner) 2285 << " Outer: " << Form("%3i", countouter) << endl; 2236 2286 } 2237 2287 … … 2361 2411 rc = kTRUE; 2362 2412 } 2363 if (IsEnvDefined(env, prefix, "UseExtractorRes", print))2364 {2365 SetUseExtractorRes(GetEnvValue(env, prefix, "UseExtractorRes", fUseExtractorRes));2413 if (IsEnvDefined(env, prefix, "UseExtractorRes", print)) 2414 { 2415 SetUseExtractorRes(GetEnvValue(env, prefix, "UseExtractorRes", IsUseExtractorRes())); 2366 2416 rc = kTRUE; 2367 2417 } 2418 if (IsEnvDefined(env, prefix, "UseUnreliables", print)) 2419 { 2420 SetUseUnreliables(GetEnvValue(env, prefix, "UseUnreliables", IsUseUnreliables())); 2421 rc = kTRUE; 2422 } 2423 2424 if (IsEnvDefined(env, prefix, "UseExternalNumPhes", print)) 2425 { 2426 SetUseExternalNumPhes(GetEnvValue(env, prefix, "UseExternalNumPhes", IsUseExternalNumPhes())); 2427 rc = kTRUE; 2428 } 2429 2430 if (IsEnvDefined(env, prefix, "UnsuitablesLimit", print)) 2431 { 2432 SetUnsuitablesLimit(GetEnvValue(env, prefix, "UnsuitablesLimit", fUnsuitablesLimit)); 2433 rc = kTRUE; 2434 } 2435 2436 if (IsEnvDefined(env, prefix, "UnreliablesLimit", print)) 2437 { 2438 SetUnreliablesLimit(GetEnvValue(env, prefix, "UnreliablesLimit", fUnreliablesLimit)); 2439 rc = kTRUE; 2440 } 2441 2368 2442 2369 2443 return rc; -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r7099 r7189 50 50 static const Float_t fgFFactorErrLimit; //! Default for fFFactorErrLimit (now set to: 4.5) 51 51 static const Float_t fgArrTimeRmsLimit; //! Default for fArrTimeRmsLimit (now set to: 3.5) 52 static const Float_t fgUnsuitablesLimit; //! Default for fUnsuitableLimit (now set to: 0.1) 53 static const Float_t fgUnreliablesLimit; //! Default for fUnreliableLimit (now set to: 0.3) 52 54 53 55 static const TString fgNamePedestalCam; //! "MPedestalCam" 54 56 55 57 // Variables 58 Float_t fArrTimeRmsLimit; // Limit acceptance RMS of absolute arrival times 56 59 Float_t fChargeLimit; // Limit acceptance mean charge (in units of PedRMS) 57 60 Float_t fChargeErrLimit; // Limit acceptance charge error (in abs. numbers) 58 61 Float_t fChargeRelErrLimit; // Limit acceptance rel. error mean (in abs. numbers) 62 Float_t fFFactorErrLimit; // Limit acceptance F-Factor w.r.t. area idx mean 59 63 Float_t fLambdaCheckLimit; // Limit rel. diff. lambda and lambdacheck in Blind Pixel 60 64 Float_t fLambdaErrLimit; // Limit acceptance lambda error in Blind Pixel … … 63 67 Float_t fPheErrLowerLimit; // Lower limit acceptance nr. phe's w.r.t. area idx mean (in sigmas) 64 68 Float_t fPheErrUpperLimit; // Upper limit acceptance nr. phe's w.r.t. area idx mean (in sigmas) 65 Float_t fFFactorErrLimit; // Limit acceptance F-Factor w.r.t. area idx mean66 Float_t fArrTimeRmsLimit; // Limit acceptance RMS of absolute arrival times67 69 Float_t fSqrtHiGainSamples; // Square root nr. High-Gain FADC slices used by extractor 68 70 Float_t fSqrtLoGainSamples; // Square root nr. Low -Gain FADC slices used by extractor 71 Float_t fUnsuitablesLimit; // Limit for relative number of unsuitable pixels 72 Float_t fUnreliablesLimit; // Limit for relative number of unreliable pixels 73 74 Float_t fExternalNumPhes; // External mean number of photo-electrons set from outside 75 Float_t fExternalNumPhesRelVar; // External rel. var. number of photo-electrons set from outside 69 76 70 77 MCalibrationCam::PulserColor_t fPulserColor; // Calibration LEDs colour … … 73 80 Int_t fNumInnerFFactorMethodUsed; // Number of inner pixels used for F-Factor Method calibration 74 81 75 Byte_t fFlags; // Bit-field for the general flags76 TArrayC fResultFlags; // Bit-fields for the fitting results (one field per area index)77 TArrayC fBlindPixelFlags; // Bit-fields for the blind pixel flags (one field per blind pixel)78 TArrayC fPINDiodeFlags; // Bit-fields for the PIN Diode flags (one field per PIN Diode )79 80 82 TString fOutputPath; // Path to the output file 81 83 TString fOutputFile; // Name of the output file … … 83 85 84 86 Int_t fNumProcessed; // Number of processed events (for Intensity calibration) 85 Bool_t fUseExtractorRes; // Include extractor resolution in F-Factor method86 87 87 88 // Pointers … … 115 116 116 117 Byte_t fCheckFlags; // Bit-field to hold the possible check flags 117 118 119 enum FitResult_t { kPheFitOK, 120 kFFactorFitOK, 121 kBlindPixelFitOK, 122 kBlindPixelPedFitOK, 123 kPINDiodeFitOK }; // Possible Fit Result flags 124 125 TArrayC fResultFlags; // Bit-fields for the fitting results (one field per area index) 126 TArrayC fBlindPixelFlags; // Bit-fields for the blind pixel flags (one field per blind pixel) 127 TArrayC fPINDiodeFlags; // Bit-fields for the PIN Diode flags (one field per PIN Diode ) 128 118 129 enum { kDebug, 119 kPheFitOK, kFFactorFitOK, kBlindPixelFitOK, kBlindPixelPedFitOK, kPINDiodeFitOK }; 130 kUseExtractorRes, 131 kUseUnreliables, 132 kUseExternalNumPhes }; // Possible general flags 133 134 Byte_t fFlags; // Bit-field to hold the general flags 120 135 121 136 // functions 137 void FinalizeArrivalTimes ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what); 138 void FinalizeBadPixels (); 139 Bool_t FinalizeBlindCam (); 140 void FinalizeBlindPixelQECam (); 141 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what); 142 void FinalizeCombinedQECam (); 143 void FinalizeFFactorQECam (); 144 Bool_t FinalizeFFactorMethod (); 122 145 void FinalizePedestals ( const MPedestalPix &ped, MCalibrationChargePix &cal, const Int_t aidx ); 123 void FinalizeArrivalTimes ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);124 Bool_t FinalizeCharges ( MCalibrationChargePix &cal, MBadPixelsPix &bad, const char* what);125 146 Bool_t FinalizePINDiode (); 126 Bool_t FinalizeBlindCam ();127 Bool_t FinalizeFFactorMethod ();128 void FinalizeBadPixels ();129 void FinalizeFFactorQECam ();130 void FinalizeBlindPixelQECam ();131 147 void FinalizePINDiodeQECam (); 132 void FinalizeCombinedQECam (); 133 void FinalizeUnsuitablePixels(); 148 Bool_t FinalizeUnsuitablePixels(); 134 149 135 150 const char* GetOutputFile(); … … 143 158 Bool_t IsCheckArrivalTimes () const { return TESTBIT(fCheckFlags,kCheckArrivalTimes); } 144 159 160 Bool_t IsDebug () const { return TESTBIT(fFlags,kDebug); } 161 Bool_t IsUseExtractorRes () const { return TESTBIT(fFlags,kUseExtractorRes); } 162 Bool_t IsUseUnreliables () const { return TESTBIT(fFlags,kUseUnreliables); } 163 Bool_t IsUseExternalNumPhes () const { return TESTBIT(fFlags,kUseExternalNumPhes); } 164 145 165 void PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const; 146 166 147 167 // Global fit results 148 void SetPheFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) { 149 b ? SETBIT(fResultFlags[aidx], kPheFitOK) 150 : CLRBIT(fResultFlags[aidx], kPheFitOK); } 151 void SetFFactorFitOK ( const Int_t aidx, const Bool_t b=kTRUE ) { 152 b ? SETBIT(fResultFlags[aidx], kFFactorFitOK) 153 : CLRBIT(fResultFlags[aidx], kFFactorFitOK); } 154 void SetBlindPixelFitOK ( const Int_t idx, const Bool_t b=kTRUE ) { 155 b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelFitOK) 156 : CLRBIT(fBlindPixelFlags[idx], kBlindPixelFitOK); } 157 void SetBlindPixelPedFitOK( const Int_t idx, const Bool_t b=kTRUE ) { 158 b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK) 159 : CLRBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK); } 160 void SetPINDiodeFitOK ( const Int_t idx, const Bool_t b=kTRUE ) { 161 b ? SETBIT(fPINDiodeFlags[idx], kPINDiodeFitOK) 162 : CLRBIT(fPINDiodeFlags[idx], kPINDiodeFitOK); } 168 void SetPheFitOK (const Int_t aidx, const Bool_t b=kTRUE) { b ? SETBIT(fResultFlags[aidx], kPheFitOK) : CLRBIT(fResultFlags[aidx], kPheFitOK); } 169 void SetFFactorFitOK (const Int_t aidx, const Bool_t b=kTRUE) { b ? SETBIT(fResultFlags[aidx], kFFactorFitOK) : CLRBIT(fResultFlags[aidx], kFFactorFitOK); } 170 void SetBlindPixelFitOK (const Int_t idx, const Bool_t b=kTRUE) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelFitOK) : CLRBIT(fBlindPixelFlags[idx], kBlindPixelFitOK); } 171 void SetBlindPixelPedFitOK(const Int_t idx, const Bool_t b=kTRUE) { b ? SETBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK): CLRBIT(fBlindPixelFlags[idx], kBlindPixelPedFitOK); } 172 void SetPINDiodeFitOK (const Int_t idx, const Bool_t b=kTRUE) { b ? SETBIT(fPINDiodeFlags[idx], kPINDiodeFitOK): CLRBIT(fPINDiodeFlags[idx], kPINDiodeFitOK); } 163 173 164 174 Int_t PreProcess (MParList *pList); … … 169 179 170 180 public: 171 172 181 MCalibrationChargeCalc(const char *name=NULL, const char *title=NULL); 173 182 … … 176 185 Int_t Finalize(); 177 186 178 Bool_t IsDebug() const { return TESTBIT(fFlags,kDebug); } 187 void SetChargeLimit (const Float_t f=fgChargeLimit ) { fChargeLimit = f; } 188 void SetChargeErrLimit (const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; } 189 void SetChargeRelErrLimit(const Float_t f=fgChargeRelErrLimit) { fChargeRelErrLimit = f; } 190 191 // Checks 192 void SetCheckArrivalTimes(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckArrivalTimes) : CLRBIT(fCheckFlags,kCheckArrivalTimes); } 193 void SetCheckDeadPixels(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckDeadPixels) : CLRBIT(fCheckFlags,kCheckDeadPixels); } 194 void SetCheckDeviatingBehavior(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckDeviatingBehavior) : CLRBIT(fCheckFlags,kCheckDeviatingBehavior); } 195 void SetCheckExtractionWindow(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckExtractionWindow) : CLRBIT(fCheckFlags,kCheckExtractionWindow); } 196 void SetCheckHistOverflow(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckHistOverflow) : CLRBIT(fCheckFlags,kCheckHistOverflow); } 197 void SetCheckOscillations(const Bool_t b=kTRUE) { b ? SETBIT(fCheckFlags,kCheckOscillations) : CLRBIT(fCheckFlags,kCheckOscillations); } 198 void SetDebug(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kDebug) : CLRBIT(fFlags, kDebug); } 199 void SetUseExtractorRes(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseExtractorRes) : CLRBIT(fFlags, kUseExtractorRes); } 200 void SetUseUnreliables(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseUnreliables) : CLRBIT(fFlags, kUseUnreliables); } 201 void SetUseExternalNumPhes(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseExternalNumPhes) : CLRBIT(fFlags, kUseExternalNumPhes); } 202 203 // pointers 204 void SetPedestals(MPedestalCam *cam) { fPedestals=cam; } 205 void SetExtractor(MExtractor *ext) { fExtractor=ext; } 206 207 // limits 208 void SetArrTimeRmsLimit (const Float_t f=fgArrTimeRmsLimit ) { fArrTimeRmsLimit = f; } 209 void SetFFactorErrLimit (const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; } 210 void SetLambdaErrLimit (const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; } 211 void SetLambdaCheckLimit(const Float_t f=fgLambdaCheckLimit) { fLambdaCheckLimit = f; } 212 void SetUnsuitablesLimit(const Float_t f=fgUnsuitablesLimit) { fUnsuitablesLimit = f; } 213 void SetUnreliablesLimit(const Float_t f=fgUnreliablesLimit) { fUnreliablesLimit = f; } 214 215 // others 216 void SetExternalNumPhes ( const Float_t f=0. ) { fExternalNumPhes = f; } 217 void SetExternalNumPhesRelVar( const Float_t f=0. ) { fExternalNumPhesRelVar = f; } 218 void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; } 219 void SetOutputPath ( const TString path="." ); 220 void SetOutputFile ( const TString file="ChargeCalibStat.txt" ); 221 void SetPheErrLowerLimit ( const Float_t f=fgPheErrLowerLimit ) { fPheErrLowerLimit = f; } 222 void SetPheErrUpperLimit ( const Float_t f=fgPheErrUpperLimit ) { fPheErrUpperLimit = f; } 223 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; } 179 224 180 void SetChargeLimit ( const Float_t f=fgChargeLimit ) { fChargeLimit = f; } 181 void SetChargeErrLimit ( const Float_t f=fgChargeErrLimit ) { fChargeErrLimit = f; } 182 void SetChargeRelErrLimit ( const Float_t f=fgChargeRelErrLimit ) { fChargeRelErrLimit = f; } 183 184 // Checks 185 void SetCheckArrivalTimes( const Bool_t b=kTRUE ) { 186 b ? SETBIT(fCheckFlags,kCheckArrivalTimes) 187 : CLRBIT(fCheckFlags,kCheckArrivalTimes); } 188 void SetCheckDeadPixels( const Bool_t b=kTRUE ) { 189 b ? SETBIT(fCheckFlags,kCheckDeadPixels) 190 : CLRBIT(fCheckFlags,kCheckDeadPixels); } 191 void SetCheckDeviatingBehavior( const Bool_t b=kTRUE ) { 192 b ? SETBIT(fCheckFlags,kCheckDeviatingBehavior) 193 : CLRBIT(fCheckFlags,kCheckDeviatingBehavior); } 194 void SetCheckExtractionWindow( const Bool_t b=kTRUE ) { 195 b ? SETBIT(fCheckFlags,kCheckExtractionWindow) 196 : CLRBIT(fCheckFlags,kCheckExtractionWindow); } 197 void SetCheckHistOverflow( const Bool_t b=kTRUE ) { 198 b ? SETBIT(fCheckFlags,kCheckHistOverflow) 199 : CLRBIT(fCheckFlags,kCheckHistOverflow); } 200 void SetCheckOscillations( const Bool_t b=kTRUE ) { 201 b ? SETBIT(fCheckFlags,kCheckOscillations) 202 : CLRBIT(fCheckFlags,kCheckOscillations); } 203 void SetDebug ( const Bool_t b=kTRUE ) { 204 b ? SETBIT(fFlags, kDebug) 205 : CLRBIT(fFlags, kDebug); } 206 207 void SetExtractor(MExtractor *ext) { fExtractor=ext; } 208 void SetPedestals(MPedestalCam *cam) { fPedestals=cam; } 209 210 void SetArrTimeRmsLimit ( const Float_t f=fgArrTimeRmsLimit ) { fArrTimeRmsLimit = f; } 211 void SetFFactorErrLimit ( const Float_t f=fgFFactorErrLimit ) { fFFactorErrLimit = f; } 212 void SetLambdaErrLimit ( const Float_t f=fgLambdaErrLimit ) { fLambdaErrLimit = f; } 213 void SetLambdaCheckLimit ( const Float_t f=fgLambdaCheckLimit ) { fLambdaCheckLimit = f; } 214 void SetNamePedestalCam ( const char *name=fgNamePedestalCam.Data()) { fNamePedestalCam = name; } 215 void SetOutputPath ( TString path="." ); 216 void SetOutputFile ( TString file="ChargeCalibStat.txt" ); 217 void SetPheErrLowerLimit ( const Float_t f=fgPheErrLowerLimit ) { fPheErrLowerLimit = f; } 218 void SetPheErrUpperLimit ( const Float_t f=fgPheErrUpperLimit ) { fPheErrUpperLimit = f; } 219 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; } 220 void SetUseExtractorRes(Bool_t b=kTRUE) { fUseExtractorRes = b; } 221 222 ClassDef(MCalibrationChargeCalc, 3) // Task calculating Calibration Containers and Quantum Efficiencies 225 ClassDef(MCalibrationChargeCalc, 4) // Task calculating Calibration Containers and Quantum Efficiencies 223 226 }; 224 227 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargePix.h
r7188 r7189 188 188 Bool_t CalcMeanFFactor(const Float_t nphotons, const Float_t nphotonsrelvar); 189 189 190 ClassDef(MCalibrationChargePix, 3) // Container Charge Calibration Results Pixel190 ClassDef(MCalibrationChargePix, 4) // Container Charge Calibration Results Pixel 191 191 }; 192 192 -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc
r7005 r7189 41 41 // MCalibrationChargeBlindPix, MCalibrationChargePINDiode 42 42 // 43 // Inline Functions: 44 // ----------------- 45 // 46 // GetSize(): Returns the current size of the TOrdCollection fCams 47 // independently if the MCalibrationCam is filled with values or not. 48 // 49 // GetAverageAreas(): Returns the current size of the TOrdCollection 50 // fAverageAreas of the current camera. 51 // 52 // GetAverageArea(UInt_t i): Get i-th High Gain pixel Area from the 53 // current camera 54 // 55 // GetAverageArea(UInt_t i): Get i-th High Gain pixel Area from the 56 // current camera 57 // 58 // GetAverageBadArea(UInt_t i): Get i-th High Gain pixel Area from the 59 // current camera 60 // 61 // GetAverageBadArea(UInt_t i): Get i-th High Gain pixel Area from the 62 // current camera 63 // 64 // GetAverageSectors(): Returns the current size of the TOrdCollection 65 // fAverageSectors or the current camera 66 // 67 // GetAverageSector(UInt_t i): Get i-th High Gain Sector from the 68 // current camera 69 // 70 // GetAverageSector(UInt_t i): Get i-th High Gain Sector from the current 71 // camera 72 // 73 // GetAverageBadSector(UInt_t i): Get i-th High Gain Sector from the 74 // current camera 75 // 76 // GetAverageBadSector(UInt_t i): Get i-th High Gain Sector from the 77 // current camera 78 // 79 // 43 80 // ClassVersion 2: 44 81 // + fHists 82 // 83 // ClassVersion 3: 84 // - MArrayD fOffsets; //! Arrays of Higain-vs-LoGain fit result Offsets 85 // - MArrayD fSlopes; //! Arrays of Higain-vs-LoGain fit result Slopes 45 86 // 46 87 ///////////////////////////////////////////////////////////////////////////// … … 127 168 128 169 MParContainer::Copy(calib); 129 130 calib.fOffsets = fOffsets;131 calib.fSlopes = fSlopes;132 170 133 171 const UInt_t n = GetSize(); … … 163 201 } 164 202 165 // -----------------------------------------------------166 //167 // Not yet installed...168 //169 void MCalibrationIntensityCam::DrawHiLoFits()170 {171 172 /*173 if (!fOffsets)174 fOffsets = new TH1D("pp","Offsets of the HiGain LoGain Fit",100,-600.,400.);175 if (!fSlopes)176 fSlopes = new TH1D("mm","Slopes of the HiGain LoGain Fit",100,-2.,2.);177 if (!fOffvsSlope)178 fOffvsSlope = new TH2D("aa","Slopes vs Offsets of the HiGain LoGain Fit",100,-600.,400.,100,-2.,2.);179 180 TIter Next(fPixels);181 MCalibrationPix *pix;182 MHCalibrationPixel *hist;183 while ((pix=(MCalibrationPix*)Next()))184 {185 hist = pix->GetHist();186 hist->FitHiGainvsLoGain();187 fOffsets->Fill(hist->GetOffset(),1.);188 fSlopes->Fill(hist->GetSlope(),1.);189 fOffvsSlope->Fill(hist->GetOffset(),hist->GetSlope(),1.);190 }191 192 TCanvas *c1 = new TCanvas();193 194 c1->Divide(1,3);195 c1->cd(1);196 fOffsets->Draw();197 gPad->Modified();198 gPad->Update();199 200 c1->cd(2);201 fSlopes->Draw();202 gPad->Modified();203 gPad->Update();204 205 c1->cd(3);206 fOffvsSlope->Draw("col1");207 gPad->Modified();208 gPad->Update();209 */210 }211 212 203 // ------------------------------------------------------------------- 213 204 // … … 256 247 } 257 248 258 259 // -------------------------------------------------------------------------- 260 // 261 // Returns the current size of the TOrdCollection fCams 262 // independently if the MCalibrationCam is filled with values or not. 263 // 264 const Int_t MCalibrationIntensityCam::GetSize() const 265 { 266 return fCams->GetSize(); 267 } 268 269 // -------------------------------------------------------------------------- 270 // 271 // Get i-th pixel from current camera 272 // 273 MCalibrationPix &MCalibrationIntensityCam::operator[](UInt_t i) 274 { 275 return (*GetCam())[i]; 276 } 277 278 // -------------------------------------------------------------------------- 279 // 280 // Get i-th pixel from current camera 281 // 282 const MCalibrationPix &MCalibrationIntensityCam::operator[](UInt_t i) const 283 { 284 return (*GetCam())[i]; 285 } 286 287 288 // -------------------------------------------------------------------------- 289 // 290 // Returns the current size of the TOrdCollection fAverageAreas of the current camera. 291 // 292 const Int_t MCalibrationIntensityCam::GetAverageAreas() const 293 { 294 return GetCam()->GetAverageAreas(); 295 } 296 297 // -------------------------------------------------------------------------- 298 // 299 // Get i-th High Gain pixel Area from the current camera 300 // 301 MCalibrationPix &MCalibrationIntensityCam::GetAverageArea(UInt_t i) 302 { 303 return GetCam()->GetAverageArea(i); 304 } 305 306 // -------------------------------------------------------------------------- 307 // 308 // Get i-th High Gain pixel Area from the current camera 309 // 310 const MCalibrationPix &MCalibrationIntensityCam::GetAverageArea(UInt_t i) const 311 { 312 return GetCam()->GetAverageArea(i); 313 } 314 315 // -------------------------------------------------------------------------- 316 // 317 // Get i-th High Gain pixel Area from the current camera 318 // 319 MBadPixelsPix &MCalibrationIntensityCam::GetAverageBadArea(UInt_t i) 320 { 321 return GetCam()->GetAverageBadArea(i); 322 } 323 324 // -------------------------------------------------------------------------- 325 // 326 // Get i-th High Gain pixel Area from the current camera 327 // 328 const MBadPixelsPix &MCalibrationIntensityCam::GetAverageBadArea(UInt_t i) const 329 { 330 return GetCam()->GetAverageBadArea(i); 331 } 332 333 // -------------------------------------------------------------------------- 334 // 335 // Returns the current size of the TOrdCollection fAverageSectors or the current camera 336 // 337 const Int_t MCalibrationIntensityCam::GetAverageSectors() const 338 { 339 return GetCam()->GetAverageSectors(); 340 } 341 342 // -------------------------------------------------------------------------- 343 // 344 // Get i-th High Gain Sector from the current camera 345 // 346 MCalibrationPix &MCalibrationIntensityCam::GetAverageSector(UInt_t i) 347 { 348 return GetCam()->GetAverageSector(i); 349 } 350 351 // -------------------------------------------------------------------------- 352 // 353 // Get i-th High Gain Sector from the current camera 354 // 355 const MCalibrationPix &MCalibrationIntensityCam::GetAverageSector(UInt_t i) const 356 { 357 return GetCam()->GetAverageSector(i); 358 } 359 360 // -------------------------------------------------------------------------- 361 // 362 // Get i-th High Gain Sector from the current camera 363 // 364 MBadPixelsPix &MCalibrationIntensityCam::GetAverageBadSector(UInt_t i) 365 { 366 return GetCam()->GetAverageBadSector(i); 367 } 368 369 // -------------------------------------------------------------------------- 370 // 371 // Get i-th High Gain Sector from the current camera 372 // 373 const MBadPixelsPix &MCalibrationIntensityCam::GetAverageBadSector(UInt_t i) const 374 { 375 return GetCam()->GetAverageBadSector(i); 376 } 377 378 379 // -------------------------------------------------------------------------- 380 // 381 // Get i-th camera 382 // 383 MCalibrationCam *MCalibrationIntensityCam::GetCam(Int_t i) 384 { 385 return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); 386 } 387 388 // -------------------------------------------------------------------------- 389 // 390 // Get i-th camera 391 // 392 const MCalibrationCam *MCalibrationIntensityCam::GetCam(Int_t i) const 393 { 394 return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); 395 } 396 397 // -------------------------------------------------------------------------- 398 // 399 // Get camera with name 'name' 400 // 401 MCalibrationCam *MCalibrationIntensityCam::GetCam(const char *name ) 402 { 403 return static_cast<MCalibrationCam*>(fCams->FindObject(name)); 404 } 405 406 // -------------------------------------------------------------------------- 407 // 408 // Get camera with name 'name' 409 // 410 const MCalibrationCam *MCalibrationIntensityCam::GetCam(const char *name ) const 411 { 412 return static_cast<MCalibrationCam*>(fCams->FindObject(name)); 413 } 414 415 // -------------------------------------------------------------------------- 416 // 417 // Calls GetPixelContent for the current entry in fCams 418 // 419 Bool_t MCalibrationIntensityCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 420 { 421 return GetCam()->GetPixelContent(val,idx,cam,type); 422 } 423 424 // -------------------------------------------------------------------------- 425 // 426 // Calls DrawPixelContent for the current entry in fCams 427 // 428 void MCalibrationIntensityCam::DrawPixelContent( Int_t num ) const 429 { 430 return GetCam()->DrawPixelContent(num); 431 } 432 433 Int_t MCalibrationIntensityCam::CountNumEntries(const MCalibrationCam::PulserColor_t col) const 249 // -------------------------------------------------------------------------- 250 // 251 Int_t MCalibrationIntensityCam::CountNumEntries(const MCalibrationCam::PulserColor_t col) const 434 252 { 435 253 … … 451 269 // -------------------------------------------------------------------------- 452 270 // 271 // Get i-th pixel from current camera 272 // 273 MCalibrationPix &MCalibrationIntensityCam::operator[](UInt_t i) 274 { 275 return (*GetCam())[i]; 276 } 277 278 // -------------------------------------------------------------------------- 279 // 280 // Get i-th pixel from current camera 281 // 282 const MCalibrationPix &MCalibrationIntensityCam::operator[](UInt_t i) const 283 { 284 return (*GetCam())[i]; 285 } 286 287 // -------------------------------------------------------------------------- 288 // 289 // Get camera with name 'name' 290 // 291 MCalibrationCam *MCalibrationIntensityCam::GetCam(const char *name) 292 { 293 return static_cast<MCalibrationCam*>(fCams->FindObject(name)); 294 } 295 296 // -------------------------------------------------------------------------- 297 // 298 // Get camera with name 'name' 299 // 300 const MCalibrationCam *MCalibrationIntensityCam::GetCam(const char *name) const 301 { 302 return static_cast<MCalibrationCam*>(fCams->FindObject(name)); 303 } 304 305 // -------------------------------------------------------------------------- 306 // 453 307 // Get i-th histogram class 454 308 // 455 309 MHCalibrationCam *MCalibrationIntensityCam::GetHist(Int_t i) 456 310 { 457 458 } 459 460 // -------------------------------------------------------------------------- 461 // 462 // Get i-th histogram class 463 // 464 const MHCalibrationCam *MCalibrationIntensityCam::GetHist(Int_t i) const 465 { 466 467 } 468 469 // -------------------------------------------------------------------------- 470 // 471 // Get histogram class with name 'name' 311 return static_cast<MHCalibrationCam*>(i==-1 ? fHists->Last() : fHists->At(i)); 312 } 313 314 // -------------------------------------------------------------------------- 315 // 316 // Get i-th histogram class 317 // 318 const MHCalibrationCam *MCalibrationIntensityCam::GetHist(Int_t i) const 319 { 320 return static_cast<MHCalibrationCam*>(i==-1 ? fHists->Last() : fHists->At(i)); 321 } 322 323 // -------------------------------------------------------------------------- 324 // 325 // Get histogram class with name 'name' 472 326 // 473 327 MHCalibrationCam *MCalibrationIntensityCam::GetHist(const char *name ) … … 478 332 // -------------------------------------------------------------------------- 479 333 // 480 // Get histogram class with name 'name' 481 // 482 const MHCalibrationCam *MCalibrationIntensityCam::GetHist(const char *name ) const 483 { 484 return static_cast<MHCalibrationCam*>(fHists->FindObject(name)); 485 } 334 // Get histogram class with name 'name' 335 // 336 const MHCalibrationCam *MCalibrationIntensityCam::GetHist(const char *name ) const 337 { 338 return static_cast<MHCalibrationCam*>(fHists->FindObject(name)); 339 } 340 341 // -------------------------------------------------------------------------- 342 // 343 // Calls DrawPixelContent for the current entry in fCams 344 // 345 void MCalibrationIntensityCam::DrawPixelContent( Int_t num ) const 346 { 347 return GetCam()->DrawPixelContent(num); 348 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.h
r7005 r7189 14 14 #endif 15 15 16 class TOrdCollection; 16 #ifndef ROOT_TOrdCollection 17 #include <TOrdCollection.h> 18 #endif 19 17 20 class MCalibrationPix; 18 21 class MBadPixelsPix; … … 22 25 class MCalibrationIntensityCam : public MParContainer, public MCamEvent 23 26 { 24 private:25 MArrayD fOffsets; //! Arrays of Higain-vs-LoGain fit result Offsets26 MArrayD fSlopes; //! Arrays of Higain-vs-LoGain fit result Slopes27 28 27 protected: 29 28 TOrdCollection *fCams; // Array of MCalibrationCams, one per pulse colour and intensity … … 45 44 Int_t CountNumEntries(const MCalibrationCam::PulserColor_t col) const; 46 45 47 // Draws 48 void DrawHiLoFits(); 49 void DrawPixelContent( Int_t num) const; 50 51 // Getters 52 Bool_t GetPixelContent( Double_t &val, Int_t idx, const MGeomCam &cam,Int_t type=0) const; 53 const Int_t GetSize() const; 46 const Int_t GetSize() const { return fCams->GetSize(); } 54 47 55 const Int_t GetAverageAreas () const ;56 MCalibrationPix &GetAverageArea ( UInt_t i ) ;57 const MCalibrationPix &GetAverageArea ( UInt_t i ) const ;58 MBadPixelsPix &GetAverageBadArea ( UInt_t i ) ;59 const MBadPixelsPix &GetAverageBadArea ( UInt_t i ) const ;60 const Int_t GetAverageSectors () const ;61 MCalibrationPix &GetAverageSector ( UInt_t i ) ;62 const MCalibrationPix &GetAverageSector ( UInt_t i ) const ;63 MBadPixelsPix &GetAverageBadSector ( UInt_t i ) ;64 const MBadPixelsPix &GetAverageBadSector ( UInt_t i ) const ;48 const Int_t GetAverageAreas () const { return GetCam()->GetAverageAreas(); } 49 MCalibrationPix &GetAverageArea ( UInt_t i ) { return GetCam()->GetAverageArea(i); } 50 const MCalibrationPix &GetAverageArea ( UInt_t i ) const { return GetCam()->GetAverageArea(i); } 51 MBadPixelsPix &GetAverageBadArea ( UInt_t i ) { return GetCam()->GetAverageBadArea(i); } 52 const MBadPixelsPix &GetAverageBadArea ( UInt_t i ) const { return GetCam()->GetAverageBadArea(i); } 53 const Int_t GetAverageSectors () const { return GetCam()->GetAverageSectors(); } 54 MCalibrationPix &GetAverageSector ( UInt_t i ) { return GetCam()->GetAverageSector(i); } 55 const MCalibrationPix &GetAverageSector ( UInt_t i ) const { return GetCam()->GetAverageSector(i); } 56 MBadPixelsPix &GetAverageBadSector ( UInt_t i ) { return GetCam()->GetAverageBadSector(i); } 57 const MBadPixelsPix &GetAverageBadSector ( UInt_t i ) const { return GetCam()->GetAverageBadSector(i); } 65 58 66 MCalibrationCam *GetCam ( Int_t i=-1); 67 const MCalibrationCam *GetCam ( Int_t i=-1) const; 59 MCalibrationCam *GetCam ( Int_t i=-1) { 60 return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); } 61 const MCalibrationCam *GetCam ( Int_t i=-1) const { 62 return static_cast<MCalibrationCam*>(i==-1 ? fCams->Last() : fCams->At(i)); } 68 63 69 64 MCalibrationCam *GetCam ( const char *name ); 70 65 const MCalibrationCam *GetCam ( const char *name ) const; 71 66 72 MHCalibrationCam *GetHist ( Int_t i=-1); 67 MHCalibrationCam *GetHist ( Int_t i=-1); 73 68 const MHCalibrationCam *GetHist ( Int_t i=-1) const; 74 69 75 MHCalibrationCam *GetHist ( const char *name ); 70 MHCalibrationCam *GetHist ( const char *name ); 76 71 const MHCalibrationCam *GetHist ( const char *name ) const; 77 72 … … 87 82 void Init ( const MGeomCam &geom ); 88 83 89 // Prints84 // Prints 90 85 void Print(Option_t *o="") const; 91 86 … … 96 91 void SetNumUnreliable ( const UInt_t i, const Int_t aidx ) { GetCam()->SetNumUnreliable(i,aidx); } 97 92 void SetPulserColor ( const MCalibrationCam::PulserColor_t col=MCalibrationCam::kCT1) { 98 GetCam()->SetPulserColor(col); } 93 GetCam()->SetPulserColor(col); } 94 void SetCam( MCalibrationCam *cam, const Int_t i) { fCams->PutAt(cam,i); } 95 96 // MCamEvent 97 Bool_t GetPixelContent( Double_t &val, Int_t idx, const MGeomCam &cam,Int_t type=0) const 98 { return GetCam()->GetPixelContent(val,idx,cam,type); } 99 void DrawPixelContent( Int_t num) const; 99 100 100 ClassDef(MCalibrationIntensityCam, 2) // Base Container Intensity Calibration Results101 ClassDef(MCalibrationIntensityCam, 3) // Base Container Intensity Calibration Results 101 102 }; 102 103 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc
r7095 r7189 81 81 ///////////////////////////////////////////////////////////////////////////// 82 82 #include "MHCalibrationHiLoCam.h" 83 #include "MHCalibrationPix.h"84 85 #include "MLog.h"86 #include "MLogManip.h"87 88 #include "MParList.h"89 90 #include "MCalibrationHiLoCam.h"91 #include "MCalibrationCam.h"92 #include "MCalibrationPix.h"93 94 #include "MExtractedSignalCam.h"95 #include "MExtractedSignalPix.h"96 #include "MArrivalTimeCam.h"97 #include "MArrivalTimePix.h"98 99 #include "MGeomCam.h"100 #include "MGeomPix.h"101 102 #include "MBadPixelsIntensityCam.h"103 #include "MBadPixelsCam.h"104 #include "MBadPixelsPix.h"105 83 106 84 #include <TOrdCollection.h> … … 114 92 #include <TLegend.h> 115 93 #include <TGraph.h> 94 #include <TProfile.h> 95 96 #include "MHCalibrationHiLoPix.h" 97 98 #include "MLog.h" 99 #include "MLogManip.h" 100 101 #include "MParList.h" 102 103 #include "MCalibrationHiLoCam.h" 104 #include "MCalibrationHiLoPix.h" 105 #include "MCalibrationCam.h" 106 #include "MCalibrationIntensityCam.h" 107 #include "MCalibrationPix.h" 108 109 #include "MExtractedSignalCam.h" 110 #include "MExtractedSignalPix.h" 111 #include "MArrivalTimeCam.h" 112 #include "MArrivalTimePix.h" 113 114 #include "MGeomCam.h" 115 #include "MGeomPix.h" 116 117 #include "MBadPixelsIntensityCam.h" 118 #include "MBadPixelsCam.h" 119 #include "MBadPixelsPix.h" 116 120 117 121 ClassImp(MHCalibrationHiLoCam); … … 123 127 const Axis_t MHCalibrationHiLoCam::fgLast = 29.9; 124 128 const Float_t MHCalibrationHiLoCam::fgProbLimit = 0.; 129 const Int_t MHCalibrationHiLoCam::fgHivsLoNbins = 90; 130 const Axis_t MHCalibrationHiLoCam::fgHivsLoFirst = 95.; 131 const Axis_t MHCalibrationHiLoCam::fgHivsLoLast = 995.; 132 const Axis_t MHCalibrationHiLoCam::fgLowerFitLimitProfile = 480.; 133 const Axis_t MHCalibrationHiLoCam::fgUpperFitLimitProfile = 680.; 125 134 const TString MHCalibrationHiLoCam::gsHistName = "HiLo"; 126 135 const TString MHCalibrationHiLoCam::gsHistTitle = "HiGain vs. LoGain"; 127 136 const TString MHCalibrationHiLoCam::gsHistXTitle = "Amplification Ratio [1]"; 128 137 const TString MHCalibrationHiLoCam::gsHistYTitle = "Nr. events"; 138 const TString MHCalibrationHiLoCam::gsHivsLoHistName = "HivsLo"; 139 const TString MHCalibrationHiLoCam::gsHivsLoHistTitle = "High-gain vs. Low-gain Charge"; 140 const TString MHCalibrationHiLoCam::gsHivsLoHistXTitle = "Q High-Gain [FADC counts]"; 141 const TString MHCalibrationHiLoCam::gsHivsLoHistYTitle = "Q Low-Gain [FADC counts]"; 129 142 130 143 // -------------------------------------------------------------------------- … … 146 159 // 147 160 MHCalibrationHiLoCam::MHCalibrationHiLoCam(const char *name, const char *title) 148 : fArrTimes(NULL) 161 : fArrTimes(NULL), fHivsLoResults("Results","Fit Results high-gain vs. low-gain", 162 200,-10.,10.,200,0.,20.), 163 fUsedLoGainSlices(0) 149 164 { 150 165 … … 163 178 SetHistYTitle(gsHistYTitle.Data()); 164 179 180 SetHivsLoNbins(fgHivsLoNbins); 181 SetHivsLoFirst(fgHivsLoFirst); 182 SetHivsLoLast (fgHivsLoLast ); 183 184 SetLowerFitLimitProfile(); 185 SetUpperFitLimitProfile(); 186 187 SetHivsLoHistName (gsHivsLoHistName .Data()); 188 SetHivsLoHistTitle (gsHivsLoHistTitle .Data()); 189 SetHivsLoHistXTitle(gsHivsLoHistXTitle.Data()); 190 SetHivsLoHistYTitle(gsHivsLoHistYTitle.Data()); 191 165 192 SetOscillations(kFALSE); 193 194 fHivsLoResults.GetXaxis()->SetTitle("Offset per FADC slices [FADC cnts]"); 195 fHivsLoResults.GetYaxis()->SetTitle("Gains ratio [1]"); 196 fHivsLoResults.SetDirectory(0); 197 166 198 } 167 199 … … 254 286 } 255 287 288 fUsedLoGainSlices = signal->GetNumUsedLoGainFADCSlices(); 289 256 290 fArrTimes = (MArrivalTimeCam*)pList->FindObject("MArrivalTimeCam"); 257 291 if (!fArrTimes) … … 282 316 return kTRUE; 283 317 } 318 319 // -------------------------------------------------------------------------- 320 // 321 // Retrieve: 322 // - fRunHeader->GetNumSamplesHiGain(); 323 // 324 // Initializes the High Gain Arrays: 325 // 326 // - For every entry in the expanded arrays: 327 // * Initialize an MHCalibrationHiLoPix 328 // * Set Binning from fNbins, fFirst and fLast 329 // * Set Binning of Abs Times histogram from fAbsNbins, fAbsFirst and fAbsLast 330 // * Set Histgram names and titles from fHistName and fHistTitle 331 // * Set Abs Times Histgram names and titles from fAbsHistName and fAbsHistTitle 332 // * Set X-axis and Y-axis titles from fHistXTitle and fHistYTitle 333 // * Set X-axis and Y-axis titles of Abs Times Histogram from fAbsHistXTitle and fAbsHistYTitle 334 // * Call InitHists 335 // 336 // 337 void MHCalibrationHiLoCam::InitHiGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors) 338 { 339 340 TProfile *h; 341 342 if (fHiGainArray->GetSize()==0) 343 { 344 for (Int_t i=0; i<npixels; i++) 345 { 346 fHiGainArray->AddAt(new MHCalibrationHiLoPix(Form("%sHiGainPix%04d",fHistName.Data(),i), 347 Form("%s High Gain Pixel%04d",fHistTitle.Data(),i)),i); 348 349 MHCalibrationHiLoPix &pix = (MHCalibrationHiLoPix&)(*this)[i]; 350 351 pix.SetNbins(fNbins); 352 pix.SetFirst(fFirst); 353 pix.SetLast (fLast); 354 355 pix.SetProbLimit(fProbLimit); 356 357 pix.SetHivsLoNbins(fHivsLoNbins); 358 pix.SetHivsLoFirst(fHivsLoFirst); 359 pix.SetHivsLoLast (fHivsLoLast); 360 361 InitHists(pix,(*fBadPixels)[i],i); 362 363 if (fCam) 364 (*fCam)[i].SetPixId(i); 365 366 h = pix.GetHivsLo(); 367 368 h->SetName (Form("H%sHiGainPix%04d",fHivsLoHistName.Data(),i)); 369 h->SetTitle(Form("%s High Gain Pixel %04d",fHivsLoHistTitle.Data(),i)); 370 h->SetXTitle(fHivsLoHistXTitle.Data()); 371 h->SetYTitle(fHivsLoHistYTitle.Data()); 372 h->SetDirectory(0); 373 } 374 } 375 376 377 if (fAverageHiGainAreas->GetSize()==0) 378 { 379 for (Int_t j=0; j<nareas; j++) 380 { 381 fAverageHiGainAreas->AddAt(new MHCalibrationHiLoPix(Form("%sHiGainArea%d",fHistName.Data(),j), 382 Form("%s High Gain Area Idx %d",fHistTitle.Data(),j)),j); 383 384 MHCalibrationHiLoPix &pix = (MHCalibrationHiLoPix&)GetAverageHiGainArea(j); 385 386 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 387 pix.SetFirst(fFirst); 388 pix.SetLast (fLast); 389 390 pix.SetHivsLoNbins(fHivsLoNbins); 391 pix.SetHivsLoFirst(fHivsLoFirst); 392 pix.SetHivsLoLast (fHivsLoLast); 393 394 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j); 395 396 if (fCam) 397 fCam->GetAverageArea(j).SetPixId(j); 398 399 h = pix.GetHivsLo(); 400 401 h->SetName (Form("H%sHiGainArea%d",fHivsLoHistName.Data(),j)); 402 h->SetTitle(Form("%s averaged on event-by-event basis High Gain Area Idx %d", 403 fHivsLoHistTitle.Data(), j)); 404 h->SetXTitle(fHivsLoHistXTitle.Data()); 405 h->SetYTitle(fHivsLoHistYTitle.Data()); 406 h->SetDirectory(0); 407 } 408 } 409 410 if (fAverageHiGainSectors->GetSize()==0) 411 { 412 for (Int_t j=0; j<nsectors; j++) 413 { 414 fAverageHiGainSectors->AddAt(new MHCalibrationHiLoPix(Form("%sHiGainSector%02d",fHistName.Data(),j), 415 Form("%s High Gain Sector %02d",fHistTitle.Data(),j)),j); 416 417 MHCalibrationHiLoPix &pix = (MHCalibrationHiLoPix&)GetAverageHiGainSector(j); 418 419 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 420 pix.SetFirst(fFirst); 421 pix.SetLast (fLast); 422 423 pix.SetHivsLoNbins(fHivsLoNbins); 424 pix.SetHivsLoFirst(fHivsLoFirst); 425 pix.SetHivsLoLast (fHivsLoLast); 426 427 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 428 429 if (fCam) 430 fCam->GetAverageSector(j).SetPixId(j); 431 432 h = pix.GetHivsLo(); 433 434 h->SetName (Form("H%sHiGainSector%02d",fHivsLoHistName.Data(),j)); 435 h->SetTitle(Form("%s averaged on event-by-event basis High Gain Area Sector %02d", 436 fHivsLoHistTitle.Data(),j)); 437 h->SetXTitle(fHivsLoHistXTitle.Data()); 438 h->SetYTitle(fHivsLoHistYTitle.Data()); 439 h->SetDirectory(0); 440 } 441 } 442 } 443 444 //-------------------------------------------------------------------------------------- 445 // 446 // Return, if IsLoGain() is kFALSE 447 // 448 // Retrieve: 449 // - fRunHeader->GetNumSamplesHiGain(); 450 // 451 // Initializes the Low Gain Arrays: 452 // 453 // - For every entry in the expanded arrays: 454 // * Initialize an MHCalibrationHiLoPix 455 // * Set Binning from fNbins, fFirst and fLast 456 // * Set Binning of HivsLo Times histogram from fHivsLoNbins, fHivsLoFirst and fHivsLoLast 457 // * Set Histgram names and titles from fHistName and fHistTitle 458 // * Set HivsLo Times Histgram names and titles from fHivsLoHistName and fHivsLoHistTitle 459 // * Set X-axis and Y-axis titles from fHistXTitle and fHistYTitle 460 // * Set X-axis and Y-axis titles of HivsLo Times Histogram from fHivsLoHistXTitle and fHivsLoHistYTitle 461 // * Call InitHists 462 // 463 void MHCalibrationHiLoCam::InitLoGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors) 464 { 465 if (!IsLoGain()) 466 return; 467 468 TProfile *h; 469 470 if (fLoGainArray->GetSize()==0 ) 471 { 472 for (Int_t i=0; i<npixels; i++) 473 { 474 fLoGainArray->AddAt(new MHCalibrationHiLoPix(Form("%sLoGainPix%04d",fHistName.Data(),i), 475 Form("%s Low Gain Pixel %04d",fHistTitle.Data(),i)),i); 476 477 MHCalibrationHiLoPix &pix = (MHCalibrationHiLoPix&)(*this)(i); 478 479 pix.SetNbins(fNbins); 480 pix.SetFirst(fFirst); 481 pix.SetLast (fLast); 482 483 pix.SetProbLimit(fProbLimit); 484 485 pix.SetHivsLoNbins(fHivsLoNbins); 486 pix.SetHivsLoFirst(fHivsLoFirst); 487 pix.SetHivsLoLast (fHivsLoLast ); 488 489 InitHists(pix,(*fBadPixels)[i],i); 490 491 h = pix.GetHivsLo(); 492 493 h->SetName (Form("H%sLoGainPix%04d",fHivsLoHistName.Data(),i)); 494 h->SetTitle(Form("%s Low Gain Pixel %04d",fHivsLoHistTitle.Data(),i)); 495 h->SetXTitle(fHivsLoHistXTitle.Data()); 496 h->SetYTitle(fHivsLoHistYTitle.Data()); 497 h->SetDirectory(0); 498 } 499 } 500 501 if (fAverageLoGainAreas->GetSize()==0) 502 { 503 for (Int_t j=0; j<nareas; j++) 504 { 505 fAverageLoGainAreas->AddAt(new MHCalibrationHiLoPix(Form("%sLoGainArea%d",fHistName.Data(),j), 506 Form("%s Low Gain Area Idx %d",fHistTitle.Data(),j)),j); 507 508 MHCalibrationHiLoPix &pix = (MHCalibrationHiLoPix&)GetAverageLoGainArea(j); 509 510 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 511 pix.SetFirst(fFirst); 512 pix.SetLast (fLast); 513 514 pix.SetHivsLoNbins(fHivsLoNbins); 515 pix.SetHivsLoFirst(fHivsLoFirst); 516 pix.SetHivsLoLast (fHivsLoLast ); 517 518 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j); 519 520 h = pix.GetHivsLo(); 521 522 h->SetName (Form("H%sLoGainArea%02d",fHivsLoHistName.Data(),j)); 523 h->SetTitle(Form("%s%s%02d",fHivsLoHistTitle.Data(), 524 " averaged on event-by-event basis Low Gain Area Idx ",j)); 525 h->SetXTitle(fHivsLoHistXTitle.Data()); 526 h->SetYTitle(fHivsLoHistYTitle.Data()); 527 h->SetDirectory(0); 528 } 529 } 530 531 532 if (fAverageLoGainSectors->GetSize()==0 && IsLoGain()) 533 { 534 for (Int_t j=0; j<nsectors; j++) 535 { 536 fAverageLoGainSectors->AddAt(new MHCalibrationHiLoPix(Form("%sLoGainSector%02d",fHistName.Data(),j), 537 Form("%s Low Gain Sector %02d",fHistTitle.Data(),j)),j); 538 539 MHCalibrationHiLoPix &pix = (MHCalibrationHiLoPix&)GetAverageLoGainSector(j); 540 541 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 542 pix.SetFirst(fFirst); 543 pix.SetLast (fLast); 544 545 pix.SetHivsLoNbins(fHivsLoNbins); 546 pix.SetHivsLoFirst(fHivsLoFirst); 547 pix.SetHivsLoLast (fHivsLoLast); 548 549 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 550 551 h = pix.GetHivsLo(); 552 553 h->SetName (Form("H%sLoGainSector%02d",fHivsLoHistName.Data(),j)); 554 h->SetTitle(Form("%s%s%02d",fHivsLoHistTitle.Data(), 555 " averaged on event-by-event basis Low Gain Area Sector ",j)); 556 h->SetXTitle(fHivsLoHistXTitle.Data()); 557 h->SetYTitle(fHivsLoHistYTitle.Data()); 558 h->SetDirectory(0); 559 } 560 } 561 } 562 563 284 564 285 565 // ------------------------------------------------------------------------------- … … 341 621 342 622 const Float_t sighi = pix.GetExtractedSignalHiGain(); 623 624 // *fLog << err << sighi << " " << siglo << endl; 343 625 const Float_t ratio = sighi / siglo; 344 626 345 MHCalibration Pix &histhi =(*this)[i];627 MHCalibrationHiLoPix &histhi = (MHCalibrationHiLoPix&)(*this)[i]; 346 628 347 629 histhi.FillHist(ratio); 630 histhi.FillHivsLo(sighi,siglo); 631 632 if (IsAverageing()) 633 { 634 MHCalibrationHiLoPix &histhi = (MHCalibrationHiLoPix&)GetAverageHiGainArea(aidx); 635 histhi.FillHivsLo(sighi,siglo); 636 } 637 348 638 fSumareahi [aidx] += ratio; 349 639 fNumareahi [aidx] ++; … … 371 661 for (Int_t j=0; j<nareas; j++) 372 662 { 373 MHCalibrationPix &histhi = GetAverageHiGainArea(j); 663 664 MHCalibrationHiLoPix &histhi = (MHCalibrationHiLoPix&)GetAverageHiGainArea(j); 665 374 666 if (IsOscillations()) 375 667 histhi.FillHistAndArray(fNumareahi[j] == 0 ? 0. : fSumareahi[j]/fNumareahi[j]); … … 390 682 { 391 683 MHCalibrationPix &hist = GetAverageHiGainSector(j); 684 392 685 if (IsOscillations()) 393 686 hist.FillHistAndArray(fNumsectorhi[j] == 0 ? 0. : fSumsectorhi[j]/fNumsectorhi[j]); … … 397 690 if (IsLoGain()) 398 691 { 692 399 693 MHCalibrationPix &histlo = GetAverageLoGainSector(j); 694 400 695 if (IsOscillations()) 401 696 histlo.FillHistAndArray(fNumsectorlo[j] == 0 ? 0. : fSumsectorlo[j]/fNumsectorlo[j]); … … 425 720 426 721 const Int_t nareas = fAverageHiGainAreas->GetSize(); 427 const Int_t nsectors = fAverageHiGainSectors->GetSize();428 722 429 723 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 430 724 { 431 725 432 MHCalibration Pix &hist =(*this)[i];726 MHCalibrationHiLoPix &hist = (MHCalibrationHiLoPix&)(*this)[i]; 433 727 434 728 if (hist.IsExcluded()) … … 436 730 437 731 CheckOverflow(hist); 732 733 TProfile *h = hist.GetHivsLo(); 734 h->Fit("pol1","RQ","",fLowerFitLimitProfile,fUpperFitLimitProfile); 735 736 TF1 *fit = h->GetFunction("pol1"); 737 738 const Float_t gainr = fit->GetParameter(1) > 0.001 739 ? 1./fit->GetParameter(1) 740 : 0.; 741 const Float_t offset = fit->GetParameter(0)/fUsedLoGainSlices; 742 743 fHivsLoResults.Fill(offset,gainr); 744 745 MCalibrationHiLoPix &pix = (MCalibrationHiLoPix&)(*fCam)[i]; 746 pix.SetOffsetPerSlice(offset); 747 pix.SetGainRatio (gainr ); 748 438 749 } 439 750 … … 472 783 { 473 784 for (Int_t j=0; j<nareas; j++) 474 CheckOverflow(GetAverageLoGainArea(j)); 475 476 for (Int_t j=0; j<nsectors; j++) 477 CheckOverflow(GetAverageLoGainSector(j)); 785 { 786 787 MHCalibrationHiLoPix &hist = (MHCalibrationHiLoPix&)GetAverageHiGainArea(j); 788 // 789 // Check histogram overflow 790 // 791 CheckOverflow(hist); 792 793 TProfile *h = hist.GetHivsLo(); 794 h->Fit("pol1","RQ","",fLowerFitLimitProfile,fUpperFitLimitProfile); 795 796 TF1 *fit = h->GetFunction("pol1"); 797 798 const Float_t gainr = fit->GetParameter(1) > 0.001 799 ? 1./fit->GetParameter(1) 800 : 0.; 801 const Float_t offset = fit->GetParameter(0)/fUsedLoGainSlices; 802 803 MCalibrationHiLoPix &pix = (MCalibrationHiLoPix&)fCam->GetAverageArea(0); 804 pix.SetOffsetPerSlice(offset); 805 pix.SetGainRatio (gainr ); 806 807 } 808 809 for (Int_t j=0; j<fAverageHiGainSectors->GetSize(); j++) 810 { 811 812 MHCalibrationHiLoPix &hist = (MHCalibrationHiLoPix&)GetAverageHiGainSector(j); 813 // 814 // Check histogram overflow 815 // 816 CheckOverflow(hist); 817 818 TProfile *h = hist.GetHivsLo(); 819 h->Fit("pol1","RQ","",fLowerFitLimitProfile,fUpperFitLimitProfile); 820 821 TF1 *fit = h->GetFunction("pol1"); 822 823 const Float_t gainr = fit->GetParameter(1) > 0.001 824 ? 1./fit->GetParameter(1) 825 : 0.; 826 const Float_t offset = fit->GetParameter(0)/fUsedLoGainSlices; 827 828 MCalibrationHiLoPix &pix = (MCalibrationHiLoPix&)fCam->GetAverageSector(0); 829 pix.SetOffsetPerSlice(offset); 830 pix.SetGainRatio (gainr ); 831 832 } 478 833 } 479 834 … … 680 1035 } 681 1036 1037 Int_t MHCalibrationHiLoCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 1038 { 1039 1040 Bool_t rc = kFALSE; 1041 1042 if (MHCalibrationCam::ReadEnv(env,prefix,print)) 1043 rc = kTRUE; 1044 1045 if (IsEnvDefined(env, prefix, "LowerFitLimitProfile", print)) 1046 { 1047 SetLowerFitLimitProfile(GetEnvValue(env, prefix, "LowerFitLimitProfile", fLowerFitLimitProfile)); 1048 rc = kTRUE; 1049 } 1050 1051 if (IsEnvDefined(env, prefix, "UpperFitLimitProfile", print)) 1052 { 1053 SetUpperFitLimitProfile(GetEnvValue(env, prefix, "UpperFitLimitProfile", fUpperFitLimitProfile)); 1054 rc = kTRUE; 1055 } 1056 1057 if (IsEnvDefined(env, prefix, "HivsLoNbins", print)) 1058 { 1059 SetHivsLoNbins(GetEnvValue(env, prefix, "HivsLoNbins", fHivsLoNbins)); 1060 rc = kTRUE; 1061 } 1062 1063 if (IsEnvDefined(env, prefix, "HivsLoFirst", print)) 1064 { 1065 SetHivsLoFirst(GetEnvValue(env, prefix, "HivsLoFirst", fHivsLoFirst)); 1066 rc = kTRUE; 1067 } 1068 1069 if (IsEnvDefined(env, prefix, "HivsLoLast", print)) 1070 { 1071 SetHivsLoLast(GetEnvValue(env, prefix, "HivsLoLast", fHivsLoLast)); 1072 rc = kTRUE; 1073 } 1074 1075 return rc; 1076 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.h
r7095 r7189 14 14 #endif 15 15 16 class TH1F; 16 #ifndef ROOT_TH2F 17 #include <TH2F.h> 18 #endif 17 19 18 20 class MGeomCam; 19 21 class MArrivalTimeCam; 22 class MHCalibrationHiLoPix; 20 23 21 24 class MHCalibrationHiLoCam : public MHCalibrationCam 22 25 { 23 26 private: 24 static const Int_t fgNbins; //! Default number of bins (now set to: 900 ) 25 static const Axis_t fgFirst; //! Default lower histogram limit (now set to: -13.5 ) 26 static const Axis_t fgLast; //! Default upper histogram limit (now set to: 13.5 ) 27 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0) 28 29 static const TString gsHistName; //! Default Histogram names 30 static const TString gsHistTitle; //! Default Histogram titles 31 static const TString gsHistXTitle; //! Default Histogram x-axis titles 32 static const TString gsHistYTitle; //! Default Histogram y-axis titles 27 static const Int_t fgNbins; //! Default number of bins (now set to: 900 ) 28 static const Axis_t fgFirst; //! Default lower histogram limit (now set to: -13.5 ) 29 static const Axis_t fgLast; //! Default upper histogram limit (now set to: 13.5 ) 30 static const Float_t fgProbLimit; //! The default for fProbLimit (now set to: 0.0) 33 31 34 MArrayD fSumareahi ; // 35 MArrayD fSumsectorhi; // 36 MArrayI fNumareahi ; // 37 MArrayI fNumsectorhi; // 38 MArrayD fSumarealo ; // 39 MArrayD fSumsectorlo; // 40 MArrayI fNumarealo ; // 41 MArrayI fNumsectorlo; // 32 static const Int_t fgHivsLoNbins; //! Default number of bins (now set to: 900 ) 33 static const Axis_t fgHivsLoFirst; //! Default lower histogram limit (now set to: -13.5 ) 34 static const Axis_t fgHivsLoLast; //! Default upper histogram limit (now set to: 13.5 ) 42 35 43 MArrivalTimeCam *fArrTimes; //! Pointer to arrival times 36 static const Axis_t fgLowerFitLimitProfile; //! Default for fLowerFitLimitProfile (now set to: 480. ) 37 static const Axis_t fgUpperFitLimitProfile; //! Default for fUpperFitLimitProfile (now set to: 680. ) 44 38 45 Bool_t ReInitHists(MParList *pList);46 Bool_t FillHists(const MParContainer *par, const Stat_t w=1);47 Bool_t FinalizeHists();48 void FinalizeBadPixels();39 static const TString gsHistName; //! Default Histogram names 40 static const TString gsHistTitle; //! Default Histogram titles 41 static const TString gsHistXTitle; //! Default Histogram x-axis titles 42 static const TString gsHistYTitle; //! Default Histogram y-axis titles 49 43 50 void CheckOverflow( MHCalibrationPix &pix); 44 static const TString gsHivsLoHistName; //! Default names hi vs. lo profile 45 static const TString gsHivsLoHistTitle; //! Default titles hi vs. lo profile 46 static const TString gsHivsLoHistXTitle; //! Default x-axis titles hi vs. lo profile 47 static const TString gsHivsLoHistYTitle; //! Default y-axis titles hi vs. lo profile 48 49 TString fHivsLoHistName; // names hi vs. lo profile 50 TString fHivsLoHistTitle; // titles hi vs. lo profile 51 TString fHivsLoHistXTitle; // x-axis titles hi vs. lo profile 52 TString fHivsLoHistYTitle; // y-axis titles hi vs. lo profile 53 54 Int_t fHivsLoNbins; // Number of HivsLo bins 55 Axis_t fHivsLoFirst; // Lower histogram limit low gain 56 Axis_t fHivsLoLast; // Upper histogram limit low gain 57 58 Axis_t fLowerFitLimitProfile; // Lower limit for hi-vs. logain fit 59 Axis_t fUpperFitLimitProfile; // Upper limit for hi-vs. logain fit 60 61 MArrayD fSumareahi ; // 62 MArrayD fSumsectorhi; // 63 MArrayI fNumareahi ; // 64 MArrayI fNumsectorhi; // 65 MArrayD fSumarealo ; // 66 MArrayD fSumsectorlo; // 67 MArrayI fNumarealo ; // 68 MArrayI fNumsectorlo; // 69 70 MArrivalTimeCam *fArrTimes; //! Pointer to arrival times 71 72 TH2F fHivsLoResults; // Results from pol1-fit 73 74 Float_t fUsedLoGainSlices; // Used low-gain FADC slices 75 Bool_t ReInitHists(MParList *pList); 76 Bool_t FillHists(const MParContainer *par, const Stat_t w=1); 77 Bool_t FinalizeHists(); 78 void FinalizeBadPixels(); 79 80 void InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 81 void InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 82 83 void FinalizeHivsLo (MHCalibrationHiLoPix &hist); 84 85 void CheckOverflow( MHCalibrationPix &pix); 86 87 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 51 88 52 89 public: … … 55 92 // Clone 56 93 TObject *Clone(const char *name="") const; 94 95 TH2F &GetHivsLoResults() { return fHivsLoResults; } 96 97 void SetHivsLoHistName ( const char *name ) { fHivsLoHistName = name; } 98 void SetHivsLoHistTitle ( const char *name ) { fHivsLoHistTitle = name; } 99 void SetHivsLoHistXTitle ( const char *name ) { fHivsLoHistXTitle = name; } 100 void SetHivsLoHistYTitle ( const char *name ) { fHivsLoHistYTitle = name; } 101 102 void SetHivsLoNbins ( const Int_t i=fgHivsLoNbins ) { fHivsLoNbins = i; } 103 void SetHivsLoFirst ( const Axis_t f=fgHivsLoFirst ) { fHivsLoFirst = f; } 104 void SetHivsLoLast ( const Axis_t f=fgHivsLoLast ) { fHivsLoLast = f; } 105 106 void SetLowerFitLimitProfile( const Axis_t f=fgLowerFitLimitProfile ) { fLowerFitLimitProfile = f; } 107 void SetUpperFitLimitProfile( const Axis_t f=fgUpperFitLimitProfile ) { fUpperFitLimitProfile = f; } 57 108 58 109 // Draw -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPulseTimeCam.cc
r7028 r7189 464 464 465 465 if (npix > fNumPixelsRequired) 466 GetAverageHiGainArea(j).FillHist(fSumhiarea[j]/npix); 466 { 467 if (IsOscillations()) 468 GetAverageHiGainArea(j).FillHistAndArray(fSumhiarea[j]/npix); 469 else 470 GetAverageHiGainArea(j).FillHist(fSumhiarea[j]/npix); 471 472 } 467 473 } 468 474 … … 473 479 474 480 if (npix > 0) 475 GetAverageHiGainSector(j).FillHist(fSumhisector [j]/npix); 481 { 482 if (IsOscillations()) 483 GetAverageHiGainSector(j).FillHistAndArray(fSumhisector [j]/npix); 484 else 485 GetAverageHiGainSector(j).FillHist(fSumhisector [j]/npix); 486 } 476 487 } 477 488 … … 560 571 { 561 572 *fLog << dbginf << GetDescriptor() << ": ID " << GetName() 573 << " "<<pix.GetPixId() 562 574 << " Mean: " << hist.GetMean () 563 575 << " MeanErr: " << hist.GetMeanErr () -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h
r7188 r7189 169 169 void SimulateGausEvents(const Float_t mean, const Float_t sigma, const Int_t nevts=4096); // *MENU* 170 170 171 ClassDef(MHGausEvents, 3) // Base class for events with Gaussian distributed values171 ClassDef(MHGausEvents, 4) // Base class for events with Gaussian distributed values 172 172 }; 173 173 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r7127 r7189 74 74 #include "MCalibrationIntensityRelTimeCam.h" 75 75 #include "MCalibrationIntensityQECam.h" 76 #include "MCalibrationIntensityConstCam.h" 76 77 #include "MBadPixelsIntensityCam.h" 77 78 … … 268 269 MCalibrationIntensityBlindCam iblcam; 269 270 MCalibrationIntensityRelTimeCam itmcam; 271 MCalibrationIntensityConstCam icncam; 270 272 MBadPixelsIntensityCam ibdcam; 271 273 … … 299 301 interlacedcont.Add(&itmcam); 300 302 interlacedcont.Add(&ibdcam); 303 interlacedcont.Add(&icncam); 301 304 interlacedcont.Add(&hchacam); 302 305 if (IsUseBlindPixel()) … … 317 320 calibcont.Add(&qecam); 318 321 calibcont.Add(&bndcam); 319 calibcont.Add(&pind);320 322 calibcont.Add(&tmcam); 323 if (IsUseBlindPixel()) 324 calibcont.Add(&bndcam); 321 325 322 326 if (!ReadCalibration(calibcont, badpix, extractor2, extractor3, geom)) … … 362 366 // This is necessary for the case in which it is not in the files 363 367 MBadPixelsCam badcam; 368 icncam.SetBadPixels(&badpix); 364 369 365 370 // Setup Parlist … … 524 529 525 530 MCalibrationChargeCalc chcalc; 531 chcalc.SetExtractor(extractor3); 532 526 533 MCalibrationRelTimeCalc recalc; 527 534 MCalibCalcFromPast pacalc; … … 570 577 // MHCamEvent evt3(4, "PedPhot", "Calibrated Pedestal;;P [phe]"); 571 578 MHCamEvent evt4( 5, "PedRMS", "Calibrated RMS from Extractor applied to ped.;;\\sigma_{p} [phe]"); 572 MHCamEvent evt5( 0, "Interp'd", "Interpolated Signal per area scaleA/A_{0};;S [phe]");579 MHCamEvent evt5( 0, "Interp'd", "Interpolated Signal scaled with A/A_{0};;S [phe]"); 573 580 MHCamEvent evt6(102, "Unsuitable", "Fraction of unsuitable events per Pixel;;[1]"); 574 581 MHCamEvent evt7( 6, "Times", "Calibrated Arrival Time;;T [fadc sl]"); … … 577 584 evt6.SetThreshold(); 578 585 579 MFillH fill0(&evt0, "MPedestalFundamental", "FillPedFLG");580 MFillH fill1(&evt1, "MPedestalFromExtractorRndm", "FillPedRmsFLG");581 MFillH fill2(&evt2, "MExtractedSignalCam", "FillExtracted");586 MFillH fill0(&evt0, "MPedestalFundamental", "FillPedFLG"); 587 MFillH fill1(&evt1, "MPedestalFromExtractorRndm", "FillPedRmsFLG"); 588 MFillH fill2(&evt2, "MExtractedSignalCam", "FillExtracted"); 582 589 // MFillH fill3(&evt3, "MPedPhotFundamental", "FillPedPhot"); 583 MFillH fill4(&evt4, "MPedPhotFromExtractorRndm", "FillPedRMS");584 MFillH fill5(&evt5, "MSignalCam", "FillInterpolated");585 MFillH fill6(&evt6, "MBadPixelsCam", "FillUnsuitable");586 MFillH fill7(&evt7, "MSignalCam", "FillTimes");587 MFillH fill8(&evt8, "MCalib ConstCam","FillConv");588 MFillH fill9(&evt9, "MSignalCam", "FillPulse");590 MFillH fill4(&evt4, "MPedPhotFromExtractorRndm", "FillPedRMS"); 591 MFillH fill5(&evt5, "MSignalCam", "FillInterpolated"); 592 MFillH fill6(&evt6, "MBadPixelsCam", "FillUnsuitable"); 593 MFillH fill7(&evt7, "MSignalCam", "FillTimes"); 594 MFillH fill8(&evt8, "MCalibrationIntensityConstCam", "FillConv"); 595 MFillH fill9(&evt9, "MSignalCam", "FillPulse"); 589 596 590 597 MTaskEnv fillflorian("FinalFantasy"); -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r7188 r7189 1838 1838 MCalibrationChargeCalc calcalc; 1839 1839 MCalibrationRelTimeCalc timecalc; 1840 calcalc.SetExtractor(fExtractor); 1840 1841 calcalc.SetOutputFile(""); 1841 1842 timecalc.SetOutputFile(""); -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r7188 r7189 174 174 } 175 175 176 TObject *o = file.Get("ExtractSignal");177 if (o && !o->InheritsFrom(MExtractor::Class()))178 {179 *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;180 return NULL;181 }182 183 176 if (file.FindKey("MBadPixelsCam")) 184 177 { … … 190 183 } 191 184 185 if (fExtractor) 186 return fExtractor; 187 188 TObject *o=0; 189 o = file.Get("ExtractSignal"); 190 if (o && !o->InheritsFrom(MExtractor::Class())) 191 { 192 *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl; 193 return NULL; 194 } 192 195 return o ? (MExtractor*)o->Clone("ExtractSignal") : NULL; 193 196 }
Note:
See TracChangeset
for help on using the changeset viewer.