Changeset 3694
- Timestamp:
- 04/09/04 13:33:02 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc
r3678 r3694 212 212 // independently if the MCalibrationPix is filled with values or not. 213 213 // 214 Int_t MCalibrationCam::GetSize() const214 const Int_t MCalibrationCam::GetSize() const 215 215 { 216 216 return fPixels->GetEntriesFast(); … … 222 222 // independently if the MCalibrationPix is filled with values or not. 223 223 // 224 Int_t MCalibrationCam::GetAverageAreas() const224 const Int_t MCalibrationCam::GetAverageAreas() const 225 225 { 226 226 return fAverageAreas->GetEntriesFast(); … … 232 232 // independently if the MCalibrationPix is filled with values or not. 233 233 // 234 Int_t MCalibrationCam::GetAverageSectors() const234 const Int_t MCalibrationCam::GetAverageSectors() const 235 235 { 236 236 return fAverageSectors->GetEntriesFast(); -
trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h
r3678 r3694 39 39 ~MCalibrationCam(); 40 40 41 virtual void Clear ( Option_t *o="" ); 41 virtual void Clear ( Option_t *o=""); 42 virtual void DrawPixelContent( Int_t num) const; 42 43 43 void Init ( const MGeomCam &geom );44 void InitSize ( const UInt_t i );45 void InitAverageAreas ( const UInt_t i );46 void InitAverageSectors ( const UInt_t i );47 48 void SetPulserColor ( const PulserColor_t col=kCT1) { fPulserColor = col; }49 50 44 // Getters 51 Int_t GetSize() const; 52 Int_t GetAverageAreas() const; 53 Int_t GetAverageSectors() const; 54 45 const Int_t GetAverageAreas () const; 55 46 MCalibrationPix &GetAverageArea ( UInt_t i ); 56 47 const MCalibrationPix &GetAverageArea ( UInt_t i ) const; … … 60 51 const MBadPixelsPix &GetAverageBadSector ( UInt_t i ) const; 61 52 MCalibrationPix &GetAverageSector ( UInt_t i ); 53 const Int_t GetAverageSectors () const; 62 54 const MCalibrationPix &GetAverageSector ( UInt_t i ) const; 55 virtual Bool_t GetPixelContent ( Double_t &val, Int_t idx, 56 const MGeomCam &cam, Int_t type=0) const; 57 const PulserColor_t GetPulserColor() const { return fPulserColor; } 58 const Int_t GetSize() const; 59 63 60 MCalibrationPix &operator[] ( UInt_t i ); 64 61 const MCalibrationPix &operator[] ( UInt_t i ) const; 65 62 66 const PulserColor_t GetPulserColor() const { return fPulserColor; } 63 // Inits 64 void Init ( const MGeomCam &geom ); 65 void InitSize ( const UInt_t i ); 66 void InitAverageAreas ( const UInt_t i ); 67 void InitAverageSectors ( const UInt_t i ); 67 68 68 virtual Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;69 v irtual void DrawPixelContent(Int_t num) const;70 69 // Setters 70 void SetPulserColor ( const PulserColor_t col=kCT1 ) { fPulserColor = col; } 71 71 72 ClassDef(MCalibrationCam, 1) // Base class Container for Calibration Results Camera 72 73 }; -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3693 r3694 290 290 { 291 291 292 SETBIT(fFlags, kUseQualityChecks);293 SETBIT(fFlags, kHiLoGainCalibration);294 295 292 fNumHiGainSamples = 0.; 296 293 fNumLoGainSamples = 0.; 297 294 fSqrtHiGainSamples = 0.; 298 295 fSqrtLoGainSamples = 0.; 299 SkipQualityChecks ( kFALSE );300 296 SkipHiLoGainCalibration( kFALSE ); 301 297 } 302 298 303 299 304 // -------------------------------------------------------------------------- 305 // 306 // The PreProcess searches for the following input containers: 307 // - MRawEvtData 300 // ----------------------------------------------------------------------------------- 301 // 302 // The following container are searched for and execution aborted if not in MParList: 308 303 // - MPedestalCam 309 304 // - MExtractedSignalCam 310 // - MExtractedSignalBlindPixel311 // - MExtractedSignalPINDiode312 //313 // The following output containers are also searched and created if314 // they were not found:315 //316 305 // - MCalibrationChargeCam 306 // 307 // The following containers are searched and created if they were not found: 308 // 317 309 // - MCalibrationQECam 318 // 319 // The following output containers are only searched, but not created 320 // 310 // - MBadPixelsCam 311 // 312 // The following output containers are only searched, but not created. If they 313 // cannot be found, the corresponding calibration part is only skipped. 314 // 315 // - MExtractedSignalBlindPixel and MCalibrationChargeBlindPix 316 // - MExtractedSignalPINDiode and MCalibrationChargePINDiode 321 317 // - MTime 322 318 // 323 // Sets the pulser colour in MCalibrationChargeCam 319 // Sets the pulser colour in: 320 // 321 // - MCalibrationChargeCam 322 // - MCalibrationChargeBlindPix 323 // - MCalibrationChargePINDiode 324 324 // 325 325 Int_t MCalibrationChargeCalc::PreProcess(MParList *pList) 326 326 { 327 327 328 // 329 // Containers that have to be there. 330 // 328 331 fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam"); 329 332 if (!fPedestals) … … 340 343 } 341 344 345 fCam = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam"); 346 if (!fCam) 347 { 348 *fLog << err << "Cannot find MCalibrationChargeCam... aborting" << endl; 349 *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl; 350 return kFALSE; 351 } 352 353 // 354 // Containers that are created in case that they are not there. 355 // 356 fQECam = (MCalibrationQECam*)pList->FindCreateObj("MCalibrationQECam"); 357 if (!fQECam) 358 { 359 *fLog << err << "Cannot find nor create MCalibrationQECam... aborting" << endl; 360 return kFALSE; 361 } 362 363 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam"); 364 if (!fBadPixels) 365 { 366 *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl; 367 return kFALSE; 368 } 369 370 // 371 // Optional Containers 372 // 342 373 fSigBlind = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel"); 343 374 if (!fSigBlind) … … 351 382 return kFALSE; 352 383 } 353 fBlindPixel->SetColor( fPulserColor );354 384 } 355 385 … … 365 395 return kFALSE; 366 396 } 367 fPINDiode->SetColor( fPulserColor ); 368 } 369 370 fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam"); 371 if (!fCam) 372 { 373 *fLog << err << "Cannot find nor create MCalibrationChargeCam... aborting" << endl; 374 return kFALSE; 375 } 376 397 } 398 399 fEvtTime = (MTime*)pList->FindObject("MTime"); 400 401 // 402 // Initialize the pulser colours 403 // 377 404 fCam->SetPulserColor( fPulserColor ); 378 405 379 fQECam = (MCalibrationQECam*)pList->FindCreateObj("MCalibrationQECam"); 380 if (!fQECam) 381 { 382 *fLog << err << "Cannot find nor create MCalibrationQECam... aborting" << endl; 383 return kFALSE; 384 } 385 386 fEvtTime = (MTime*)pList->FindObject("MTime"); 406 if (fBlindPixel) 407 fBlindPixel->SetColor( fPulserColor ); 408 409 if (fPINDiode) 410 fPINDiode->SetColor( fPulserColor ); 387 411 388 412 return kTRUE; … … 393 417 // 394 418 // The ReInit searches for the following input containers: 395 // - MRawRunHeader396 419 // - MGeomCam 397 // - MBadPixelsCam398 420 // 399 421 // It retrieves the following variables from MExtractedSignalCam: 400 422 // 401 // fNumHiGainSamples 402 // fNumLoGainSamples 403 // 404 // fFirstUsedSliceHiGain 405 // fLastUsedSliceHiGain 406 // fFirstUsedSliceLoGain 407 // fLastUsedSliceLoGain 408 // 409 // It defines the PixId of every pixel in MCalibrationChargeCam and MCalibrationQECam 410 // It sets all pixels excluded which have the flag fBadBixelsPix::IsBad() set. 423 // - fNumHiGainSamples 424 // - fNumLoGainSamples 425 // 426 // It defines the PixId of every pixel in: 427 // 428 // - MCalibrationChargeCam 429 // - MCalibrationQECam 430 // 431 // It sets all pixels in excluded which have the flag fBadBixelsPix::IsBad() set in: 432 // 433 // - MCalibrationChargePix 434 // - MCalibrationQEPix 435 // 436 // It tests the pulser colour one more time... 411 437 // 412 438 Bool_t MCalibrationChargeCalc::ReInit(MParList *pList ) … … 420 446 } 421 447 422 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");423 if (!fBadPixels)424 {425 *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl;426 return kFALSE;427 }428 429 448 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); 430 449 fNumLoGainSamples = fSignals->GetNumUsedLoGainFADCSlices(); … … 436 455 for (UInt_t i=0; i<npixels; i++) 437 456 { 438 457 439 458 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam) [i]; 440 459 MCalibrationQEPix &pqe = (MCalibrationQEPix&) (*fQECam)[i]; 441 460 MBadPixelsPix &bad = (*fBadPixels)[i]; 442 461 443 462 pix.SetPixId(i); 444 463 pqe.SetPixId(i); 445 464 446 465 if (bad.IsBad()) 447 {466 { 448 467 pix.SetExcluded(); 449 468 pqe.SetExcluded(); 450 469 continue; 451 } 452 453 } 454 455 return kTRUE; 456 } 457 470 } 471 472 } 473 474 if (fPulserColor != fCam->GetPulserColor()) 475 { 476 *fLog << err << GetDescriptor() << ": Pulser colour has changed w.r.t. last file." 477 << "This feature is not yet implemented, sorry ... aborting " << endl; 478 return kFALSE; 479 } 480 481 482 return kTRUE; 483 } 458 484 459 485 // ---------------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r3693 r3694 82 82 83 83 // enums 84 enum { k UseQualityChecks, kHiLoGainCalibration };84 enum { kHiLoGainCalibration }; 85 85 86 86 // functions … … 124 124 void SkipHiLoGainCalibration ( const Bool_t b=kTRUE ) 125 125 { b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration); } 126 void SkipQualityChecks ( const Bool_t b=kTRUE)127 { b ? CLRBIT(fFlags, kUseQualityChecks) : SETBIT(fFlags, kUseQualityChecks); }128 126 129 127 ClassDef(MCalibrationChargeCalc, 1) // Task calculating Calibration Containers and Quantum Efficiencies
Note:
See TracChangeset
for help on using the changeset viewer.