Changeset 3625


Ignore:
Timestamp:
04/01/04 17:02:35 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3624 r3625  
    2727   * manalysis/MGeomApply.cc
    2828     - add average pixels per sector
     29
     30   * mcalib/MHGausEvents.[h,cc]
     31   * mcalib/MHCalibrationChargePix.[h,cc]
     32   * mcalib/MHCalibrationRelTimePix.[h,cc]
     33     - moved BypassFit() function to MHGausEvents
     34
    2935
    3036 2004/03/31: Markus Gaug
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc

    r3624 r3625  
    848848      *fLog << warn << "Saturated Hi Gain histogram in pixel: " << pix.GetPixId() << endl;
    849849      pix.SetHiGainSaturation();
    850       //      return;
     850      hist.CreateFourierSpectrum();
     851      return;
    851852    }
    852853   
     
    917918      bad.SetUncalibrated( MBadPixelsPix::kLoGainSaturation );
    918919      bad.SetUnsuitable(   MBadPixelsPix::kUnsuitableRun    );
    919       //      return;
     920      hist.CreateFourierSpectrum();
     921      return;
    920922    }
    921923
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.cc

    r3622 r3625  
    140140// - all flags to kFALSE
    141141//
    142 // - executes MHGausEvents::Clear()
     142// Executes:
     143// - MHGausEvents::Clear()
    143144//
    144145void MHCalibrationChargePix::Clear(Option_t *o)
     
    165166// --------------------------------------------------------------------------
    166167//
    167 // - Set fPixId to id
    168 // - Add id to name and title of this
    169 // - Add id to names of fHGausHist and fHAbsTime
    170 // - Add id to the titles of fHGausHist and fHAbsTime
     168// Set fPixId to id
     169//
     170// Add id to names and titles of:
     171// - this
     172// - fHGausHist
     173// - fHAbsTime
    171174//
    172175void MHCalibrationChargePix::ChangeHistId(Int_t id)
     
    185188}
    186189
    187 
     190// --------------------------------------------------------------------------
     191//
     192// Set Excluded bit from outside
     193//
    188194void MHCalibrationChargePix::SetExcluded(const Bool_t b)
    189195{
    190196    b ? SETBIT(fFlags,kExcluded) : CLRBIT(fFlags,kExcluded);
     197}
     198
     199const Bool_t MHCalibrationChargePix::IsExcluded()      const
     200{
     201  return TESTBIT(fFlags,kExcluded);
    191202}
    192203
     
    200211}
    201212
     213// --------------------------------------------------------------------------
     214//
     215// returns fHAbsTime.GetMean()
     216//
    202217const Float_t MHCalibrationChargePix::GetAbsTimeMean() const
    203218{
     
    205220}
    206221
     222// --------------------------------------------------------------------------
     223//
     224// returns fHAbsTime.GetRMS()
     225//
    207226const Float_t MHCalibrationChargePix::GetAbsTimeRms()  const
    208227{
    209228  return fHAbsTime.GetRMS();
    210 }
    211 
    212 const Bool_t MHCalibrationChargePix::IsExcluded()      const
    213 {
    214   return TESTBIT(fFlags,kExcluded);
    215229}
    216230
     
    351365
    352366
    353 // -----------------------------------------------------------------------------
    354 //
    355 // Bypasses the Gauss fit by taking mean and RMS from the histogram
    356 //
    357 // Errors are determined in the following way:
    358 // MeanErr  = RMS / Sqrt(entries)
    359 // SigmaErr = RMS / (2.*Sqrt(entries) )
    360 //
    361 void MHCalibrationChargePix::BypassFit()
    362 {
    363 
    364   //
    365   // In case, we do not obtain reasonable values
    366   // with the fit, we take the histogram values
    367   //
    368   SetMean     ( fHGausHist.GetMean() );
    369   SetMeanErr  ( fHGausHist.GetRMS() / TMath::Sqrt(fHGausHist.GetEntries()) );
    370   SetSigma    ( fHGausHist.GetRMS() );
    371   SetSigmaErr ( fHGausHist.GetRMS() / TMath::Sqrt(fHGausHist.GetEntries()) / 2. );
    372 }
    373367
    374368void MHCalibrationChargePix::CountPickup()
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h

    r3617 r3625  
    8484
    8585  // Fits
    86   void   BypassFit();
    8786  Bool_t RepeatFit(const Option_t *option="RQ0");
    8887 
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.cc

    r3620 r3625  
    168168          MHCalibrationRelTimePix &hist = (*this)[i];
    169169          hist.ChangeHistId(i);
    170           hist.InitBins();
     170          hist.Init();
    171171          hist.SetEventFrequency(fPulserFrequency);
    172172        }
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimeCam.h

    r3620 r3625  
    5050  void DrawPixelContent(Int_t idx) const;
    5151 
    52   ClassDef(MHCalibrationRelTimeCam, 1)  // Storage Container for all pedestal information of the camera
     52  ClassDef(MHCalibrationRelTimeCam, 1)  // Histogram class for camera relative time calibration
    5353};
    5454
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.cc

    r3620 r3625  
    4747// Default Constructor.
    4848//
     49// Sets:
     50// - the default number for fChargeNbins  (fgChargeNbins)
     51// - the default number for fChargeFirst  (fgChargeFirst)
     52// - the default number for fChargeLast   (fgChargeLast)
     53//
     54// - the default name of the  fHGausHist ("HCalibrationRelTime")
     55// - the default title of the fHGausHist ("Distribution of Relative Arrival Times Pixel ")
     56// - the default x-axis title for fHGausHist ("FADC Slice")
     57// - the default y-axis title for fHGausHist ("Nr. of events")
     58//
     59// Initializes:
     60// - fPixId to -1
     61//
     62// Executes:
     63// - MHGausEvents::Clear()
     64//
    4965MHCalibrationRelTimePix::MHCalibrationRelTimePix(const char *name, const char *title)
    5066    : fPixId(-1)
     
    5975
    6076  // Create a large number of bins, later we will rebin
    61   fHGausHist.SetName("HCalibrationRelTimeCharge");
     77  fHGausHist.SetName("HCalibrationRelTime");
    6278  fHGausHist.SetTitle("Distribution of Relative Arrival Times Pixel ");
    6379  fHGausHist.SetXTitle("FADC Slice");
    6480  fHGausHist.SetYTitle("Nr. of events");
    65   fHGausHist.Sumw2();
     81
     82  Clear();
    6683
    6784}
    6885
    69 MHCalibrationRelTimePix::~MHCalibrationRelTimePix()
    70 {
    71 }
    72 
     86// --------------------------------------------------------------------------
     87//
     88// Sets:
     89// - fPixId to -1
     90//
     91// Executes:
     92// - MHGausEvents::Clear()
     93//
    7394void MHCalibrationRelTimePix::Clear(Option_t *o)
    7495{
     
    80101
    81102
     103// --------------------------------------------------------------------------
     104//
     105// Empty function to overload MHGausEvents::Reset()
     106//
     107void MHCalibrationRelTimePix::Reset()
     108{
     109}
    82110
    83 void MHCalibrationRelTimePix::InitBins()
     111// --------------------------------------------------------------------------
     112//
     113// Sets:
     114// - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
     115//
     116void MHCalibrationRelTimePix::Init()
    84117{
    85118
     
    88121}
    89122
    90 
     123// --------------------------------------------------------------------------
     124//
     125// - Set fPixId to id
     126//
     127// Add id to names and titles of:
     128// - fHGausHist
     129//
    91130void MHCalibrationRelTimePix::ChangeHistId(Int_t id)
    92131{
     
    100139
    101140
    102 void  MHCalibrationRelTimePix::BypassFit()
    103 {
    104 
    105   //
    106   // In case, we do not obtain reasonable values
    107   // with the fit, we take the histogram values
    108   //
    109   SetMean(      fHGausHist.GetMean()                              );
    110   SetMeanErr(   fHGausHist.GetRMS() / fHGausHist.GetEntries()     );
    111   SetSigma(     fHGausHist.GetRMS()                               );
    112   SetSigmaErr(  fHGausHist.GetRMS() / fHGausHist.GetEntries() /2. );
    113 
    114 }
    115 
    116141// ----------------------------------------------------------------------
    117142//
    118 // Renorm the results from FADC slices to times in ns.
     143// Renorm the results from FADC slices to times.
     144// The parameters slicewidth is the inverse of the FADC frequency and has the unit ns.
    119145//
    120146void MHCalibrationRelTimePix::Renorm(const Float_t slicewidth)
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.h

    r3620 r3625  
    2424
    2525  MHCalibrationRelTimePix(const char *name=NULL, const char *title=NULL);
    26   ~MHCalibrationRelTimePix();
     26  ~MHCalibrationRelTimePix() {}
     27 
    2728
    2829  void Clear(Option_t *o="");
    29   void InitBins();
     30  void Reset();
     31  void Init();
    3032 
    3133  // Setters
     
    3436  void SetChargeLast( const Axis_t last =fgChargeLast)     { fChargeLast  = last; }
    3537
    36   // Fits
    37   void BypassFit();
    38  
    3938  // Others
    4039  void ChangeHistId(Int_t i);
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r3617 r3625  
    544544}
    545545
     546// -----------------------------------------------------------------------------
     547//
     548// Bypasses the Gauss fit by taking mean and RMS from the histogram
     549//
     550// Errors are determined in the following way:
     551// MeanErr  = RMS / Sqrt(entries)
     552// SigmaErr = RMS / (2.*Sqrt(entries) )
     553//
     554void MHGausEvents::BypassFit()
     555{
     556
     557  const Stat_t entries = fHGausHist.GetEntries();
     558 
     559  if (entries <= 0.)
     560    {
     561      *fLog << warn << GetDescriptor() << ": Cannot bypass fit. Number of entries smaller or equal 0" << endl;
     562      return;
     563    }
     564 
     565  SetMean     ( fHGausHist.GetMean() );
     566  SetMeanErr  ( fHGausHist.GetRMS() / TMath::Sqrt(entries) );
     567  SetSigma    ( fHGausHist.GetRMS() );
     568  SetSigmaErr ( fHGausHist.GetRMS() / TMath::Sqrt(entries) / 2. );
     569}
     570
    546571// -----------------------------------------------------------------------------------
    547572//
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.h

    r3611 r3625  
    5858  Int_t    fNDFLimit;                  // NDF limit for judgement if fit is OK
    5959
     60  Float_t *CreateEventXaxis(Int_t n);  //   Create an x-axis for the Event TGraphs
     61  Float_t *CreatePSDXaxis(Int_t n);    //   Create an x-axis for the PSD TGraphs
     62
     63  void DrawEvents();                               // Draw graph of fEvents
     64  void DrawPowerSpectrum(TVirtualPad &pad, Int_t i);  // Draw graph of fPowerSpectrum and fHPowerProbability
     65
    6066  // Setters
    6167  void  SetPowerProbabilityBins ( const Int_t nbins=fgPowerProbabilityBins ) { fPowerProbabilityBins = nbins;  }
    6268  void  SetBinsAfterStripping   ( const Int_t nbins=fgBinsAfterStripping   ) { fBinsAfterStripping   = nbins;  }
    63 
    64   void DrawEvents();                                  // Draw a graph of the array fEvents
    65   void DrawPowerSpectrum(TVirtualPad &pad, Int_t i);     // Draw a graph of the array fPowerSpectrum and the hist fHPowerProbability
    66  
    67   Float_t *CreateEventXaxis(Int_t n);              //   Create an x-axis for the Event TGraphs
    68   Float_t *CreatePSDXaxis(Int_t n);                //   Create an x-axis for the PSD TGraphs
    6969
    7070public:
     
    143143 
    144144  // Fits
    145   Bool_t FitGaus(Option_t *option="RQ0", const Double_t xmin=0., const Double_t xmax=0.);     // Fit the histogram HGausHist with a Gaussian
    146 
     145  Bool_t FitGaus(Option_t *option="RQ0",
     146                 const Double_t xmin=0., const Double_t xmax=0.); // Fit the histogram HGausHist with a Gaussian
     147  void BypassFit();   // Take mean and RMS from the histogram
     148 
     149 
    147150  // Draws
    148   virtual void Draw(Option_t *option="");     // Default Draw
     151  virtual void Draw(Option_t *option="");        // Default Draw
    149152 
    150153  // Prints
Note: See TracChangeset for help on using the changeset viewer.