Changeset 2666 for trunk/MagicSoft


Ignore:
Timestamp:
12/12/03 14:27:05 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2663 r2666  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6
     7 2003/12/12: Markus Gaug
     8       
     9   * manalysis/MExtractSignal.[h,cc]
     10        - now with constructor allowing to set the first and last used time slice
     11        - (default like before)
     12        - extract number of pixels from MGeomCam
     13
    614
    715 2003/12/12: Sabrina Stark
  • trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc

    r2660 r2666  
    8383#include "MPedestalPix.h"
    8484
     85#include "MGeomCam.h"
     86
    8587#include "MLog.h"
    8688#include "MLogManip.h"
     
    220222    }
    221223
    222     //    fNumHiGainSamples =  fRunHeader->GetNumSamplesHiGain();
    223     //    fNumLoGainSamples =  fRunHeader->GetNumSamplesLoGain();
    224     fNumHiGainSamples =  6;
    225     fNumLoGainSamples =  6;
    226 
    227     //
    228     // FIXME: The next statement simply does not work:
    229     //        fRawEvt->GetNumPixels() returns always 0
    230     // fCalibrations->InitSize(fRawEvt->GetNumPixels());
    231     //
    232 
    233     fCalibrations->InitSize(577);   
    234 
    235     for (Int_t i=0;i<577;i++)
     224
     225    MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
     226    if (!cam)
     227    {
     228        *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
     229        return kFALSE;
     230    }
     231
     232
     233    fNumHiGainSamples =  fSignals->GetNumUsedHiGainFADCSlices();
     234    fNumLoGainSamples =  fSignals->GetNumUsedLoGainFADCSlices();
     235
     236    fCalibrations->InitSize(cam->GetNumPixels());   
     237
     238    for (UInt_t i=0;i<cam->GetNumPixels();i++)
    236239      {
    237240        MCalibrationPix &pix = (*fCalibrations)[i];
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc

    r2665 r2666  
    152152         
    153153          Float_t nsb = TMath::Sqrt(fPedRms*fPedRms - fElectronicPedRms*fElectronicPedRms);
    154 
    155154          //      Float_t logainrms = fElectronicPedRms + (TMath::Sqrt(fPedRms*fPedRms - fElectronicPedRms*fElectronicPedRms));
    156           Float_t logainrms = (TMath::Sqrt(nsb*nsb + 100.*fElectronicPedRms*fElectronicPedRms));
    157           if (logainrms > 0.)
    158             fRSigmaSquare = (fSigmaCharge*fSigmaCharge) - (logainrms*logainrms);
     155
     156          if (nsb > 0.)
     157            {
     158              Float_t logainrms = (TMath::Sqrt(nsb*nsb + 100.*fElectronicPedRms*fElectronicPedRms));
     159              fRSigmaSquare = (fSigmaCharge*fSigmaCharge) - (logainrms*logainrms);
     160            }
    159161          else
    160             fRSigmaSquare =  fSigmaCharge*fSigmaCharge;
    161 
     162            fRSigmaSquare =  fSigmaCharge*fSigmaCharge - (100.*fElectronicPedRms*fElectronicPedRms);
    162163        }
    163164      else
     
    167168      {
    168169       fPheFFactorMethod         =  fFactor * fCharge*fCharge / fRSigmaSquare;
    169        fConversionFFactorMethod  =  fPheFFactorMethod /   fCharge ;
     170       fConversionFFactorMethod  =  fPheFFactorMethod /  fCharge ;
    170171      }
    171172    else
  • trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h

    r2661 r2666  
    9494                                                    }
    9595
    96   Float_t GetMeanConversionBlindPixelMethod()          { return fConversionBlindPixelMethod ; }
    97   Float_t GetErrorConversionBlindPixelMethod()         { return fConversionErrorBlindPixelMethod ; }
    98   Float_t GetSigmaConversionBlindPixelMethod()                   { return fConversionSigmaBlindPixelMethod ; }
     96  Float_t GetMeanConversionBlindPixelMethod()   const  { return fConversionBlindPixelMethod ; }
     97  Float_t GetErrorConversionBlindPixelMethod()  const  { return fConversionErrorBlindPixelMethod ; }
     98  Float_t GetSigmaConversionBlindPixelMethod()  const  { return fConversionSigmaBlindPixelMethod ; }
    9999
    100   Float_t GetMeanConversionFFactorMethod()             { return fConversionFFactorMethod ; }
    101   Float_t GetErrorConversionFFactorMethod()            { return fConversionErrorFFactorMethod ; }
    102   Float_t GetSigmaConversionFFactorMethod()            { return fConversionSigmaFFactorMethod ; }
     100  Float_t GetMeanConversionFFactorMethod()      const  { return fConversionFFactorMethod ; }
     101  Float_t GetErrorConversionFFactorMethod()     const  { return fConversionErrorFFactorMethod ; }
     102  Float_t GetSigmaConversionFFactorMethod()     const  { return fConversionSigmaFFactorMethod ; }
     103  Float_t GetPheFFactorMethod()                 const  { return fPheFFactorMethod;           } 
    103104 
    104   Float_t GetMeanConversionPINDiodeMethod()            { return fConversionPINDiodeMethod ; }
    105   Float_t GetErrorConversionPINDiodeMethod()           { return fConversionErrorPINDiodeMethod ; }
    106   Float_t GetSigmaConversionPINDiodeMethod()           { return fConversionSigmaPINDiodeMethod ; }
     105  Float_t GetMeanConversionPINDiodeMethod()     const  { return fConversionPINDiodeMethod ; }
     106  Float_t GetErrorConversionPINDiodeMethod()    const  { return fConversionErrorPINDiodeMethod ; }
     107  Float_t GetSigmaConversionPINDiodeMethod()    const  { return fConversionSigmaPINDiodeMethod ; }
    107108
    108109  void   SetChargesInGraph(Float_t qhi,Float_t qlo) { fHist->SetPointInGraph(qhi,qlo); }
     
    126127  void Draw(Option_t *opt="")           { fHist->Draw(opt); }
    127128 
    128   Float_t GetPheFFactorMethod()           const { return fPheFFactorMethod;           } 
    129   Float_t GetConversionFFactorMethod()    const { return fConversionFFactorMethod;    }
    130129 
    131130  ClassDef(MCalibrationPix, 1)  // Storage Container for Calibration information of one pixel
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc

    r2665 r2666  
    3737#include "MPedestalPix.h"
    3838
     39#include "MGeomCam.h"
     40
    3941#include "MLog.h"
    4042#include "MLogManip.h"
     
    5658// Default constructor.
    5759//
    58 MExtractSignal::MExtractSignal(const char *name, const char *title)
    59   : fNumHiGainSamples(0), fNumLoGainSamples(0),
    60     fSqrtHiGainSamples(0), fSqrtLoGainSamples(0),
    61     fBefore(2), fAfter(4),
     60MExtractSignal::MExtractSignal(const Byte_t first, const Byte_t last, const char *name, const char *title)
     61  : fNumHiGainSamples(last-first+1), fNumLoGainSamples(last-first+1),
    6262    fSaturationLimit(254), fConversionHiLo(10.)
    6363{
     
    6767
    6868    AddToBranchList("MRawEvtData.*");
     69
     70    fFirst = first;
     71
     72    fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples);
     73    fSqrtLoGainSamples = TMath::Sqrt((Float_t)fNumLoGainSamples);
    6974}
    7075
     
    125130    }
    126131
    127     //fNumHiGainSamples =  fRunHeader->GetNumSamplesHiGain();
    128     //fNumLoGainSamples =  fRunHeader->GetNumSamplesLoGain();
    129     fNumHiGainSamples =  6;
    130     fNumLoGainSamples =  6;
    131 
    132     fSqrtHiGainSamples = TMath::Sqrt((float)fNumHiGainSamples);
    133     fSqrtLoGainSamples = TMath::Sqrt((float)fNumLoGainSamples);
    134 
    135     //
    136     // FIXME: The next statement simply does not work:
    137     //        fRawEvt->GetNumPixels() returns always 0
    138     //
    139 
    140     fSignals->InitSize(577);   
    141     // fExtractedSignals->InitSize(fRawEvt->GetNumPixels());
     132
     133    MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
     134    if (!cam)
     135    {
     136        *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
     137        return kFALSE;
     138    }
     139
     140    fSignals->InitSize(cam->GetNumPixels());   
    142141
    143142    return kTRUE;
     
    163162
    164163        Byte_t *ptr   = pixel.GetHiGainSamples();
    165         Byte_t *first = ptr + 3;
    166         Byte_t *last  = ptr + 9;
     164        Byte_t *first = ptr + fFirst;
     165        Byte_t *last  = ptr + fFirst + fNumHiGainSamples;
    167166
    168167        UInt_t  sumHi   = 0;
     
    196195
    197196        ptr   = pixel.GetLoGainSamples();
    198         first = ptr + 3;
    199         last  = ptr + 9;
     197        first = ptr + fFirst;
     198        last  = ptr + fFirst + fNumLoGainSamples;
    200199        Byte_t maxlo  = 0;
    201200        Byte_t midlo  = 0;
     
    230229
    231230        if (satHi)
    232           pix.SetArrivalTimes((Float_t)(midlo+3),0.,0.);
     231          pix.SetArrivalTimes((Float_t)(midlo+fFirst),0.,0.);
    233232        else
    234           pix.SetArrivalTimes((Float_t)(midhi+3),0.,0.);
     233          pix.SetArrivalTimes((Float_t)(midhi+fFirst),0.,0.);
    235234
    236235      } /* while (pixel.Next()) */
    237236
    238     fSignals->SetNumUsedFADCSlices(fNumHiGainSamples,3,8,fNumLoGainSamples,3,8);
     237    fSignals->SetNumUsedFADCSlices(fNumHiGainSamples,fFirst,fFirst+fNumHiGainSamples-1,
     238                                   fNumLoGainSamples,fFirst,fFirst+fNumLoGainSamples-1);
    239239    fSignals->SetReadyToSave();
    240240
  • trunk/MagicSoft/Mars/manalysis/MExtractSignal.h

    r2640 r2666  
    3131  MRawRunHeader            *fRunHeader;    // RunHeader information
    3232
     33  Byte_t fFirst;
     34
    3335  Byte_t fNumHiGainSamples;
    3436  Byte_t fNumLoGainSamples;
     
    3638  Float_t fSqrtHiGainSamples;
    3739  Float_t fSqrtLoGainSamples;
    38 
    39   Byte_t fBefore;
    40   Byte_t fAfter;
    4140
    4241  Byte_t  fSaturationLimit;
     
    5049public:
    5150
    52   MExtractSignal(const char *name=NULL, const char *title=NULL);
     51  MExtractSignal(const Byte_t first=4, const Byte_t last=9, const char *name=NULL, const char *title=NULL);
    5352 
    5453  void SetSaturationLimit(Byte_t lim)      { fSaturationLimit = lim; }
  • trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc

    r2662 r2666  
    547547  fHivsLoGain->GetXaxis()->SetTitle("Sum of Charges High Gain");
    548548  fHivsLoGain->GetYaxis()->SetTitle("Sum of Charges Low Gain");
     549
     550  TString titleHiLoGain  = TString(fHivsLoGain->GetName());
     551  titleHiLoGain += fPixId;
     552  fHivsLoGain->SetName(titleHiLoGain.Data());
     553
    549554 
    550555  for (Int_t i=0;i<fTotalEntries;i++)
Note: See TracChangeset for help on using the changeset viewer.