Ignore:
Timestamp:
09/12/04 22:49:41 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhcalib
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r4950 r4962  
    145145#include <TStyle.h>
    146146#include <TF1.h>
    147 #include <TH2D.h>
    148147#include <TLine.h>
    149148#include <TLatex.h>
    150149#include <TLegend.h>
     150#include <TGraph.h>
    151151
    152152ClassImp(MHCalibrationChargeCam);
     
    382382//
    383383// - 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
    390391//   * Call InitHists
    391392//
     
    539540//
    540541// - 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
    547549//   * Call InitHists
    548550//
     
    590592          h->SetXTitle(fAbsHistXTitle.Data());
    591593          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
    605595          InitHists(pix,(*fBadPixels)[i],i);
    606596      }
     
    633623        h->SetYTitle(fHistYTitle.Data());
    634624
    635         //
    636         // Adapt the range for the case, the intense blue is used:
    637         // FIXME: this is a nasty workaround, but for the moment necessary
    638         // 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             }
    649625
    650626        if (fGeom->InheritsFrom("MGeomCamMagic"))
     
    745721// - MExtractedSignalPix::GetExtractedSignalLoGain();
    746722//
    747 // 2) Set number of saturated slices (MHCalibrationChargePix::SetSaturated()) with:
     723// 2) Set number of saturated slices (MHCalibrationChargePix::AddSaturated()) with:
    748724// - MExtractedSignalPix::GetNumHiGainSaturated();
    749725// - MExtractedSignalPix::GetNumLoGainSaturated();
     
    800776        histhi.FillHist(sumhi);
    801777       
    802       histhi.SetSaturated(sathi);
     778      histhi.AddSaturated(sathi);
    803779
    804780      const Int_t aidx   = (*fGeom)[i].GetAidx();
     
    822798            histlo.FillHist(sumlo);
    823799         
    824           histlo.SetSaturated(satlo);
     800          histlo.AddSaturated(satlo);
    825801         
    826802          fSumloarea[aidx]  += sumlo;
     
    880856        hipix.FillHist(fSumhiarea[j]/npix);
    881857     
    882       hipix.SetSaturated    ((Float_t)fSathiarea [j]/npix > 0.5 ? 1 : 0);
     858      hipix.AddSaturated    ((Float_t)fSathiarea [j]/npix > 0.5 ? 1 : 0);
    883859      hipix.FillAbsTime     (fTimehiarea[j]/npix);
    884860
     
    890866          else
    891867            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);
    893869          lopix.FillAbsTime     (fTimeloarea[j]/npix);
    894870        }
     
    910886        hipix.FillHist(fSumhisector [j]/npix);
    911887
    912       hipix.SetSaturated    ((Float_t)fSathisector[j]/npix > 0.5 ? 1 : 0);
     888      hipix.AddSaturated    ((Float_t)fSathisector[j]/npix > 0.5 ? 1 : 0);
    913889      hipix.FillAbsTime     (fTimehisector[j]/npix);
    914890
     
    922898            lopix.FillHist(fSumlosector [j]/npix);
    923899           
    924           lopix.SetSaturated    ((Float_t)fSatlosector[j]/npix > 0.5 ? 1 : 0);
     900          lopix.AddSaturated    ((Float_t)fSatlosector[j]/npix > 0.5 ? 1 : 0);
    925901          lopix.FillAbsTime     (fTimelosector[j]/npix);
    926902        }
     
    1018994          {
    1019995            *fLog << warn << GetDescriptor()
    1020                   << ": Lo-Gain Histogram Overflow occurred " << overflow
     996                  << ": LoGain Histogram Overflow occurred " << overflow
    1021997                  << " times in pixel: " << i << " (without saturation!) " << endl;
    1022998            bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow );
     
    10271003          {
    10281004            *fLog << warn << GetDescriptor()
    1029                   << ": Lo-Gain Histogram Underflow occurred " << overflow
     1005                  << ": LoGain Histogram Underflow occurred " << overflow
    10301006                  << " times in pixel: " << i << " (without saturation!) " << endl;
    10311007            bad.SetUncalibrated( MBadPixelsPix::kLoGainOverFlow );
     
    13181294// I don't know the reason.
    13191295//
    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()
    13211301//
    13221302TObject *MHCalibrationChargeCam::Clone(const char *name) const
     
    13251305  const Int_t navhi = fAverageHiGainAreas->GetEntries();
    13261306  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();
    13291309 
    13301310  //
     
    13341314
    13351315  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);
    13441317
    13451318  for (int i=0; i<navhi; i++)
    13461319    (*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 
    13541334  cam->fAverageAreaNum         = fAverageAreaNum;
    13551335  cam->fAverageAreaSat         = fAverageAreaSat;
     
    13631343  cam->fColor                  = fColor;
    13641344  cam->fPulserFrequency        = fPulserFrequency;
     1345  cam->fFlags                  = fFlags;
    13651346
    13661347  return cam;
     
    13681349}
    13691350
     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//
    13701359void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline[])
    13711360{
     
    13801369
    13811370  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());
    13861379  null->SetDirectory(NULL);
    13871380  null->SetBit(kCanDelete);
     
    14001393  xaxe->SetLabelSize(0.06);
    14011394  yaxe->SetLabelSize(0.06);   
    1402 
    14031395  xaxe->SetTitle(hist->GetXaxis()->GetTitle());
    14041396  yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 
     1397
    14051398  null->Draw();
    14061399  hist->Draw("same");
     
    14081401  gStyle->SetOptFit();
    14091402
    1410   if (pix.GetFGausFit())
     1403  TF1 *fit = pix.GetFGausFit();
     1404
     1405  if (fit)
    14111406  {
    14121407    switch ( fColor )
    14131408      {
    14141409      case MCalibrationCam::kGREEN:
    1415         pix.GetFGausFit()->SetLineColor(kGreen);
     1410        fit->SetLineColor(kGreen);
    14161411        break;
    14171412      case MCalibrationCam::kBLUE:
    1418         pix.GetFGausFit()->SetLineColor(kBlue);
     1413        fit->SetLineColor(kBlue);
    14191414        break;
    14201415      case MCalibrationCam::kUV: 
    1421         pix.GetFGausFit()->SetLineColor(106);
     1416        fit->SetLineColor(106);
    14221417        break;
    14231418      case MCalibrationCam::kCT1:
    1424         pix.GetFGausFit()->SetLineColor(006);
     1419        fit->SetLineColor(006);
    14251420        break;
    14261421      default:
    1427         pix.GetFGausFit()->SetLineColor(kRed);
     1422        fit->SetLineColor(kRed);
    14281423      }
    1429     pix.GetFGausFit()->Draw("same");
     1424    fit->Draw("same");
    14301425  }
    14311426
     
    14351430  gPad->SetTicks();
    14361431
    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");
    14381462  return;
    14391463 
     
    14411465
    14421466
    1443 void  MHCalibrationChargeCam::DisplayRefLines(const TH2D *hist, const Float_t refline[]) const
     1467void  MHCalibrationChargeCam::DisplayRefLines(const TH1F *hist, const Float_t refline[]) const
    14441468{
    14451469
    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());
    14471471  green1->SetBit(kCanDelete);
    14481472  green1->SetLineColor(kGreen);
     
    14511475  green1->Draw();
    14521476
    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());
    14541478  green5->SetBit(kCanDelete);
    14551479  green5->SetLineColor(8);
     
    14581482  green5->Draw();
    14591483
    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());
    14611485  blue1->SetBit(kCanDelete);
    14621486  blue1->SetLineColor(227);
     
    14651489  blue1->Draw();
    14661490
    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());
    14681492  blue5->SetBit(kCanDelete);
    14691493  blue5->SetLineColor(68);
     
    14721496  blue5->Draw();
    14731497
    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());
    14751499  blue10->SetBit(kCanDelete);
    14761500  blue10->SetLineColor(4);
     
    14791503  blue10->Draw();
    14801504
    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());
    14821506  uv10->SetBit(kCanDelete);
    14831507  uv10->SetLineColor(106);
     
    14861510  uv10->Draw();
    14871511
    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());
    14891513  ct1->SetBit(kCanDelete);
    14901514  ct1->SetLineColor(6);
     
    14931517  ct1->Draw();
    14941518
    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);
    14961520  leg->SetBit(kCanDelete);
    14971521  leg->AddEntry(green1,"1 Led GREEN","l");
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h

    r4950 r4962  
    1414#endif
    1515
    16 class TH2D;
     16class TH1F;
    1717class MRawEvtData;
    1818class MExtractedSignalCam;
     
    9696
    9797  void   DrawDataCheckPixel(MHCalibrationChargePix &pix, const Float_t refline[]);
    98   void   DisplayRefLines   ( const TH2D *hist,           const Float_t refline[]) const;
     98  void   DisplayRefLines   ( const TH1F *hist,           const Float_t refline[]) const;
    9999 
    100100public:
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.cc

    r4950 r4962  
    8181}
    8282
    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//
    8891TObject *MHCalibrationChargePix::Clone(const char *name) const
    8992{
    9093
    91   MHCalibrationChargePix &pix = (MHCalibrationChargePix&)*MHCalibrationPix::Clone(name);
     94  MHCalibrationChargePix &pix =
     95    *new MHCalibrationChargePix(name ? name : fName.Data(),fTitle.Data());
    9296  //
    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
    94147  //
    95148  pix.fHAbsTime = fHAbsTime;
     
    97150  return &pix;
    98151}
     152#endif
    99153
    100154// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargePix.h

    r4950 r4962  
    2222  ~MHCalibrationChargePix() {}
    2323
    24   TObject *Clone(const char* name="") const;
     24  //  TObject *Clone(const char* name="") const;
    2525
    2626  void Reset(); 
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPix.cc

    r4936 r4962  
    9595}
    9696
    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//
    102106TObject *MHCalibrationPix::Clone(const char *name) const
    103107{
    104108
    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
    107151  //
    108152  // Copy data members
     
    116160  return &pix;
    117161}
     162#endif
    118163
    119164// -----------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationPix.h

    r4936 r4962  
    1313  const static Float_t  fgPickupLimit;   //! Default for fPickupLimit   (now set to: 5. )
    1414 
     15protected:
     16
    1517  Float_t  fEventFrequency;              // Event frequency in Hertz (to be set)
    1618
    1719  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
    2121 
    22 protected:
    23 
    2422  Float_t  fBlackoutLimit;               // Lower nr sigmas from mean until event is considered blackout
    2523  Int_t    fSaturated;                   // Number of events classified as saturated
     
    3432  void  Clear(Option_t *o="");
    3533
    36   TObject *Clone(const char* name="") const;
     34  //  TObject *Clone(const char* name="") const;
    3735 
     36  void  CreateGraphEvents();          // Create the TGraph fGraphEvents of fEvents                   
     37  void  CreateGraphPowerSpectrum();   // Create the TGraph fGraphPowerSpectrum out of fPowerSpectrum
     38
    3839  // 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;      }
    4345
    4446  // Fits
     
    4749 
    4850  // Setters
     51  void  AddSaturated        ( const Int_t    i                   ) { fSaturated     += i;   }
    4952  void  SetBlackoutLimit    ( const Float_t  lim=fgBlackoutLimit ) { fBlackoutLimit  = lim; }
    5053  void  SetEventFrequency   ( const Float_t  f                   ) { fEventFrequency = f;   }
    5154  void  SetPickupLimit      ( const Float_t  lim=fgPickupLimit   ) { fPickupLimit    = lim; }
    5255  void  SetPixId            ( const Int_t    i                   ) { fPixId          = i;   }
    53   void  SetSaturated        ( const Int_t    i                   ) { fSaturated     += i;   }
    5456
    5557  // Miscelleaneous
  • trunk/MagicSoft/Mars/mhcalib/MHGausEvents.cc

    r4951 r4962  
    9090
    9191#include "MFFT.h"
    92 #include "MArray.h"
     92#include "MArrayF.h"
    9393
    9494#include "MH.h"
     
    172172
    173173  // 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;
    177177 
    178178  // delete fits
     
    271271
    272272  MHGausEvents &pix = (MHGausEvents&)*MH::Clone(name);
    273  
    274 
     273
     274  /*
    275275  //
    276276  // Copy data members
     
    286286  if (fPowerSpectrum)
    287287    pix.fPowerSpectrum = new TArrayF(*fPowerSpectrum);
    288 
    289   pix.fEvents = fEvents;
    290288
    291289  if (fFGausFit)
     
    312310  pix.fProb      = fProb;
    313311  pix.fProbLimit = fProbLimit;
    314 
     312  */
    315313  return &pix;
    316314}
     
    365363 
    366364  // This cuts only the non-used zero's, but MFFT will later cut the rest
    367   MArray::StripZeros(fEvents);
     365  fEvents.StripZeros();
    368366
    369367  if (fEvents.GetSize() < 8)
     
    425423{
    426424
    427   MArray::StripZeros(fEvents);
     425  fEvents.StripZeros();
    428426
    429427  const Int_t n = fEvents.GetSize();
     
    446444{
    447445
    448   MArray::StripZeros(*fPowerSpectrum);
     446  fPowerSpectrum->StripZeros();
    449447
    450448  const Int_t n = fPowerSpectrum->GetSize();
     
    616614void MHGausEvents::FillArray(const Float_t f)
    617615{
     616
    618617  if (fEvents.GetSize() == 0)
    619618    fEvents.Set(512);
  • trunk/MagicSoft/Mars/mhcalib/MHGausEvents.h

    r4951 r4962  
    1010#endif
    1111
     12#ifndef MARS_MArrayF
     13#include "MArrayF.h"
     14#endif
     15
    1216class TVirtualPad;
    1317class TGraph;
    14 class TArrayF;
     18class MArrayF;
    1519class TH1F;
    1620class TH1I;
    1721class TF1;
    18 
    1922class MHGausEvents : public MH
    2023{
     
    2831
    2932  Int_t    fBinsAfterStripping;        // Bins for the Gauss Histogram after stripping off the zeros at both ends
    30   Int_t    fCurrentSize;               // Current size of the array fEvents
     33  UInt_t   fCurrentSize;               // Current size of the array fEvents
    3134  Byte_t   fFlags;                     // Bit field for the fit result bits
    3235  Int_t    fPowerProbabilityBins;      // Bins for the projected power spectrum
    3336 
    3437  TH1I    *fHPowerProbability;         // Fourier transform of fEvents projected on y-axis
    35   TArrayF *fPowerSpectrum;             // Fourier transform of fEvents
     38  MArrayF *fPowerSpectrum;             // Fourier transform of fEvents
    3639
    3740  enum  { kGausFitOK,
     
    4043          kExcluded };                 // Bits for information about fit results
    4144 
    42   TArrayF  fEvents;                    // Array which holds the entries of GausHist
     45  MArrayF  fEvents;                    // Array which holds the entries of GausHist
    4346  TF1     *fFGausFit;                  // Gauss fit for fHGausHist
    4447  TF1     *fFExpFit;                   // Exponential fit for FHPowerProbability
     
    8891  const Int_t    GetExpNdf()             const;
    8992  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;            }
    9295        TF1     *GetFExpFit()                  { return fFExpFit;            }
    9396  const TF1     *GetFExpFit()            const { return fFExpFit;            }
     
    107110  const Double_t GetMeanErr()            const { return fMeanErr;            }
    108111  const Int_t    GetNdf()                const;
     112  const Int_t    GetNbins()               const { return fNbins;            }
    109113  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;      }
    112116  const Double_t GetProb()               const { return fProb;               }
    113117  const Double_t GetSigma()              const { return fSigma;              }
Note: See TracChangeset for help on using the changeset viewer.