Changeset 4962 for trunk/MagicSoft/Mars/mhcalib
- Timestamp:
- 09/12/04 22:49:41 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r4950 r4962 145 145 #include <TStyle.h> 146 146 #include <TF1.h> 147 #include <TH2D.h>148 147 #include <TLine.h> 149 148 #include <TLatex.h> 150 149 #include <TLegend.h> 150 #include <TGraph.h> 151 151 152 152 ClassImp(MHCalibrationChargeCam); … … 382 382 // 383 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 384 // * Initialize an MHCalibrationPix 385 // * Set Binning from fNbins, fFirst and fLast 386 // * Set Binning of Abs Times histogram from fAbsNbins, fAbsFirst and fAbsLast 387 // * Set Histgram names and titles from fHistName and fHistTitle 388 // * Set Abs Times Histgram names and titles from fAbsHistName and fAbsHistTitle 389 // * Set X-axis and Y-axis titles from fHistXTitle and fHistYTitle 390 // * Set X-axis and Y-axis titles of Abs Times Histogram from fAbsHistXTitle and fAbsHistYTitle 390 391 // * Call InitHists 391 392 // … … 539 540 // 540 541 // - 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 542 // * Initialize an MHCalibrationPix 543 // * Set Binning from fNbins, fFirst and fLast 544 // * Set Binning of Abs Times histogram from fAbsNbins, fAbsFirst and fAbsLast 545 // * Set Histgram names and titles from fHistName and fHistTitle 546 // * Set Abs Times Histgram names and titles from fAbsHistName and fAbsHistTitle 547 // * Set X-axis and Y-axis titles from fHistXTitle and fHistYTitle 548 // * Set X-axis and Y-axis titles of Abs Times Histogram from fAbsHistXTitle and fAbsHistYTitle 547 549 // * Call InitHists 548 550 // … … 590 592 h->SetXTitle(fAbsHistXTitle.Data()); 591 593 h->SetYTitle(fAbsHistYTitle.Data()); 592 // 593 // Adapt the range for the case, the intense blue is used: 594 // FIXME: this is a nasty workaround, but for the moment necessary 595 // in order to avoid default memory space. 596 // 597 if (fGeom->InheritsFrom("MGeomCamMagic")) 598 { 599 if ( fColor == MCalibrationCam::kBLUE) 600 { 601 pix.SetLast(999.5); 602 pix.SetNbins((Int_t)(999.5-fgChargeLoGainFirst)); 603 } 604 } 594 605 595 InitHists(pix,(*fBadPixels)[i],i); 606 596 } … … 633 623 h->SetYTitle(fHistYTitle.Data()); 634 624 635 //636 // Adapt the range for the case, the intense blue is used:637 // FIXME: this is a nasty workaround, but for the moment necessary638 // in order to avoid default memory space.639 //640 if (fGeom->InheritsFrom("MGeomCamMagic"))641 {642 if ( fColor == MCalibrationCam::kBLUE)643 {644 pix.SetFirst(-10.5);645 pix.SetLast(999.5);646 pix.SetNbins(3030);647 }648 }649 625 650 626 if (fGeom->InheritsFrom("MGeomCamMagic")) … … 745 721 // - MExtractedSignalPix::GetExtractedSignalLoGain(); 746 722 // 747 // 2) Set number of saturated slices (MHCalibrationChargePix:: SetSaturated()) with:723 // 2) Set number of saturated slices (MHCalibrationChargePix::AddSaturated()) with: 748 724 // - MExtractedSignalPix::GetNumHiGainSaturated(); 749 725 // - MExtractedSignalPix::GetNumLoGainSaturated(); … … 800 776 histhi.FillHist(sumhi); 801 777 802 histhi. SetSaturated(sathi);778 histhi.AddSaturated(sathi); 803 779 804 780 const Int_t aidx = (*fGeom)[i].GetAidx(); … … 822 798 histlo.FillHist(sumlo); 823 799 824 histlo. SetSaturated(satlo);800 histlo.AddSaturated(satlo); 825 801 826 802 fSumloarea[aidx] += sumlo; … … 880 856 hipix.FillHist(fSumhiarea[j]/npix); 881 857 882 hipix. SetSaturated ((Float_t)fSathiarea [j]/npix > 0.5 ? 1 : 0);858 hipix.AddSaturated ((Float_t)fSathiarea [j]/npix > 0.5 ? 1 : 0); 883 859 hipix.FillAbsTime (fTimehiarea[j]/npix); 884 860 … … 890 866 else 891 867 lopix.FillHist(fSumloarea [j]/npix); 892 lopix. SetSaturated ((Float_t)fSatloarea [j]/npix > 0.5 ? 1 : 0);868 lopix.AddSaturated ((Float_t)fSatloarea [j]/npix > 0.5 ? 1 : 0); 893 869 lopix.FillAbsTime (fTimeloarea[j]/npix); 894 870 } … … 910 886 hipix.FillHist(fSumhisector [j]/npix); 911 887 912 hipix. SetSaturated ((Float_t)fSathisector[j]/npix > 0.5 ? 1 : 0);888 hipix.AddSaturated ((Float_t)fSathisector[j]/npix > 0.5 ? 1 : 0); 913 889 hipix.FillAbsTime (fTimehisector[j]/npix); 914 890 … … 922 898 lopix.FillHist(fSumlosector [j]/npix); 923 899 924 lopix. SetSaturated ((Float_t)fSatlosector[j]/npix > 0.5 ? 1 : 0);900 lopix.AddSaturated ((Float_t)fSatlosector[j]/npix > 0.5 ? 1 : 0); 925 901 lopix.FillAbsTime (fTimelosector[j]/npix); 926 902 } … … 1018 994 { 1019 995 *fLog << warn << GetDescriptor() 1020 << ": Lo -Gain Histogram Overflow occurred " << overflow996 << ": LoGain Histogram Overflow occurred " << overflow 1021 997 << " times in pixel: " << i << " (without saturation!) " << endl; 1022 998 bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow ); … … 1027 1003 { 1028 1004 *fLog << warn << GetDescriptor() 1029 << ": Lo -Gain Histogram Underflow occurred " << overflow1005 << ": LoGain Histogram Underflow occurred " << overflow 1030 1006 << " times in pixel: " << i << " (without saturation!) " << endl; 1031 1007 bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow ); … … 1318 1294 // I don't know the reason. 1319 1295 // 1320 // Creates new MHCalibrationCam 1296 // Creates new MHCalibrationChargeCam only for the Averaged Areas, 1297 // the rest has to be retrieved directly, e.g. via: 1298 // MHCalibrationChargeCam *cam = MParList::FindObject("MHCalibrationChargeCam"); 1299 // - cam->GetAverageSector(5).DrawClone(); 1300 // - (*cam)[100].DrawClone() 1321 1301 // 1322 1302 TObject *MHCalibrationChargeCam::Clone(const char *name) const … … 1325 1305 const Int_t navhi = fAverageHiGainAreas->GetEntries(); 1326 1306 const Int_t navlo = fAverageLoGainAreas->GetEntries(); 1327 const Int_t nsehi = fAverageHiGainSectors->GetEntries();1328 const Int_t nselo = fAverageLoGainSectors->GetEntries();1307 // const Int_t nsehi = fAverageHiGainSectors->GetEntries(); 1308 // const Int_t nselo = fAverageLoGainSectors->GetEntries(); 1329 1309 1330 1310 // … … 1334 1314 1335 1315 cam->fAverageHiGainAreas->Expand(navhi); 1336 cam->fAverageLoGainAreas->Expand(navlo); 1337 cam->fAverageHiGainSectors->Expand(nsehi); 1338 cam->fAverageLoGainSectors->Expand(nselo); 1339 1340 cam->fAverageHiGainAreas->Expand(navhi); 1341 cam->fAverageLoGainAreas->Expand(navlo); 1342 cam->fAverageHiGainSectors->Expand(nsehi); 1343 cam->fAverageLoGainSectors->Expand(nselo); 1316 // cam->fAverageHiGainSectors->Expand(nsehi); 1344 1317 1345 1318 for (int i=0; i<navhi; i++) 1346 1319 (*cam->fAverageHiGainAreas) [i] = (*fAverageHiGainAreas) [i]->Clone(); 1347 for (int i=0; i<navlo; i++) 1348 (*cam->fAverageLoGainAreas) [i] = (*fAverageLoGainAreas) [i]->Clone(); 1349 for (int i=0; i<nsehi; i++) 1350 (*cam->fAverageHiGainSectors)[i] = (*fAverageHiGainSectors)[i]->Clone(); 1351 for (int i=0; i<nselo; i++) 1352 (*cam->fAverageLoGainSectors)[i] = (*fAverageLoGainSectors)[i]->Clone(); 1353 1320 // for (int i=0; i<nsehi; i++) 1321 // (*cam->fAverageHiGainSectors)[i] = (*fAverageHiGainSectors)[i]->Clone(); 1322 1323 if (IsLoGain()) 1324 { 1325 cam->fAverageLoGainAreas->Expand(navlo); 1326 // cam->fAverageLoGainSectors->Expand(nselo); 1327 1328 for (int i=0; i<navlo; i++) 1329 (*cam->fAverageLoGainAreas) [i] = (*fAverageLoGainAreas) [i]->Clone(); 1330 // for (int i=0; i<nselo; i++) 1331 // (*cam->fAverageLoGainSectors)[i] = (*fAverageLoGainSectors)[i]->Clone(); 1332 } 1333 1354 1334 cam->fAverageAreaNum = fAverageAreaNum; 1355 1335 cam->fAverageAreaSat = fAverageAreaSat; … … 1363 1343 cam->fColor = fColor; 1364 1344 cam->fPulserFrequency = fPulserFrequency; 1345 cam->fFlags = fFlags; 1365 1346 1366 1347 return cam; … … 1368 1349 } 1369 1350 1351 // ----------------------------------------------------------------------------- 1352 // 1353 // Draw the average pixel for the datacheck: 1354 // 1355 // Displays the averaged areas, both High Gain and Low Gain 1356 // 1357 // Calls the Draw of the fAverageHiGainAreas and fAverageLoGainAreas objects with options 1358 // 1370 1359 void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline[]) 1371 1360 { … … 1380 1369 1381 1370 TH1F *hist = pix.GetHGausHist(); 1382 1383 TH2D *null = new TH2D("Null",hist->GetTitle(),100,pix.GetFirst() > -1. ? 0. : 100.,pix.GetLast()/2., 1384 100,0.,hist->GetEntries()/10.); 1385 1371 1372 TH1F *null = new TH1F("Null",hist->GetTitle(),100, 1373 pix.GetFirst() > 0. ? pix.GetFirst() : 0., 1374 pix.GetLast() > pix.GetFirst() 1375 ? ( pix.GetLast() > 450. ? 450. : pix.GetLast() ) 1376 : pix.GetFirst()*2.); 1377 1378 null->SetMaximum(1.1*hist->GetMaximum()); 1386 1379 null->SetDirectory(NULL); 1387 1380 null->SetBit(kCanDelete); … … 1400 1393 xaxe->SetLabelSize(0.06); 1401 1394 yaxe->SetLabelSize(0.06); 1402 1403 1395 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 1404 1396 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 1397 1405 1398 null->Draw(); 1406 1399 hist->Draw("same"); … … 1408 1401 gStyle->SetOptFit(); 1409 1402 1410 if (pix.GetFGausFit()) 1403 TF1 *fit = pix.GetFGausFit(); 1404 1405 if (fit) 1411 1406 { 1412 1407 switch ( fColor ) 1413 1408 { 1414 1409 case MCalibrationCam::kGREEN: 1415 pix.GetFGausFit()->SetLineColor(kGreen);1410 fit->SetLineColor(kGreen); 1416 1411 break; 1417 1412 case MCalibrationCam::kBLUE: 1418 pix.GetFGausFit()->SetLineColor(kBlue);1413 fit->SetLineColor(kBlue); 1419 1414 break; 1420 1415 case MCalibrationCam::kUV: 1421 pix.GetFGausFit()->SetLineColor(106);1416 fit->SetLineColor(106); 1422 1417 break; 1423 1418 case MCalibrationCam::kCT1: 1424 pix.GetFGausFit()->SetLineColor(006);1419 fit->SetLineColor(006); 1425 1420 break; 1426 1421 default: 1427 pix.GetFGausFit()->SetLineColor(kRed);1422 fit->SetLineColor(kRed); 1428 1423 } 1429 pix.GetFGausFit()->Draw("same");1424 fit->Draw("same"); 1430 1425 } 1431 1426 … … 1435 1430 gPad->SetTicks(); 1436 1431 1437 pix.DrawEvents(); 1432 TH1F *null2 = new TH1F("Null2",hist->GetTitle(),100,0.,pix.GetEvents()->GetSize()/pix.GetEventFrequency()); 1433 1434 null2->SetMinimum(pix.GetMean()-10.*pix.GetSigma()); 1435 null2->SetMaximum(pix.GetMean()+10.*pix.GetSigma()); 1436 null2->SetDirectory(NULL); 1437 null2->SetBit(kCanDelete); 1438 null2->SetStats(kFALSE); 1439 // 1440 // set the labels bigger 1441 // 1442 TAxis *xaxe2 = null2->GetXaxis(); 1443 TAxis *yaxe2 = null2->GetYaxis(); 1444 xaxe2->CenterTitle(); 1445 yaxe2->CenterTitle(); 1446 xaxe2->SetTitleSize(0.07); 1447 yaxe2->SetTitleSize(0.07); 1448 xaxe2->SetTitleOffset(0.7); 1449 yaxe2->SetTitleOffset(0.55); 1450 xaxe2->SetLabelSize(0.06); 1451 yaxe2->SetLabelSize(0.06); 1452 1453 pix.CreateGraphEvents(); 1454 TGraph *gr = pix.GetGraphEvents(); 1455 1456 xaxe2->SetTitle(gr->GetXaxis()->GetTitle()); 1457 yaxe2->SetTitle(gr->GetYaxis()->GetTitle()); 1458 1459 null2->Draw(); 1460 1461 pix.DrawEvents("same"); 1438 1462 return; 1439 1463 … … 1441 1465 1442 1466 1443 void MHCalibrationChargeCam::DisplayRefLines(const TH 2D*hist, const Float_t refline[]) const1467 void MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline[]) const 1444 1468 { 1445 1469 1446 TLine *green1 = new TLine(refline[0],0. ,refline[0],hist->GetYaxis()->GetXmax());1470 TLine *green1 = new TLine(refline[0],0.1,refline[0],0.9*hist->GetMaximum()); 1447 1471 green1->SetBit(kCanDelete); 1448 1472 green1->SetLineColor(kGreen); … … 1451 1475 green1->Draw(); 1452 1476 1453 TLine *green5 = new TLine(refline[6],0. ,refline[6],hist->GetYaxis()->GetXmax());1477 TLine *green5 = new TLine(refline[6],0.1,refline[6],0.9*hist->GetMaximum()); 1454 1478 green5->SetBit(kCanDelete); 1455 1479 green5->SetLineColor(8); … … 1458 1482 green5->Draw(); 1459 1483 1460 TLine *blue1 = new TLine(refline[1],0. ,refline[1],hist->GetYaxis()->GetXmax());1484 TLine *blue1 = new TLine(refline[1],0.1,refline[1],0.9*hist->GetMaximum()); 1461 1485 blue1->SetBit(kCanDelete); 1462 1486 blue1->SetLineColor(227); … … 1465 1489 blue1->Draw(); 1466 1490 1467 TLine *blue5 = new TLine(refline[2],0. ,refline[2],hist->GetYaxis()->GetXmax());1491 TLine *blue5 = new TLine(refline[2],0.1,refline[2],0.9*hist->GetMaximum()); 1468 1492 blue5->SetBit(kCanDelete); 1469 1493 blue5->SetLineColor(68); … … 1472 1496 blue5->Draw(); 1473 1497 1474 TLine *blue10 = new TLine(refline[3],0. ,refline[3],hist->GetYaxis()->GetXmax());1498 TLine *blue10 = new TLine(refline[3],0.1,refline[3],0.9*hist->GetMaximum()); 1475 1499 blue10->SetBit(kCanDelete); 1476 1500 blue10->SetLineColor(4); … … 1479 1503 blue10->Draw(); 1480 1504 1481 TLine *uv10 = new TLine(refline[4],0. ,refline[4],hist->GetYaxis()->GetXmax());1505 TLine *uv10 = new TLine(refline[4],0.1,refline[4],0.9*hist->GetMaximum()); 1482 1506 uv10->SetBit(kCanDelete); 1483 1507 uv10->SetLineColor(106); … … 1486 1510 uv10->Draw(); 1487 1511 1488 TLine *ct1 = new TLine(refline[5],0. ,refline[5],hist->GetYaxis()->GetXmax());1512 TLine *ct1 = new TLine(refline[5],0.1,refline[5],0.9*hist->GetMaximum()); 1489 1513 ct1->SetBit(kCanDelete); 1490 1514 ct1->SetLineColor(6); … … 1493 1517 ct1->Draw(); 1494 1518 1495 TLegend *leg = new TLegend(0. 7,0.35,0.9,0.99);1519 TLegend *leg = new TLegend(0.8,0.35,0.99,0.99); 1496 1520 leg->SetBit(kCanDelete); 1497 1521 leg->AddEntry(green1,"1 Led GREEN","l"); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h
r4950 r4962 14 14 #endif 15 15 16 class TH 2D;16 class TH1F; 17 17 class MRawEvtData; 18 18 class MExtractedSignalCam; … … 96 96 97 97 void DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline[]); 98 void DisplayRefLines ( const TH 2D*hist, const Float_t refline[]) const;98 void DisplayRefLines ( const TH1F *hist, const Float_t refline[]) const; 99 99 100 100 public: -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.cc
r4950 r4962 81 81 } 82 82 83 // -------------------------------------------------------------------------- 84 // 85 // Use the MHGausEvents::Clone function and clone additionally the rest of the 86 // data members. 87 // 83 #if 0 84 // -------------------------------------------------------------------------- 85 // 86 // ATTENTION: This nasty Clone function is necessary since the ROOT cloning 87 // lead to crashes on SOME machines (unfortunately not mine...). 88 // This function is a workaround in order to achieve the correct 89 // DrawClone() behaviour. 90 // 88 91 TObject *MHCalibrationChargePix::Clone(const char *name) const 89 92 { 90 93 91 MHCalibrationChargePix &pix = (MHCalibrationChargePix&)*MHCalibrationPix::Clone(name); 94 MHCalibrationChargePix &pix = 95 *new MHCalibrationChargePix(name ? name : fName.Data(),fTitle.Data()); 92 96 // 93 // Copy data members 97 // Copy MHGausEvents data members 98 // 99 pix.fBinsAfterStripping = fBinsAfterStripping; 100 pix.fCurrentSize = fCurrentSize; 101 pix.fFlags = fFlags; 102 pix.fPowerProbabilityBins = fPowerProbabilityBins; 103 104 if (fHPowerProbability) 105 pix.fHPowerProbability=(TH1I*)fHPowerProbability->Clone(); 106 107 if (fPowerSpectrum) 108 pix.fPowerSpectrum = new TArrayF(*fPowerSpectrum); 109 110 pix.fEvents = fEvents; 111 112 if (fFGausFit) 113 pix.fFGausFit=(TF1*)fFGausFit->Clone(); 114 if (fFExpFit) 115 pix.fFExpFit=(TF1*)fFExpFit->Clone(); 116 117 pix.fFirst = fFirst; 118 119 if (fGraphEvents) 120 pix.fGraphEvents=(TGraph*)fGraphEvents->Clone(); 121 if (fGraphPowerSpectrum) 122 pix.fGraphPowerSpectrum=(TGraph*)fGraphPowerSpectrum->Clone(); 123 124 pix.fHGausHist = fHGausHist; 125 126 pix.fLast = fLast; 127 pix.fMean = fMean; 128 pix.fMeanErr = fMeanErr; 129 pix.fNbins = fNbins; 130 pix.fNDFLimit = fNDFLimit; 131 pix.fSigma = fSigma; 132 pix.fSigmaErr = fSigmaErr; 133 pix.fProb = fProb; 134 pix.fProbLimit = fProbLimit; 135 136 // 137 // Copy MHCalibrationPix data members 138 // 139 pix.fEventFrequency = fEventFrequency; 140 pix.fBlackoutLimit = fBlackoutLimit; 141 pix.fSaturated = fSaturated; 142 pix.fPickupLimit = fPickupLimit; 143 pix.fPixId = fPixId; 144 145 // 146 // Copy MHCalibrationChargePix data members 94 147 // 95 148 pix.fHAbsTime = fHAbsTime; … … 97 150 return &pix; 98 151 } 152 #endif 99 153 100 154 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.h
r4950 r4962 22 22 ~MHCalibrationChargePix() {} 23 23 24 TObject *Clone(const char* name="") const;24 // TObject *Clone(const char* name="") const; 25 25 26 26 void Reset(); -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPix.cc
r4936 r4962 95 95 } 96 96 97 // -------------------------------------------------------------------------- 98 // 99 // Use the MHGausEvents::Clone function and clone additionally the rest of the 100 // data members. 101 // 97 98 #if 0 99 // -------------------------------------------------------------------------- 100 // 101 // ATTENTION: This nasty Clone function is necessary since the ROOT cloning 102 // lead to crashes on SOME machines (unfortunately not mine...). 103 // This function is a workaround in order to achieve the correct 104 // DrawClone() behaviour. 105 // 102 106 TObject *MHCalibrationPix::Clone(const char *name) const 103 107 { 104 108 105 MHCalibrationPix &pix = (MHCalibrationPix&)*MHGausEvents::Clone(name); 106 109 MHCalibrationPix &pix = *new MHCalibrationPix(name ? name : fName.Data(),fTitle.Data()); 110 111 // 112 // Copy MHGausEvents data members 113 // 114 pix.fBinsAfterStripping = fBinsAfterStripping; 115 pix.fCurrentSize = fCurrentSize; 116 pix.fFlags = fFlags; 117 pix.fPowerProbabilityBins = fPowerProbabilityBins; 118 119 if (fHPowerProbability) 120 pix.fHPowerProbability=(TH1I*)fHPowerProbability->Clone(); 121 122 if (fPowerSpectrum) 123 pix.fPowerSpectrum = new TArrayF(*fPowerSpectrum); 124 125 pix.fEvents = fEvents; 126 127 if (fFGausFit) 128 pix.fFGausFit=(TF1*)fFGausFit->Clone(); 129 if (fFExpFit) 130 pix.fFExpFit=(TF1*)fFExpFit->Clone(); 131 132 pix.fFirst = fFirst; 133 134 if (fGraphEvents) 135 pix.fGraphEvents=(TGraph*)fGraphEvents->Clone(); 136 if (fGraphPowerSpectrum) 137 pix.fGraphPowerSpectrum=(TGraph*)fGraphPowerSpectrum->Clone(); 138 139 pix.fHGausHist = fHGausHist; 140 141 pix.fLast = fLast; 142 pix.fMean = fMean; 143 pix.fMeanErr = fMeanErr; 144 pix.fNbins = fNbins; 145 pix.fNDFLimit = fNDFLimit; 146 pix.fSigma = fSigma; 147 pix.fSigmaErr = fSigmaErr; 148 pix.fProb = fProb; 149 pix.fProbLimit = fProbLimit; 150 107 151 // 108 152 // Copy data members … … 116 160 return &pix; 117 161 } 162 #endif 118 163 119 164 // ----------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationPix.h
r4936 r4962 13 13 const static Float_t fgPickupLimit; //! Default for fPickupLimit (now set to: 5. ) 14 14 15 protected: 16 15 17 Float_t fEventFrequency; // Event frequency in Hertz (to be set) 16 18 17 19 Float_t *CreateEventXaxis(Int_t n); // Create an x-axis for the Event TGraphs 18 Float_t *CreatePSDXaxis(Int_t n); // Create an x-axis for the PSD TGraphs 19 void CreateGraphEvents(); // Create the TGraph fGraphEvents of fEvents 20 void CreateGraphPowerSpectrum(); // Create the TGraph fGraphPowerSpectrum out of fPowerSpectrum 20 Float_t *CreatePSDXaxis (Int_t n); // Create an x-axis for the PSD TGraphs 21 21 22 protected:23 24 22 Float_t fBlackoutLimit; // Lower nr sigmas from mean until event is considered blackout 25 23 Int_t fSaturated; // Number of events classified as saturated … … 34 32 void Clear(Option_t *o=""); 35 33 36 TObject *Clone(const char* name="") const;34 // TObject *Clone(const char* name="") const; 37 35 36 void CreateGraphEvents(); // Create the TGraph fGraphEvents of fEvents 37 void CreateGraphPowerSpectrum(); // Create the TGraph fGraphPowerSpectrum out of fPowerSpectrum 38 38 39 // Getters 39 const Double_t GetBlackout() const; 40 const Double_t GetPickup() const; 41 const Int_t GetPixId() const { return fPixId; } 42 const Float_t GetSaturated() const { return fSaturated; } 40 const Double_t GetBlackout () const; 41 const Float_t GetEventFrequency () const { return fEventFrequency; } 42 const Double_t GetPickup () const; 43 const Int_t GetPixId () const { return fPixId; } 44 const Float_t GetSaturated () const { return fSaturated; } 43 45 44 46 // Fits … … 47 49 48 50 // Setters 51 void AddSaturated ( const Int_t i ) { fSaturated += i; } 49 52 void SetBlackoutLimit ( const Float_t lim=fgBlackoutLimit ) { fBlackoutLimit = lim; } 50 53 void SetEventFrequency ( const Float_t f ) { fEventFrequency = f; } 51 54 void SetPickupLimit ( const Float_t lim=fgPickupLimit ) { fPickupLimit = lim; } 52 55 void SetPixId ( const Int_t i ) { fPixId = i; } 53 void SetSaturated ( const Int_t i ) { fSaturated += i; }54 56 55 57 // Miscelleaneous -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc
r4951 r4962 90 90 91 91 #include "MFFT.h" 92 #include "MArray .h"92 #include "MArrayF.h" 93 93 94 94 #include "MH.h" … … 172 172 173 173 // delete histograms 174 //if (fHPowerProbability)175 //if (gROOT->FindObject(fHPowerProbability->GetName()))176 //delete fHPowerProbability;174 if (fHPowerProbability) 175 if (gROOT->FindObject(fHPowerProbability->GetName())) 176 delete fHPowerProbability; 177 177 178 178 // delete fits … … 271 271 272 272 MHGausEvents &pix = (MHGausEvents&)*MH::Clone(name); 273 274 273 274 /* 275 275 // 276 276 // Copy data members … … 286 286 if (fPowerSpectrum) 287 287 pix.fPowerSpectrum = new TArrayF(*fPowerSpectrum); 288 289 pix.fEvents = fEvents;290 288 291 289 if (fFGausFit) … … 312 310 pix.fProb = fProb; 313 311 pix.fProbLimit = fProbLimit; 314 312 */ 315 313 return &pix; 316 314 } … … 365 363 366 364 // This cuts only the non-used zero's, but MFFT will later cut the rest 367 MArray::StripZeros(fEvents);365 fEvents.StripZeros(); 368 366 369 367 if (fEvents.GetSize() < 8) … … 425 423 { 426 424 427 MArray::StripZeros(fEvents);425 fEvents.StripZeros(); 428 426 429 427 const Int_t n = fEvents.GetSize(); … … 446 444 { 447 445 448 MArray::StripZeros(*fPowerSpectrum);446 fPowerSpectrum->StripZeros(); 449 447 450 448 const Int_t n = fPowerSpectrum->GetSize(); … … 616 614 void MHGausEvents::FillArray(const Float_t f) 617 615 { 616 618 617 if (fEvents.GetSize() == 0) 619 618 fEvents.Set(512); -
trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h
r4951 r4962 10 10 #endif 11 11 12 #ifndef MARS_MArrayF 13 #include "MArrayF.h" 14 #endif 15 12 16 class TVirtualPad; 13 17 class TGraph; 14 class TArrayF;18 class MArrayF; 15 19 class TH1F; 16 20 class TH1I; 17 21 class TF1; 18 19 22 class MHGausEvents : public MH 20 23 { … … 28 31 29 32 Int_t fBinsAfterStripping; // Bins for the Gauss Histogram after stripping off the zeros at both ends 30 Int_tfCurrentSize; // Current size of the array fEvents33 UInt_t fCurrentSize; // Current size of the array fEvents 31 34 Byte_t fFlags; // Bit field for the fit result bits 32 35 Int_t fPowerProbabilityBins; // Bins for the projected power spectrum 33 36 34 37 TH1I *fHPowerProbability; // Fourier transform of fEvents projected on y-axis 35 TArrayF *fPowerSpectrum; // Fourier transform of fEvents38 MArrayF *fPowerSpectrum; // Fourier transform of fEvents 36 39 37 40 enum { kGausFitOK, … … 40 43 kExcluded }; // Bits for information about fit results 41 44 42 TArrayF fEvents; // Array which holds the entries of GausHist45 MArrayF fEvents; // Array which holds the entries of GausHist 43 46 TF1 *fFGausFit; // Gauss fit for fHGausHist 44 47 TF1 *fFExpFit; // Exponential fit for FHPowerProbability … … 88 91 const Int_t GetExpNdf() const; 89 92 const Double_t GetExpProb() const; 90 TArrayF *GetEvents() { return &fEvents; }91 const TArrayF *GetEvents() const { return &fEvents; }93 MArrayF *GetEvents() { return &fEvents; } 94 const MArrayF *GetEvents() const { return &fEvents; } 92 95 TF1 *GetFExpFit() { return fFExpFit; } 93 96 const TF1 *GetFExpFit() const { return fFExpFit; } … … 107 110 const Double_t GetMeanErr() const { return fMeanErr; } 108 111 const Int_t GetNdf() const; 112 const Int_t GetNbins() const { return fNbins; } 109 113 const Double_t GetOffset() const; 110 TArrayF *GetPowerSpectrum() { return fPowerSpectrum; }111 const TArrayF *GetPowerSpectrum() const { return fPowerSpectrum; }114 MArrayF *GetPowerSpectrum() { return fPowerSpectrum; } 115 const MArrayF *GetPowerSpectrum() const { return fPowerSpectrum; } 112 116 const Double_t GetProb() const { return fProb; } 113 117 const Double_t GetSigma() const { return fSigma; }
Note:
See TracChangeset
for help on using the changeset viewer.