- Timestamp:
- 09/11/04 22:13:21 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4949 r4950 37 37 - use new functions InitHiGainArrays and InitLoGainArrays 38 38 39 * mhcalib/MHCalibrationRelTimePix.[h,cc] 40 * mhcalib/MHCalibrationTestPix.[h,cc] 41 * mhcalib/MHCalibrationTestTimePix.[h,cc] 42 - removed 43 39 44 40 45 2004/09/10: Antonio Stamerra -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r4947 r4950 154 154 using namespace std; 155 155 156 const Int_t MHCalibrationChargeCam::fgChargeHiGainNbins = 550; 156 157 const Axis_t MHCalibrationChargeCam::fgChargeHiGainFirst = -100.5; 157 158 const Axis_t MHCalibrationChargeCam::fgChargeHiGainLast = 999.5; 159 const Int_t MHCalibrationChargeCam::fgChargeLoGainNbins = 325; 158 160 const Axis_t MHCalibrationChargeCam::fgChargeLoGainFirst = -150.5; 159 const Axis_t MHCalibrationChargeCam::fgChargeLoGainLast = 499.5; 160 161 const Axis_t MHCalibrationChargeCam::fgChargeLoGainLast = 499.5; 162 const TString MHCalibrationChargeCam::gsHistName = "Charge"; 163 const TString MHCalibrationChargeCam::gsHistTitle = "Signals"; 164 const TString MHCalibrationChargeCam::gsHistXTitle = "Signal [FADC counts]"; 165 const TString MHCalibrationChargeCam::gsHistYTitle = "Nr. events"; 166 const TString MHCalibrationChargeCam::gsAbsHistName = "AbsTime"; 167 const TString MHCalibrationChargeCam::gsAbsHistTitle = "Abs. Arr. Times"; 168 const TString MHCalibrationChargeCam::gsAbsHistXTitle = "Time [FADC slices]"; 169 const TString MHCalibrationChargeCam::gsAbsHistYTitle = "Nr. events"; 161 170 const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.01; 162 171 const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005; … … 180 189 // - fTimeLowerLimit to fgTimeLowerLimit 181 190 // - fTimeUpperLimit to fgTimeUpperLimit 182 // - fNbins to fgChargeHiGainLast-fgChargeHiGainFirst 191 // 192 // - fNbins to fgChargeHiGainNbins 183 193 // - fFirst to fgChargeHiGainFirst 184 194 // - fLast to fgChargeHiGainLast 195 // 196 // - fLoGainNbins to fgChargeLoGainNbins 197 // - fLoGainFirst to fgChargeLoGainFirst 198 // - fLoGainLast to fgChargeLoGainLast 199 // 200 // - fHistName to gsHistName 201 // - fHistTitle to gsHistTitle 202 // - fHistXTitle to gsHistXTitle 203 // - fHistYTitle to gsHistYTitle 204 // 205 // - fAbsHistName to gsAbsHistName 206 // - fAbsHistTitle to gsAbsHistTitle 207 // - fAbsHistXTitle to gsAbsHistXTitle 208 // - fAbsHistYTitle to gsAbsHistYTitle 185 209 // 186 210 MHCalibrationChargeCam::MHCalibrationChargeCam(const char *name, const char *title) … … 196 220 SetTimeUpperLimit(); 197 221 198 SetNbins( (Int_t)(fgChargeHiGainLast-fgChargeHiGainFirst)/2);222 SetNbins(fgChargeHiGainNbins); 199 223 SetFirst(fgChargeHiGainFirst); 200 224 SetLast (fgChargeHiGainLast ); 201 225 202 SetLoGainNbins( (Int_t)(fgChargeLoGainLast-fgChargeLoGainFirst)/2);226 SetLoGainNbins(fgChargeLoGainNbins); 203 227 SetLoGainFirst(fgChargeLoGainFirst); 204 228 SetLoGainLast (fgChargeLoGainLast ); 229 230 SetHistName (gsHistName .Data()); 231 SetHistTitle (gsHistTitle .Data()); 232 SetHistXTitle(gsHistXTitle.Data()); 233 SetHistYTitle(gsHistYTitle.Data()); 234 235 SetAbsHistName (gsAbsHistName .Data()); 236 SetAbsHistTitle (gsAbsHistTitle .Data()); 237 SetAbsHistXTitle(gsAbsHistXTitle.Data()); 238 SetAbsHistYTitle(gsAbsHistYTitle.Data()); 205 239 } 206 240 … … 233 267 // into MCalibrationChargeCam and test for changes in that variable 234 268 // 235 // Initializes, if empty to MGeomCam::GetNumPixels(): 236 // - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray 237 // - MHCalibrationCam::fHiGainOverflow, MHCalibrationCam::fLoGainOverflow 238 // 239 // Initializes, if empty to MGeomCam::GetNumAreas() for: 240 // - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas 241 // 242 // Initializes, if empty to MGeomCam::GetNumSectors() for: 243 // - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors 244 // 245 // Calls MHCalibrationCam::InitHists() for every entry in: 246 // - MHCalibrationCam::fHiGainArray, MHCalibrationCam::fLoGainArray 247 // - MHCalibrationCam::fAverageHiGainAreas, MHCalibrationCam::fAverageLoGainAreas 248 // - MHCalibrationCam::fAverageHiGainSectors, MHCalibrationCam::fAverageLoGainSectors 249 // 250 // Sets Titles and Names for the Charge Histograms: 251 // - MHCalibrationCam::fAverageHiGainAreas 252 // - MHCalibrationCam::fAverageHiGainSectors 269 // Calls: 270 // - InitHiGainArrays() 271 // - InitLoGainArrays() 253 272 // 273 // Sets: 274 // - fSumhiarea to nareas 275 // - fSumloarea to nareas 276 // - fTimehiarea to nareas 277 // - fTimeloarea to nareas 278 // - fSumhisector to nsectors 279 // - fSumlosector to nsectors 280 // - fTimehisector to nsectors 281 // - fTimelosector to nsectors 282 // - fSathiarea to nareas 283 // - fSatloarea to nareas 284 // - fSathisector to nsectors 285 // - fSatlosector to nsectors 286 // 254 287 Bool_t MHCalibrationChargeCam::ReInitHists(MParList *pList) 255 288 { … … 313 346 */ 314 347 315 316 348 const Int_t npixels = fGeom->GetNumPixels(); 317 349 const Int_t nsectors = fGeom->GetNumSectors(); 318 350 const Int_t nareas = fGeom->GetNumAreas(); 319 351 352 InitHiGainArrays(npixels,nareas,nsectors); 353 InitLoGainArrays(npixels,nareas,nsectors); 354 355 fSumhiarea .Set(nareas); 356 fSumloarea .Set(nareas); 357 fTimehiarea .Set(nareas); 358 fTimeloarea .Set(nareas); 359 fSumhisector.Set(nsectors); 360 fSumlosector.Set(nsectors); 361 fTimehisector.Set(nsectors); 362 fTimelosector.Set(nsectors); 363 364 fSathiarea .Set(nareas); 365 fSatloarea .Set(nareas); 366 fSathisector.Set(nsectors); 367 fSatlosector.Set(nsectors); 368 369 return kTRUE; 370 } 371 372 // -------------------------------------------------------------------------- 373 // 374 // Retrieve: 375 // - fRunHeader->GetNumSamplesHiGain(); 376 // 377 // Initializes the High Gain Arrays: 378 // 379 // - Expand fHiGainArrays to npixels 380 // - Expand fAverageHiGainAreas to nareas 381 // - Expand fAverageHiGainSectors to nsectors 382 // 383 // - For every entry in the expanded arrays: 384 // * call new MHCalibrationPix(fHistName,fHistTitle) 385 // * SetNbins(fNbins), SetFirst(fFirst), SetLast(fLast) 386 // * SetAbsTimeNbins(samples hi gain), SetAbsTimeFirst(-0.5), SetAbsTimeLast(samples hi-gain-0.5) 387 // * Set fHistName and fHistTitle in the Histogram of MHCalibrationPix 388 // * Set Name and Title in the Abs Time Histogram of MHCalibrationPix 389 // * Set X-axis and Y-axis titles with fHistXTitle and fHistYTitle 390 // * Call InitHists 391 // 392 // 393 void MHCalibrationChargeCam::InitHiGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors) 394 { 395 396 TH1F *h; 397 320 398 const Int_t higainsamples = fRunHeader->GetNumSamplesHiGain(); 321 const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain();322 399 323 400 if (fHiGainArray->GetEntries()==0) … … 326 403 for (Int_t i=0; i<npixels; i++) 327 404 { 328 (*fHiGainArray)[i] = new MHCalibrationChargePix("ChargeHiGainPix","Signals of the HiGain"); 405 (*fHiGainArray)[i] = new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"HiGainPix"), 406 Form("%s%s",fHistTitle.Data()," High Gain Pixel")); 407 329 408 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)(*this)[i]; 409 410 pix.SetNbins(fNbins); 411 pix.SetFirst(fFirst); 412 pix.SetLast (fLast); 330 413 331 414 pix.SetAbsTimeNbins(higainsamples); … … 333 416 pix.SetAbsTimeLast(higainsamples-0.5); 334 417 335 pix.SetNbins(fNbins);336 pix.SetFirst(fFirst); 337 pix.SetLast (fLast);338 339 TH1F *h = pix.GetHGausHist();340 341 h->SetName ("HChargeHiGainPix");342 h ->SetTitle("Signals High Gain Pixel ");343 h->SetXTitle("Signal [FADC counts]"); 344 h->Set YTitle("Nr. of events");345 346 pix.GetHAbsTime()->SetName ("HAbsTimeHiGainPix");347 pix.GetHAbsTime()->SetTitle("Absolute Arrival Times High Gain Pixel ");418 h = pix.GetHGausHist(); 419 420 h->SetName (Form("%s%s%s","H",fHistName.Data(),"HiGainPix")); 421 h->SetTitle(Form("%s%s",fHistTitle.Data()," High Gain Pixel ")); 422 h->SetXTitle(fHistXTitle.Data()); 423 h->SetYTitle(fHistYTitle.Data()); 424 425 h = pix.GetHAbsTime(); 426 427 h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainPix")); 428 h->SetTitle(Form("%s%s",fAbsHistTitle.Data()," High Gain Pixel ")); 429 h->SetXTitle(fAbsHistXTitle.Data()); 430 h->SetYTitle(fAbsHistYTitle.Data()); 348 431 349 432 InitHists((*this)[i],(*fBadPixels)[i],i); … … 351 434 } 352 435 353 if (fLoGainArray->GetEntries()==0 && IsLoGain()) 436 437 if (fAverageHiGainAreas->GetEntries()==0) 438 { 439 fAverageHiGainAreas->Expand(nareas); 440 441 for (Int_t j=0; j<nareas; j++) 442 { 443 (*fAverageHiGainAreas)[j] = 444 new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"HiGainArea"), 445 Form("%s%s",fHistTitle.Data()," High Gain Area Idx ")); 446 447 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainArea(j); 448 449 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 450 pix.SetFirst(fFirst); 451 pix.SetLast (fLast); 452 453 pix.SetAbsTimeNbins(higainsamples); 454 pix.SetAbsTimeFirst(-0.5); 455 pix.SetAbsTimeLast(higainsamples-0.5); 456 457 h = pix.GetHGausHist(); 458 459 h->SetName (Form("%s%s%s","H",fHistName.Data(),"HiGainArea")); 460 h->SetXTitle(fHistXTitle.Data()); 461 h->SetYTitle(fHistYTitle.Data()); 462 463 if (fGeom->InheritsFrom("MGeomCamMagic")) 464 { 465 h->SetTitle(Form("%s%s%s%s",fHistTitle.Data()," averaged on event-by-event basis ", 466 j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: ")); 467 pix.InitBins(); 468 pix.SetEventFrequency(fPulserFrequency); 469 } 470 else 471 { 472 h->SetTitle(Form("%s%s",fHistTitle.Data(), 473 " averaged on event-by-event basis High Gain Area Idx ")); 474 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j); 475 } 476 477 h = pix.GetHAbsTime(); 478 479 h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainArea")); 480 h->SetTitle(Form("%s%s",fAbsHistTitle.Data(), 481 " averaged on event-by-event basis High Gain Area Idx ")); 482 h->SetXTitle(fAbsHistXTitle.Data()); 483 h->SetYTitle(fAbsHistYTitle.Data()); 484 } 485 } 486 487 if (fAverageHiGainSectors->GetEntries()==0) 488 { 489 fAverageHiGainSectors->Expand(nsectors); 490 491 for (Int_t j=0; j<nsectors; j++) 492 { 493 (*fAverageHiGainSectors)[j] = 494 new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"HiGainSector"), 495 Form("%s%s",fHistTitle.Data()," High Gain Sector ")); 496 497 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainSector(j); 498 499 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 500 pix.SetFirst(fFirst); 501 pix.SetLast (fLast); 502 503 pix.SetAbsTimeNbins(higainsamples); 504 pix.SetAbsTimeFirst(-0.5); 505 pix.SetAbsTimeLast(higainsamples-0.5); 506 507 h = pix.GetHGausHist(); 508 509 h->SetName (Form("%s%s%s","H",fHistName.Data(),"HiGainSector")); 510 h->SetTitle(Form("%s%s",fHistTitle.Data()," High Gain Sector ")); 511 h->SetXTitle(fHistXTitle.Data()); 512 h->SetYTitle(fHistYTitle.Data()); 513 514 h = pix.GetHAbsTime(); 515 516 h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainSector")); 517 h->SetTitle(Form("%s%s",fAbsHistTitle.Data(), 518 " averaged on event-by-event basis High Gain Area Sector ")); 519 h->SetXTitle(fAbsHistXTitle.Data()); 520 h->SetYTitle(fAbsHistYTitle.Data()); 521 522 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j); 523 } 524 } 525 } 526 527 //-------------------------------------------------------------------------------------- 528 // 529 // Return, if IsLoGain() is kFALSE 530 // 531 // Retrieve: 532 // - fRunHeader->GetNumSamplesHiGain(); 533 // 534 // Initializes the Low Gain Arrays: 535 // 536 // - Expand fLoGainArrays to npixels 537 // - Expand fAverageLoGainAreas to nareas 538 // - Expand fAverageLoGainSectors to nsectors 539 // 540 // - For every entry in the expanded arrays: 541 // * call new MHCalibrationPix(fHistName,fHistTitle) 542 // * SetBins(fNbins), SetFirst(fFirst), SetLast(fLast) 543 // * SetAbsTimeNbins(samples lo gain), SetAbsTimeFirst(-0.5), SetAbsTimeLast(samples lo-gain-0.5) 544 // * Set fHistName and fHistTitle in the Histogram of MHCalibrationPix 545 // * Set fHistName and fHistTitle in the Histogram of MHCalibrationPix 546 // * Set X-axis and Y-axis titles with fHistXTitle and fHistYTitle 547 // * Call InitHists 548 // 549 void MHCalibrationChargeCam::InitLoGainArrays(const Int_t npixels, const Int_t nareas, const Int_t nsectors) 550 { 551 552 if (!IsLoGain()) 553 return; 554 555 const Int_t logainsamples = fRunHeader->GetNumSamplesLoGain(); 556 557 TH1F *h; 558 559 if (fLoGainArray->GetEntries()==0 ) 354 560 { 355 561 fLoGainArray->Expand(npixels); … … 357 563 for (Int_t i=0; i<npixels; i++) 358 564 { 359 (*fLoGainArray)[i] = new MHCalibrationChargePix("ChargeLoGainPix","Signals of the LoGain"); 565 (*fLoGainArray)[i] = 566 new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"LoGainPix"), 567 Form("%s%s",fHistTitle.Data()," Low Gain Pixel")); 568 360 569 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)(*this)(i); 361 570 571 pix.SetNbins(fLoGainNbins); 572 pix.SetFirst(fLoGainFirst); 573 pix.SetLast (fLoGainLast); 574 362 575 pix.SetAbsTimeNbins(logainsamples); 363 576 pix.SetAbsTimeFirst(-0.5); 364 577 pix.SetAbsTimeLast(logainsamples-0.5); 365 578 366 pix.SetNbins(fLoGainNbins); 367 pix.SetFirst(fLoGainFirst); 368 pix.SetLast (fLoGainLast); 369 370 TH1F *h = pix.GetHGausHist(); 371 372 h->SetName ("HChargeLoGainPix"); 373 h->SetTitle("Signals Low Gain Pixel "); 374 h->SetXTitle("Signal [FADC counts]"); 375 h->SetYTitle("Nr. of events"); 376 377 pix.GetHAbsTime()->SetName ("HAbsTimeLoGainPix"); 378 pix.GetHAbsTime()->SetTitle("Absolute Arrival Times Low Gain Pixel "); 379 579 h = pix.GetHGausHist(); 580 581 h->SetName (Form("%s%s%s","H",fHistName.Data(),"LoGainPix")); 582 h->SetTitle(Form("%s%s",fHistTitle.Data()," Low Gain Pixel ")); 583 h->SetXTitle(fHistXTitle.Data()); 584 h->SetYTitle(fHistYTitle.Data()); 585 586 h = pix.GetHAbsTime(); 587 588 h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"HiGainPix")); 589 h->SetTitle(Form("%s%s",fAbsHistTitle.Data()," High Gain Pixel ")); 590 h->SetXTitle(fAbsHistXTitle.Data()); 591 h->SetYTitle(fAbsHistYTitle.Data()); 380 592 // 381 593 // Adapt the range for the case, the intense blue is used: … … 395 607 } 396 608 397 if (fAverageHiGainAreas->GetEntries()==0) 398 { 399 fAverageHiGainAreas->Expand(nareas); 400 401 for (Int_t j=0; j<nareas; j++) 402 { 403 (*fAverageHiGainAreas)[j] = new MHCalibrationChargePix("ChargeAverageHiGainArea", 404 "Average HiGain FADC sums area idx "); 405 406 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainArea(j); 407 408 pix.SetAbsTimeNbins(higainsamples); 409 pix.SetAbsTimeFirst(-0.5); 410 pix.SetAbsTimeLast(higainsamples-0.5); 411 412 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 413 pix.SetFirst(fFirst); 414 pix.SetLast (fLast); 415 416 TH1F *h = pix.GetHGausHist(); 417 418 h->SetName ("HChargeHiGainAreaIdx"); 419 h->SetXTitle("Signal [FADC counts]"); 420 h->SetYTitle("Nr. of events"); 421 422 pix.GetHAbsTime()->SetName ("HAbsTimeHiGainAreaIdx"); 423 pix.GetHAbsTime()->SetTitle("Absolute Arrival Times average Hi Gain Area Idx "); 424 425 if (fGeom->InheritsFrom("MGeomCamMagic")) 426 { 427 h->SetTitle(Form("%s%s%s","Signals averaged on event-by-event basis ", 428 j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: ")); 429 pix.InitBins(); 430 pix.SetEventFrequency(fPulserFrequency); 431 } 432 else 433 { 434 h->SetTitle("Signals averaged on event-by-event basis High Gain Area Idx "); 435 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j); 436 } 437 } 438 } 439 440 441 if (fAverageLoGainAreas->GetEntries()==0 && IsLoGain()) 609 if (fAverageLoGainAreas->GetEntries()==0) 442 610 { 443 611 fAverageLoGainAreas->Expand(nareas); … … 445 613 for (Int_t j=0; j<nareas; j++) 446 614 { 447 (*fAverageLoGainAreas)[j] = new MHCalibrationChargePix("ChargeAverageLoGainArea", 448 "Average LoGain FADC sums area idx "); 449 615 (*fAverageLoGainAreas)[j] = 616 new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"LoGainArea"), 617 Form("%s%s",fHistTitle.Data()," Low Gain Area Idx ")); 618 450 619 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageLoGainArea(j); 620 621 pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 622 pix.SetFirst(fLoGainFirst); 623 pix.SetLast (fLoGainLast); 451 624 452 625 pix.SetAbsTimeNbins(logainsamples); … … 454 627 pix.SetAbsTimeLast(logainsamples-0.5); 455 628 456 pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 457 pix.SetFirst(fLoGainFirst); 458 pix.SetLast (fLoGainLast); 459 460 TH1F *h = pix.GetHGausHist(); 461 462 h->SetName ("HChargeLoGainAreaIdx"); 463 h->SetXTitle("Signal [FADC counts]"); 464 h->SetYTitle("Nr. of events"); 465 466 pix.GetHAbsTime()->SetName ("HAbsTimeLoGainAreaIdx"); 467 pix.GetHAbsTime()->SetTitle("Absolute Arrival Times average Low Gain Area Idx "); 629 h = pix.GetHGausHist(); 630 631 h->SetName (Form("%s%s%s","H",fHistName.Data(),"LoGainArea")); 632 h->SetXTitle(fHistXTitle.Data()); 633 h->SetYTitle(fHistYTitle.Data()); 634 468 635 // 469 636 // Adapt the range for the case, the intense blue is used: … … 483 650 if (fGeom->InheritsFrom("MGeomCamMagic")) 484 651 { 485 h->SetTitle(Form("%s%s%s ","Signalsaveraged on event-by-event basis ",652 h->SetTitle(Form("%s%s%s%s",fHistTitle.Data()," averaged on event-by-event basis ", 486 653 j==0 ? "Inner Pixels " : "Outer Pixels ","Low Gain Runs: ")); 487 654 pix.InitBins(); … … 490 657 else 491 658 { 492 h->SetTitle( "Signals averaged on event-by-event basis Low Gain Area Idx ");659 h->SetTitle(Form("%s%s",fHistTitle.Data()," averaged on event-by-event basis Low Gain Area Idx ")); 493 660 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadArea(j) : fCam->GetAverageBadArea(j),j); 494 661 } 662 663 h = pix.GetHAbsTime(); 664 665 h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"LoGainArea")); 666 h->SetTitle(Form("%s%s",fAbsHistTitle.Data(), 667 " averaged on event-by-event basis Low Gain Area Idx ")); 668 h->SetXTitle(fAbsHistXTitle.Data()); 669 h->SetYTitle(fAbsHistYTitle.Data()); 670 495 671 } 496 672 } 497 673 498 if (fAverageHiGainSectors->GetEntries()==0)499 {500 fAverageHiGainSectors->Expand(nsectors);501 502 for (Int_t j=0; j<nsectors; j++)503 {504 (*fAverageHiGainSectors)[j] = new MHCalibrationChargePix("ChargeAverageHiGainSector",505 "Averaged HiGain Signals Sector ");506 507 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageHiGainSector(j);508 509 pix.SetAbsTimeNbins(higainsamples);510 pix.SetAbsTimeFirst(-0.5);511 pix.SetAbsTimeLast(higainsamples-0.5);512 513 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas));514 pix.SetFirst(fFirst);515 pix.SetLast (fLast);516 517 TH1F *h = pix.GetHGausHist();518 519 h->SetName ("HChargeHiGainSector");520 h->SetTitle("Signals averaged on event-by-event basis HiGain Sector ");521 h->SetXTitle("Signal [FADC counts]");522 h->SetYTitle("Nr. of events");523 524 pix.GetHAbsTime()->SetName ("HAbsTimeHiGainPix");525 pix.GetHAbsTime()->SetTitle("Absolute Arrival Time average HiGain Sector ");526 527 InitHists(pix,fIntensCam ? fIntensCam->GetAverageBadSector(j) : fCam->GetAverageBadSector(j),j);528 }529 }530 674 531 675 if (fAverageLoGainSectors->GetEntries()==0 && IsLoGain()) … … 535 679 for (Int_t j=0; j<nsectors; j++) 536 680 { 537 (*fAverageLoGainSectors)[j] = new MHCalibrationChargePix("ChargeAverageLoGainSector", 538 "Average LoGain Signals Sector "); 681 (*fAverageLoGainSectors)[j] = 682 new MHCalibrationChargePix(Form("%s%s",fHistName.Data(),"LoGainSector"), 683 Form("%s%s",fHistTitle.Data()," Low Gain Sector ")); 539 684 540 685 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)GetAverageLoGainSector(j); 686 687 pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 688 pix.SetFirst(fLoGainFirst); 689 pix.SetLast (fLoGainLast); 541 690 542 691 pix.SetAbsTimeNbins(logainsamples); … … 544 693 pix.SetAbsTimeLast(logainsamples-0.5); 545 694 546 pix.SetNbins(fLoGainNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 547 pix.SetFirst(fLoGainFirst); 548 pix.SetLast (fLoGainLast); 549 550 TH1F *h = pix.GetHGausHist(); 551 552 h->SetName ("HChargeLoGainSector"); 553 h->SetTitle("Signals averaged on event-by-event basis LoGain Sector "); 554 h->SetXTitle("Signal [FADC counts]"); 555 h->SetYTitle("Nr. of events"); 556 557 pix.GetHAbsTime()->SetName ("HAbsTimeLoGainPix"); 558 pix.GetHAbsTime()->SetTitle("Absolute Arrival Time average LoGain Sector "); 559 695 h = pix.GetHGausHist(); 696 697 h->SetName (Form("%s%s%s","H",fHistName.Data(),"LoGainSector")); 698 h->SetTitle(Form("%s%s",fHistTitle.Data()," Low Gain Sector ")); 699 h->SetXTitle(fHistXTitle.Data()); 700 h->SetYTitle(fHistYTitle.Data()); 701 702 h = pix.GetHAbsTime(); 703 704 h->SetName (Form("%s%s%s","H",fAbsHistName.Data(),"LoGainSector")); 705 h->SetTitle(Form("%s%s",fAbsHistTitle.Data(), 706 " averaged on event-by-event basis Low Gain Area Sector ")); 707 h->SetXTitle(fAbsHistXTitle.Data()); 708 h->SetYTitle(fAbsHistYTitle.Data()); 709 560 710 // 561 711 // Adapt the range for the case, the intense blue is used: … … 576 726 } 577 727 } 578 579 fSumhiarea .Set(nareas);580 fSumloarea .Set(nareas);581 fTimehiarea .Set(nareas);582 fTimeloarea .Set(nareas);583 fSumhisector.Set(nsectors);584 fSumlosector.Set(nsectors);585 fTimehisector.Set(nsectors);586 fTimelosector.Set(nsectors);587 588 fSathiarea .Set(nareas);589 fSatloarea .Set(nareas);590 fSathisector.Set(nsectors);591 fSatlosector.Set(nsectors);592 593 return kTRUE;594 728 } 595 729 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h
r4947 r4950 24 24 private: 25 25 26 static const Axis_t fgChargeHiGainFirst; //! First Bin of HiGain Histograms (nw set to: -100.5) 27 static const Axis_t fgChargeHiGainLast; //! Last Bin of HiGain Histograms (nw set to: 999.5) 28 static const Axis_t fgChargeLoGainFirst; //! First Bin of LoGain Histograms (nw set to: -150.5) 29 static const Axis_t fgChargeLoGainLast; //! Last Bin of LoGain Histograms (nw set to: 499.5) 26 static const Int_t fgChargeHiGainNbins; //! Nr. bins of HiGain Histograms (now set to: 550 ) 27 static const Axis_t fgChargeHiGainFirst; //! First Bin of HiGain Histograms (now set to: -100.5) 28 static const Axis_t fgChargeHiGainLast; //! Last Bin of HiGain Histograms (now set to: 999.5) 29 static const Int_t fgChargeLoGainNbins; //! First Bin of LoGain Histograms (now set to: 325 ) 30 static const Axis_t fgChargeLoGainFirst; //! First Bin of LoGain Histograms (now set to: -150.5) 31 static const Axis_t fgChargeLoGainLast; //! Last Bin of LoGain Histograms (now set to: 499.5) 32 33 static const TString gsHistName; //! Default Histogram names 34 static const TString gsHistTitle; //! Default Histogram titles 35 static const TString gsHistXTitle; //! Default Histogram x-axis titles 36 static const TString gsHistYTitle; //! Default Histogram y-axis titles 37 38 static const TString gsAbsHistName; //! Default Histogram names abs.times 39 static const TString gsAbsHistTitle; //! Default Histogram titles abs.times 40 static const TString gsAbsHistXTitle; //! Default Histogram x-axis titles abs.times 41 static const TString gsAbsHistYTitle; //! Default Histogram y-axis titles abs.times 30 42 31 43 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit (now at: 0.01) … … 43 55 Axis_t fLoGainLast; // Upper histogram limit low gain 44 56 57 TString fAbsHistName; // Histogram names abs.times 58 TString fAbsHistTitle; // Histogram titles abs. times 59 TString fAbsHistXTitle; // Histogram x-axis titles abs. times 60 TString fAbsHistYTitle; // Histogram y-axis titles abs. times 61 45 62 MArrayD fSumhiarea ; //! 46 63 MArrayD fSumloarea ; //! … … 70 87 Bool_t FillHists(const MParContainer *par, const Stat_t w=1); 71 88 89 void InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 90 void InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors ); 91 72 92 void FinalizeAbsTimes (MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad, 73 93 Byte_t first, Byte_t last); … … 92 112 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 93 113 114 void SetAbsHistName ( const char *name ) { fAbsHistName = name; } 115 void SetAbsHistTitle ( const char *name ) { fAbsHistTitle = name; } 116 void SetAbsHistXTitle( const char *name ) { fAbsHistXTitle = name; } 117 void SetAbsHistYTitle( const char *name ) { fAbsHistYTitle = name; } 118 94 119 Bool_t GetPixelContent ( Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 95 120 void DrawPixelContent( Int_t num ) const; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.cc
r4943 r4950 63 63 const Float_t MHCalibrationChargePINDiode::fgTimeLowerLimit = 3.; 64 64 const Float_t MHCalibrationChargePINDiode::fgTimeUpperLimit = 4.; 65 const TString MHCalibrationChargePINDiode::gsHistName = "Charge"; 66 const TString MHCalibrationChargePINDiode::gsHistTitle = "Signals"; 67 const TString MHCalibrationChargePINDiode::gsHistXTitle = "Signal [FADC counts]"; 68 const TString MHCalibrationChargePINDiode::gsHistYTitle = "Nr. events"; 69 const TString MHCalibrationChargePINDiode::gsAbsHistName = "AbsTime"; 70 const TString MHCalibrationChargePINDiode::gsAbsHistTitle = "Abs. Arr. Times"; 71 const TString MHCalibrationChargePINDiode::gsAbsHistXTitle = "Time [FADC slices]"; 72 const TString MHCalibrationChargePINDiode::gsAbsHistYTitle = "Nr. events"; 65 73 // -------------------------------------------------------------------------- 66 74 // … … 95 103 // - the current style for fHRmsCharge (NULL) 96 104 // 105 // - fHistName to gsHistName 106 // - fHistTitle to gsHistTitle 107 // - fHistXTitle to gsHistXTitle 108 // - fHistYTitle to gsHistYTitle 109 // 110 // - fAbsHistName to gsAbsHistName 111 // - fAbsHistTitle to gsAbsHistTitle 112 // - fAbsHistXTitle to gsAbsHistXTitle 113 // - fAbsHistYTitle to gsAbsHistYTitle 114 // 97 115 // Initializes: 98 116 // - fHRmsCharge() … … 124 142 SetTimeUpperLimit(); 125 143 126 fHGausHist.SetName("HCalibrationChargePINDiode");127 fHGausHist.SetTitle("Distribution of Summed FADC slices PIN Diode");128 fHGausHist.SetXTitle("Sum FADC Slices");129 fHGausHist.SetYTitle("Nr. of events");130 131 fHAbsTime.SetName("HAbsTimePINDiode");132 fHAbsTime.SetTitle("Distribution of Absolute Arrival Times PIN Diode");133 fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");134 fHAbsTime.SetYTitle("Nr. of events");144 SetHistName (gsHistName .Data()); 145 SetHistTitle (gsHistTitle .Data()); 146 SetHistXTitle(gsHistXTitle.Data()); 147 SetHistYTitle(gsHistYTitle.Data()); 148 149 SetAbsHistName (gsAbsHistName .Data()); 150 SetAbsHistTitle (gsAbsHistTitle .Data()); 151 SetAbsHistXTitle(gsAbsHistXTitle.Data()); 152 SetAbsHistYTitle(gsAbsHistYTitle.Data()); 135 153 136 154 fHRmsCharge.SetName("HRmsChargePINDiode"); … … 154 172 { 155 173 174 TH1F *h = GetHGausHist(); 175 176 h->SetName (fHistName.Data()); 177 h->SetTitle(fHistTitle.Data()); 178 h->SetXTitle(fHistXTitle.Data()); 179 h->SetYTitle(fHistYTitle.Data()); 180 181 h = GetHAbsTime(); 182 183 h->SetName (fAbsHistName.Data()); 184 h->SetTitle(fAbsHistTitle.Data()); 185 h->SetXTitle(fAbsHistXTitle.Data()); 186 h->SetYTitle(fAbsHistYTitle.Data()); 187 156 188 MHCalibrationPix::InitBins(); 157 189 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePINDiode.h
r4943 r4950 25 25 static const Float_t fgTimeLowerLimit; //! Default for fTimeLowerLimit (now set to: 1.) 26 26 static const Float_t fgTimeUpperLimit; //! Default for fTimeUpperLimit (now set to: 2.) 27 28 static const TString gsHistName; //! Default Histogram names 29 static const TString gsHistTitle; //! Default Histogram titles 30 static const TString gsHistXTitle; //! Default Histogram x-axis titles 31 static const TString gsHistYTitle; //! Default Histogram y-axis titles 32 33 static const TString gsAbsHistName; //! Default Histogram names abs.times 34 static const TString gsAbsHistTitle; //! Default Histogram titles abs.times 35 static const TString gsAbsHistXTitle; //! Default Histogram x-axis titles abs.times 36 static const TString gsAbsHistYTitle; //! Default Histogram y-axis titles abs.times 37 38 TString fHistName; // Histogram names 39 TString fHistTitle; // Histogram titles 40 TString fHistXTitle; // Histogram x-axis titles 41 TString fHistYTitle; // Histogram y-axis titles 42 43 TString fAbsHistName; // Histogram names abs.times 44 TString fAbsHistTitle; // Histogram titles abs. times 45 TString fAbsHistXTitle; // Histogram x-axis titles abs. times 46 TString fAbsHistYTitle; // Histogram y-axis titles abs. times 27 47 28 48 MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results … … 80 100 void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; } 81 101 102 void SetAbsHistName ( const char *name ) { fAbsHistName = name; } 103 void SetAbsHistTitle ( const char *name ) { fAbsHistTitle = name; } 104 void SetAbsHistXTitle( const char *name ) { fAbsHistXTitle = name; } 105 void SetAbsHistYTitle( const char *name ) { fAbsHistYTitle = name; } 106 107 void SetHistName ( const char *name ) { fHistName = name; } 108 void SetHistTitle ( const char *name ) { fHistTitle = name; } 109 void SetHistXTitle( const char *name ) { fHistXTitle = name; } 110 void SetHistYTitle( const char *name ) { fHistYTitle = name; } 111 82 112 ClassDef(MHCalibrationChargePINDiode, 1) // Histogram class for Charge PIN Diode Calibration 83 113 }; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.cc
r4938 r4950 50 50 using namespace std; 51 51 52 const Int_t MHCalibrationChargePix::fgChargeNbins = 2000;53 const Axis_t MHCalibrationChargePix::fgChargeFirst = -0.5;54 const Axis_t MHCalibrationChargePix::fgChargeLast = 1999.5;55 const Int_t MHCalibrationChargePix::fgAbsTimeNbins = 15;56 const Axis_t MHCalibrationChargePix::fgAbsTimeFirst = -0.5;57 const Axis_t MHCalibrationChargePix::fgAbsTimeLast = 14.5;58 52 // -------------------------------------------------------------------------- 59 53 // … … 61 55 // 62 56 // Sets: 63 // - the default number for fNbins (fgChargeNbins)64 // - the default number for fFirst (fgChargeFirst)65 // - the default number for fLast (fgChargeLast)66 // - the default number for fAbsTimeNbins (fgAbsTimeNbins)67 // - the default number for fAbsTimeFirst (fgAbsTimeFirst)68 // - the default number for fAbsTimeLast (fgAbsTimeLast)69 //70 // - the default name of the fHGausHist ("HCalibrationCharge")71 // - the default title of the fHGausHist ("Distribution of Summed FADC slices Pixel ")72 // - the default x-axis title for fHGausHist ("Sum FADC Slices")73 // - the default y-axis title for fHGausHist ("Nr. of events")74 //75 // - the default name of the fHAbsTime ("HAbsTimePixel")76 // - the default title of the fHAbsTime ("Distribution of Absolute Arrival Times Pixel ")77 57 // - the default x-axis title for fHAbsTime ("Absolute Arrival Time [FADC slice nr]") 78 58 // - the default y-axis title for fHAbsTime ("Nr. of events"); … … 87 67 // 88 68 MHCalibrationChargePix::MHCalibrationChargePix(const char *name, const char *title) 89 : fHAbsTime() 69 : fHAbsTime(), 70 fAbsTimeNbins(1), fAbsTimeFirst(0.), fAbsTimeLast(1.) 90 71 { 91 72 92 73 fName = name ? name : "MHCalibrationChargePix"; 93 74 fTitle = title ? title : "Statistics of the FADC sums of calibration events"; 94 95 SetNbins ( fgChargeNbins );96 SetFirst ( fgChargeFirst );97 SetLast ( fgChargeLast );98 99 SetAbsTimeNbins();100 SetAbsTimeFirst();101 SetAbsTimeLast();102 103 fHGausHist.SetName("HCalibrationCharge");104 fHGausHist.SetTitle("Distribution of Summed FADC slices Pixel");105 fHGausHist.SetXTitle("Sum FADC Slices");106 fHGausHist.SetYTitle("Nr. of events");107 108 fHAbsTime.SetName("HAbsTimePixel");109 fHAbsTime.SetTitle("Distribution of Absolute Arrival Times Pixel ");110 fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");111 fHAbsTime.SetYTitle("Nr. of events");112 75 113 76 fHAbsTime.UseCurrentStyle(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.h
r4937 r4950 8 8 class MHCalibrationChargePix : public MHCalibrationPix 9 9 { 10 11 private:12 13 static const Int_t fgChargeNbins; // Default for fNBins (now set to: 2000 )14 static const Axis_t fgChargeFirst; // Default for fFirst (now set to: -0.5 )15 static const Axis_t fgChargeLast; // Default for fLast (now set to: 1999.5)16 static const Int_t fgAbsTimeNbins; // Default for fAbsTimeNbins (now set to: 15 )17 static const Axis_t fgAbsTimeFirst; // Default for fAbsTimeFirst (now set to: -0.5 )18 static const Axis_t fgAbsTimeLast; // Default for fAbsTimeLast (now set to: 14.5 )19 10 20 11 protected: … … 37 28 38 29 // Setters 39 virtual void SetAbsTimeNbins(const Int_t bins =fgAbsTimeNbins) { fAbsTimeNbins = bins; }40 virtual void SetAbsTimeFirst(const Axis_t first =fgAbsTimeFirst) { fAbsTimeFirst = first; }41 virtual void SetAbsTimeLast( const Axis_t last =fgAbsTimeLast) { fAbsTimeLast = last; }30 virtual void SetAbsTimeNbins(const Int_t bins ) { fAbsTimeNbins = bins; } 31 virtual void SetAbsTimeFirst(const Axis_t first) { fAbsTimeFirst = first; } 32 virtual void SetAbsTimeLast( const Axis_t last ) { fAbsTimeLast = last; } 42 33 43 34 // Getters -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.cc
r4946 r4950 107 107 using namespace std; 108 108 109 const Int_t MHCalibrationTestCam::fgTestNbins = 900; 110 const Axis_t MHCalibrationTestCam::fgTestFirst = -5.; 111 const Axis_t MHCalibrationTestCam::fgTestLast = 5.; 109 const Int_t MHCalibrationTestCam::fgNbins = 900; 110 const Axis_t MHCalibrationTestCam::fgFirst = -5.; 111 const Axis_t MHCalibrationTestCam::fgLast = 5.; 112 const TString MHCalibrationTestCam::gsHistName = "Test"; 113 const TString MHCalibrationTestCam::gsHistTitle = "Calibrated Calibration Signals"; 114 const TString MHCalibrationTestCam::gsHistXTitle = "Nr. Photons"; 115 const TString MHCalibrationTestCam::gsHistYTitle = "Nr. events"; 112 116 // -------------------------------------------------------------------------- 113 117 // … … 115 119 // 116 120 // Sets: 117 // - fNbins to fgTestNbins 118 // - fFirst to fgTestFirst 119 // - fLast to fgTestLast 121 // - fNbins to fgNbins 122 // - fFirst to fgFirst 123 // - fLast to fgLast 124 // 125 // - fHistName to gsHistName 126 // - fHistTitle to gsHistTitle 127 // - fHistXTitle to gsHistXTitle 128 // - fHistYTitle to gsHistYTitle 120 129 // 121 130 MHCalibrationTestCam::MHCalibrationTestCam(const char *name, const char *title) … … 125 134 fTitle = title ? title : "Histogram class for testing the calibration"; 126 135 127 SetNbins(fgTestNbins); 128 SetFirst(fgTestFirst); 129 SetLast (fgTestLast ); 136 SetNbins(fgNbins); 137 SetFirst(fgFirst); 138 SetLast (fgLast ); 139 140 SetHistName (gsHistName .Data()); 141 SetHistTitle (gsHistTitle .Data()); 142 SetHistXTitle(gsHistXTitle.Data()); 143 SetHistYTitle(gsHistYTitle.Data()); 144 130 145 } 131 146 … … 135 150 // - MCerPhotEvt 136 151 // 137 // Initializes, if empty to MGeomCam::GetNumAreas() for: 138 // - MHCalibrationCam::fAverageHiGainAreas 139 // 140 // Initializes, if empty to MGeomCam::GetNumSectors() for: 141 // - MHCalibrationCam::fAverageHiGainSectors 152 // Calls: 153 // - MHCalibrationCam::InitHiGainArrays() 142 154 // 143 // Calls MHCalibrationCam::InitHists() for every entry in: 144 // - MHCalibrationCam::fHiGainArray 145 // - MHCalibrationCam::fAverageHiGainAreas 146 // - MHCalibrationCam::fAverageHiGainSectors 147 // 148 // Sets Titles and Names for the Histograms 149 // - MHCalibrationCam::fAverageHiGainAreas 150 // - MHCalibrationCam::fAverageHiGainSectors 151 // 155 // Sets: 156 // - SetLoGain(kFALSE); 157 // - fMeanMeanPhotPerArea to nareas 158 // - fRmsMeanPhotPerArea to nareas 159 // - fMeanSigmaPhotPerArea to nareas 160 // - fRmsSigmaPhotPerArea to nareas 161 // 152 162 Bool_t MHCalibrationTestCam::ReInitHists(MParList *pList) 153 163 { … … 165 175 const Int_t nareas = fGeom->GetNumAreas(); 166 176 167 if (fHiGainArray->GetEntries()==0) 168 { 169 fHiGainArray->Expand(npixels); 170 for (Int_t i=0; i<npixels; i++) 171 { 172 (*fHiGainArray)[i] = new MHCalibrationPix("TestPix", 173 "Test Calibration Pixel"); 174 175 MHCalibrationPix &pix = (*this)[i]; 176 177 pix.SetNbins(fNbins); 178 pix.SetFirst(fFirst); 179 pix.SetLast (fLast); 180 181 TH1F *h = pix.GetHGausHist(); 182 183 h->SetName ("HTestPix"); 184 h->SetTitle("Calibrated Calibration Signals Pixel "); 185 h->SetXTitle("Nr. Photons"); 186 h->SetYTitle("Nr. of events"); 187 188 InitHists((*this)[i],(*fBadPixels)[i],i); 189 } 190 } 191 192 193 if (fAverageHiGainAreas->GetEntries()==0) 194 { 195 fAverageHiGainAreas->Expand(nareas); 196 197 for (Int_t j=0; j<nareas; j++) 198 { 199 (*fAverageHiGainAreas)[j] = 200 new MHCalibrationPix("TestArea", 201 "Average Test Calibrations Area Idx "); 202 203 MHCalibrationPix &pix = GetAverageHiGainArea(j); 204 205 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 206 pix.SetFirst(fFirst); 207 pix.SetLast (fLast); 208 209 pix.InitBins(); 210 pix.SetEventFrequency(fPulserFrequency); 211 212 TH1F *h = pix.GetHGausHist(); 213 214 h->SetName ("HTestArea"); 215 h->SetTitle("Calibrated Calibration Signals Area Idx "); 216 h->SetXTitle("Nr. Photons"); 217 h->SetYTitle("Nr. of events"); 218 219 if (fGeom->InheritsFrom("MGeomCamMagic")) 220 h->SetTitle(Form("%s%s%s","Calibrated Calibration Signals averaged on event-by-event basis ", 221 j==0 ? "Inner Pixels " : "Outer Pixels Runs: ")); 222 else 223 { 224 pix.ChangeHistId(j); 225 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: ")); 226 } 227 } 228 } 229 230 if (fAverageHiGainSectors->GetEntries()==0) 231 { 232 fAverageHiGainSectors->Expand(nsectors); 233 234 for (Int_t j=0; j<nsectors; j++) 235 { 236 (*fAverageHiGainSectors)[j] = 237 new MHCalibrationPix("TestSector", 238 "Average Test Calibrations Sector "); 239 240 MHCalibrationPix &pix = GetAverageHiGainSector(j); 241 242 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nsectors)); 243 pix.SetFirst(fFirst); 244 pix.SetLast (fLast); 245 246 TH1F *h = pix.GetHGausHist(); 247 248 h->SetName ("HTestSector"); 249 h->SetTitle("Calibrated Calibration Signals Sector "); 250 h->SetXTitle("Nr. Photons"); 251 h->SetYTitle("Nr. of events"); 252 253 pix.InitBins(); 254 pix.ChangeHistId(j); 255 pix.SetEventFrequency(fPulserFrequency); 256 257 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: ")); 258 } 259 } 260 177 InitHiGainArrays(npixels,nareas,nsectors); 261 178 262 179 fMeanMeanPhotPerArea.Set(nareas); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestCam.h
r4946 r4950 18 18 private: 19 19 20 static const Int_t fg TestNbins; // Default for fNBins (now set to: 2000 )21 static const Axis_t fg TestFirst; // Default for fFirst (now set to: -0.5 )22 static const Axis_t fg TestLast; // Default for fLast (now set to: 1999.5)20 static const Int_t fgNbins; // Default for fNBins (now set to: 2000 ) 21 static const Axis_t fgFirst; // Default for fFirst (now set to: -0.5 ) 22 static const Axis_t fgLast; // Default for fLast (now set to: 1999.5) 23 23 24 static const TString gsHistName; //! Default Histogram names 25 static const TString gsHistTitle; //! Default Histogram titles 26 static const TString gsHistXTitle; //! Default Histogram x-axis titles 27 static const TString gsHistYTitle; //! Default Histogram y-axis titles 28 24 29 TArrayF fMeanMeanPhotPerArea; 25 30 TArrayF fRmsMeanPhotPerArea ; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestTimeCam.cc
r4946 r4950 106 106 using namespace std; 107 107 108 const Int_t MHCalibrationTestTimeCam::fgTestNbins = 600; 109 const Axis_t MHCalibrationTestTimeCam::fgTestFirst = -0.5; 110 const Axis_t MHCalibrationTestTimeCam::fgTestLast = 29.5; 108 const Int_t MHCalibrationTestTimeCam::fgNbins = 600; 109 const Axis_t MHCalibrationTestTimeCam::fgFirst = -0.5; 110 const Axis_t MHCalibrationTestTimeCam::fgLast = 29.5; 111 const TString MHCalibrationTestTimeCam::gsHistName = "TestTime"; 112 const TString MHCalibrationTestTimeCam::gsHistTitle = "Calibrated Calibration Arrival Times"; 113 const TString MHCalibrationTestTimeCam::gsHistXTitle = "Arrival Time [FADC slices]"; 114 const TString MHCalibrationTestTimeCam::gsHistYTitle = "Nr. events"; 111 115 // -------------------------------------------------------------------------- 112 116 // … … 114 118 // 115 119 // Sets: 116 // - fNbins to fgTestNbins 117 // - fFirst to fgTestFirst 118 // - fLast to fgTestLast 120 // - fNbins to fgNbins 121 // - fFirst to fgFirst 122 // - fLast to fgLast 123 // 124 // - fHistName to gsHistName 125 // - fHistTitle to gsHistTitle 126 // - fHistXTitle to gsHistXTitle 127 // - fHistYTitle to gsHistYTitle 119 128 // 120 129 MHCalibrationTestTimeCam::MHCalibrationTestTimeCam(const char *name, const char *title) … … 124 133 fTitle = title ? title : "Histogram class for testing the calibration of arrival times"; 125 134 126 SetNbins(fgTestNbins); 127 SetFirst(fgTestFirst); 128 SetLast (fgTestLast ); 129 130 } 131 132 // -------------------------------------------------------------------------- 133 // 134 // Gets or creates the pointers to: 135 SetNbins(fgNbins); 136 SetFirst(fgFirst); 137 SetLast (fgLast ); 138 139 SetHistName (gsHistName .Data()); 140 SetHistTitle (gsHistTitle .Data()); 141 SetHistXTitle(gsHistXTitle.Data()); 142 SetHistYTitle(gsHistYTitle.Data()); 143 144 } 145 146 // -------------------------------------------------------------------------- 135 147 // 136 148 // Searches pointer to: 137 149 // - MArrivalTime 138 150 // 139 // Initializes, if empty to MGeomCam::GetNumAreas() for: 140 // - MHCalibrationCam::fAverageHiGainAreas 141 // 142 // Initializes, if empty to MGeomCam::GetNumSectors() for: 143 // - MHCalibrationCam::fAverageHiGainSectors 151 // Calls: 152 // - MHCalibrationCam::InitHiGainArrays() 144 153 // 145 // Calls MHCalibrationCam::InitHists() for every entry in: 146 // - MHCalibrationCam::fHiGainArray 147 // - MHCalibrationCam::fAverageHiGainAreas 148 // - MHCalibrationCam::fAverageHiGainSectors 149 // 150 // Sets Titles and Names for the Histograms 151 // - MHCalibrationCam::fAverageHiGainAreas 152 // - MHCalibrationCam::fAverageHiGainSectors 153 // 154 // Sets number of bins to MHCalibrationCam::fAverageNbins for: 155 // - MHCalibrationCam::fAverageHiGainAreas 156 // - MHCalibrationCam::fAverageHiGainSectors 154 // Sets: 155 // - SetLoGain(kFALSE); 157 156 // 158 157 Bool_t MHCalibrationTestTimeCam::ReInitHists(MParList *pList) … … 170 169 const Int_t nareas = fGeom->GetNumAreas(); 171 170 172 if (fHiGainArray->GetEntries()==0) 173 { 174 fHiGainArray->Expand(npixels); 175 for (Int_t i=0; i<npixels; i++) 176 { 177 (*fHiGainArray)[i] = new MHCalibrationPix("TestTimePix", 178 "TestTime Calibration Pixel"); 179 MHCalibrationPix &pix = (*this)[i]; 180 181 pix.SetNbins(fNbins); 182 pix.SetFirst(fFirst); 183 pix.SetLast (fLast); 184 185 TH1F *h = pix.GetHGausHist(); 186 187 h->SetName ("HTestHiGainPix"); 188 h->SetTitle("Calibrated Rel. Arrival Times Pixel "); 189 h->SetXTitle("Arrival Time [FADC slices]"); 190 h->SetYTitle("Nr. of events"); 191 192 InitHists((*this)[i],(*fBadPixels)[i],i); 193 } 194 } 195 196 if (fAverageHiGainAreas->GetEntries()==0) 197 { 198 fAverageHiGainAreas->Expand(nareas); 199 200 for (Int_t j=0; j<nareas; j++) 201 { 202 (*fAverageHiGainAreas)[j] = 203 new MHCalibrationPix("TestTimeArea", 204 "Average TestTime Calibrations Area Idx "); 205 206 MHCalibrationPix &pix = GetAverageHiGainArea(j); 207 208 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nareas)); 209 pix.SetFirst(fFirst); 210 pix.SetLast (fLast); 211 212 pix.InitBins(); 213 pix.SetEventFrequency(fPulserFrequency); 214 215 TH1F *h = pix.GetHGausHist(); 216 217 h->SetName ("HTestTimeArea"); 218 h->SetTitle("Calibrated Rel. Arrival Times Area Idx "); 219 h->SetXTitle("Arrival Time [FADC slices]"); 220 h->SetYTitle("Nr. of events"); 221 222 if (fGeom->InheritsFrom("MGeomCamMagic")) 223 h->SetTitle(Form("%s%s%s","Calibrated Rel. Times averaged on event-by-event basis ", 224 j==0 ? "Inner Pixels " : "Outer Pixels Runs: ")); 225 else 226 { 227 pix.ChangeHistId(j); 228 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: ")); 229 } 230 } 231 } 232 233 234 if (fAverageHiGainSectors->GetEntries()==0) 235 { 236 fAverageHiGainSectors->Expand(nsectors); 237 238 for (Int_t j=0; j<nsectors; j++) 239 { 240 (*fAverageHiGainSectors)[j] = 241 new MHCalibrationPix("TestTimeSector", 242 "Average TestTime Calibrations Sector "); 243 244 MHCalibrationPix &pix = GetAverageHiGainSector(j); 245 246 pix.SetNbins(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nsectors)); 247 pix.SetFirst(fFirst); 248 pix.SetLast (fLast); 249 250 TH1F *h = pix.GetHGausHist(); 251 252 h->SetName ("HTestTimeSector"); 253 h->SetTitle("Calibrated Rel. Arr. Times Sector "); 254 h->SetXTitle("Arrival Time [FADC slices]"); 255 h->SetYTitle("Nr. of events"); 256 257 pix.InitBins(); 258 pix.ChangeHistId(j); 259 pix.SetEventFrequency(fPulserFrequency); 260 261 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: ")); 262 } 263 } 171 InitHiGainArrays(npixels,nareas,nsectors); 264 172 265 173 SetLoGain(kFALSE); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationTestTimeCam.h
r4946 r4950 11 11 private: 12 12 13 static const Int_t fg TestNbins; // Default for fTestNBins (now set to: 600 )14 static const Axis_t fg TestFirst; // Default for fTestFirst (now set to: -0.5)15 static const Axis_t fg TestLast; // Default for fTestLast (now set to: 29.5)13 static const Int_t fgNbins; // Default for fNBins (now set to: 600 ) 14 static const Axis_t fgFirst; // Default for fFirst (now set to: -0.5 ) 15 static const Axis_t fgLast; // Default for fLast (now set to: 29.5 ) 16 16 17 static const TString gsHistName; //! Default Histogram names 18 static const TString gsHistTitle; //! Default Histogram titles 19 static const TString gsHistXTitle; //! Default Histogram x-axis titles 20 static const TString gsHistYTitle; //! Default Histogram y-axis titles 21 17 22 Bool_t ReInitHists(MParList *pList); 18 23 Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
Note:
See TracChangeset
for help on using the changeset viewer.