Changeset 5946 for trunk/MagicSoft
- Timestamp:
- 01/23/05 13:49:09 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5942 r5946 20 20 21 21 -*-*- END OF LINE -*-*- 22 23 2005/01/23 Markus Gaug 24 25 * mhcalib/MHCalibrationHiLoCam.[h,cc] 26 - updated to new logain switch setting in MExtractTimeAndCharge 27 - extract also high-gain vs. low-gain time difference 28 29 * mhcalib/MCalibrationHiLoCam.[h,cc] 30 * mhcalib/MCalibrationHiLoPix.[h,cc] 31 * mhcalib/MCalibrationIntensityHiLoCam.[h,cc] 32 - updated accordingly 22 33 23 34 2005/01/22 Markus Gaug -
trunk/MagicSoft/Mars/mcalib/MCalibrationHiLoCam.cc
r5749 r5946 139 139 *fLog << all 140 140 << Form("%s%4i%s%4.2f%s%4.2f%s%4.2f%s%4.2f","Pix ",pix->GetPixId(), 141 ": Ratio: ",pix->GetHiLo Ratio()," +- ",pix->GetHiLoRatioErr(),142 " Sigma: ",pix->GetHiLo Sigma()," +- ",pix->GetHiLoSigmaErr())141 ": Ratio: ",pix->GetHiLoChargeRatio()," +- ",pix->GetHiLoChargeRatioErr(), 142 " Sigma: ",pix->GetHiLoChargeRatioSigma()," +- ",pix->GetHiLoChargeRatioSigmaErr()) 143 143 << endl; 144 144 id++; … … 173 173 *fLog << all 174 174 << Form("%s%4i%s%4.2f%s%4.2f%s%4.2f%s%4.2f","Average Area ",pix->GetPixId(), 175 ": Ratio: ",pix->GetHiLo Ratio()," +- ",pix->GetHiLoRatioErr(),176 " Sigma: ",pix->GetHiLo Sigma()," +- ",pix->GetHiLoSigmaErr())175 ": Ratio: ",pix->GetHiLoChargeRatio()," +- ",pix->GetHiLoChargeRatioErr(), 176 " Sigma: ",pix->GetHiLoChargeRatioSigma()," +- ",pix->GetHiLoChargeRatioSigmaErr()) 177 177 << endl; 178 178 } … … 183 183 *fLog << all 184 184 << Form("%s%4i%s%4.2f%s%4.2f%s%4.2f%s%4.2f","Average Sector ",pix->GetPixId(), 185 ": Ratio: ",pix->GetHiLo Ratio()," +- ",pix->GetHiLoRatioErr(),186 " Sigma: ",pix->GetHiLo Sigma()," +- ",pix->GetHiLoSigmaErr())185 ": Ratio: ",pix->GetHiLoChargeRatio()," +- ",pix->GetHiLoChargeRatioErr(), 186 " Sigma: ",pix->GetHiLoChargeRatioSigma()," +- ",pix->GetHiLoChargeRatioSigmaErr()) 187 187 << endl; 188 188 } … … 225 225 if (pix.IsExcluded()) 226 226 return kFALSE; 227 val = pix.Get Mean();227 val = pix.GetHiLoChargeRatio(); 228 228 break; 229 229 case 1: 230 230 if (pix.IsExcluded()) 231 231 return kFALSE; 232 val = pix.Get MeanErr();232 val = pix.GetHiLoChargeRatioErr(); 233 233 break; 234 234 case 2: 235 235 if (pix.IsExcluded()) 236 236 return kFALSE; 237 val = pix.Get Sigma();237 val = pix.GetHiLoChargeRatioSigma(); 238 238 break; 239 239 case 3: 240 240 if (pix.IsExcluded()) 241 241 return kFALSE; 242 val = pix.Get SigmaErr();242 val = pix.GetHiLoChargeRatioSigmaErr(); 243 243 break; 244 244 case 4: 245 245 if (pix.IsExcluded()) 246 246 return kFALSE; 247 val = pix.GetProb(); 247 val = pix.GetHiLoChargeRatioProb(); 248 break; 249 case 5: 250 if (pix.IsExcluded()) 251 return kFALSE; 252 val = pix.GetHiLoTimeDiff(); 253 break; 254 case 6: 255 if (pix.IsExcluded()) 256 return kFALSE; 257 val = pix.GetHiLoTimeDiffErr(); 258 break; 259 case 7: 260 if (pix.IsExcluded()) 261 return kFALSE; 262 val = pix.GetHiLoTimeDiffSigma(); 263 break; 264 case 8: 265 if (pix.IsExcluded()) 266 return kFALSE; 267 val = pix.GetHiLoTimeDiffSigmaErr(); 268 break; 269 case 9: 270 if (pix.IsExcluded()) 271 return kFALSE; 272 val = pix.GetHiLoTimeDiffProb(); 248 273 break; 249 274 default: -
trunk/MagicSoft/Mars/mcalib/MCalibrationHiLoPix.h
r5749 r5946 15 15 ~MCalibrationHiLoPix() {} 16 16 17 Float_t GetHiLoRatio() const { return GetMean(); } 18 Float_t GetHiLoRatioErr() const { return GetMeanErr(); } 19 Float_t GetHiLoSigma() const { return GetSigma(); } 20 Float_t GetHiLoSigmaErr() const { return GetSigmaErr(); } 17 Float_t GetHiLoChargeRatio() const { return GetHiGainMean(); } 18 Float_t GetHiLoChargeRatioErr() const { return GetHiGainMeanErr(); } 19 Float_t GetHiLoChargeRatioSigma() const { return GetHiGainSigma(); } 20 Float_t GetHiLoChargeRatioSigmaErr() const { return GetHiGainSigmaErr(); } 21 Float_t GetHiLoChargeRatioProb() const { return GetHiGainProb(); } 22 23 Float_t GetHiLoTimeDiff() const { return GetLoGainMean(); } 24 Float_t GetHiLoTimeDiffErr() const { return GetLoGainMeanErr(); } 25 Float_t GetHiLoTimeDiffSigma() const { return GetLoGainSigma(); } 26 Float_t GetHiLoTimeDiffSigmaErr() const { return GetLoGainSigmaErr(); } 27 Float_t GetHiLoTimeDiffProb() const { return GetLoGainProb(); } 21 28 22 29 ClassDef(MCalibrationHiLoPix, 1) // Container HiLo conversion Calibration Results Pixel -
trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityHiLoCam.cc
r5749 r5946 139 139 continue; 140 140 // 141 ratio[cnt] = relpix.GetHiLo Ratio();142 ratioerr[cnt] = relpix.GetHiLo RatioErr();141 ratio[cnt] = relpix.GetHiLoChargeRatio(); 142 ratioerr[cnt] = relpix.GetHiLoChargeRatioErr(); 143 143 // 144 144 sig [cnt] = pix.GetPheFFactorMethod(); … … 219 219 continue; 220 220 221 ratiool += relpix.GetHiLo Ratio();222 ratiool2 += relpix.GetHiLo Ratio()*relpix.GetHiLoRatio();221 ratiool += relpix.GetHiLoChargeRatio(); 222 ratiool2 += relpix.GetHiLoChargeRatio()*relpix.GetHiLoChargeRatio(); 223 223 num++; 224 224 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc
r5864 r5946 95 95 #include "MExtractedSignalCam.h" 96 96 #include "MExtractedSignalPix.h" 97 98 #include "M RawEvtPixelIter.h"97 #include "MArrivalTimeCam.h" 98 #include "MArrivalTimePix.h" 99 99 100 100 #include "MGeomCam.h" … … 128 128 const TString MHCalibrationHiLoCam::gsHistXTitle = "Amplification Ratio [1]"; 129 129 const TString MHCalibrationHiLoCam::gsHistYTitle = "Nr. events"; 130 const Byte_t MHCalibrationHiLoCam::fgLowerLim = 200;131 const Byte_t MHCalibrationHiLoCam::fgUpperLim = 252;132 130 // -------------------------------------------------------------------------- 133 131 // … … 164 162 SetHistYTitle(gsHistYTitle.Data()); 165 163 166 SetLowerLim();167 SetUpperLim();168 164 } 169 165 … … 207 203 208 204 const Int_t navhi = fAverageHiGainAreas->GetSize(); 205 const Int_t navlo = fAverageLoGainAreas->GetSize(); 209 206 210 207 for (int i=0; i<navhi; i++) 211 208 cam->fAverageHiGainAreas->AddAt(GetAverageHiGainArea(i).Clone(),i); 212 209 210 for (int i=0; i<navlo; i++) 211 cam->fAverageLoGainAreas->AddAt(GetAverageLoGainArea(i).Clone(),i); 212 213 213 return cam; 214 }215 216 // --------------------------------------------------------------------------217 //218 // Gets the pointers to:219 // - MRawEvtData220 //221 Bool_t MHCalibrationHiLoCam::SetupHists(const MParList *pList)222 {223 224 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");225 if (!fRawEvt)226 {227 *fLog << err << dbginf << "MRawEvtData not found... aborting." << endl;228 return kFALSE;229 }230 231 return kTRUE;232 214 } 233 215 … … 239 221 // Searches pointer to: 240 222 // - MExtractedSignalCam 223 // - MArrivalTimeCam 241 224 // 242 225 // Calls: 243 226 // - MHCalibrationCam::InitHiGainArrays() 227 // - MHCalibrationCam::InitLoGainArrays() 244 228 // 245 229 // Sets: 246 // - SetLoGain(kFALSE);247 230 // - fSumarea to nareas 248 231 // - fSumsector to nareas … … 263 246 } 264 247 248 MArrivalTimeCam *times = (MArrivalTimeCam*)pList->FindObject("MArrivalTimeCam"); 249 if (!times) 250 { 251 *fLog << warn << "MArrivalTimeCam not found... cannot calibrated arrival times between " 252 <<"high and low-gain" << endl; 253 SetLoGain(kFALSE); 254 } 255 265 256 const Int_t npixels = fGeom->GetNumPixels(); 266 257 const Int_t nsectors = fGeom->GetNumSectors(); … … 268 259 269 260 InitHiGainArrays(npixels,nareas,nsectors); 270 271 fSumarea .Set(nareas); 272 fSumsector.Set(nsectors); 273 fNumarea .Set(nareas); 274 fNumsector.Set(nsectors); 275 276 SetLoGain(kFALSE); 277 261 InitLoGainArrays(npixels,nareas,nsectors); 262 263 fSumareahi .Set(nareas); 264 fSumsectorhi.Set(nsectors); 265 fNumareahi .Set(nareas); 266 fNumsectorhi.Set(nsectors); 267 if (IsLoGain()) 268 { 269 fSumarealo .Set(nareas); 270 fSumsectorlo.Set(nsectors); 271 fNumarealo .Set(nareas); 272 fNumsectorlo.Set(nsectors); 273 } 278 274 return kTRUE; 279 275 } … … 290 286 // Fills histograms (MHGausEvents::FillHistAndArray()) with: 291 287 // - MExtractedSignalPix::GetExtractedSignalHiGain(pixid) / MExtractedSignalPix::GetExtractedSignalLoGain; 292 // if the high-gain signal lies in between the limits: fLowerLim and fUpperLim 288 // if the high-gain signal does not show high-gain saturation, but the low-gain 289 // has been extracted. 290 // - MArrivalTimePix::GetArrivalTimeHiGain(pixid) / MArrivalTimePix::GetArrivalTimeLoGain; 291 // if the high-gain signal does not show high-gain saturation, but the low-gain 292 // has been extracted. 293 293 // 294 294 Bool_t MHCalibrationHiLoCam::FillHists(const MParContainer *par, const Stat_t w) … … 302 302 } 303 303 304 MArrivalTimeCam *times = (MArrivalTimeCam*)par; 305 306 const Int_t npixels = fGeom->GetNumPixels(); 304 307 const Int_t nareas = fGeom->GetNumAreas(); 305 308 const Int_t nsectors = fGeom->GetNumSectors(); 306 309 307 fSumarea .Reset(); 308 fSumsector.Reset(); 309 fNumarea .Reset(); 310 fNumsector.Reset(); 311 312 MRawEvtPixelIter pixel(fRawEvt); 313 314 while (pixel.Next()) 315 { 316 317 const Byte_t max = pixel.GetMaxHiGainSample(); 318 319 if (max < fLowerLim || max > fUpperLim) 320 continue; 321 322 const UInt_t pixidx = pixel.GetPixelId(); 323 324 MHCalibrationPix &hist = (*this)[pixidx]; 325 326 if (hist.IsExcluded()) 310 fSumareahi .Reset(); 311 fSumsectorhi.Reset(); 312 fNumareahi .Reset(); 313 fNumsectorhi.Reset(); 314 fSumarealo .Reset(); 315 fSumsectorlo.Reset(); 316 fNumarealo .Reset(); 317 fNumsectorlo.Reset(); 318 319 for (Int_t i=0; i<npixels; i++) 320 { 321 const MExtractedSignalPix &pix = (*signal)[i]; 322 const Int_t aidx = (*fGeom)[i].GetAidx(); 323 const Int_t sector = (*fGeom)[i].GetSector(); 324 325 const Float_t siglo = pix.GetExtractedSignalLoGain(); 326 327 // 328 // Skip all pixels with: 329 // - Saturated high-gain 330 // - Not extracted low-gain 331 // (see MExtractTimeAndCharge::fLoGainSwitch for setting the criteria) 332 // 333 if (siglo < 0.5 || pix.GetNumHiGainSaturated() > 0) 327 334 continue; 328 335 329 const MExtractedSignalPix &pix = (*signal)[pixidx]; 330 const Int_t aidx = (*fGeom)[pixidx].GetAidx(); 331 const Int_t sector = (*fGeom)[pixidx].GetSector(); 332 333 const Float_t ratio = pix.GetExtractedSignalHiGain() / pix.GetExtractedSignalLoGain(); 334 335 hist.FillHistAndArray(ratio) ; 336 fSumarea [aidx] += ratio; 337 fNumarea [aidx] ++; 338 fSumsector[sector] += ratio; 339 fNumsector[sector] ++; 336 const Float_t sighi = pix.GetExtractedSignalHiGain(); 337 const Float_t ratio = sighi / siglo; 338 339 MHCalibrationPix &histhi = (*this)[i]; 340 341 histhi.FillHistAndArray(ratio); 342 fSumareahi [aidx] += ratio; 343 fNumareahi [aidx] ++; 344 fSumsectorhi[sector] += ratio; 345 fNumsectorhi[sector] ++; 346 347 if (IsLoGain()) 348 { 349 const MArrivalTimePix &tix = (*times)[i]; 350 MHCalibrationPix &histlo = (*this)(i); 351 352 const Float_t diff = tix.GetArrivalTimeLoGain() - tix.GetArrivalTimeHiGain(); 353 354 histlo.FillHistAndArray(diff); 355 fSumarealo [aidx] += diff; 356 fNumarealo [aidx] ++; 357 fSumsectorlo[sector] += diff; 358 fNumsectorlo[sector] ++; 359 } 340 360 } 341 361 342 362 for (Int_t j=0; j<nareas; j++) 343 363 { 344 MHCalibrationPix &hist = GetAverageHiGainArea(j); 345 hist.FillHistAndArray(fNumarea[j] == 0 ? 0. : fSumarea[j]/fNumarea[j]); 364 MHCalibrationPix &histhi = GetAverageHiGainArea(j); 365 histhi.FillHistAndArray(fNumareahi[j] == 0 ? 0. : fSumareahi[j]/fNumareahi[j]); 366 367 if (IsLoGain()) 368 { 369 MHCalibrationPix &histlo = GetAverageLoGainArea(j); 370 histlo.FillHistAndArray(fNumarealo[j] == 0 ? 0. : fSumarealo[j]/fNumarealo[j]); 371 } 346 372 } 347 373 … … 349 375 { 350 376 MHCalibrationPix &hist = GetAverageHiGainSector(j); 351 hist.FillHistAndArray(fNumsector[j] == 0 ? 0. : fSumsector[j]/fNumsector[j]); 377 hist.FillHistAndArray(fNumsectorhi[j] == 0 ? 0. : fSumsectorhi[j]/fNumsectorhi[j]); 378 379 if (IsLoGain()) 380 { 381 MHCalibrationPix &histlo = GetAverageLoGainSector(j); 382 histlo.FillHistAndArray(fNumsectorlo[j] == 0 ? 0. : fSumsectorlo[j]/fNumsectorlo[j]); 383 } 352 384 } 353 385 … … 369 401 370 402 MCalibrationCam *hilocam = fIntensCam ? fIntensCam->GetCam() : fCam; 371 MBadPixelsCam *badcam = fIntensBad ? fIntensBad->GetCam() : fBadPixels;372 373 const Int_t nareas = fAverageHiGainAreas->GetSize();403 MBadPixelsCam *badcam = fIntensBad ? fIntensBad->GetCam() : fBadPixels; 404 405 const Int_t nareas = fAverageHiGainAreas->GetSize(); 374 406 const Int_t nsectors = fAverageHiGainSectors->GetSize(); 375 376 TArrayI satarea(nareas);377 TArrayI satsect(nsectors);378 fNumarea .Reset();379 fNumsector.Reset();380 407 381 408 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) … … 387 414 continue; 388 415 389 const Int_t aidx = (*fGeom)[i].GetAidx();390 const Int_t sector = (*fGeom)[i].GetSector();391 392 fNumarea[aidx]++;393 fNumsector[sector]++;394 //395 // Check histogram overflow396 //397 416 CheckOverflow(hist); 398 417 } … … 422 441 MBadPixelsPix::kHiLoOscillating); 423 442 443 if (!IsLoGain()) 444 return kTRUE; 445 446 for (Int_t i=0; i<fLoGainArray->GetSize(); i++) 447 { 448 449 MHCalibrationPix &hist = (*this)(i); 450 451 if (hist.IsExcluded()) 452 continue; 453 454 CheckOverflow(hist); 455 } 456 457 for (Int_t j=0; j<nareas; j++) 458 { 459 460 MHCalibrationPix &hist = GetAverageLoGainArea(j); 461 CheckOverflow(hist); 462 } 463 464 for (Int_t j=0; j<nsectors; j++) 465 { 466 467 MHCalibrationPix &hist = GetAverageLoGainSector(j); 468 CheckOverflow(hist); 469 } 470 471 FitLoGainArrays(*hilocam,*badcam, 472 MBadPixelsPix::kHiLoNotFitted, 473 MBadPixelsPix::kHiLoOscillating); 474 424 475 return kTRUE; 425 476 } … … 478 529 return kFALSE; 479 530 480 const MHCalibrationPix &pix = (*this)[idx]; 531 const MHCalibrationPix &pixhi = (*this)[idx]; 532 const MHCalibrationPix &pixlo = (*this)(idx); 481 533 482 534 switch (type) 483 535 { 484 536 case 0: 485 val = pix .GetMean();537 val = pixhi.GetMean(); 486 538 break; 487 539 case 1: 488 val = pix .GetMeanErr();540 val = pixhi.GetMeanErr(); 489 541 break; 490 542 case 2: 491 val = pix .GetSigma();543 val = pixhi.GetSigma(); 492 544 break; 493 545 case 3: 494 val = pix .GetSigmaErr();546 val = pixhi.GetSigmaErr(); 495 547 break; 496 548 case 4: 497 val = pix .GetProb();549 val = pixhi.GetProb(); 498 550 break; 499 551 case 5: 500 if (!pix .IsGausFitOK())552 if (!pixhi.IsGausFitOK()) 501 553 val = 1.; 502 554 break; 503 555 case 6: 504 if (!pix.IsFourierSpectrumOK()) 556 if (!pixhi.IsFourierSpectrumOK()) 557 val = 1.; 558 break; 559 case 7: 560 if (!IsLoGain()) 561 break; 562 val = pixlo.GetMean(); 563 break; 564 case 8: 565 if (!IsLoGain()) 566 break; 567 val = pixlo.GetMeanErr(); 568 break; 569 case 9: 570 if (!IsLoGain()) 571 break; 572 val = pixlo.GetSigma(); 573 break; 574 case 10: 575 if (!IsLoGain()) 576 break; 577 val = pixlo.GetSigmaErr(); 578 break; 579 case 11: 580 if (!IsLoGain()) 581 break; 582 val = pixlo.GetProb(); 583 break; 584 case 12: 585 if (!IsLoGain()) 586 break; 587 if (!pixlo.IsGausFitOK()) 588 val = 1.; 589 break; 590 case 13: 591 if (!IsLoGain()) 592 break; 593 if (!pixlo.IsFourierSpectrumOK()) 505 594 val = 1.; 506 595 break; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.h
r5749 r5946 33 33 static const TString gsHistYTitle; //! Default Histogram y-axis titles 34 34 35 static const Byte_t fgLowerLim; //! Default for fLowerLimt (now set to: 200) 36 static const Byte_t fgUpperLim; //! Default for fUpperLimt (now set to: 252) 35 MArrayD fSumareahi ; // 36 MArrayD fSumsectorhi; // 37 MArrayI fNumareahi ; // 38 MArrayI fNumsectorhi; // 39 MArrayD fSumarealo ; // 40 MArrayD fSumsectorlo; // 41 MArrayI fNumarealo ; // 42 MArrayI fNumsectorlo; // 37 43 38 Byte_t fLowerLim; // Lower allowed FADC value limit for max. slicey39 Byte_t fUpperLim; // Upper allowed FADC value limit for max. slicey40 41 MArrayD fSumarea ; //42 MArrayD fSumsector; //43 MArrayI fNumarea ; //44 MArrayI fNumsector; //45 46 MRawEvtData *fRawEvt; //! Raw event data47 48 Bool_t SetupHists(const MParList *pList);49 44 Bool_t ReInitHists(MParList *pList); 50 45 Bool_t FillHists(const MParContainer *par, const Stat_t w=1); … … 62 57 TObject *Clone(const char *name="") const; 63 58 64 Byte_t GetLowerLim() const { return fLowerLim; }65 Byte_t GetUpperLim() const { return fUpperLim; }66 67 void SetLowerLim( const UInt_t i=fgLowerLim) { fLowerLim = i; }68 void SetUpperLim( const UInt_t i=fgUpperLim) { fUpperLim = i; }69 70 59 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 71 60 void DrawPixelContent(Int_t idx) const;
Note:
See TracChangeset
for help on using the changeset viewer.