Changeset 3617


Ignore:
Timestamp:
03/31/04 10:52:35 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3614 r3617  
    2626   * mcalib/MHCalibrationChargeLoGainPix.[h,cc]
    2727   * mcalib/MHCalibrationChargeBlindPix.[h,cc]
     28   * mcalib/MHCalibrationChargePINDiode.[h,cc]
    2829     - updated and enlarged documentation
    2930
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.cc

    r3315 r3617  
    100100  SetConversionChargePhotonsErr();
    101101
    102   SetExcluded(kFALSE);
    103   SetExcludeQualityCheck(kFALSE);
     102  SetOscillating          ( kFALSE );
     103  SetExcluded             ( kFALSE );
     104  SetExcludeQualityCheck  ( kFALSE );
    104105}
    105106
     
    154155  fPedRms = pedrms;
    155156 
     157}
     158
     159// --------------------------------------------------------------------------
     160//
     161// Set the Oscillating Bit from outside
     162//
     163void  MCalibrationChargePINDiode::SetOscillating( const Bool_t b)
     164{
     165    b ? SETBIT(fFlags,kOscillating) : CLRBIT(fFlags,kOscillating);
    156166}
    157167
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargePINDiode.h

    r3315 r3617  
    6969  PulserColor_t fColor; 
    7070
    71   enum  { kExcluded, kExcludeQualityCheck,
     71  enum  { kExcluded, kExcludeQualityCheck, kOscillating,
    7272          kChargeFitValid, kTimeFitValid,
    7373          kMeanTimeInFirstBin, kMeanTimeInLastBin,
     
    106106  void SetPedestal(Float_t ped, Float_t pedrms);
    107107
     108  void SetOscillating     ( const Bool_t b=kTRUE);
    108109  void SetExcluded           ( const Bool_t b = kTRUE );
    109110  void SetExcludeQualityCheck( const Bool_t b = kTRUE );
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.cc

    r3614 r3617  
    179179//
    180180// Sets:
    181 // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
    182 //
    183 void MHCalibrationChargeBlindPix::Init()
    184 {
    185   fHGausHist.SetBins( fChargeNbins, fChargeFirst, fChargeLast);
    186 }
    187 
    188 // --------------------------------------------------------------------------
    189 //
    190 // Sets:
    191181// - all variables to 0., except the fit result variables to -999.
    192182// - all flags to kFALSE
     
    287277// - fAPedestalFADCSlices(0);
    288278//
    289 // Calls Init()
     279// Sets Binning of the following histograms:
     280// - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
    290281//
    291282Bool_t MHCalibrationChargeBlindPix::SetupFill(const MParList *pList)
     
    309300  fAPedestalFADCSlices(0);
    310301 
    311   Init();
     302  fHGausHist.SetBins( fChargeNbins, fChargeFirst, fChargeLast);
    312303 
    313304  return kTRUE;
     
    349340// - blind Pixel ID
    350341//
    351 // Executes MHGausEvents::FillHistAndArray(signal)
     342// Fills the following histograms:
     343// - MHGausEvents::FillHistAndArray(signal)
    352344//
    353345// Creates MRawEvtPixelIter, jumps to blind pixel ID,
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.h

    r3614 r3617  
    9696
    9797  void Clear(Option_t *o=""); 
    98   void Init();
    9998
    10099  Bool_t SetupFill(const MParList *pList);
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.cc

    r3445 r3617  
    3434
    3535#include <TH1.h>
     36#include <TF1.h>
    3637#include <TPad.h>
    3738#include <TVirtualPad.h>
     
    6364// Default Constructor.
    6465//
     66// Sets:
     67// - the default number for fChargeNbins     (fgChargeNbins)
     68// - the default number for fChargeFirst     (fgChargeFirst)
     69// - the default number for fChargeLast      (fgChargeLast)
     70// - the default number for fRmsChargeNbins  (fgRmsChargeNbins)
     71// - the default number for fRmsChargeFirst  (fgRmsChargeFirst)
     72// - the default number for fRmsChargeLast   (fgRmsChargeLast)
     73// - the default number for fAbsTimeNbins    (fgAbsTimeNbins)
     74// - the default number for fAbsTimeFirst    (fgAbsTimeFirst)
     75// - the default number for fAbsTimeLast     (fgAbsTimeLast)
     76//
     77// - the default name of the  fHGausHist      ("HCalibrationChargePINDiode")
     78// - the default title of the fHGausHist      ("Distribution of Summed FADC slices PIN Diode")
     79// - the default x-axis title for fHGausHist  ("Sum FADC Slices")
     80// - the default y-axis title for fHGausHist  ("Nr. of events")
     81// - the default name of the  fHAbsTime       ("HAbsTimePINDiode")
     82// - the default title of the fHAbsTime       ("Distribution of Absolute Arrival Times PIN Diode")
     83// - the default x-axis title for fHAbsTime   ("Absolute Arrival Time [FADC slice nr]")
     84// - the default y-axis title for fHAbsTime   ("Nr. of events")
     85// - the default name of the  fHRmsCharge     ("HRmsChargePINDiode")
     86// - the default title of the fHRmsCharge     ("Distribution of Variances of summed FADC slices PIN Diode")
     87// - the default x-axis title for fHRmsCharge ("RMS (sum) [FADC slices]")
     88// - the default y-axis title for fHRmsCharge ("Nr. of events")
     89// - the default directory of the fHRmsCharge (NULL)
     90//
     91// Initializes:
     92// - fHRmsCharge()
     93// - all pointers to NULL
     94// - all variables to 0.
     95// - all flags to kFALSE
     96//
    6597MHCalibrationChargePINDiode::MHCalibrationChargePINDiode(const char *name, const char *title)
    6698    : fPINDiode(NULL), fHRmsCharge()
     
    82114  SetAbsTimeLast();
    83115
    84   fHRmsCharge.SetName("HRmsCharge");
    85   fHRmsCharge.SetTitle("Distribution of Variances of summed FADC slices"); 
     116  fHGausHist.SetName("HCalibrationChargePINDiode");
     117  fHGausHist.SetTitle("Distribution of Summed FADC slices PIN Diode"); 
     118  fHGausHist.SetXTitle("Sum FADC Slices");
     119  fHGausHist.SetYTitle("Nr. of events");
     120
     121  fHAbsTime.SetName("HAbsTimePINDiode");
     122  fHAbsTime.SetTitle("Distribution of Absolute Arrival Times PIN Diode"); 
     123  fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");
     124  fHAbsTime.SetYTitle("Nr. of events");
     125
     126  fHRmsCharge.SetName("HRmsChargePINDiode");
     127  fHRmsCharge.SetTitle("Distribution of Variances of summed FADC slices PIN Diode"); 
    86128  fHRmsCharge.SetXTitle("RMS (sum) [FADC slices]");
    87129  fHRmsCharge.SetYTitle("Nr. of events");
     
    92134}
    93135
    94 
    95 void MHCalibrationChargePINDiode::Init()
    96 {
    97 
    98   fHGausHist.SetName("HCalibrationChargePINDiode");
    99   fHGausHist.SetTitle("Distribution of Summed FADC slices PIN Diode"); 
    100   fHGausHist.SetXTitle("Sum FADC Slices");
    101   fHGausHist.SetYTitle("Nr. of events");
     136// --------------------------------------------------------------------------
     137//
     138// Initializes Binning of the following histograms:
     139// - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
     140// - fHAbsTime.SetBins(fAbsTimeNbins,fAbsTimeFirst,fAbsTimeLast);
     141// - fHRmsCharge.SetBins(fRmsChargeNbins,fRmsChargeFirst,fRmsChargeLast);
     142//
     143Bool_t MHCalibrationChargePINDiode::SetupFill(const MParList *pList)
     144{
     145
    102146  fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
    103   //  fHGausHist.Sumw2();
    104 
    105   fHAbsTime.SetName("HAbsTimePINDiode");
    106   fHAbsTime.SetTitle("Distribution of Absolute Arrival Times PIN Diode "); 
    107   fHAbsTime.SetXTitle("Absolute Arrival Time [FADC slice nr]");
    108   fHAbsTime.SetYTitle("Nr. of events");
    109147  fHAbsTime.SetBins(fAbsTimeNbins,fAbsTimeFirst,fAbsTimeLast);
    110 
    111148  fHRmsCharge.SetBins(fRmsChargeNbins,fRmsChargeFirst,fRmsChargeLast);
    112 }
    113 
    114 
    115 void MHCalibrationChargePINDiode::Clear(Option_t *o)
    116 {
    117  
    118   fExtractSlices = 0;
    119 
    120   MHCalibrationChargePix::Clear();
    121   return;
    122 }
    123 
    124 Bool_t MHCalibrationChargePINDiode::SetupFill(const MParList *pList)
    125 {
    126   Init();
     149
    127150  return kTRUE;
    128 }
    129 
     151
     152}
     153
     154// --------------------------------------------------------------------------
     155//
     156// Gets or creates the pointers to:
     157// - MCalibrationChargePINDiode
     158//
    130159Bool_t MHCalibrationChargePINDiode::ReInit(MParList *pList)
    131160{
    132 
     161 
    133162  fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");
    134163  if (!fPINDiode)
     
    141170}
    142171
     172// --------------------------------------------------------------------------
     173//
     174// Retrieves from MExtractedSignalPINDiode:
     175// - Number of used FADC samples
     176// - Extracted signal
     177// - Signal Rms
     178// - Arrival Time
     179//
     180// Fills the following histograms:
     181// - MHGausEvents::FillHistAndArray(signal)
     182// - FillAbsTime(time);
     183// - FillRmsCharge(rms);
     184//
    143185Bool_t MHCalibrationChargePINDiode::Fill(const MParContainer *par, const Stat_t w)
    144186{
     
    161203    }
    162204 
    163   if (fExtractSlices != 0. && slices != fExtractSlices )
    164     {
    165       *fLog << err << "Number of used signal slices changed in MExtractedSignalCam  ... abort."
    166            << endl;
    167       return kFALSE;
    168     }
    169  
    170   fExtractSlices = slices;
    171  
    172205  const Float_t signal = (float)extractor->GetExtractedSignal();
    173206  const Float_t time   = extractor->GetExtractedTime();
     
    181214}
    182215
     216// --------------------------------------------------------------------------
     217//
     218// Returns kFALSE, if empty
     219//
     220// Performs the following fits:
     221// - MHGausEvents::FitGaus()
     222// - FitRmsCharge()
     223//
     224// Creates the fourier spectrum and sets bit IsFourierSpectrumOK()
     225// Retrieves the results of the following fits and stores them in MCalibrationChargePINDiode:
     226// - Mean Charge and Error
     227// - Sigma Charge and Error
     228// - Abs Time Mean
     229// - Abs Time Rms
     230// - Rms Charge Mean and Error
     231// - Rms Charge Sigma and Error
     232//
    183233Bool_t MHCalibrationChargePINDiode::Finalize()
    184234{
     
    189239  FitGaus();
    190240  FitRmsCharge();
     241
    191242  CreateFourierSpectrum();
     243  fPINDiode->SetOscillating  ( !IsFourierSpectrumOK() );
    192244
    193245  fPINDiode->SetMeanCharge(     GetMean()     );
     
    207259}
    208260
     261// --------------------------------------------------------------------------
     262//
     263// Fills fHRmsCharge with q
     264// Returns kFALSE, if overflow or underflow occurred, else kTRUE
     265//
    209266Bool_t MHCalibrationChargePINDiode::FillRmsCharge(const Float_t q)
    210267{
     
    222279
    223280
     281// -------------------------------------------------------------------------
     282//
     283// Draw the histogram
     284//
     285// The following options can be chosen:
     286//
     287// "": displays the fHGausHist with fits and fHRmsCharge
     288// "all": executes additionally MHGausEvents::Draw(), with option "fourierevents"
     289//
    224290void MHCalibrationChargePINDiode::Draw(const Option_t *opt)
    225291{
     
    230296  Int_t win = 1;
    231297
    232   TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this,600, 600);
    233 
    234   pad->SetTicks();
    235   pad->SetBorderMode(0);
     298  TVirtualPad *oldpad = gPad ? gPad : MH::MakeDefCanvas(this,900, 600);
     299  TVirtualPad *pad    = NULL;
     300
     301  oldpad->SetBorderMode(0);
    236302   
    237   if (option.Contains("rmscharge"))
    238     win++;
    239 
    240   pad->Divide(1,win);
    241   pad->cd(1);
     303  if (option.Contains("all"))
     304  {
     305      option.ReplaceAll("all","");
     306      oldpad->Divide(2,1);
     307      win = 2;
     308      oldpad->cd(1);
     309      TVirtualPad *newpad = gPad;
     310      pad = newpad;
     311      pad->Divide(1,2);
     312      pad->cd(1);
     313  }
     314  else
     315  {
     316      pad = oldpad;
     317      pad->Divide(1,2);
     318      pad->cd(1);
     319  }
    242320
    243321  if (!IsEmpty())
    244     gPad->SetLogy();
    245 
    246   MHGausEvents::Draw(opt);
    247 
    248   if (win > 1)
    249     {
    250       pad->cd(2);
    251       fHRmsCharge.Draw(opt);
    252     }
    253 }
    254 
    255 
    256 
    257 
     322      gPad->SetLogy();
     323
     324  gPad->SetTicks();
     325
     326  fHGausHist.Draw(opt);
     327  if (fFGausFit)
     328  {
     329      fFGausFit->SetLineColor(IsGausFitOK() ? kGreen : kRed);
     330      fFGausFit->Draw("same");
     331  }
     332
     333  pad->cd(2);
     334  fHRmsCharge.Draw(opt);
     335
     336  oldpad->cd(2);
     337  MHGausEvents::Draw("fourierevents");
     338}
     339
     340
     341
     342
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.h

    r3266 r3617  
    1313private:
    1414
    15   MCalibrationChargePINDiode *fPINDiode;  //! Storage container of the results
     15  static const Int_t   fgChargeNbins;     // Default for fChargeNBins  (now set to: 200   )
     16  static const Axis_t  fgChargeFirst;     // Default for fChargeFirst  (now set to: -0.5  )
     17  static const Axis_t  fgChargeLast;      // Default for fChargeLast   (now set to: 199.5 )
     18  static const Int_t   fgRmsChargeNbins;  // Default for fChargeNBins  (now set to: 100   )
     19  static const Axis_t  fgRmsChargeFirst;  // Default for fChargeFirst  (now set to: 0.    )
     20  static const Axis_t  fgRmsChargeLast;   // Default for fChargeLast   (now set to: 100.  )
     21  static const Int_t   fgAbsTimeNbins;    // Default for fChargeNBins  (now set to: 30    )
     22  static const Axis_t  fgAbsTimeFirst;    // Default for fChargeFirst  (now set to: -0.5  )
     23  static const Axis_t  fgAbsTimeLast;     // Default for fChargeLast   (now set to: 29.5  )
    1624
    17   TH1F fHRmsCharge;                       // Variance of summed FADC slices
     25  MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results
    1826
    19   static const Int_t   fgChargeNbins;
    20   static const Axis_t  fgChargeFirst;
    21   static const Axis_t  fgChargeLast; 
     27  TH1F fHRmsCharge;                      // Histogram containing Variance of summed FADC slices
    2228
    23   static const Int_t   fgRmsChargeNbins;
    24   static const Axis_t  fgRmsChargeFirst;
    25   static const Axis_t  fgRmsChargeLast; 
     29  Int_t   fRmsChargeNbins;               // Number of  bins used for the fHRmsCharge
     30  Axis_t  fRmsChargeFirst;               // Lower bound bin used for the fHRmsCharge
     31  Axis_t  fRmsChargeLast;                // Upper bound bin used for the fHRmsCharge
    2632
    27   static const Int_t   fgAbsTimeNbins;
    28   static const Axis_t  fgAbsTimeFirst;
    29   static const Axis_t  fgAbsTimeLast;
     33  Float_t fRmsChargeMean;                //  Mean of the Gauss fit               
     34  Float_t fRmsChargeSigma;               //  Sigma of the Gauss fit             
     35  Float_t fRmsChargeMeanErr;             //  Error of the mean of the Gauss fit
     36  Float_t fRmsChargeSigmaErr;            //  Error of the sigma of the Gauss fit
    3037
    31   Int_t   fRmsChargeNbins;
    32   Axis_t  fRmsChargeFirst;
    33   Axis_t  fRmsChargeLast; 
    34 
    35   Float_t  fRmsChargeMean;
    36   Float_t  fRmsChargeMeanErr;
    37   Float_t  fRmsChargeSigma;
    38   Float_t  fRmsChargeSigmaErr;
    39 
    40   Float_t fExtractSlices;
    41  
    4238public:
    4339
     
    4541  ~MHCalibrationChargePINDiode(){}
    4642
    47   void Clear(Option_t *o="");
    48   void Init();
    49  
    5043  Bool_t SetupFill(const MParList *pList);
    5144  Bool_t ReInit   (      MParList *pList);
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h

    r3612 r3617  
    2424  Int_t    fPixId;         // The pixel ID
    2525
    26   TH1F     fHAbsTime;      // Histogram to hold the absolute arrival times in number of FADC slices
     26  TH1F     fHAbsTime;      // Histogram containing the absolute arrival times
    2727                         
    2828  Int_t    fChargeNbins;   // Number of  bins used for the fHGausHist
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r3616 r3617  
    282282Bool_t MHGausEvents::FillHist(const Float_t f)
    283283{
    284 
    285   if (fHGausHist.Fill(f) == -1)
    286     return kFALSE;
    287 
    288  return kTRUE;
     284  return fHGausHist.Fill(f) > -1;
    289285}
    290286
Note: See TracChangeset for help on using the changeset viewer.