Changeset 3694


Ignore:
Timestamp:
04/09/04 13:33:02 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r3678 r3694  
    212212// independently if the MCalibrationPix is filled with values or not.
    213213//
    214 Int_t MCalibrationCam::GetSize() const
     214const Int_t MCalibrationCam::GetSize() const
    215215{
    216216  return fPixels->GetEntriesFast();
     
    222222// independently if the MCalibrationPix is filled with values or not.
    223223//
    224 Int_t MCalibrationCam::GetAverageAreas() const
     224const Int_t MCalibrationCam::GetAverageAreas() const
    225225{
    226226  return fAverageAreas->GetEntriesFast();
     
    232232// independently if the MCalibrationPix is filled with values or not.
    233233//
    234 Int_t MCalibrationCam::GetAverageSectors() const
     234const Int_t MCalibrationCam::GetAverageSectors() const
    235235{
    236236  return fAverageSectors->GetEntriesFast();
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h

    r3678 r3694  
    3939  ~MCalibrationCam();
    4040 
    41   virtual void Clear      ( Option_t *o=""               );
     41  virtual void Clear           ( Option_t *o="");
     42  virtual void DrawPixelContent( Int_t num) const;   
    4243
    43   void Init               ( const MGeomCam &geom         );
    44   void InitSize           ( const UInt_t i               );
    45   void InitAverageAreas   ( const UInt_t i               );
    46   void InitAverageSectors ( const UInt_t i               );
    47 
    48   void SetPulserColor     ( const PulserColor_t col=kCT1)  { fPulserColor = col; }
    49  
    5044  // Getters
    51   Int_t   GetSize()               const;
    52   Int_t   GetAverageAreas()       const;
    53   Int_t   GetAverageSectors()     const; 
    54 
     45  const Int_t            GetAverageAreas     ()           const;
    5546        MCalibrationPix &GetAverageArea      ( UInt_t i );
    5647  const MCalibrationPix &GetAverageArea      ( UInt_t i ) const;
     
    6051  const MBadPixelsPix   &GetAverageBadSector ( UInt_t i ) const;
    6152        MCalibrationPix &GetAverageSector    ( UInt_t i );
     53  const Int_t            GetAverageSectors   ()           const; 
    6254  const MCalibrationPix &GetAverageSector    ( UInt_t i ) const;
     55  virtual Bool_t         GetPixelContent     ( Double_t &val, Int_t idx,
     56                                               const MGeomCam &cam, Int_t type=0) const;
     57  const PulserColor_t    GetPulserColor()                 const { return fPulserColor; }
     58  const Int_t            GetSize()                        const;
     59
    6360        MCalibrationPix &operator[]          ( UInt_t i );
    6461  const MCalibrationPix &operator[]          ( UInt_t i ) const;
    6562
    66   const PulserColor_t    GetPulserColor()                 const { return fPulserColor; }
     63  // Inits
     64  void  Init               ( const MGeomCam &geom       );
     65  void  InitSize           ( const UInt_t i             );
     66  void  InitAverageAreas   ( const UInt_t i             );
     67  void  InitAverageSectors ( const UInt_t i             );
    6768
    68   virtual Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    69   virtual void DrawPixelContent(Int_t num) const;   
    70 
     69  // Setters
     70  void  SetPulserColor     ( const PulserColor_t col=kCT1 )  { fPulserColor = col; }
     71 
    7172  ClassDef(MCalibrationCam, 1)  // Base class Container for Calibration Results Camera
    7273};
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3693 r3694  
    290290{
    291291 
    292     SETBIT(fFlags, kUseQualityChecks);
    293     SETBIT(fFlags, kHiLoGainCalibration);
    294 
    295292    fNumHiGainSamples        = 0.;
    296293    fNumLoGainSamples        = 0.;
    297294    fSqrtHiGainSamples       = 0.;
    298295    fSqrtLoGainSamples       = 0.;
    299     SkipQualityChecks      ( kFALSE );
    300296    SkipHiLoGainCalibration( kFALSE );   
    301297}
    302298
    303299
    304 // --------------------------------------------------------------------------
    305 //
    306 // The PreProcess searches for the following input containers:
    307 //  - MRawEvtData
     300// -----------------------------------------------------------------------------------
     301//
     302// The following container are searched for and execution aborted if not in MParList:
    308303//  - MPedestalCam
    309304//  - MExtractedSignalCam
    310 //  - MExtractedSignalBlindPixel
    311 //  - MExtractedSignalPINDiode
    312 //
    313 // The following output containers are also searched and created if
    314 // they were not found:
    315 //
    316305//  - MCalibrationChargeCam
     306//
     307// The following containers are searched and created if they were not found:
     308//
    317309//  - MCalibrationQECam
    318 //
    319 // The following output containers are only searched, but not created
    320 //
     310//  - MBadPixelsCam
     311//
     312// The following output containers are only searched,  but not created. If they
     313// cannot be found, the corresponding calibration part is only skipped.
     314//
     315//  - MExtractedSignalBlindPixel and MCalibrationChargeBlindPix
     316//  - MExtractedSignalPINDiode   and MCalibrationChargePINDiode
    321317//  - MTime
    322318//
    323 // Sets the pulser colour in MCalibrationChargeCam
     319// Sets the pulser colour in:
     320//
     321// - MCalibrationChargeCam
     322// - MCalibrationChargeBlindPix
     323// - MCalibrationChargePINDiode
    324324//
    325325Int_t MCalibrationChargeCalc::PreProcess(MParList *pList)
    326326{
    327327 
     328  //
     329  // Containers that have to be there.
     330  //
    328331  fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
    329332  if (!fPedestals)
     
    340343    }
    341344 
     345  fCam = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam");
     346  if (!fCam)
     347    {
     348      *fLog << err << "Cannot find MCalibrationChargeCam... aborting" << endl;
     349      *fLog << err << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl;
     350      return kFALSE;
     351    }
     352
     353  //
     354  // Containers that are created in case that they are not there.
     355  //
     356  fQECam = (MCalibrationQECam*)pList->FindCreateObj("MCalibrationQECam");
     357  if (!fQECam)
     358    {
     359      *fLog << err << "Cannot find nor create MCalibrationQECam... aborting" << endl;
     360      return kFALSE;
     361    }
     362
     363  fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
     364  if (!fBadPixels)
     365    {
     366      *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl;
     367      return kFALSE;
     368    }
     369
     370  //
     371  // Optional Containers
     372  //
    342373  fSigBlind = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");
    343374  if (!fSigBlind)
     
    351382          return kFALSE;
    352383        }
    353       fBlindPixel->SetColor( fPulserColor );
    354384    }
    355385 
     
    365395          return kFALSE;
    366396        }
    367       fPINDiode->SetColor( fPulserColor );
    368     }
    369  
    370   fCam = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam");
    371   if (!fCam)
    372     {
    373       *fLog << err << "Cannot find nor create MCalibrationChargeCam... aborting" << endl;
    374       return kFALSE;
    375     }
    376 
     397    }
     398 
     399  fEvtTime = (MTime*)pList->FindObject("MTime");
     400 
     401  //
     402  // Initialize the pulser colours
     403  //
    377404  fCam->SetPulserColor( fPulserColor );
    378405
    379   fQECam = (MCalibrationQECam*)pList->FindCreateObj("MCalibrationQECam");
    380   if (!fQECam)
    381     {
    382       *fLog << err << "Cannot find nor create MCalibrationQECam... aborting" << endl;
    383       return kFALSE;
    384     }
    385  
    386   fEvtTime = (MTime*)pList->FindObject("MTime");
     406  if (fBlindPixel)
     407    fBlindPixel->SetColor( fPulserColor );
     408 
     409  if (fPINDiode)
     410    fPINDiode->SetColor( fPulserColor );
    387411 
    388412  return kTRUE;
     
    393417//
    394418// The ReInit searches for the following input containers:
    395 //  - MRawRunHeader
    396419//  - MGeomCam
    397 //  - MBadPixelsCam
    398420//
    399421// It retrieves the following variables from MExtractedSignalCam:
    400422//
    401 //  fNumHiGainSamples
    402 //  fNumLoGainSamples
    403 //
    404 //  fFirstUsedSliceHiGain
    405 //  fLastUsedSliceHiGain
    406 //  fFirstUsedSliceLoGain
    407 //  fLastUsedSliceLoGain
    408 //
    409 // It defines the PixId of every pixel in MCalibrationChargeCam and MCalibrationQECam
    410 // It sets all pixels excluded which have the flag fBadBixelsPix::IsBad() set.
     423//  - fNumHiGainSamples
     424//  - fNumLoGainSamples
     425//
     426// It defines the PixId of every pixel in:
     427//
     428// - MCalibrationChargeCam
     429// - MCalibrationQECam
     430//
     431// It sets all pixels in excluded which have the flag fBadBixelsPix::IsBad() set in:
     432//
     433// - MCalibrationChargePix
     434// - MCalibrationQEPix
     435//
     436// It tests the pulser colour one more time...
    411437//
    412438Bool_t MCalibrationChargeCalc::ReInit(MParList *pList )
     
    420446    }
    421447 
    422   fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
    423   if (!fBadPixels)
    424     {
    425       *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl;
    426       return kFALSE;
    427     }
    428 
    429448  fNumHiGainSamples  =  fSignals->GetNumUsedHiGainFADCSlices();
    430449  fNumLoGainSamples  =  fSignals->GetNumUsedLoGainFADCSlices();
     
    436455  for (UInt_t i=0; i<npixels; i++)
    437456    {
    438 
     457     
    439458      MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)  [i];
    440459      MCalibrationQEPix     &pqe = (MCalibrationQEPix&)    (*fQECam)[i];
    441460      MBadPixelsPix         &bad = (*fBadPixels)[i];
    442 
     461     
    443462      pix.SetPixId(i);
    444463      pqe.SetPixId(i);
    445 
     464     
    446465      if (bad.IsBad())
    447       {
     466        {
    448467          pix.SetExcluded();
    449468          pqe.SetExcluded();
    450469          continue;
    451       }
    452 
    453     }
    454 
    455     return kTRUE;
    456 }
    457 
     470        }
     471     
     472    }
     473
     474  if (fPulserColor != fCam->GetPulserColor())
     475    {
     476      *fLog << err << GetDescriptor() << ": Pulser colour has changed w.r.t. last file."
     477            << "This feature is not yet implemented, sorry ... aborting " << endl;
     478      return kFALSE;
     479    }
     480 
     481
     482  return kTRUE;
     483}
    458484
    459485// ----------------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h

    r3693 r3694  
    8282
    8383  // enums
    84   enum  { kUseQualityChecks, kHiLoGainCalibration };
     84  enum  { kHiLoGainCalibration };
    8585
    8686  // functions
     
    124124  void SkipHiLoGainCalibration ( const Bool_t b=kTRUE )
    125125      { b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration); }
    126   void SkipQualityChecks       ( const Bool_t b=kTRUE)
    127       { b ? CLRBIT(fFlags, kUseQualityChecks)    : SETBIT(fFlags, kUseQualityChecks);    }
    128126
    129127  ClassDef(MCalibrationChargeCalc, 1)   // Task calculating Calibration Containers and Quantum Efficiencies
Note: See TracChangeset for help on using the changeset viewer.