Changeset 5864 for trunk/MagicSoft


Ignore:
Timestamp:
01/16/05 21:46:43 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5861 r5864  
    2424
    2525  * mhcalib/MHCalibrationCam.[h,cc]
    26     - finished event type recognition and rejection. Only used if
    27       SetInterlaced() is set.
     26  * mhcalib/MHCalibrationRelTimeCam.[h,cc]
     27  * mhcalib/MHCalibrationChargeCam.[h,cc]
     28    - put overflow management and results camera initialization into
     29      base class
    2830 
    2931  * mcalib/MCalibrateData.[h,cc]
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc

    r5858 r5864  
    8686using namespace std;
    8787
    88 const Int_t   MHCalibrationCam::fgPulserFrequency = 500;
    89 const Float_t MHCalibrationCam::fgProbLimit  = 0.0001;
     88const Int_t   MHCalibrationCam::fgPulserFrequency  = 500;
     89const Float_t MHCalibrationCam::fgProbLimit        = 0.0001;
     90const Float_t MHCalibrationCam::fgOverflowLimit    = 0.005;
    9091const TString MHCalibrationCam::gsHistName   = "Hist";
    9192const TString MHCalibrationCam::gsHistTitle  = "";
     
    106107// Initializes:
    107108// - fPulserFrequency to fgPulserFrequency
    108 // - fProbLimit to fgProbLimit
     109// - fProbLimit       to fgProbLimit
     110// - fOverflowLimit   to fgOverflowLimit
    109111//
    110112// - SetAveregeing  (kTRUE);
     
    143145    SetPulserFrequency();
    144146    SetProbLimit();
     147    SetOverflowLimit();
    145148
    146149    SetAverageing  (kTRUE);
     
    995998}
    996999
     1000// -------------------------------------------------------------
     1001//
     1002// - Searches for the CalibrationIntensity*Cam corresponding to 'name'.
     1003// - In case, it does not exist in the parameter list, it searches
     1004//   for the corresponding MCalibration*Cam.
     1005// - Initializes the MCalibration*Cam, if not yet done.
     1006//
     1007Bool_t MHCalibrationCam::InitCams( MParList *plist, const TString name )
     1008{
     1009
     1010  TString intensname = "MCalibrationIntensity";
     1011  intensname += name;
     1012  intensname += "Cam";
     1013
     1014  TString ordname    = "MCalibration";
     1015  ordname    += name;
     1016  ordname    += "Cam";
     1017
     1018  fIntensCam = (MCalibrationIntensityCam*)plist->FindObject(AddSerialNumber(intensname));
     1019  if (fIntensCam)
     1020    *fLog << inf << "Found " << intensname << "... " << endl;
     1021  else
     1022    {
     1023      fCam = (MCalibrationCam*)plist->FindObject(AddSerialNumber(ordname));
     1024      if (!fCam)
     1025        {
     1026          fCam = (MCalibrationCam*)plist->FindCreateObj(AddSerialNumber(ordname));
     1027          if (!fCam)
     1028            {
     1029              *fLog << err << "Cannot find nor create " << ordname << " ... abort." << endl;
     1030              return kFALSE;
     1031            }
     1032          fCam->Init(*fGeom);
     1033        }
     1034    }
     1035  return kTRUE;
     1036}
     1037
    9971038// --------------------------------------------------------------------------
    9981039//
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h

    r5863 r5864  
    4141private:
    4242
    43   static const Int_t   fgPulserFrequency; //! The default for fPulserFrequency (now set to: 500)
    44   static const Float_t fgProbLimit;       //! The default for fProbLimit (now set to: 0.0001) 
    45 
    46   static const TString gsHistName;        //! Default Histogram names
    47   static const TString gsHistTitle;       //! Default Histogram titles
    48   static const TString gsHistXTitle;      //! Default Histogram x-axis titles
    49   static const TString gsHistYTitle;      //! Default Histogram y-axis titles
     43  static const Int_t   fgPulserFrequency;  //! The default for fPulserFrequency (now set to: 500)
     44  static const Float_t fgProbLimit;        //! The default for fProbLimit (now set to: 0.0001) 
     45  static const Float_t fgOverflowLimit;    //! The default for fOverflowLimit (now at: 0.005)
     46 
     47  static const TString gsHistName;         //! Default Histogram names
     48  static const TString gsHistTitle;        //! Default Histogram titles
     49  static const TString gsHistXTitle;       //! Default Histogram x-axis titles
     50  static const TString gsHistYTitle;       //! Default Histogram y-axis titles
    5051 
    5152protected:
     
    5657 
    5758  Float_t fProbLimit;                     // Limit for acceptance of probability of Gauss-Fit
     59  Float_t fOverflowLimit;                 // Part of maximum allowed overflow events
    5860 
    5961  TString fHistName;                      //! Histogram names
     
    6466  Float_t fNumHiGainSaturationLimit;      // Rel. amount sat. higain FADC slices until pixel is called saturated
    6567  Float_t fNumLoGainSaturationLimit;      // Rel. amount sat. logain FADC slices until pixel is called saturated
    66   Float_t fNumOverflowLimit;              // Part of maximum allowed overflow events
    6768 
    6869  MArrayI fRunNumbers;                    // Numbers of runs used
     
    111112  virtual void   InitHiGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
    112113  virtual void   InitLoGainArrays( const Int_t npix, const Int_t nareas, const Int_t nsectors );
    113 
     114 
    114115  virtual void   ResetHistTitles();
    115116 
     
    138139                         MBadPixelsPix::UncalibratedType_t osctyp);
    139140
    140   void InitHists       ( MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i);
    141 
     141  void   InitHists     ( MHCalibrationPix &hist, MBadPixelsPix &bad, const Int_t i);
     142  Bool_t InitCams      ( MParList *plist, const TString name );
     143 
    142144  Bool_t IsAverageing  () const  { return TESTBIT(fFlags,kAverageing);   }
    143145  Bool_t IsDebug       () const  { return TESTBIT(fFlags,kDebug);        } 
     
    218220  void SetNumLoGainSaturationLimit( const Float_t lim )    { fNumLoGainSaturationLimit  = lim; }
    219221  void SetNumHiGainSaturationLimit( const Float_t lim )    { fNumHiGainSaturationLimit  = lim; }
    220   void SetNumOverflowLimit        ( const Float_t lim )    { fNumOverflowLimit          = lim; }
    221   void SetPulserFrequency         ( const Int_t f=fgPulserFrequency) { fPulserFrequency = f;  }
     222  void SetOverflowLimit        ( const Float_t f=fgOverflowLimit ) { fOverflowLimit = f; }
     223  void SetPulserFrequency      ( const Int_t   i=fgPulserFrequency )   { fPulserFrequency  = i; }
    222224 
    223225  ClassDef(MHCalibrationCam, 4) // Base Histogram class for Calibration Camera
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc

    r5137 r5864  
    156156{
    157157
     158  if (!InitCams(pList,"Blind"))
     159    return kFALSE;
     160
    158161  MExtractedSignalBlindPixel *signal =
    159162    (MExtractedSignalBlindPixel*)pList->FindObject(AddSerialNumber("MExtractedSignalBlindPixel"));
     
    163166      return kFALSE;
    164167  }
    165 
    166   fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityBlindCam"));
    167   if (fIntensCam)
    168     *fLog << inf << "Found MCalibrationIntensityBlindCam ... " << endl;
    169   else
    170     {
    171       fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationBlindCam"));
    172       if (!fCam)
    173         {
    174           fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationBlindCam"));
    175           if (!fCam)
    176             {
    177               *fLog << err << "Cannot find nor create MCalibrationBlindCam ... abort." << endl;
    178               return kFALSE;
    179             }
    180         }
    181     }
    182168
    183169  const Int_t nblindpixels = signal->GetNumBlindPixels();
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc

    r5773 r5864  
    172172const Float_t MHCalibrationChargeCam::fgNumHiGainSaturationLimit = 0.01;
    173173const Float_t MHCalibrationChargeCam::fgNumLoGainSaturationLimit = 0.005;
    174 const Float_t MHCalibrationChargeCam::fgNumOverflowLimit         = 0.005;
    175174const Float_t MHCalibrationChargeCam::fgTimeLowerLimit           = 1.;
    176175const Float_t MHCalibrationChargeCam::fgTimeUpperLimit           = 2.;
     
    220219  SetNumHiGainSaturationLimit(fgNumHiGainSaturationLimit);
    221220  SetNumLoGainSaturationLimit(fgNumLoGainSaturationLimit);
    222   SetNumOverflowLimit(fgNumOverflowLimit);
    223221
    224222  SetTimeLowerLimit();
     
    361359  }
    362360
    363   fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityChargeCam"));
    364   if (fIntensCam)
    365     *fLog << inf << "Found MCalibrationIntensityChargeCam ... " << endl;
    366   else
    367     {
    368       fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam"));
    369       if (!fCam)
    370         {
    371           fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationChargeCam"));
    372           if (!fCam)
    373             {
    374               *fLog << err << "Cannot find nor create MCalibrationChargeCam ... abort." << endl;
    375               return kFALSE;
    376             }
    377           fCam->Init(*fGeom);
    378         }
    379     }
     361  if (!InitCams(pList,"Charge"))
     362    return kFALSE;
    380363
    381364  fFirstHiGain = signal->GetFirstUsedSliceHiGain();
     
    383366  fFirstLoGain = signal->GetFirstUsedSliceLoGain();
    384367  fLastLoGain  = signal->GetLastUsedSliceLoGain();
    385 
    386   /*
    387   const Float_t numhigain = signal->GetNumUsedHiGainFADCSlices();
    388   const Float_t numlogain = signal->GetNumUsedLoGainFADCSlices(); 
    389 
    390   if (fCam)
    391     {
    392       if (fCam->GetNumHiGainFADCSlices() == 0.)
    393         fCam->SetNumHiGainFADCSlices ( numhigain );
    394       else if (fCam->GetNumHiGainFADCSlices() != numhigain)
    395         {
    396           *fLog << err << GetDescriptor()
    397                 << ": Number of High Gain FADC extraction slices has changed, abort..." << endl;
    398           return kFALSE;
    399         }
    400      
    401       if (fCam->GetNumLoGainFADCSlices() == 0.)
    402         fCam->SetNumLoGainFADCSlices ( numlogain );
    403       else if (fCam->GetNumLoGainFADCSlices() != numlogain)
    404         {
    405           *fLog << err << GetDescriptor()
    406                 << ": Number of Low Gain FADC extraction slices has changes, abort..." << endl;
    407           return kFALSE;
    408         }
    409     }
    410   */
    411368
    412369  const Int_t npixels  = fGeom->GetNumPixels();
     
    928885
    929886      Stat_t overflow = h->GetBinContent(h->GetNbinsX()+1);
    930       if (overflow > fNumOverflowLimit*histhi.GetHGausHist()->GetEntries())
     887      if (overflow > fOverflowLimit*histhi.GetHGausHist()->GetEntries())
    931888        {
    932889          *fLog << warn
     
    937894
    938895      overflow = h->GetBinContent(0);
    939       if (overflow >  fNumOverflowLimit*histhi.GetHGausHist()->GetEntries())
     896      if (overflow >  fOverflowLimit*histhi.GetHGausHist()->GetEntries())
    940897        {
    941898          *fLog << warn
     
    970927
    971928        Stat_t overflow = h->GetBinContent(h->GetNbinsX()+1);
    972         if (overflow >  fNumOverflowLimit*histlo.GetHGausHist()->GetEntries())
     929        if (overflow >  fOverflowLimit*histlo.GetHGausHist()->GetEntries())
    973930          {
    974931              *fLog << warn
     
    979936
    980937        overflow = h->GetBinContent(0);
    981         if (overflow > fNumOverflowLimit*histlo.GetHGausHist()->GetEntries())
     938        if (overflow > fOverflowLimit*histlo.GetHGausHist()->GetEntries())
    982939          {
    983940            *fLog << warn
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.h

    r5773 r5864  
    4444  static const Float_t fgNumHiGainSaturationLimit;   //! The default for fNumHiGainSaturationLimit (now at: 0.01)
    4545  static const Float_t fgNumLoGainSaturationLimit;   //! The default for fNumLoGainSaturationLimit (now at: 0.005)
    46   static const Float_t fgNumOverflowLimit;           //! The default for fNumOverflowLimit         (now at: 0.005)
    4746
    4847  static const Float_t fgTimeLowerLimit;             //! Default for fTimeLowerLimit    (now set to: 1.)
     
    5857  Axis_t  fLoGainLast;                               // Upper histogram limit low gain 
    5958
    60   Float_t fNumOverflowLimit;                         // Part of maximum allowed overflow events
    61  
    6259  TString fAbsHistName;                              // Histogram names abs.times
    6360  TString fAbsHistTitle;                             // Histogram titles abs. times
     
    117114  void SetLoGainLast        ( const Axis_t f )       { fLoGainLast    = f; } 
    118115
    119   void SetNumOverflowLimit ( const Float_t f=fgNumOverflowLimit ) { fNumOverflowLimit = f; }
    120  
    121116  void SetTimeLowerLimit    ( const Float_t f=fgTimeLowerLimit ) { fTimeLowerLimit = f; }
    122117  void SetTimeUpperLimit    ( const Float_t f=fgTimeUpperLimit ) { fTimeUpperLimit = f; }
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationHiLoCam.cc

    r5749 r5864  
    253253{
    254254
    255   fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityHiLoCam"));
    256   if (fIntensCam)
    257     *fLog << inf << "Found MCalibrationIntensityHiLoCam ... " << endl;
    258   else
    259     {
    260       fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationHiLoCam"));
    261       if (!fCam)
    262         {
    263           fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationHiLoCam"));
    264           if (!fCam)
    265             {
    266               *fLog << err << "Cannot find nor create MCalibrationHiLoCam ... abort." << endl;
    267               return kFALSE;
    268             }
    269           fCam->Init(*fGeom);
    270         }
    271     }
     255  if (!InitCams(pList,"HiLo"))
     256    return kFALSE;
    272257
    273258  MExtractedSignalCam *signal = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
     
    544529 
    545530  Stat_t overflow = hist->GetBinContent(hist->GetNbinsX()+1);
    546   if (overflow > 0.0005*hist->GetEntries())
     531  if (overflow > fOverflowLimit*hist->GetEntries())
    547532    {
    548533      *fLog << warn << "Hist-overflow " << overflow
    549             << " times in " << pix.GetName() << " (w/o saturation!) " << endl;
     534            << " times in " << pix.GetName() << endl;
    550535    }
    551536 
    552537  overflow = hist->GetBinContent(0);
    553   if (overflow > 0.0005*hist->GetEntries())
     538  if (overflow > fOverflowLimit*hist->GetEntries())
    554539    {
    555540      *fLog << warn << "Hist-underflow " << overflow
    556             << " times in " << pix.GetName() << " (w/o saturation!) " << endl;
    557     }
    558 }
    559 
     541            << " times in " << pix.GetName() << endl;
     542    }
     543}
     544
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc

    r5863 r5864  
    130130const Axis_t  MHCalibrationRelTimeCam::fgLast       =  5.;
    131131const Float_t MHCalibrationRelTimeCam::fgProbLimit  = 0.;
    132 const Float_t MHCalibrationRelTimeCam::fgNumOverflowLimit = 0.005;
    133132const TString MHCalibrationRelTimeCam::gsHistName   = "RelTime";
    134133const TString MHCalibrationRelTimeCam::gsHistTitle  = "Rel. Arr. Times";
     
    164163  SetLast (fgLast );
    165164
    166   SetNumOverflowLimit(fgNumOverflowLimit);
    167165  SetProbLimit(fgProbLimit);
    168166
     
    254252{
    255253
    256   fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityRelTimeCam"));
    257   if (fIntensCam)
    258     *fLog << inf << "Found MCalibrationIntensityRelTimeCam ... " << endl;
    259   else
    260     {
    261       fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCam"));
    262       if (!fCam)
    263         {
    264           fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationRelTimeCam"));
    265           if (!fCam)
    266             {
    267               *fLog << err << "Cannot find nor create MCalibrationRelTimeCam ... abort." << endl;
    268               return kFALSE;
    269             }
    270           fCam->Init(*fGeom);
    271         }
    272     }
     254  if (!InitCams(pList,"RelTime"))
     255    return kFALSE;
    273256
    274257  MArrivalTimeCam *signal = (MArrivalTimeCam*)pList->FindObject("MArrivalTimeCam");
     
    681664 
    682665  Stat_t overflow = hist->GetBinContent(hist->GetNbinsX()+1);
    683   if (overflow > fNumOverflowLimit*hist->GetEntries())
     666  if (overflow > fOverflowLimit*hist->GetEntries())
    684667    {
    685668      *fLog << warn << "HiGain Hist-overflow " << overflow
     
    688671 
    689672  overflow = hist->GetBinContent(0);
    690   if (overflow > fNumOverflowLimit*hist->GetEntries())
     673  if (overflow > fOverflowLimit*hist->GetEntries())
    691674    {
    692675      *fLog << warn << "HiGain Hist-underflow " << overflow
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.h

    r5863 r5864  
    2222
    2323  static const Float_t fgNumHiGainSaturationLimit;   //! The default for fNumHiGainSaturationLimit (now at: 0.25)
    24   static const Float_t fgNumOverflowLimit;           //! The default for fNumOverflowLimit         (now at: 0.005)
    2524  static const UInt_t  fgReferencePixel;             //! Default for fReferencePixel   (now set to: 1)
    2625  static const Int_t   fgNbins;                      //! Default number of bins        (now set to: 900   )
  • trunk/MagicSoft/Mars/mhcalib/Makefile

    r5850 r5864  
    2121INCLUDES = -I. -I../mbase  -I../mgui -I../mgeom -I../mhbase -I../mcalib \
    2222           -I../manalysis -I../mraw -I../mtools -I../mmc -I../mhist  \
    23            -I../mimage -I../msignal -I../mbadpixels -I../mpedestal \
    24            -I../mtrigger
     23           -I../mimage -I../msignal -I../mbadpixels -I../mpedestal
    2524
    2625# mhbase:    MBinning MH
Note: See TracChangeset for help on using the changeset viewer.