Ignore:
Timestamp:
09/07/04 10:04:04 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc

    r4793 r4873  
    4141// dealing with calibration pixels derive from MHGausEvents.
    4242//
     43// The following flag can be set:
     44// - SetDebug() for debug output.
     45// - SetLoGain() for the case that low-gain slices are available, but
     46//               MRawRunHeader::GetNumLoGainSlices() gives still 0.
     47//
     48// The flag fLoGain steers if low-gain signal is treated at all or not.
     49//
    4350/////////////////////////////////////////////////////////////////////////////
    4451#include "MHCalibrationCam.h"
     
    9198MHCalibrationCam::MHCalibrationCam(const char *name, const char *title)
    9299    :  fColor(MCalibrationCam::kNONE),
    93        fBadPixels(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL), fDebug(kFALSE)
     100       fBadPixels(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL),
     101       fDebug(kFALSE), fLoGain(kFALSE)
    94102{
    95103
     
    483491
    484492  if (fRunHeader)
    485     fRunNumbers[fRunNumbers.GetSize()-1] = fRunHeader->GetRunNumber();
     493    {
     494      fRunNumbers[fRunNumbers.GetSize()-1] = fRunHeader->GetRunNumber();
     495      fLoGain = fRunHeader->GetNumSamplesLoGain();
     496    }
    486497
    487498  if (!ReInitHists(pList))
     
    497508    }
    498509
    499   for (Int_t i=0; i<fLoGainArray->GetEntries(); i++)
    500     {
    501       TH1F *h = (*this)(i).GetHGausHist();
    502       h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
    503     }
     510  if (fLoGain)
     511    for (Int_t i=0; i<fLoGainArray->GetEntries(); i++)
     512      {
     513        TH1F *h = (*this)(i).GetHGausHist();
     514        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     515      }
    504516 
    505517  for (Int_t j=0; j<nareas; j++)
     
    509521    }
    510522 
    511   for (Int_t j=0; j<nareas; j++)
    512     {
    513       TH1F *h = GetAverageLoGainArea(j).GetHGausHist();
    514       h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
    515     }
     523  if (fLoGain)
     524    for (Int_t j=0; j<nareas; j++)
     525      {
     526        TH1F *h = GetAverageLoGainArea(j).GetHGausHist();
     527        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     528      }
    516529 
    517530  for (Int_t j=0; j<nsectors; j++)
     
    521534    }
    522535 
    523   for (Int_t j=0; j<nsectors; j++)
    524     {
    525       TH1F *h = GetAverageLoGainSector(j).GetHGausHist();
    526       h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
    527     }
    528 
     536  if (fLoGain)
     537    for (Int_t j=0; j<nsectors; j++)
     538      {
     539        TH1F *h = GetAverageLoGainSector(j).GetHGausHist();
     540        h->SetTitle( Form("%s%i%s", h->GetTitle(),fRunNumbers[fRunNumbers.GetSize()-1]," "));
     541      }
     542 
    529543  return kTRUE;
    530544}
     
    564578    }
    565579 
    566   if (fLoGainArray->GetEntries() != npixels)
    567     {
    568       *fLog << err << "ERROR - Size mismatch... abort." << endl;
    569       return kFALSE;
    570     }
     580  if (fLoGain)
     581    if (fLoGainArray->GetEntries() != npixels)
     582      {
     583        *fLog << err << "ERROR - Size mismatch... abort." << endl;
     584        return kFALSE;
     585      }
    571586 
    572587  if (fAverageHiGainAreas->GetEntries() != nareas)
     
    576591    }
    577592
    578   if (fAverageLoGainAreas->GetEntries() != nareas)
    579     {
    580       *fLog << err << "ERROR - Size mismatch in number of areas ... abort." << endl;
    581       return kFALSE;
    582     }
    583 
     593  if (fLoGain)
     594    if (fAverageLoGainAreas->GetEntries() != nareas)
     595      {
     596        *fLog << err << "ERROR - Size mismatch in number of areas ... abort." << endl;
     597        return kFALSE;
     598    }
     599 
    584600  if (fAverageHiGainSectors->GetEntries() != nsectors)
    585601    {
     
    588604    }
    589605
    590   if (fAverageLoGainSectors->GetEntries() != nsectors)
    591     {
    592       *fLog << err << "ERROR - Size mismatch in number of sectors ... abort." << endl;
    593       return kFALSE;
    594     }
    595 
     606  if (fLoGain)
     607    if (fAverageLoGainSectors->GetEntries() != nsectors)
     608      {
     609        *fLog << err << "ERROR - Size mismatch in number of sectors ... abort." << endl;
     610        return kFALSE;
     611      }
     612 
    596613  return FillHists(par, w);
    597614}
     
    802819
    803820
    804   if (hist.IsEmpty())
     821  if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow())
    805822    return;
    806 
     823 
    807824  //
    808825  // 2) Fit the Hi Gain histograms with a Gaussian
     
    881898{
    882899
    883   if (hist.IsEmpty())
     900  if (hist.IsEmpty() || hist.IsOnlyOverflow() || hist.IsOnlyUnderflow())
    884901      return;
    885902 
     
    970987  pad->SetBorderMode(0);
    971988
    972   pad->Divide(2,nareas);
     989  pad->Divide(fLoGain ? 2 : 1,nareas);
    973990
    974991  for (Int_t i=0; i<nareas;i++)
    975992    {
    976993
    977       pad->cd(2*(i+1)-1);
     994      pad->cd(fLoGain ? 2*(i+1)-1 : i+1);
    978995      GetAverageHiGainArea(i).Draw(opt);
    979996
     
    9831000                         fAverageAreaRelSigma[i], fAverageAreaRelSigmaVar[i]);
    9841001
    985       pad->cd(2*(i+1));
    986       GetAverageLoGainArea(i).Draw(opt);
     1002      if (fLoGain)
     1003        {
     1004          pad->cd(2*(i+1));
     1005          GetAverageLoGainArea(i).Draw(opt);
     1006        }
    9871007     
    9881008      if (fAverageAreaSat[i])
     
    9911011                         fAverageAreaRelSigma[i], fAverageAreaRelSigmaVar[i]);
    9921012    }
    993 
     1013     
    9941014}
    9951015
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h

    r4793 r4873  
    8080  Int_t      fPulserFrequency;           // Light pulser frequency
    8181  Bool_t     fDebug;                     // Debug option is used?
     82  Bool_t     fLoGain;                    // Is Low-Gain available
    8283 
    8384  virtual Bool_t SetupHists(const MParList *pList);
     
    161162  void SetColor               ( const MCalibrationCam::PulserColor_t color ) { fColor   = color; }
    162163  void SetDebug               ( const Bool_t b=kTRUE )               { fDebug           = b;     }
     164  void SetLoGain              ( const Bool_t b=kTRUE )               { fLoGain          = b;     }
    163165  void SetAverageNbins        ( const Int_t bins=fgAverageNbins )    { fAverageNbins    = bins;  }
    164166  void SetNumLoGainSaturationLimit( const Float_t lim )    { fNumLoGainSaturationLimit  = lim;   }
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r4872 r4873  
    809809
    810810
     811// --------------------------------------------------------------------------
     812//
     813// If fFExpFit exists, returns fit parameter 1 (Slope of Exponential fit),
     814// otherwise 0.
     815//
    811816const Double_t MHGausEvents::GetSlope()  const
    812817{
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.h

    r4872 r4873  
    125125  const Bool_t IsGausFitOK()             const;
    126126  const Bool_t IsOnlyOverflow()          const;
    127   const Bool_t IsUnderOverflow()         const; 
     127  const Bool_t IsOnlyUnderflow()         const; 
    128128
    129129  // Fill
Note: See TracChangeset for help on using the changeset viewer.