Changeset 3352 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 02/28/04 04:19:05 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r3350 r3352 377 377 *fLog << all << id << " Excluded pixels " << endl; 378 378 *fLog << endl; 379 *fLog << all << "Average Inner Pix: " 380 << ": Ped. Rms: " << fAverageInnerPix->GetPedRms() << " +- " << fAverageInnerPix->GetPedRmsErr() 381 << " Mean signal: " << fAverageInnerPix->GetMeanCharge() << " +- " << fAverageInnerPix->GetSigmaCharge() 379 *fLog << all << "Average Inner Pix:" 380 << " Ped. Rms: " << fAverageInnerPix->GetPedRms() << " +- " << fAverageInnerPix->GetPedRmsErr() 381 << " Mean signal: " << fAverageInnerPix->GetMeanCharge() << " +- " << fAverageInnerPix->GetMeanChargeErr() 382 << " Sigma signal: " << fAverageInnerPix->GetSigmaCharge() << " +- "<< fAverageInnerPix->GetSigmaChargeErr() 382 383 << " Reduced Sigma: " << fAverageInnerPix->GetRSigmaCharge() 383 384 << " Nr Phe's: " << fAverageInnerPix->GetPheFFactorMethod() 384 385 << endl; 385 *fLog << all << "Average Outer Pix: " 386 << ": Ped. Rms: " << fAverageOuterPix->GetPedRms() << " +- " << fAverageOuterPix->GetPedRmsErr() 387 << " Mean signal: " << fAverageOuterPix->GetMeanCharge() << " +- " << fAverageOuterPix->GetSigmaCharge() 386 *fLog << all << "Average Outer Pix:" 387 << " Ped. Rms: " << fAverageOuterPix->GetPedRms() << " +- " << fAverageOuterPix->GetPedRmsErr() 388 << " Mean signal: " << fAverageOuterPix->GetMeanCharge() << " +- " << fAverageOuterPix->GetMeanChargeErr() 389 << " Sigma signal: " << fAverageOuterPix->GetSigmaCharge() << " +- "<< fAverageOuterPix->GetSigmaChargeErr() 388 390 << " Reduced Sigma: " << fAverageOuterPix->GetRSigmaCharge() 389 391 << " Nr Phe's: " << fAverageOuterPix->GetPheFFactorMethod() -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc
r3283 r3352 27 27 // 28 28 // MHCalibrationChargeCam 29 // 30 // Fills the extracted signals of MExtractedSignalCam into the MH-classes: 31 // 32 // MHCalibrationChargeHiGainPix, MHCalibrationChargeLoGainPix for each pixel 33 // and additionally two classes containing an average of the inner and the outer 34 // pixels, respectively 35 // 36 // By default, subsequently the hi-gain classes are treated unless 37 // more than fNumHiGainSaturationLimit (default: 1%) of the overall FADC 38 // slices show saturation. In that case, the low-gain classes are treated. 39 // If more than fNumLoGainSaturationLimit (default: 1%) of the overall 40 // low-gain FADC slices saturate, the pixel is declared not valid and no further 41 // treatment is pursued. 42 // 43 // The filled histograms are fitted to a Gaussian and the mean and sigma with 44 // its errors and the fit probability are extracted. If none of these values are 45 // NaN's and if the probability is bigger than fProbLimit (default: 0.5%), the fit 46 // is declared valid. Otherwise, histogram means and RMS's are taken directly, but the 47 // flag kFitValid is set to FALSE. Outliers of more than fPickUpLimit (default: 5) sigmas 48 // from the mean are counted as PickUp events. 49 // 50 // Additionally, the slice number with the highest value is stored and a corresponding 51 // histogram is filled. This histogram serves only for a rought cross-check if the 52 // signal does not lie at the edges of chose extraction window. 53 // 54 // The class also fills arrays with the signal vs. event number, creates a fourier 55 // spectrum out of it and investigates if the projected frequencies follow an exponential 56 // distribution. In case that the probability of the exponential fit is less than 57 // fProbLimit, the pixel is declared HiGainOscillating or LoGainOscillating, respectively. 58 // 59 // The results are written into MCalibrationChargeCam. 29 60 // 30 // Contains a list of MHCalibrationPix31 // plus the MHCalibrationBlindPix32 // and the MHCalibrationPINDiode33 61 ///////////////////////////////////////////////////////////////////////////// 34 62 #include "MHCalibrationChargeCam.h" 35 63 64 #include <TVirtualPad.h> 65 #include <TCanvas.h> 66 #include <TPad.h> 67 36 68 #include "MLog.h" 37 69 #include "MLogManip.h" … … 41 73 #include "MHCalibrationChargeHiGainPix.h" 42 74 #include "MHCalibrationChargeLoGainPix.h" 75 #include "MHCalibrationChargePix.h" 43 76 44 77 #include "MCalibrationChargeCam.h" 45 78 #include "MCalibrationChargePix.h" 46 79 80 #include "MGeomCam.h" 81 #include "MGeomPix.h" 82 47 83 #include "MRawEvtData.h" 48 84 #include "MRawEvtPixelIter.h" … … 63 99 { 64 100 fName = name ? name : "MHCalibrationChargeCam"; 65 fTitle = title ? title : " ";101 fTitle = title ? title : "Class to fill the calibration histograms "; 66 102 67 103 fHiGainArray = new TObjArray; … … 71 107 fLoGainArray->SetOwner(); 72 108 109 fAverageHiGainInnerPix = new MHCalibrationChargeHiGainPix("AverageHiGainInnerPix","Average HiGain FADC sums of inner pixels"); 110 fAverageLoGainInnerPix = new MHCalibrationChargeLoGainPix("AverageLoGainInnerPix","Average LoGain FADC sums of inner pixels"); 111 fAverageHiGainOuterPix = new MHCalibrationChargeHiGainPix("AverageHiGainOuterPix","Average HiGain FADC sums of outer pixels"); 112 fAverageLoGainOuterPix = new MHCalibrationChargeLoGainPix("AverageLoGainOuterPix","Average LoGain FADC sums of outer pixels"); 113 114 /* 115 fAverageHiGainInnerPix->GetHGausHist()->SetName("HCalibrationChargeAverageInnerHiGainPix"); 116 fAverageHiGainOuterPix->GetHGausHist()->SetName("HCalibrationChargeAverageOuterHiGainPix"); 117 fAverageLoGainInnerPix->GetHGausHist()->SetName("HCalibrationChargeAverageInnerLoGainPix"); 118 fAverageLoGainOuterPix->GetHGausHist()->SetName("HCalibrationChargeAverageOuterLoGainPix"); 119 */ 120 fAverageHiGainInnerPix->GetHGausHist()->SetTitle("Summed FADC slices average Inner pixels HiGain"); 121 fAverageLoGainInnerPix->GetHGausHist()->SetTitle("Summed FADC slices average Inner pixels LoGain"); 122 fAverageHiGainOuterPix->GetHGausHist()->SetTitle("Summed FADC slices average Outer pixels HiGain"); 123 fAverageLoGainOuterPix->GetHGausHist()->SetTitle("Summed FADC slices average Outer pixels LoGain"); 124 125 fAverageHiGainInnerPix->GetHAbsTime()->SetTitle("Absolute Arrival Time average Inner pixels HiGain"); 126 fAverageLoGainInnerPix->GetHAbsTime()->SetTitle("Absolute Arrival Time average Inner pixels LoGain"); 127 fAverageHiGainOuterPix->GetHAbsTime()->SetTitle("Absolute Arrival Time average Outer pixels HiGain"); 128 fAverageLoGainOuterPix->GetHAbsTime()->SetTitle("Absolute Arrival Time average Outer pixels LoGain"); 129 130 fAverageHiGainInnerPix->SetChargeLast(1000.); 131 fAverageLoGainInnerPix->SetChargeLast(100.); 132 fAverageHiGainOuterPix->SetChargeLast(1000.); 133 fAverageLoGainOuterPix->SetChargeLast(100.); 134 135 fAverageHiGainInnerPix->SetChargeNbins(4000); 136 fAverageLoGainInnerPix->SetChargeNbins(4000); 137 fAverageHiGainOuterPix->SetChargeNbins(4000); 138 fAverageLoGainOuterPix->SetChargeNbins(4000); 139 73 140 SetNumHiGainSaturationLimit(); 74 141 SetNumLoGainSaturationLimit(); … … 86 153 delete fHiGainArray; 87 154 delete fLoGainArray; 155 156 delete fAverageHiGainInnerPix; 157 delete fAverageLoGainInnerPix; 158 delete fAverageHiGainOuterPix; 159 delete fAverageLoGainOuterPix; 88 160 } 89 161 … … 131 203 TObject *MHCalibrationChargeCam::Clone(const char *) const 132 204 { 205 133 206 const Int_t nhi = fHiGainArray->GetSize(); 134 207 const Int_t nlo = fLoGainArray->GetSize(); 135 136 208 // 137 209 // FIXME, this might be done faster and more elegant, by direct copy. 138 210 // 139 211 MHCalibrationChargeCam *cam = new MHCalibrationChargeCam; 140 212 // MHCalibrationChargeCam cam; 213 Copy(*cam); 214 215 /* 141 216 cam->fHiGainArray->Expand(nhi); 142 217 cam->fLoGainArray->Expand(nlo); … … 152 227 (*cam->fLoGainArray)[i] = (*fLoGainArray)[i]->Clone(); 153 228 } 229 230 delete cam->fAverageHiGainInnerPix; 231 delete cam->fAverageLoGainInnerPix; 232 delete cam->fAverageHiGainOuterPix; 233 delete cam->fAverageLoGainOuterPix; 234 235 cam->GetAverageHiGainInnerPix() = *(MHCalibrationChargeHiGainPix*)fAverageHiGainInnerPix->Clone(); 236 cam->GetAverageLoGainInnerPix() = *(MHCalibrationChargeLoGainPix*)fAverageLoGainInnerPix->Clone(); 237 238 cam->GetAverageHiGainOuterPix() = *(MHCalibrationChargeHiGainPix*)fAverageHiGainOuterPix->Clone(); 239 cam->GetAverageLoGainOuterPix() = *(MHCalibrationChargeLoGainPix*)fAverageLoGainOuterPix->Clone(); 240 241 fAverageHiGainInnerPix->Copy(cam->GetAverageHiGainInnerPix()); 242 fAverageLoGainInnerPix->Copy(cam->GetAverageLoGainInnerPix()); 243 fAverageHiGainOuterPix->Copy(cam->GetAverageHiGainOuterPix()); 244 fAverageLoGainOuterPix->Copy(cam->GetAverageLoGainOuterPix()); 245 */ 246 154 247 return cam; 155 248 } … … 163 256 { 164 257 258 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData"); 259 260 if (!fRawEvt) 261 { 262 gLog << err << dbginf << "MRawEvtData not found... aborting." << endl; 263 return kFALSE; 264 } 265 266 fGeom = (MGeomCam*)pList->FindObject("MGeomCam"); 267 268 if (!fGeom) 269 { 270 gLog << err << dbginf << "MGeomCam not found... aborting." << endl; 271 return kFALSE; 272 } 273 165 274 fHiGainArray->Delete(); 166 275 fLoGainArray->Delete(); 276 277 fAverageHiGainInnerPix->Init(); 278 fAverageLoGainInnerPix->Init(); 279 fAverageHiGainOuterPix->Init(); 280 fAverageLoGainOuterPix->Init(); 281 167 282 return kTRUE; 168 169 283 } 170 284 … … 179 293 } 180 294 181 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");182 if (!fRawEvt)183 {184 gLog << err << dbginf << "MRawEvtData not found... aborting." << endl;185 return kFALSE;186 }187 188 295 MExtractedSignalCam *signal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam"); 189 296 if (!signal) … … 192 299 return kFALSE; 193 300 } 301 302 const Int_t n = signal->GetSize(); 303 304 if (fHiGainArray->GetEntries()==0) 305 { 306 fHiGainArray->Expand(n); 194 307 195 const Int_t n = signal->GetSize(); 196 197 fHiGainArray->Expand(n); 308 for (Int_t i=0; i<n; i++) 309 { 310 (*fHiGainArray)[i] = new MHCalibrationChargeHiGainPix; 311 (*this)[i].Init(); 312 (*this)[i].ChangeHistId(i); 313 314 } 315 } 316 317 if (fLoGainArray->GetEntries()==0) 318 { 319 fLoGainArray->Expand(n); 320 321 for (Int_t i=0; i<n; i++) 322 { 323 (*fLoGainArray)[i] = new MHCalibrationChargeLoGainPix; 324 (*this)(i).Init(); 325 (*this)(i).ChangeHistId(i); 326 } 327 } 328 329 return kTRUE; 330 } 198 331 199 for (Int_t i=0; i<n; i++)200 {201 (*fHiGainArray)[i] = new MHCalibrationChargeHiGainPix;202 (*this)[i].Init();203 (*this)[i].ChangeHistId(i);204 205 }206 207 fLoGainArray->Expand(n);208 209 for (Int_t i=0; i<n; i++)210 {211 (*fLoGainArray)[i] = new MHCalibrationChargeLoGainPix;212 (*this)(i).Init();213 (*this)(i).ChangeHistId(i);214 }215 216 return kTRUE;217 }218 219 332 220 333 // -------------------------------------------------------------------------- … … 229 342 } 230 343 231 constInt_t n = signal->GetSize();344 Int_t n = signal->GetSize(); 232 345 233 346 if (fHiGainArray->GetEntries() != n) … … 242 355 return kFALSE; 243 356 } 244 357 358 // 359 // First the extracted signal 360 // 361 Float_t sumhiinnertot = 0.; 362 Float_t sumloinnertot = 0.; 363 Float_t sumhioutertot = 0.; 364 Float_t sumlooutertot = 0.; 365 Int_t sumhiinnersat = 0; 366 Int_t sumloinnersat = 0; 367 Int_t sumhioutersat = 0; 368 Int_t sumlooutersat = 0; 369 Int_t numinner = 0; 370 Int_t numouter = 0; 371 245 372 for (int i=0; i<n; i++) 246 373 { 374 247 375 const MExtractedSignalPix &pix = (*signal)[i]; 248 376 … … 253 381 (*this)(i).FillHistAndArray(sumlo); 254 382 255 (*this)[i].SetSaturated((Int_t)pix.GetNumHiGainSaturated()); 256 (*this)(i).SetSaturated((Int_t)pix.GetNumLoGainSaturated()); 257 } 258 383 const Int_t sathi = (Int_t)pix.GetNumHiGainSaturated(); 384 const Int_t satlo = (Int_t)pix.GetNumLoGainSaturated(); 385 386 (*this)[i].SetSaturated(sathi); 387 (*this)(i).SetSaturated(satlo); 388 389 if (fGeom->GetPixRatio(i) == 1.) 390 { 391 sumhiinnertot += sumhi; 392 sumloinnertot += sumlo; 393 sumhiinnersat += sathi; 394 sumloinnersat += satlo; 395 numinner++; 396 } 397 else 398 { 399 sumhioutertot += sumhi; 400 sumlooutertot += sumlo; 401 sumhioutersat += sathi; 402 sumlooutersat += satlo; 403 numouter++; 404 } 405 406 } 407 408 fAverageHiGainInnerPix->FillHistAndArray(sumhiinnertot/numinner); 409 fAverageLoGainInnerPix->FillHistAndArray(sumloinnertot/numinner); 410 fAverageHiGainOuterPix->FillHistAndArray(sumhioutertot/numouter); 411 fAverageLoGainOuterPix->FillHistAndArray(sumlooutertot/numouter); 412 413 fAverageHiGainInnerPix->SetSaturated(sumhiinnersat/numinner); 414 fAverageLoGainInnerPix->SetSaturated(sumloinnersat/numinner); 415 fAverageHiGainOuterPix->SetSaturated(sumhioutersat/numouter); 416 fAverageLoGainOuterPix->SetSaturated(sumlooutersat/numouter); 417 418 // 419 // Now the times 420 // 421 sumhiinnertot = sumloinnertot = sumhioutertot = sumlooutertot = 0.; 422 numinner = numouter = 0; 259 423 MRawEvtPixelIter pixel(fRawEvt); 260 261 424 while (pixel.Next()) 262 425 { … … 270 433 (*this)(pixid).FillAbsTime(timelo); 271 434 272 } 435 if (fGeom->GetPixRatio(pixel.GetPixelId()) == 1.) 436 { 437 sumhiinnertot += timehi; 438 sumloinnertot += timelo; 439 } 440 else 441 { 442 sumhioutertot += timehi; 443 sumlooutertot += timelo; 444 } 445 } 446 447 fAverageHiGainInnerPix-> FillAbsTime(sumhiinnertot/numinner); 448 fAverageLoGainInnerPix-> FillAbsTime(sumloinnertot/numinner); 449 fAverageHiGainOuterPix-> FillAbsTime(sumhioutertot/numouter); 450 fAverageLoGainOuterPix-> FillAbsTime(sumlooutertot/numouter); 273 451 274 452 return kTRUE; … … 291 469 { 292 470 293 MHCalibrationChargeHiGainPix &pixhi = (*this)[i]; 294 MCalibrationChargePix &pix = (*fCam)[i]; 295 296 if (pixhi.IsEmpty()) 297 continue; 298 299 if (pixhi.GetSaturated() > fNumHiGainSaturationLimit*pixhi.GetHGausHist()->GetEntries()) 300 { 301 pix.SetHiGainSaturation(); 302 continue; 303 } 304 305 // 306 // 2) Fit the Hi Gain histograms with a Gaussian 307 // 308 if (pixhi.FitGaus()) 309 pix.SetHiGainFitted(); 310 // 311 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS 312 // 313 else if (pixhi.RepeatFit()) 314 pix.SetHiGainFitted(); 315 else 316 pixhi.BypassFit(); 317 318 // 319 // 4) Check for pickup 320 // 321 pixhi.CountPickup(); 322 323 // 324 // 5) Check for oscillations 325 // 326 pixhi.CreateFourierSpectrum(); 327 328 // 329 // 6) Retrieve the results and store them in this class 330 // 331 pix.SetHiGainMeanCharge( pixhi.GetMean() ); 332 pix.SetHiGainMeanChargeErr( pixhi.GetMeanErr() ); 333 pix.SetHiGainSigmaCharge( pixhi.GetSigma() ); 334 pix.SetHiGainSigmaChargeErr( pixhi.GetSigmaErr() ); 335 pix.SetHiGainChargeProb ( pixhi.GetProb() ); 336 337 pix.SetAbsTimeMean ( pixhi.GetAbsTimeMean()); 338 pix.SetAbsTimeRms ( pixhi.GetAbsTimeRms() ); 339 340 pix.SetHiGainOscillating ( !pixhi.IsFourierSpectrumOK() ); 341 pix.SetHiGainNumPickup ( pixhi.GetPickup() ); 471 MHCalibrationChargeHiGainPix &histhi = (*this)[i]; 472 MCalibrationChargePix &pix = (*fCam)[i]; 473 474 FinalizeHiGainHists(histhi,pix); 342 475 } 343 476 … … 345 478 { 346 479 347 MHCalibrationChargeLoGainPix &pixlo = (*this)(i); 348 MCalibrationChargePix &pix = (*fCam)[i]; 349 350 if (pixlo.IsEmpty()) 351 continue; 352 353 if (pixlo.GetSaturated() > fNumHiGainSaturationLimit*pixlo.GetHGausHist()->GetEntries()) 354 { 355 pix.SetLoGainSaturation(); 356 continue; 357 } 358 // 359 // 2) Fit the Lo Gain histograms with a Gaussian 360 // 361 if (pixlo.FitGaus()) 362 pix.SetLoGainFitted(); 363 // 364 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS 365 // 366 else if (pixlo.RepeatFit()) 367 pix.SetLoGainFitted(); 368 else 369 pixlo.BypassFit(); 370 371 // 372 // 4) Check for pickup 373 // 374 pixlo.CountPickup(); 375 376 // 377 // 5) Check for oscillations 378 // 379 pixlo.CreateFourierSpectrum(); 380 381 // 382 // 6) Retrieve the results and store them in this class 383 // 384 pix.SetLoGainMeanCharge( pixlo.GetMean() ); 385 pix.SetLoGainMeanChargeErr( pixlo.GetMeanErr() ); 386 pix.SetLoGainSigmaCharge( pixlo.GetSigma() ); 387 pix.SetLoGainSigmaChargeErr( pixlo.GetSigmaErr() ); 388 pix.SetLoGainChargeProb ( pixlo.GetProb() ); 389 390 if (pix.IsHiGainSaturation()) 391 { 392 pix.SetAbsTimeMean ( pixlo.GetAbsTimeMean()); 393 pix.SetAbsTimeRms ( pixlo.GetAbsTimeRms() ); 394 } 395 396 pix.SetLoGainOscillating ( !pixlo.IsFourierSpectrumOK() ); 397 pix.SetLoGainNumPickup ( pixlo.GetPickup() ); 398 399 } 480 MHCalibrationChargeLoGainPix &histlo = (*this)(i); 481 MCalibrationChargePix &pix = (*fCam)[i]; 482 483 FinalizeLoGainHists(histlo,pix); 484 } 485 486 FinalizeHiGainHists(*fAverageHiGainInnerPix,*fCam->GetAverageInnerPix()); 487 FinalizeLoGainHists(*fAverageLoGainInnerPix,*fCam->GetAverageInnerPix()); 488 FinalizeHiGainHists(*fAverageHiGainOuterPix,*fCam->GetAverageOuterPix()); 489 FinalizeLoGainHists(*fAverageLoGainOuterPix,*fCam->GetAverageOuterPix()); 400 490 401 491 return kTRUE; 402 492 } 403 493 494 void MHCalibrationChargeCam::FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix) 495 { 496 497 if (hist.IsEmpty()) 498 return; 499 500 if (hist.GetSaturated() > fNumHiGainSaturationLimit*hist.GetHGausHist()->GetEntries()) 501 { 502 pix.SetHiGainSaturation(); 503 return; 504 } 505 506 // 507 // 2) Fit the Hi Gain histograms with a Gaussian 508 // 509 if (hist.FitGaus()) 510 pix.SetHiGainFitted(); 511 // 512 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS 513 // 514 else if (hist.RepeatFit()) 515 pix.SetHiGainFitted(); 516 else 517 hist.BypassFit(); 518 519 // 520 // 4) Check for pickup 521 // 522 hist.CountPickup(); 523 524 // 525 // 5) Check for oscillations 526 // 527 hist.CreateFourierSpectrum(); 528 529 // 530 // 6) Retrieve the results and store them in this class 531 // 532 pix.SetHiGainMeanCharge( hist.GetMean() ); 533 pix.SetHiGainMeanChargeErr( hist.GetMeanErr() ); 534 pix.SetHiGainSigmaCharge( hist.GetSigma() ); 535 pix.SetHiGainSigmaChargeErr( hist.GetSigmaErr() ); 536 pix.SetHiGainChargeProb ( hist.GetProb() ); 537 538 pix.SetAbsTimeMean ( hist.GetAbsTimeMean()); 539 pix.SetAbsTimeRms ( hist.GetAbsTimeRms() ); 540 541 pix.SetHiGainOscillating ( !hist.IsFourierSpectrumOK() ); 542 pix.SetHiGainNumPickup ( hist.GetPickup() ); 543 544 } 545 546 547 void MHCalibrationChargeCam::FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix) 548 { 549 550 551 if (hist.IsEmpty()) 552 return; 553 554 if (hist.GetSaturated() > fNumLoGainSaturationLimit*hist.GetHGausHist()->GetEntries()) 555 { 556 pix.SetLoGainSaturation(); 557 return; 558 } 559 // 560 // 2) Fit the Lo Gain histograms with a Gaussian 561 // 562 if (hist.FitGaus()) 563 pix.SetLoGainFitted(); 564 // 565 // 3) In case of failure set the bit kFitted to false and take histogram means and RMS 566 // 567 else if (hist.RepeatFit()) 568 pix.SetLoGainFitted(); 569 else 570 hist.BypassFit(); 571 572 // 573 // 4) Check for pickup 574 // 575 hist.CountPickup(); 576 577 // 578 // 5) Check for oscillations 579 // 580 hist.CreateFourierSpectrum(); 581 582 // 583 // 6) Retrieve the results and store them in this class 584 // 585 pix.SetLoGainMeanCharge( hist.GetMean() ); 586 pix.SetLoGainMeanChargeErr( hist.GetMeanErr() ); 587 pix.SetLoGainSigmaCharge( hist.GetSigma() ); 588 pix.SetLoGainSigmaChargeErr( hist.GetSigmaErr() ); 589 pix.SetLoGainChargeProb ( hist.GetProb() ); 590 591 if (pix.IsHiGainSaturation()) 592 { 593 pix.SetAbsTimeMean ( hist.GetAbsTimeMean()); 594 pix.SetAbsTimeRms ( hist.GetAbsTimeRms() ); 595 } 596 597 pix.SetLoGainOscillating ( !hist.IsFourierSpectrumOK() ); 598 pix.SetLoGainNumPickup ( hist.GetPickup() ); 599 600 } 601 404 602 Bool_t MHCalibrationChargeCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const 405 603 { … … 413 611 void MHCalibrationChargeCam::DrawPixelContent(Int_t idx) const 414 612 { 415 (*this)[idx].DrawClone(); 416 } 417 613 614 if (idx == -1) 615 fAverageHiGainInnerPix->DrawClone(); 616 if (idx == -2) 617 fAverageHiGainOuterPix->DrawClone(); 618 if (idx == -3) 619 fAverageLoGainInnerPix->DrawClone(); 620 if (idx == -4) 621 fAverageLoGainOuterPix->DrawClone(); 622 (*this)[idx].DrawClone(); 623 624 } 625 626 627 void MHCalibrationChargeCam::Draw(const Option_t *opt) 628 { 629 630 TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 631 pad->SetBorderMode(0); 632 633 pad->Divide(2,2); 634 635 pad->cd(1); 636 637 if (!fAverageHiGainInnerPix->IsEmpty()) 638 gPad->SetLogy(); 639 fAverageHiGainInnerPix->Draw(opt); 640 641 pad->cd(2); 642 643 if (!fAverageLoGainInnerPix->IsEmpty()) 644 gPad->SetLogy(); 645 fAverageLoGainInnerPix->Draw(opt); 646 647 pad->cd(3); 648 649 if (!fAverageHiGainOuterPix->IsEmpty()) 650 gPad->SetLogy(); 651 fAverageHiGainOuterPix->Draw(opt); 652 653 pad->cd(4); 654 655 if (!fAverageLoGainOuterPix->IsEmpty()) 656 gPad->SetLogy(); 657 fAverageLoGainOuterPix->Draw(opt); 658 659 } -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h
r3283 r3352 14 14 15 15 class MRawEvtData; 16 class MGeomCam; 16 17 class MCalibrationChargeCam; 18 class MCalibrationChargePix; 17 19 class MHCalibrationChargeHiGainPix; 18 20 class MHCalibrationChargeLoGainPix; … … 21 23 private: 22 24 23 static const Float_t fgNumHiGainSaturationLimit; // The default number of fNumHiGainSaturationLimit24 static const Float_t fgNumLoGainSaturationLimit; // The default number of fNumLoGainSaturationLimit25 static const Float_t fgNumHiGainSaturationLimit; // The default number of fNumHiGainSaturationLimit 26 static const Float_t fgNumLoGainSaturationLimit; // The default number of fNumLoGainSaturationLimit 25 27 26 28 Float_t fNumHiGainSaturationLimit; // The rel. number of saturated higain FADC slices in the whole run upon which the pixel is called saturated 27 29 Float_t fNumLoGainSaturationLimit; // The rel. number of saturated logain FADC slices in the whole run upon which the pixel is called saturated 28 30 29 TObjArray *fHiGainArray; //-> Array of MHCalibrationChargePix with hists 30 TObjArray *fLoGainArray; //-> Array of MHCalibrationChargePix with hists 31 32 MCalibrationChargeCam *fCam; //! Class holding the results 33 MRawEvtData *fRawEvt; //! Raw event data (time slices) 31 TObjArray *fHiGainArray; //-> Array of MHCalibrationChargePix with hists 32 TObjArray *fLoGainArray; //-> Array of MHCalibrationChargePix with hists 33 MHCalibrationChargeHiGainPix *fAverageHiGainInnerPix; //-> One MHCalibrationChargeHiGainPix with the average of all inner pixels 34 MHCalibrationChargeLoGainPix *fAverageLoGainInnerPix; //-> One MHCalibrationChargeLoGainPix with the average of all inner pixels 35 MHCalibrationChargeHiGainPix *fAverageHiGainOuterPix; //-> One MHCalibrationChargeHiGainPix with the average of all outer pixels 36 MHCalibrationChargeLoGainPix *fAverageLoGainOuterPix; //-> One MHCalibrationChargeLoGainPix with the average of all outer pixels 34 37 38 MCalibrationChargeCam *fCam; //! Class holding the results 39 MRawEvtData *fRawEvt; //! Raw event data (time slices) 40 MGeomCam *fGeom; //! MAGIC geometry 41 42 void FinalizeHiGainHists(MHCalibrationChargeHiGainPix &hist, MCalibrationChargePix &pix); 43 void FinalizeLoGainHists(MHCalibrationChargeLoGainPix &hist, MCalibrationChargePix &pix); 35 44 36 45 public: … … 42 51 void SetNumLoGainSaturationLimit( const Float_t lim=fgNumLoGainSaturationLimit) { fNumLoGainSaturationLimit = lim; } 43 52 44 Float_t GetNumHiGainSaturationLimit() 45 Float_t GetNumLoGainSaturationLimit() 53 Float_t GetNumHiGainSaturationLimit() const { return fNumHiGainSaturationLimit; } 54 Float_t GetNumLoGainSaturationLimit() const { return fNumLoGainSaturationLimit; } 46 55 47 48 MHCalibrationChargeHiGainPix &operator[](UInt_t i); 49 const MHCalibrationChargeHiGainPix &operator[](UInt_t i) const; 56 MHCalibrationChargeHiGainPix &operator[](UInt_t i); 57 const MHCalibrationChargeHiGainPix &operator[](UInt_t i) const; 50 58 51 MHCalibrationChargeLoGainPix &operator()(UInt_t i); 52 const MHCalibrationChargeLoGainPix &operator()(UInt_t i) const; 59 MHCalibrationChargeLoGainPix &operator()(UInt_t i); 60 const MHCalibrationChargeLoGainPix &operator()(UInt_t i) const; 61 62 MHCalibrationChargeHiGainPix &GetAverageHiGainInnerPix() { return *fAverageHiGainInnerPix; } 63 const MHCalibrationChargeHiGainPix &GetAverageHiGainInnerPix() const { return *fAverageHiGainInnerPix; } 64 65 MHCalibrationChargeLoGainPix &GetAverageLoGainInnerPix() { return *fAverageLoGainInnerPix; } 66 const MHCalibrationChargeLoGainPix &GetAverageLoGainInnerPix() const { return *fAverageLoGainInnerPix; } 67 68 MHCalibrationChargeHiGainPix &GetAverageHiGainOuterPix() { return *fAverageHiGainOuterPix; } 69 const MHCalibrationChargeHiGainPix &GetAverageHiGainOuterPix() const { return *fAverageHiGainOuterPix; } 70 71 MHCalibrationChargeLoGainPix &GetAverageLoGainOuterPix() { return *fAverageLoGainOuterPix; } 72 const MHCalibrationChargeLoGainPix &GetAverageLoGainOuterPix() const { return *fAverageLoGainOuterPix; } 53 73 54 74 Bool_t SetupFill(const MParList *pList); … … 58 78 59 79 TObject *Clone(const char *) const; 80 81 // Draw 82 void Draw(const Option_t *opt); 60 83 61 84 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
Note:
See TracChangeset
for help on using the changeset viewer.