Changeset 3034


Ignore:
Timestamp:
02/05/04 17:45:27 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3033 r3034  
    3737   * manalysis/MExtractSignal2.[h,cc]
    3838     - removed uncommented code (arrival time)
     39
     40   * manalysis/MHPedestalPixel.[h,cc]
     41     - is now filled with total pedestals (not per slice), but results are
     42       renormalized to values per slice (this is not to screw up with the
     43       pedestal RMS and the derived uncertainties)
     44     - new function Renorm(nslices)
    3945
    4046
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal2.cc

    r3018 r3034  
    4949#include "MExtractedSignalPix.h"
    5050
    51 //#include "MArrivalTime.h"
    52 
    5351ClassImp(MExtractSignal2);
    5452
     
    128126        return kFALSE;
    129127    }
    130 /*
    131     fArrivalTime = (MArrivalTime*)pList->FindCreateObj(AddSerialNumber("MArrivalTime"));
    132     if (!fArrivalTime)
    133         return kFALSE;
    134  */
    135128    return kTRUE;
    136129}
  • trunk/MagicSoft/Mars/manalysis/MHPedestalPixel.cc

    r3015 r3034  
    4848const Float_t gkSq2Pi = 2.506628274631;
    4949const Float_t gkProbLimit = 0.01;
    50 const Int_t   MHPedestalPixel::gkChargeNbins    = 500 ;
     50const Int_t   MHPedestalPixel::gkChargeNbins    = 250 ;
     51const Axis_t  MHPedestalPixel::gkChargeFirst    = -0.5;
     52const Axis_t  MHPedestalPixel::gkChargeLast     = 249.5;
    5153const Int_t   MHPedestalPixel::gkChargevsNbins  = 1000;
    5254const Axis_t  MHPedestalPixel::gkChargevsNFirst = -0.5;
    5355const Axis_t  MHPedestalPixel::gkChargevsNLast  = 999.5;
    54 const Axis_t  MHPedestalPixel::gkChargeFirst    = -0.5;
    55 const Axis_t  MHPedestalPixel::gkChargeLast     = 499.5;
    5656
    5757// --------------------------------------------------------------------------
     
    9797{
    9898 
    99   fTotalEntries    = 0;
     99  fTotalEntries    =  0;
    100100
    101101  fChargeMean      = -1.;
     
    196196{
    197197
    198   gStyle->SetOptFit(1);
    199198  gStyle->SetOptStat(111111);
     199  gStyle->SetOptFit();
    200200 
    201201  gROOT->SetSelectedPad(NULL);
     
    203203  TCanvas *c = MH::MakeDefCanvas(this,600,900);
    204204 
    205   c->Divide(1,2);
     205  //  c->Divide(1,2);
    206206 
    207207  c->cd(1);
     
    210210
    211211  if (fHPedestalCharge->Integral() > 0)
    212     gPad->SetLogy(1);
     212    gPad->SetLogy();
    213213
    214214  fHPedestalCharge->Draw(opt);
     
    226226  c->Update();
    227227
     228  /*
    228229  c->cd(2);
    229230  gPad->SetTicks();
    230231
    231232  fHPedestalChargevsN->Draw(opt);
     233  */
     234
    232235  c->Modified();
    233236  c->Update();
     
    285288 
    286289  //
    287   // If we are not able to fit, try once again
    288   //
    289   if (fGausFit->GetProb() < gkProbLimit)
    290     {
    291 
    292       Axis_t rtry = fGausFit->GetParameter(1) - 2.0*fGausFit->GetParameter(2);
    293       rmin        = (rtry < rmin ? rmin : rtry);
    294       rmax        = fGausFit->GetParameter(1) + 2.0*fGausFit->GetParameter(2);
    295       fGausFit->SetRange(rmin,rmax); 
    296 
    297       fHPedestalCharge->Fit(fGausFit,option);
    298     }
     290  // In order not to be affected by outliers,
     291  // try once again with stricter borders
     292  //
     293  Axis_t rtry = fGausFit->GetParameter(1) - 2.5*fGausFit->GetParameter(2);
     294  rmin        = (rtry < rmin ? rmin : rtry);
     295  rtry        = fGausFit->GetParameter(1) + 2.5*fGausFit->GetParameter(2);
     296  rmax        = (rtry > rmax ? rmax : rtry);
     297  fGausFit->SetRange(rmin,rmax); 
     298 
     299  fHPedestalCharge->Fit(fGausFit,option);
    299300 
    300301  fChargeChisquare = fGausFit->GetChisquare();
     
    312313  // The Probability is greater than gkProbLimit (default 0.001 == 99.9%)
    313314  //
    314   if (TMath::IsNaN(fChargeMean) || TMath::IsNaN(fChargeMeanErr))
     315  if (TMath::IsNaN(fChargeMean)    ||
     316     TMath::IsNaN(fChargeMeanErr) ||
     317     TMath::IsNaN(fChargeSigma) ||
     318     TMath::IsNaN(fChargeSigmaErr))
     319    {
     320      Clear();
     321      //      CLRBIT(fFlags,kFitOK);
     322      return kFALSE;
     323    }
     324 
     325  if ((fChargeProb < gkProbLimit) || (TMath::IsNaN(fChargeProb)))
    315326    {
    316327      CLRBIT(fFlags,kFitOK);
     
    318329    }
    319330 
    320   if ((fChargeProb < gkProbLimit) || (TMath::IsNaN(fChargeProb)))
    321     {
    322       CLRBIT(fFlags,kFitOK);
    323       return kFALSE;
    324     }
    325  
    326331  SETBIT(fFlags,kFitOK);
    327332  return kTRUE;
    328333}
    329334
     335void MHPedestalPixel::Renorm(const Float_t nslices)
     336{
     337
     338  if (!TESTBIT(fFlags,kFitOK))
     339    return;
     340
     341  Float_t sqslices = TMath::Sqrt(nslices);
     342
     343  fChargeMean      /= nslices;
     344  //
     345  // Mean error goes with PedestalRMS/Sqrt(entries) -> scale with slices
     346  //
     347  fChargeMeanErr   /= nslices;
     348  //
     349  // Sigma goes like PedestalRMS -> scale with sqrt(slices)   
     350  //
     351  fChargeSigma     /= sqslices;
     352  //
     353  // Sigma error goes like PedestalRMS/2.(entries) -> scale with slices
     354  //
     355  fChargeSigmaErr  /= nslices;
     356 
     357}
     358
    330359void MHPedestalPixel::CutAllEdges()
    331360{
    332361
    333   Int_t nbins = 30;
     362  Int_t nbins = 15;
    334363
    335364  MH::CutEdges(fHPedestalCharge,nbins);
  • trunk/MagicSoft/Mars/manalysis/MHPedestalPixel.h

    r3015 r3034  
    8080
    8181  // Fits
    82   Bool_t FitCharge(Option_t *option="RQ0"); 
     82  Bool_t FitCharge(Option_t *option="RQ0");
     83  void Renorm(const Float_t nslices); 
    8384
    8485  // Draws
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.h

    r3014 r3034  
    4747  MPedestalPix &operator[](Int_t i) const;
    4848 
    49   MHPedestalPixel      &operator()(UInt_t i);
    50   const MHPedestalPixel &operator()(UInt_t i) const;
     49  MHPedestalPixel &operator()(UInt_t i);
     50  MHPedestalPixel &operator()(UInt_t i) const;
    5151 
    5252  Bool_t SetupFill(const MParList *pList);
     
    5454  Bool_t Finalize();
    5555 
    56   //  TObject *Clone(const char *) const;
     56  TObject *Clone(const char *) const;
    5757 
    5858  // Setters
  • trunk/MagicSoft/Mars/manalysis/MPedestalPix.cc

    r3014 r3034  
    5959void MPedestalPix::InitUseHists()
    6060{
     61
    6162  fPedestal = 0.;
    6263  fPedestalRms = 0.;
Note: See TracChangeset for help on using the changeset viewer.