Changeset 3696 for trunk


Ignore:
Timestamp:
04/09/04 16:59:46 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3695 r3696  
    2121
    2222   * mcalib/MHCalibrationChargePINDiode.[h,cc] 
     23   * mcalib/MHCalibrationChargeCam.[h,cc]       
     24   * mcalib/MHCalibrationChargeCalc.[h,cc]     
    2325     - put abs. time consistency check from MCalibrationChargeCalc into
    24        MHCalibrationChargePINDiode
     26       MHCalibrationChargePINDiode and MHCalibrationChargeCam
    2527
    2628
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationCam.cc

    r3676 r3696  
    393393{
    394394
    395   fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
    396   if (!fBadPixels)
    397       return kFALSE;
    398 
    399 
    400395  const Int_t npixels  = fGeom->GetNumPixels();
    401396  const Int_t nsectors = fGeom->GetNumSectors();
    402397  const Int_t nareas   = fGeom->GetNumAreas();
     398
     399  fBadPixels = (MBadPixelsCam*)pList->FindObject("MBadPixelsCam");
     400  if (!fBadPixels)
     401    {
     402      fBadPixels = (MBadPixelsCam*)pList->FindCreateObj(AddSerialNumber("MBadPixelsCam"));
     403      if (!fBadPixels)
     404        {
     405          gLog << err << "Cannot find nor create MBadPixelsCam ... abort." << endl;
     406          return kFALSE;
     407        }
     408      else
     409        fBadPixels->InitSize(npixels);
     410    }
    403411
    404412  //
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h

    r3639 r3696  
    77
    88class MRawEvtData;
    9 class MBadPixelsPix;
    10 class MCalibrationChargeCam;
     9class MExtractedSignalCam;
    1110class MCalibrationChargePix;
    1211class MHCalibrationChargePix;
     
    1514private:
    1615
    17   static const Float_t fgNumHiGainSaturationLimit;   // The default for fNumHiGainSaturationLimit
    18   static const Float_t fgNumLoGainSaturationLimit;   // The default for fNumLoGainSaturationLimit
     16  static const Float_t fgNumHiGainSaturationLimit;   //! The default for fNumHiGainSaturationLimit (now at: 0.01)
     17  static const Float_t fgNumLoGainSaturationLimit;   //! The default for fNumLoGainSaturationLimit (now at: 0.005)
     18  static const Float_t fgTimeLowerLimit;             //! Default for fTimeLowerLimit    (now set to: 1.)
     19  static const Float_t fgTimeUpperLimit;             //! Default for fTimeUpperLimit    (now set to: 2.)
    1920 
    2021  Float_t fNumHiGainSaturationLimit;  // Rel. amount sat. higain FADC slices until pixel is called saturated
    2122  Float_t fNumLoGainSaturationLimit;  // Rel. amount sat. logain FADC slices until pixel is called saturated
    22  
    23   MRawEvtData *fRawEvt;               //!  Raw event data
     23  Float_t fTimeLowerLimit;            // Limit dist. to first signal slice (in units of FADC slices)
     24  Float_t fTimeUpperLimit;            // Limit dist. to last signal slice  (in units of FADC slices)
     25
     26  MRawEvtData         *fRawEvt;       //!  Raw event data
     27  MExtractedSignalCam *fSig;          //!  Signal Extractor
    2428
    2529  Bool_t SetupHists(const MParList *pList);
    2630  Bool_t ReInitHists(MParList *pList);
    2731  Bool_t FillHists(const MParContainer *par, const Stat_t w=1);
     32
     33  void   FinalizeAbsTimes (MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad,
     34                           Byte_t first, Byte_t last); 
    2835  Bool_t FinalizeHists();
    2936  void   FinalizeBadPixels();
    3037
    31   void FinalizeHiGainHists(MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad);
    32   void FinalizeLoGainHists(MHCalibrationChargePix &hist, MCalibrationChargePix &pix, MBadPixelsPix &bad);
    3338
    3439 public:
     
    3944  void SetNumLoGainSaturationLimit( const Float_t lim=fgNumLoGainSaturationLimit) { fNumLoGainSaturationLimit = lim; }
    4045  void SetNumHiGainSaturationLimit( const Float_t lim=fgNumHiGainSaturationLimit) { fNumHiGainSaturationLimit = lim; }
     46  void SetTimeLowerLimit    ( const Float_t f=fgTimeLowerLimit         ) { fTimeLowerLimit    = f;   }
     47  void SetTimeUpperLimit    ( const Float_t f=fgTimeUpperLimit         ) { fTimeUpperLimit    = f;   }
    4148 
    4249  Float_t GetNumHiGainSaturationLimit()      const  { return fNumHiGainSaturationLimit; }
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.cc

    r3670 r3696  
    5252using namespace std;
    5353
    54 const Int_t   MHCalibrationChargePINDiode::fgChargeNbins     = 200;
     54const Axis_t  MHCalibrationChargePINDiode::fgAbsTimeFirst    = -0.5;
     55const Axis_t  MHCalibrationChargePINDiode::fgAbsTimeLast     = 29.5;
     56const Int_t   MHCalibrationChargePINDiode::fgAbsTimeNbins    = 30;
    5557const Axis_t  MHCalibrationChargePINDiode::fgChargeFirst     = -0.5;
    5658const Axis_t  MHCalibrationChargePINDiode::fgChargeLast      = 199.5;
     59const Int_t   MHCalibrationChargePINDiode::fgChargeNbins     = 200;
    5760const Int_t   MHCalibrationChargePINDiode::fgRmsChargeNbins  = 100;
    5861const Axis_t  MHCalibrationChargePINDiode::fgRmsChargeFirst  = 0.;
    5962const Axis_t  MHCalibrationChargePINDiode::fgRmsChargeLast   = 100.; 
    60 const Int_t   MHCalibrationChargePINDiode::fgAbsTimeNbins    = 30;
    61 const Axis_t  MHCalibrationChargePINDiode::fgAbsTimeFirst    = -0.5;
    62 const Axis_t  MHCalibrationChargePINDiode::fgAbsTimeLast     = 29.5;
     63const Float_t MHCalibrationChargePINDiode::fgTimeLowerLimit  = 3.;
     64const Float_t MHCalibrationChargePINDiode::fgTimeUpperLimit  = 4.;
    6365// --------------------------------------------------------------------------
    6466//
     
    6668//
    6769// Sets:
     70// - the default number for fAbsTimeFirst        (fgAbsTimeFirst)
     71// - the default number for fAbsTimeLast         (fgAbsTimeLast)
     72// - the default number for fAbsTimeNbins        (fgAbsTimeNbins)
    6873// - the default number for MHGausEvents::fNbins (fgChargeNbins)
    6974// - the default number for MHGausEvents::fFirst (fgChargeFirst)
     
    7277// - the default number for fRmsChargeFirst      (fgRmsChargeFirst)
    7378// - the default number for fRmsChargeLast       (fgRmsChargeLast)
    74 // - the default number for fAbsTimeNbins        (fgAbsTimeNbins)
    75 // - the default number for fAbsTimeFirst        (fgAbsTimeFirst)
    76 // - the default number for fAbsTimeLast         (fgAbsTimeLast)
     79// - the default number for fTimeLowerLimit      (fgTimeLowerLimit)
     80// - the default number for fTimeUpperLimit      (fgTimeUpperLimit)
    7781//
    7882// - the default name of the  fHGausHist      ("HCalibrationChargePINDiode")
     
    99103//
    100104MHCalibrationChargePINDiode::MHCalibrationChargePINDiode(const char *name, const char *title)
    101     : fPINDiode(NULL), fHRmsCharge()
     105    : fPINDiode(NULL), fSigPIN(NULL), fHRmsCharge()
    102106{
    103107
     
    105109  fTitle = title ? title : "Fill the FADC sums of the PINDiode events and perform the fits";
    106110 
     111  SetAbsTimeFirst();
     112  SetAbsTimeLast();
     113  SetAbsTimeNbins();
     114
    107115  SetNbins( fgChargeNbins );
    108116  SetFirst( fgChargeFirst );
     
    113121  SetRmsChargeLast();
    114122 
    115   SetAbsTimeNbins();
    116   SetAbsTimeFirst();
    117   SetAbsTimeLast();
     123  SetTimeLowerLimit();
     124  SetTimeUpperLimit();
    118125
    119126  fHGausHist.SetName("HCalibrationChargePINDiode");
     
    159166//
    160167// Gets or creates the pointers to:
     168// - MExtractedSignalPINDiode
    161169// - MCalibrationChargePINDiode
    162170//
     
    164172{
    165173 
     174  fSigPIN = (MExtractedSignalPINDiode*)pList->FindCreateObj("MExtractedSignalPINDiode");
     175  if (!fSigPIN)
     176  {
     177      *fLog << err << "MExtractedSignalPINDiode not found... aborting " << endl;
     178      return kFALSE;
     179  }
     180
    166181  fPINDiode = (MCalibrationChargePINDiode*)pList->FindCreateObj("MCalibrationChargePINDiode");
    167182  if (!fPINDiode)
     
    237252// - Rms Charge Sigma and Error
    238253//
     254// Performs one consistency check on the arrival time:
     255// The check returns kFALSE if:
     256//
     257// -The mean arrival time is in fTimeLowerLimit slices from the lower edge
     258//  and fUpperLimit slices from the upper edge
     259//
    239260Bool_t MHCalibrationChargePINDiode::Finalize()
    240261{
     
    262283  fPINDiode->SetRmsChargeSigma(    GetRmsChargeSigma()       );
    263284  fPINDiode->SetRmsChargeSigmaErr( GetRmsChargeSigmaErr()    );
     285
     286  const Byte_t  loweredge  = fSigPIN->GetFirstUsedSlice();
     287  const Byte_t  upperedge  = fSigPIN->GetLastUsedSlice();
     288  const Float_t lowerlimit = (Float_t)loweredge + fTimeLowerLimit;
     289  const Float_t upperlimit = (Float_t)upperedge + fTimeUpperLimit; 
     290
     291  if (GetAbsTimeMean() < lowerlimit)
     292    {
     293      *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in first " << fTimeLowerLimit
     294            << " extraction bin in PIN Diode " << endl;
     295      *fLog << GetAbsTimeMean() << "   " << lowerlimit << endl;
     296      return kFALSE;
     297    }
     298 
     299  if ( GetAbsTimeMean() > upperlimit )
     300    {
     301      *fLog << warn << GetDescriptor() << ": Mean ArrivalTime in last " << fTimeUpperLimit
     302            << " two extraction bins in PIN Diode " << endl;
     303      *fLog << GetAbsTimeMean() << "   " << upperlimit << endl;
     304      return kFALSE;
     305    }
    264306
    265307  return kTRUE;
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePINDiode.h

    r3639 r3696  
    88
    99class TH1F;
     10class MExtractedSignalPINDiode;
    1011class MCalibrationChargePINDiode;
    1112class MHCalibrationChargePINDiode : public MHCalibrationChargePix
     
    1314private:
    1415
     16  static const Axis_t  fgAbsTimeFirst;    //! Default for fAbsTimeFirst    (now set to: -0.5  )
     17  static const Axis_t  fgAbsTimeLast;     //! Default for fAbsTimeLast     (now set to: 29.5  )
     18  static const Int_t   fgAbsTimeNbins;    //! Default for fAbsTimeNBins    (now set to: 30    )
    1519  static const Int_t   fgChargeNbins;     //! Default for fNBins           (now set to: 200   )
    1620  static const Axis_t  fgChargeFirst;     //! Default for fFirst           (now set to: -0.5  )
     
    1923  static const Axis_t  fgRmsChargeFirst;  //! Default for fRmsChargeFirst  (now set to: 0.    )
    2024  static const Axis_t  fgRmsChargeLast;   //! Default for fRmsChargeLast   (now set to: 100.  )
    21   static const Int_t   fgAbsTimeNbins;    //! Default for fAbsTimeNBins    (now set to: 30    )
    22   static const Axis_t  fgAbsTimeFirst;    //! Default for fAbsTimeFirst    (now set to: -0.5  )
    23   static const Axis_t  fgAbsTimeLast;     //! Default for fAbsTimeLast     (now set to: 29.5  )
     25  static const Float_t fgTimeLowerLimit;  //! Default for fTimeLowerLimit    (now set to: 1.)
     26  static const Float_t fgTimeUpperLimit;  //! Default for fTimeUpperLimit    (now set to: 2.)
     27 
     28  MCalibrationChargePINDiode *fPINDiode;  //! Storage container of the results
     29  MExtractedSignalPINDiode   *fSigPIN;    //! Storage container of extracted signal
    2430
    25   MCalibrationChargePINDiode *fPINDiode; //! Storage container of the results
     31  TH1F fHRmsCharge;                       //  Histogram containing Variance of summed FADC slices
    2632
    27   TH1F fHRmsCharge;                      // Histogram containing Variance of summed FADC slices
    28 
    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
    32 
    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
    37 
     33  Axis_t  fRmsChargeFirst;                //  Lower bound bin used for the fHRmsCharge
     34  Axis_t  fRmsChargeLast;                 //  Upper bound bin used for the fHRmsCharge
     35  Int_t   fRmsChargeNbins;                //  Number of  bins used for the fHRmsCharge
     36  Float_t fRmsChargeMean;                 //  Mean of the Gauss fit               
     37  Float_t fRmsChargeMeanErr;              //  Error of the mean of the Gauss fit
     38  Float_t fRmsChargeSigma;                //  Sigma of the Gauss fit             
     39  Float_t fRmsChargeSigmaErr;             //  Error of the sigma of the Gauss fit
     40  Float_t fTimeLowerLimit;                //  Limit dist. to first signal slice (units: FADC slices)
     41  Float_t fTimeUpperLimit;                //  Limit dist. to last signal slice  (units: FADC slices)
     42 
    3843public:
    3944
     
    4449  Bool_t ReInit   (      MParList *pList);
    4550  Bool_t Fill     (const MParContainer *par, const Stat_t w=1);
    46   Bool_t Finalize();
    47 
    48   // Setters
    49   void SetAbsTimeNbins(const Int_t  bins =fgAbsTimeNbins)        { fAbsTimeNbins = bins;    }
    50   void SetAbsTimeFirst(const Axis_t first=fgAbsTimeFirst)        { fAbsTimeFirst = first;   }
    51   void SetAbsTimeLast( const Axis_t last =fgAbsTimeLast)         { fAbsTimeLast  = last;    }
    52 
    53   void SetRmsChargeNbins(const Int_t  bins =fgRmsChargeNbins)    { fRmsChargeNbins = bins;  }
    54   void SetRmsChargeFirst(const Axis_t first=fgRmsChargeFirst)    { fRmsChargeFirst = first; }
    55   void SetRmsChargeLast( const Axis_t last =fgRmsChargeLast)     { fRmsChargeLast  = last;  }
    56 
     51  Bool_t Finalize ();
     52 
     53  // Draw
     54  void Draw(Option_t *opt="");
     55 
    5756  // Getters
    58   TH1F *GetHRmsCharge()                        { return &fHRmsCharge;  }
    59   const TH1F *GetHRmsCharge()            const { return &fHRmsCharge;  }
    60 
    61   Float_t  GetRmsChargeMean()            const { return fRmsChargeMean; }
    62   Float_t  GetRmsChargeMeanErr()         const { return fRmsChargeMeanErr; }
    63   Float_t  GetRmsChargeSigma()           const { return fRmsChargeSigma; }
    64   Float_t  GetRmsChargeSigmaErr()        const { return fRmsChargeSigmaErr; }
     57        TH1F *GetHRmsCharge()                  { return &fHRmsCharge;       }
     58  const TH1F *GetHRmsCharge()            const { return &fHRmsCharge;       }
     59  Float_t     GetRmsChargeMean()         const { return fRmsChargeMean;     }
     60  Float_t     GetRmsChargeMeanErr()      const { return fRmsChargeMeanErr;  }
     61  Float_t     GetRmsChargeSigma()        const { return fRmsChargeSigma;    }
     62  Float_t     GetRmsChargeSigmaErr()     const { return fRmsChargeSigmaErr; }
    6563
    6664  // Fill histos
     
    7068  Bool_t FitRmsCharge(Option_t *option="RQ0");
    7169
    72   // Draw
    73   void Draw(Option_t *opt="");
    74  
     70  // Setters
     71  void SetAbsTimeNbins   ( const Int_t   bins =fgAbsTimeNbins   ) { fAbsTimeNbins   = bins;  }
     72  void SetAbsTimeFirst   ( const Axis_t  first=fgAbsTimeFirst   ) { fAbsTimeFirst   = first; }
     73  void SetAbsTimeLast    ( const Axis_t  last =fgAbsTimeLast    ) { fAbsTimeLast    = last;  }
     74  void SetRmsChargeNbins ( const Int_t   bins =fgRmsChargeNbins ) { fRmsChargeNbins = bins;  }
     75  void SetRmsChargeFirst ( const Axis_t  first=fgRmsChargeFirst ) { fRmsChargeFirst = first; }
     76  void SetRmsChargeLast  ( const Axis_t  last =fgRmsChargeLast  ) { fRmsChargeLast  = last;  }
     77  void SetTimeLowerLimit ( const Float_t f=fgTimeLowerLimit     ) { fTimeLowerLimit = f;     }
     78  void SetTimeUpperLimit ( const Float_t f=fgTimeUpperLimit     ) { fTimeUpperLimit = f;     }
     79
    7580  ClassDef(MHCalibrationChargePINDiode, 1)  // Histogram class for Charge PIN Diode Calibration
    7681};
Note: See TracChangeset for help on using the changeset viewer.