Changeset 4901 for trunk/MagicSoft


Ignore:
Timestamp:
09/09/04 17:28:11 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4900 r4901  
    5353       occurrance of multiple intensities and the new *Intensity*
    5454       containers
     55
     56   * mcalib/MHCalibrationChargePix.[h,cc]
     57   * mcalib/MHCalibrationRelTimePix.[h,cc]
     58   * mcalib/MHCalibrationTestPix.[h,cc]
     59   * mcalib/MHCalibrationTestTimePix.[h,cc]
     60     - derive from MHCalibrationPix
     61     - new functions Reset()
    5562
    5663   * msignal/MExtractor.cc
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc

    r4882 r4901  
    3939// GetAverageLoGainArea(), GetAverageHiGainSector() and GetAverageLoGainSector()
    4040// have to be cast to the corresponding class. It is assumed that all classes
    41 // dealing with calibration pixels derive from MHGausEvents.
     41// dealing with calibration pixels derive from MHCalibrationPix.
    4242//
    4343// The following flag can be set:
     
    6363#include "MCalibrationCam.h"
    6464
    65 #include "MHGausEvents.h"
     65#include "MHCalibrationPix.h"
    6666
    6767#include "MBadPixelsPix.h"
     
    9999MHCalibrationCam::MHCalibrationCam(const char *name, const char *title)
    100100    :  fColor(MCalibrationCam::kNONE),
    101        fBadPixels(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL),
     101       fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL),
    102102       fDebug(kFALSE), fLoGain(kFALSE)
    103103{
     
    151151}
    152152
     153void MHCalibrationCam::ResetHists()
     154{
     155 
     156  if (fHiGainArray)
     157    { fHiGainArray->ForEach(MHCalibrationPix,Reset)();  }
     158  if (fLoGainArray)
     159    { fLoGainArray->ForEach(MHCalibrationPix,Reset)();  }
     160 
     161  if (fAverageHiGainAreas)
     162    { fAverageHiGainAreas->ForEach(MHCalibrationPix,Reset)();  }
     163  if (fAverageLoGainAreas)
     164    { fAverageLoGainAreas->ForEach(MHCalibrationPix,Reset)();  }
     165  if (fAverageHiGainSectors)
     166    { fAverageHiGainSectors->ForEach(MHCalibrationPix,Reset)();  }
     167  if (fAverageLoGainSectors)
     168    { fAverageLoGainSectors->ForEach(MHCalibrationPix,Reset)();  }
     169 
     170}
     171
     172
     173
    153174// --------------------------------------------------------------------------
    154175//
    155176// Get i-th High Gain pixel (pixel number)
    156177//
    157 MHGausEvents &MHCalibrationCam::operator[](UInt_t i)
    158 {
    159   return *static_cast<MHGausEvents*>(fHiGainArray->UncheckedAt(i));
     178MHCalibrationPix &MHCalibrationCam::operator[](UInt_t i)
     179{
     180  return *static_cast<MHCalibrationPix*>(fHiGainArray->UncheckedAt(i));
    160181}
    161182
     
    164185// Get i-th High Gain pixel (pixel number)
    165186//
    166 const MHGausEvents &MHCalibrationCam::operator[](UInt_t i) const
    167 {
    168   return *static_cast<MHGausEvents*>(fHiGainArray->UncheckedAt(i));
     187const MHCalibrationPix &MHCalibrationCam::operator[](UInt_t i) const
     188{
     189  return *static_cast<MHCalibrationPix*>(fHiGainArray->UncheckedAt(i));
    169190}
    170191
     
    173194// Get i-th Low Gain pixel (pixel number)
    174195//
    175 MHGausEvents  &MHCalibrationCam::operator()(UInt_t i)
    176 {
    177   return *static_cast<MHGausEvents*>(fLoGainArray->UncheckedAt(i));
     196MHCalibrationPix  &MHCalibrationCam::operator()(UInt_t i)
     197{
     198  return *static_cast<MHCalibrationPix*>(fLoGainArray->UncheckedAt(i));
    178199}
    179200
     
    182203// Get i-th Low Gain pixel (pixel number)
    183204//
    184 const MHGausEvents  &MHCalibrationCam::operator()(UInt_t i) const
    185 {
    186   return *static_cast<MHGausEvents*>(fLoGainArray->UncheckedAt(i));
     205const MHCalibrationPix  &MHCalibrationCam::operator()(UInt_t i) const
     206{
     207  return *static_cast<MHCalibrationPix*>(fLoGainArray->UncheckedAt(i));
    187208}
    188209
     
    190211//
    191212// Returns the current size of the TObjArray fAverageHiGainAreas
    192 // independently if the MHGausEvents is filled with values or not.
     213// independently if the MHCalibrationPix is filled with values or not.
    193214//
    194215const Int_t MHCalibrationCam::GetAverageAreas() const
     
    201222// Get i-th High Gain pixel Area (area number)
    202223//
    203 MHGausEvents  &MHCalibrationCam::GetAverageHiGainArea(UInt_t i)
    204 {
    205   return *static_cast<MHGausEvents*>(fAverageHiGainAreas->UncheckedAt(i));
     224MHCalibrationPix  &MHCalibrationCam::GetAverageHiGainArea(UInt_t i)
     225{
     226  return *static_cast<MHCalibrationPix*>(fAverageHiGainAreas->UncheckedAt(i));
    206227}
    207228
     
    210231// Get i-th High Gain pixel Area (area number)
    211232//
    212 const MHGausEvents  &MHCalibrationCam::GetAverageHiGainArea(UInt_t i) const
    213 {
    214   return *static_cast<MHGausEvents *>(fAverageHiGainAreas->UncheckedAt(i));
     233const MHCalibrationPix  &MHCalibrationCam::GetAverageHiGainArea(UInt_t i) const
     234{
     235  return *static_cast<MHCalibrationPix *>(fAverageHiGainAreas->UncheckedAt(i));
    215236}
    216237
     
    219240// Get i-th Low Gain pixel Area (area number)
    220241//
    221 MHGausEvents  &MHCalibrationCam::GetAverageLoGainArea(UInt_t i)
    222 {
    223   return *static_cast<MHGausEvents*>(fAverageLoGainAreas->UncheckedAt(i));
     242MHCalibrationPix  &MHCalibrationCam::GetAverageLoGainArea(UInt_t i)
     243{
     244  return *static_cast<MHCalibrationPix*>(fAverageLoGainAreas->UncheckedAt(i));
    224245}
    225246
     
    228249// Get i-th Low Gain pixel Area (area number)
    229250//
    230 const MHGausEvents  &MHCalibrationCam::GetAverageLoGainArea(UInt_t i) const
    231 {
    232   return *static_cast<MHGausEvents*>(fAverageLoGainAreas->UncheckedAt(i));
     251const MHCalibrationPix  &MHCalibrationCam::GetAverageLoGainArea(UInt_t i) const
     252{
     253  return *static_cast<MHCalibrationPix*>(fAverageLoGainAreas->UncheckedAt(i));
    233254}
    234255
     
    236257//
    237258// Returns the current size of the TObjArray fAverageHiGainSectors
    238 // independently if the MHGausEvents is filled with values or not.
     259// independently if the MHCalibrationPix is filled with values or not.
    239260//
    240261const Int_t MHCalibrationCam::GetAverageSectors() const
     
    247268// Get i-th High Gain Sector (sector number)
    248269//
    249 MHGausEvents  &MHCalibrationCam::GetAverageHiGainSector(UInt_t i)
    250 {
    251   return *static_cast<MHGausEvents*>(fAverageHiGainSectors->UncheckedAt(i));
     270MHCalibrationPix  &MHCalibrationCam::GetAverageHiGainSector(UInt_t i)
     271{
     272  return *static_cast<MHCalibrationPix*>(fAverageHiGainSectors->UncheckedAt(i));
    252273}
    253274
     
    256277// Get i-th High Gain Sector (sector number)
    257278//
    258 const MHGausEvents  &MHCalibrationCam::GetAverageHiGainSector(UInt_t i) const
    259 {
    260   return *static_cast<MHGausEvents*>(fAverageHiGainSectors->UncheckedAt(i));
     279const MHCalibrationPix  &MHCalibrationCam::GetAverageHiGainSector(UInt_t i) const
     280{
     281  return *static_cast<MHCalibrationPix*>(fAverageHiGainSectors->UncheckedAt(i));
    261282}
    262283
     
    265286// Get i-th Low Gain Sector (sector number)
    266287//
    267 MHGausEvents  &MHCalibrationCam::GetAverageLoGainSector(UInt_t i)
    268 {
    269   return *static_cast<MHGausEvents*>(fAverageLoGainSectors->UncheckedAt(i));
     288MHCalibrationPix  &MHCalibrationCam::GetAverageLoGainSector(UInt_t i)
     289{
     290  return *static_cast<MHCalibrationPix*>(fAverageLoGainSectors->UncheckedAt(i));
    270291}
    271292
     
    274295// Get i-th Low Gain Sector (sector number)
    275296//
    276 const MHGausEvents  &MHCalibrationCam::GetAverageLoGainSector(UInt_t i) const
    277 {
    278   return *static_cast<MHGausEvents*>(fAverageLoGainSectors->UncheckedAt(i));
     297const MHCalibrationPix  &MHCalibrationCam::GetAverageLoGainSector(UInt_t i) const
     298{
     299  return *static_cast<MHCalibrationPix*>(fAverageLoGainSectors->UncheckedAt(i));
    279300}
    280301
     
    666687//
    667688// If MBadPixelsPix::IsBad():
    668 // - calls MHGausEvents::SetExcluded()
     689// - calls MHCalibrationPix::SetExcluded()
    669690//
    670691// Calls:
    671692// - MHGausEvents::InitBins()
    672 // - MHGausEvents::ChangeHistId(i)
    673 // - MHGausEvents::SetEventFrequency(fPulserFrequency)
     693// - MHCalibrationPix::ChangeHistId(i)
     694// - MHCalibrationPix::SetEventFrequency(fPulserFrequency)
    674695//
    675 void MHCalibrationCam::InitHists(MHGausEvents &hist, MBadPixelsPix &bad, const Int_t i)
     696void MHCalibrationCam::InitHists(MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i)
    676697{
    677698
     
    695716    {
    696717     
    697       MHGausEvents &hist = (*this)[i];
     718      MHCalibrationPix &hist = (*this)[i];
    698719     
    699720      if (hist.IsExcluded())
     
    710731    {
    711732     
    712       MHGausEvents     &hist = GetAverageHiGainArea(j);     
     733      MHCalibrationPix     &hist = GetAverageHiGainArea(j);     
    713734      MCalibrationPix  &pix  = calcam.GetAverageArea(j);
    714735      MBadPixelsPix    &bad  = calcam.GetAverageBadArea(j);       
     
    721742    {
    722743     
    723       MHGausEvents     &hist = GetAverageHiGainSector(j);     
     744      MHCalibrationPix     &hist = GetAverageHiGainSector(j);     
    724745      MCalibrationPix  &pix  = calcam.GetAverageSector(j);
    725746      MBadPixelsPix    &bad  = calcam.GetAverageBadSector(j);       
     
    738759    {
    739760     
    740       MHGausEvents &hist = (*this)(i);
     761      MHCalibrationPix &hist = (*this)(i);
    741762     
    742763      if (hist.IsExcluded())
     
    753774    {
    754775     
    755       MHGausEvents     &hist = GetAverageLoGainArea(j);     
     776      MHCalibrationPix     &hist = GetAverageLoGainArea(j);     
    756777      MCalibrationPix  &pix  = calcam.GetAverageArea(j);
    757778      MBadPixelsPix    &bad  = calcam.GetAverageBadArea(j);       
     
    764785    {
    765786     
    766       MHGausEvents     &hist = GetAverageLoGainSector(j);     
     787      MHCalibrationPix     &hist = GetAverageLoGainSector(j);     
    767788      MCalibrationPix  &pix  = calcam.GetAverageSector(j);
    768789      MBadPixelsPix    &bad  = calcam.GetAverageBadSector(j);       
     
    779800void MHCalibrationCam::CalcAverageSigma()
    780801{
     802
     803  if (!fCam)
     804    return;
    781805 
    782806  for (UInt_t j=0; j<fGeom->GetNumAreas(); j++)
     
    805829//
    806830// Fits the histograms with a Gaussian, in case of failure
    807 // calls MHGausEvents::RepeatFit(), in case of repeated failure
    808 // calls MHGausEvents::BypassFit() and sets the following flags:
     831// calls MHCalibrationPix::RepeatFit(), in case of repeated failure
     832// calls MHCalibrationPix::BypassFit() and sets the following flags:
    809833// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::UncalibratedType_t fittyp )
    810834// - MBadPixelsPix::SetUnsuitable(   MBadPixelsPix::kUnreliableRun   )
     
    817841// Retrieves the results and store them in MCalibrationPix
    818842//
    819 void MHCalibrationCam::FitHiGainHists(MHGausEvents &hist,
     843void MHCalibrationCam::FitHiGainHists(MHCalibrationPix &hist,
    820844                                      MCalibrationPix &pix,
    821845                                      MBadPixelsPix &bad,
     
    885909//
    886910// Fits the histograms with a Gaussian, in case of failure
    887 // calls MHGausEvents::RepeatFit(), in case of repeated failure
    888 // calls MHGausEvents::BypassFit() and sets the following flags:
     911// calls MHCalibrationPix::RepeatFit(), in case of repeated failure
     912// calls MHCalibrationPix::BypassFit() and sets the following flags:
    889913// - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::UncalibratedType_t fittyp )
    890914// - MBadPixelsPix::SetUnsuitable(   MBadPixelsPix::kUnreliableRun   )
     
    897921// Retrieves the results and store them in MCalibrationPix
    898922//
    899 void MHCalibrationCam::FitLoGainHists(MHGausEvents &hist,
     923void MHCalibrationCam::FitLoGainHists(MHCalibrationPix &hist,
    900924                                      MCalibrationPix &pix,
    901925                                      MBadPixelsPix &bad,
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.h

    r4882 r4901  
    2828class TObjArray;
    2929
    30 class MHGausEvents;
     30class MHCalibrationPix;
    3131class MGeomCam;
    3232class MRawRunHeader;
     33class MCalibrationIntensityCam;
    3334class MCalibrationCam;
    3435class MCalibrationPix;
     
    6263  TArrayI    fAverageSectorNum;          // Number of pixels in average pixels per sector
    6364  TArrayI    fRunNumbers;                // Numbers of runs used
    64   TArrayI    fHiGainOverFlow;            // Number of times overflow occurred in whole run
    65   TArrayI    fLoGainOverFlow;            // Number of times overflow occurred in whole run
    6665
    6766  MCalibrationCam::PulserColor_t fColor; // Colour of the pulsed LEDs
    6867 
    6968  MBadPixelsCam    *fBadPixels;          //! Bad Pixels storage container
     69  MCalibrationIntensityCam *fIntensCam;  //! Intensity Calibration Cam with the results
    7070  MCalibrationCam  *fCam;                //! Calibration Cam with the results
    7171  MGeomCam         *fGeom;               //! Camera geometry
     
    9595                       MBadPixelsPix::UncalibratedType_t osctyp);
    9696 
    97   void FitHiGainHists(MHGausEvents &hist,
     97  void FitHiGainHists(MHCalibrationPix &hist,
    9898                      MCalibrationPix &pix,
    9999                      MBadPixelsPix &bad,
     
    105105                       MBadPixelsPix::UncalibratedType_t osctyp);
    106106 
    107   void FitLoGainHists(MHGausEvents &hist,
     107  void FitLoGainHists(MHCalibrationPix &hist,
    108108                      MCalibrationPix &pix,
    109109                      MBadPixelsPix &bad,
     
    111111                      MBadPixelsPix::UncalibratedType_t osctyp);
    112112
    113   void InitHists(MHGausEvents &hist, MBadPixelsPix &bad, const Int_t i);
     113  void InitHists(MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i);
    114114
    115115  Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     
    125125  virtual Bool_t Finalize ( );
    126126
     127  virtual void ResetHists();
     128 
    127129  // Clone
    128130  virtual TObject *Clone(const char *name="") const;
     
    135137
    136138  const Int_t          GetAverageAreas       ()          const; 
    137         MHGausEvents  &GetAverageHiGainArea  (UInt_t i);
    138   const MHGausEvents  &GetAverageHiGainArea  (UInt_t i)  const;
    139         MHGausEvents  &GetAverageLoGainArea  (UInt_t i);
    140   const MHGausEvents  &GetAverageLoGainArea  (UInt_t i)  const;
    141         MHGausEvents  &GetAverageHiGainSector(UInt_t i);
    142   const MHGausEvents  &GetAverageHiGainSector(UInt_t i)  const;
    143         MHGausEvents  &GetAverageLoGainSector(UInt_t i);
    144   const MHGausEvents  &GetAverageLoGainSector(UInt_t i)  const;
     139        MHCalibrationPix  &GetAverageHiGainArea  (UInt_t i);
     140  const MHCalibrationPix  &GetAverageHiGainArea  (UInt_t i)  const;
     141        MHCalibrationPix  &GetAverageLoGainArea  (UInt_t i);
     142  const MHCalibrationPix  &GetAverageLoGainArea  (UInt_t i)  const;
     143        MHCalibrationPix  &GetAverageHiGainSector(UInt_t i);
     144  const MHCalibrationPix  &GetAverageHiGainSector(UInt_t i)  const;
     145        MHCalibrationPix  &GetAverageLoGainSector(UInt_t i);
     146  const MHCalibrationPix  &GetAverageLoGainSector(UInt_t i)  const;
    145147  const Int_t          GetAverageSectors     ()          const;
    146148  const MCalibrationCam::PulserColor_t GetColor   ()     const  { return fColor;                    }
     
    152154  const Bool_t         IsDebug               ()          const  { return fDebug; }
    153155 
    154         MHGausEvents  &operator[]            (UInt_t i);
    155   const MHGausEvents  &operator[]            (UInt_t i)  const;
    156         MHGausEvents  &operator()            (UInt_t i);
    157   const MHGausEvents  &operator()            (UInt_t i)  const;
     156        MHCalibrationPix  &operator[]            (UInt_t i);
     157  const MHCalibrationPix  &operator[]            (UInt_t i)  const;
     158        MHCalibrationPix  &operator()            (UInt_t i);
     159  const MHCalibrationPix  &operator()            (UInt_t i)  const;
    158160 
    159161  void SetColor               ( const MCalibrationCam::PulserColor_t color ) { fColor   = color; }
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.cc

    r4884 r4901  
    136136void MHCalibrationChargePix::Reset()
    137137{
    138 }
    139 
    140 // --------------------------------------------------------------------------
    141 //
    142 // Calls MHGausEvents::ChangeHistId()
     138  MHGausEvents::Reset();
     139  fHAbsTime.Reset();
     140}
     141
     142// --------------------------------------------------------------------------
     143//
     144// Calls MHCalibrationPix::ChangeHistId()
    143145//
    144146// Add id to names and titles of:
     
    148150{
    149151
    150   MHGausEvents::ChangeHistId(id);
     152  MHCalibrationPix::ChangeHistId(id);
    151153
    152154  fHAbsTime.SetName (Form("%s%d", fHAbsTime.GetName(),  id));
     
    199201//
    200202// "": displays the fHGausHist and the fHAbsTime
    201 // "all": executes additionally MHGausEvents::Draw(), with options
     203// "all": executes additionally MHCalibrationPix::Draw(), with options
    202204//
    203205// The following picture shows a typical outcome of call to Draw("all"):
     
    248250  else if (option.Contains("datacheck"))
    249251    {
    250       MHGausEvents::Draw("events");
     252      MHCalibrationPix::Draw("events");
    251253      return;
    252254    }
     
    303305
    304306  oldpad->cd(2);
    305   MHGausEvents::Draw("fourierevents");
    306 
    307 }
     307  MHCalibrationPix::Draw("fourierevents");
     308
     309}
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h

    r4882 r4901  
    22#define MARS_MHCalibrationChargePix
    33
    4 #ifndef MARS_MHGausEvents
    5 #include "MHGausEvents.h"
     4#ifndef MARS_MHCalibrationPix
     5#include "MHCalibrationPix.h"
    66#endif
    77
    8 class MHCalibrationChargePix : public MHGausEvents
     8class MHCalibrationChargePix : public MHCalibrationPix
    99{
    1010
     
    3131  ~MHCalibrationChargePix() {}
    3232
    33   virtual void Reset(); 
    34   virtual void InitBins();
     33  void Reset(); 
     34  void InitBins();
    3535 
    3636  // Setters
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.cc

    r3923 r4901  
    7979}
    8080
    81 
    82 // --------------------------------------------------------------------------
    83 //
    84 // Empty function to overload MHGausEvents::Reset()
    85 //
    86 void MHCalibrationRelTimePix::Reset()
    87 {
    88 }
    89 
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.h

    r3908 r4901  
    22#define MARS_MHCalibrationRelTimePix
    33
    4 #ifndef MARS_MHGausEvents
    5 #include "MHGausEvents.h"
     4#ifndef MARS_MHCalibrationPix
     5#include "MHCalibrationPix.h"
    66#endif
    77
    8 class MHCalibrationRelTimePix : public MHGausEvents
     8class MHCalibrationRelTimePix : public MHCalibrationPix
    99{
    1010
     
    2929  void SetFADCSliceWidth( const Float_t f=fgFADCSliceWidth )  {  fFADCSliceWidth = f; }
    3030 
    31   void Reset();
    32  
    3331  ClassDef(MHCalibrationRelTimePix, 1)     // Histogram class for Relative Time Pixel Calibration
    3432};
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationTestPix.h

    r4882 r4901  
    2020  ~MHCalibrationTestPix() {}
    2121
    22   virtual void Reset(); 
    23  
    2422  const Float_t  GetIntegral()          const;
    2523 
Note: See TracChangeset for help on using the changeset viewer.