Changeset 3120


Ignore:
Timestamp:
02/12/04 16:16:26 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3118 r3120  
    2323   * mcalib/MCalibrationCalc.cc
    2424     - removed initialization of non-used nsamples
     25
     26   * mcalib/MHCalibrationPixel.[h,cc]
     27   * mcalib/MCalibrationPix.[h,cc]
     28   * mcalib/MCalibrationCalc.[h,cc]
     29     - implemented new histograms:
     30       HSinglePheFADCSlices and HPedestalFADCSlices
     31       They are filled with the FADC slice values of either a s.phe.
     32       event or a pedestal event. The decision is taken with the
     33       variable: MCalibrationCalc::fBlindPixelSinglePheCut, to be set
     34       with a setter
     35     - as the blind pixel signal seems to be delayed a bit, the
     36       extraction range is now by default: 10,20. The extractor takes
     37       already care of the fact that part of the signal lies in the
     38       LoGain Sample.
    2539
    2640
  • trunk/MagicSoft/Mars/mcalib/MCalibrationBlindPix.cc

    r3076 r3120  
    5757    *fLog << warn << dbginf << " Could not create MHCalibrationBlindPixel " << endl;
    5858
    59   fHSinglePheFADCSlices = new TH1I("HSinglePheFADCSlices","Summed FADC slices single phe events",30,0.5,30.5); 
    60  
    6159  Clear();
    6260}
     
    6563{
    6664  delete fHist;
    67   delete fHSinglePheFADCSlices;
    6865}
    6966
     
    9693}
    9794
    98 Bool_t MCalibrationBlindPix::FillCharge(const Float_t q)
     95Bool_t MCalibrationBlindPix::FillCharge(const Int_t q)
    9996{
    10097  return fHist->FillBlindPixelCharge(q);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationBlindPix.h

    r3076 r3120  
    3232  Float_t fErrTime;             // The error of the mean arrival time after the fit
    3333 
    34   TH1I* fHSinglePheFADCSlices;
    35 
    3634 
    3735public:
     
    5856  Float_t GetErrTime()   const    { return fErrTime;      }
    5957
    60   TH1I *GetSinglePheFADCSlices()    { return fHSinglePheFADCSlices;  }
    61  
    6258  MHCalibrationBlindPixel *GetHist()     const  { return fHist;  }
    6359  MHCalibrationBlindPixel *GetHist()            { return fHist;  }
     
    6662 
    6763  // Fill histos
    68   Bool_t FillCharge(const Float_t q);
     64  Bool_t FillCharge(const Int_t q);
    6965  Bool_t FillTime(const Float_t t);
    70   Bool_t FillGraphs(Float_t qhi,Float_t qlo) const { return fHist->FillGraphs(qhi,qlo); }
     66  Bool_t FillGraphs(const Int_t qhi, const Int_t qlo) const { return fHist->FillGraphs(qhi,qlo); }
    7167 
    7268  // Fits
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.cc

    r3116 r3120  
    115115const UInt_t MCalibrationCalc::fPINDiodeId   = 9999;
    116116const Byte_t MCalibrationCalc::fgSaturationLimit = 254;
    117 const Byte_t MCalibrationCalc::fgBlindPixelFirst = 3;
    118 const Byte_t MCalibrationCalc::fgBlindPixelLast  = 12;
     117const Byte_t MCalibrationCalc::fgBlindPixelFirst = 10;
     118const Byte_t MCalibrationCalc::fgBlindPixelLast  = 20;
     119const Int_t  MCalibrationCalc::fgBlindPixelSinglePheCut = 150;
    119120
    120121// --------------------------------------------------------------------------
     
    460461              Byte_t *ptr = pixel.GetHiGainSamples();
    461462
    462               Float_t blindpixelsumhi = 0.;
    463               Float_t blindpixelsumlo = 0.;
     463              Int_t blindpixelsumhi = 0;
     464              Int_t blindpixelsumlo = 0;
    464465              //
    465466              // We need a dedicated signal extractor for the blind pixel
     
    499500                }
    500501             
    501               blindpixelsumhi = (Float_t)sum;
     502              blindpixelsumhi = sum;
    502503
    503504              ptr = pixel.GetLoGainSamples();
     
    513514                sum += *ptr;
    514515
    515               blindpixelsumlo = (Float_t)sum;
     516              blindpixelsumlo = sum;
    516517
    517518              //              if (!CalcSignalBlindPixel(hiptr, blindpixelsumhi))
     
    527528              blindpixel.FillGraphs(blindpixelsumhi,blindpixelsumlo);
    528529         
    529               TH1I *hist = blindpixel.GetSinglePheFADCSlices();
    530 
    531               if (blindpixelsumhi > 50.)
    532                 {
    533                   ptr = pixel.GetHiGainSamples();
    534                   for (Int_t i=0;i<15;i++)
    535                     hist->Fill(i,*ptr++);
    536                   ptr = pixel.GetLoGainSamples();
    537                   for (Int_t i=15;i<30;i++)
    538                     hist->Fill(i,*ptr++);
    539                 }
     530              TH1I *hist;
     531
     532              if (blindpixelsumhi > fBlindPixelSinglePheCut)
     533                hist = (blindpixel.GetHist())->GetHSinglePheFADCSlices();
     534              else
     535                hist = (blindpixel.GetHist())->GetHPedestalFADCSlices();
     536
     537              ptr = pixel.GetHiGainSamples();
     538              for (Int_t i=1;i<16;i++)
     539                hist->Fill(i,*ptr++);
     540              ptr = pixel.GetLoGainSamples();
     541              for (Int_t i=16;i<31;i++)
     542                hist->Fill(i,*ptr++);
     543
    540544            } /* if use blind pixel */
    541545         
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCalc.h

    r3106 r3120  
    4343  static const Byte_t fgBlindPixelFirst;    // First FADC slice blind pixel
    4444  static const Byte_t fgBlindPixelLast;     // Last FADC slice blind pixel
     45
     46  static const Int_t  fgBlindPixelSinglePheCut; // FADC sum from which on an event is considered as a S.ph. one.
    4547 
    4648  MPedestalCam             *fPedestals;    // Pedestals of all pixels in the camera
     
    5961  Byte_t fBlindPixelFirst;
    6062  Byte_t fBlindPixelLast;
     63
     64  Int_t  fBlindPixelSinglePheCut;
    6165 
    6266  Float_t fConversionHiLo;
     
    107111
    108112  void SetBlindPixelRange(Byte_t first=fgBlindPixelFirst, Byte_t last=fgBlindPixelLast);
    109 
     113  void SetBlindPixelSinglePheCut(Int_t cut=fgBlindPixelSinglePheCut)    { fBlindPixelSinglePheCut = cut;  }
     114 
    110115  // Getters
    111116  MCalibrationBlindPix *GetBlindPixel() const;
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationBlindPixel.cc

    r3112 r3120  
    116116    fBlindPixelChargelast  = 1600.;
    117117
    118     fHBlindPixelCharge = new TH1F("HBlindPixelCharge","Distribution of Summed FADC Slices",
     118    fHBlindPixelCharge = new TH1I("HBlindPixelCharge","Distribution of Summed FADC Slices",
    119119                                  fgBlindPixelChargeNbins,fBlindPixelChargefirst,fBlindPixelChargelast);
    120120    fHBlindPixelCharge->SetXTitle("Sum FADC Slices");
     
    133133    fLoGains = new TArrayF(fCurrentSize);
    134134
     135    fHSinglePheFADCSlices = new TH1I("HSinglePheFADCSlices","FADC slices Single Phe events",30,0.5,30.5); 
     136    fHSinglePheFADCSlices->SetXTitle("FADC slice");
     137    fHSinglePheFADCSlices->SetYTitle("Counts");   
     138    fHSinglePheFADCSlices->SetDirectory(NULL);   
     139
     140    fHPedestalFADCSlices  = new TH1I("HPedestalFADCSlices", "FADC slices Pedestal events",30,0.5,30.5); 
     141    fHPedestalFADCSlices->SetXTitle("FADC slice");
     142    fHPedestalFADCSlices->SetYTitle("Counts");   
     143    fHPedestalFADCSlices->SetDirectory(NULL);   
     144
    135145    Clear();
    136146}
     
    147157  delete fHiGains;
    148158  delete fLoGains;
     159
     160  delete fHSinglePheFADCSlices;
     161  delete fHPedestalFADCSlices;
    149162
    150163  if (fHBlindPixelPSD)
     
    247260  fLoGains->Set(1024);
    248261
    249   fHiGains->Reset(0.);
    250   fLoGains->Reset(0.);
     262  fHiGains->Reset(0);
     263  fLoGains->Reset(0);
    251264
    252265
     
    337350}
    338351
    339 void MHCalibrationBlindPixel::CutArrayBorder(TArrayF *array)
     352void MHCalibrationBlindPixel::CutArrayBorder(TArrayF *array) const
    340353{
    341354 
     
    350363}
    351364
     365void MHCalibrationBlindPixel::CutArrayBorder(TArrayI *array) const
     366{
     367 
     368  Int_t i;
     369
     370  for (i=array->GetSize()-1;i>=0;i--)
     371    if (array->At(i) != 0)
     372      {
     373        array->Set(i+1);
     374        break;
     375      }
     376}
     377
    352378const Bool_t MHCalibrationBlindPixel::IsFitOK() const
    353379{
     
    365391}
    366392
    367 Bool_t MHCalibrationBlindPixel::FillGraphs(Float_t qhi,Float_t qlo)
     393Bool_t MHCalibrationBlindPixel::FillGraphs(const Int_t qhi, const Int_t qlo)
    368394{
    369395
     
    387413
    388414
    389 Bool_t MHCalibrationBlindPixel::FillBlindPixelCharge(Float_t q)
     415Bool_t MHCalibrationBlindPixel::FillBlindPixelCharge(const Int_t q)
    390416{
    391417    return fHBlindPixelCharge->Fill(q) > -1;
    392418}
    393419
    394 Bool_t MHCalibrationBlindPixel::FillBlindPixelTime(Float_t t)
     420Bool_t MHCalibrationBlindPixel::FillBlindPixelTime(const Float_t t)
    395421{
    396422    return fHBlindPixelTime->Fill(t) > -1;
     
    529555    c->cd(2);
    530556    DrawLegend();
     557   
     558
     559    c->cd(3);
     560    gPad->SetLogy(0);
     561    gPad->SetBorderMode(0);
     562    //    fHBlindPixelTime->Draw(opt);
     563    fHSinglePheFADCSlices->Draw(opt);
     564
     565    c->cd(4);
     566    gPad->SetLogy(0);
     567    gPad->SetBorderMode(0);
     568    //    fHBlindPixelTime->Draw(opt);
     569    fHPedestalFADCSlices->Draw(opt);
     570   
    531571    c->Modified();
    532572    c->Update();
    533    
    534     c->cd(3);
    535     gPad->SetLogy(1);
    536     gPad->SetBorderMode(0);
    537     fHBlindPixelTime->Draw(opt);
    538    
     573
    539574    CutArrayBorder(fHiGains);
    540575    CreateChargeXaxis(fHiGains->GetSize());
     
    623658    c->Modified();
    624659    c->Update();
     660
     661    c->cd(10);
    625662}
    626663
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationBlindPixel.h

    r3108 r3120  
    77
    88class TArrayF;
     9class TArrayI;
    910class TH1F;
    1011class TH1I;
     
    2829  static const Int_t   fPulserFrequency;
    2930 
    30   TH1F* fHBlindPixelCharge;        // Histogram with the single Phe spectrum
     31  TH1I* fHBlindPixelCharge;        // Histogram with the single Phe spectrum
    3132  TH1F* fHBlindPixelTime;          // Variance of summed FADC slices
    3233  TH1F* fHBlindPixelPSD;           // Power spectrum density of fHBlindPixelChargevsN
     34
     35  TH1I* fHSinglePheFADCSlices;
     36  TH1I* fHPedestalFADCSlices;
    3337 
    3438  TF1 *fSinglePheFit;   
     
    5862  void CreateChargeXaxis(Int_t n);
    5963  void CreatePSDXaxis(Int_t n);
    60   void CutArrayBorder(TArrayF *array);
     64  void CutArrayBorder(TArrayF *array) const;
     65  void CutArrayBorder(TArrayI *array) const;
    6166
    6267  TPaveText *fFitLegend;                 
     
    104109  void Reset();
    105110 
    106   Bool_t FillBlindPixelCharge(Float_t q);
    107   Bool_t FillBlindPixelTime(Float_t t);
    108   Bool_t FillGraphs(Float_t qhi, Float_t qlo);
     111  Bool_t FillBlindPixelCharge(const Int_t q);
     112  Bool_t FillBlindPixelTime(const Float_t t);
     113  Bool_t FillGraphs(const Int_t qhi, const Int_t qlo);
    109114 
    110115  // Setters
     
    138143  const Double_t GetSigmaTimeErr()   const { return fSigmaTimeErr;   }
    139144
     145  TH1I *GetHSinglePheFADCSlices()    { return fHSinglePheFADCSlices;  }
     146  TH1I *GetHPedestalFADCSlices()    { return fHPedestalFADCSlices;  } 
     147 
    140148  const Bool_t IsFitOK()        const;
    141149  const Bool_t IsOscillating();
Note: See TracChangeset for help on using the changeset viewer.