Changeset 3644


Ignore:
Timestamp:
04/04/04 19:06:45 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3643 r3644  
    2020
    2121 2004/04/02: Markus Gaug
     22
     23   * mcalib/MCalibrationQEPix.[h,cc]
     24   * mcalib/MCalibrationQECam.[h,cc]
     25   * mcalib/MCalibrationRelTimeCam.[h,cc]
     26   * mcalib/MCalibrationRelTimePix.[h,cc]
     27     - updated and enlarged documentation
     28
     29
    2230   * mcalib/MHGausEvents.[h,cc]
    2331   * mcalib/MHPedestalPix.[h,cc]
     
    159167   * mcalib/MHCalibrationChargeBlindPix.[h,cc]
    160168   * mcalib/MHCalibrationChargePINDiode.[h,cc]
     169   * mcalib/MHCalibrationRelTimeCam.[h,cc]
    161170   * mcalib/MHCalibrationRelTimePix.[h,cc]
    162171   * mcalib/MHPedestalPix.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r3638 r3644  
    378378    {
    379379
    380       MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i];
    381       MCalibrationQEPix     &pqe = (*fQECam)    [i];
     380      MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)  [i];
     381      MCalibrationQEPix     &pqe = (MCalibrationQEPix&)    (*fQECam)[i];
    382382      MBadPixelsPix         &bad = (*fBadPixels)[i];
    383383
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.cc

    r3635 r3644  
    7373  SetHiGainSaturation  ( kFALSE );
    7474  SetExcluded          ( kFALSE );
     75  SetValid             ( kFALSE );
    7576
    7677}
     
    9394{
    9495    b ?  SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded);
     96}
     97
     98// --------------------------------------------------------------------------
     99//
     100// Set the Valid Bit from outside
     101//
     102void MCalibrationPix::SetValid(Bool_t b )
     103{
     104    b ?  SETBIT(fFlags, kValid) : CLRBIT(fFlags, kValid);
    95105}
    96106
     
    119129
    120130
     131Bool_t MCalibrationPix::IsHiGainSaturation()    const
     132{
     133   return TESTBIT(fFlags,kHiGainSaturation); 
     134}
     135
    121136Bool_t MCalibrationPix::IsExcluded()     const
    122137{
     
    124139}
    125140
    126 Bool_t MCalibrationPix::IsHiGainSaturation()    const
     141Bool_t MCalibrationPix::IsValid()     const
    127142{
    128    return TESTBIT(fFlags,kHiGainSaturation); 
     143   return TESTBIT(fFlags,kValid); 
    129144}
    130145
  • trunk/MagicSoft/Mars/mcalib/MCalibrationPix.h

    r3635 r3644  
    2929  Float_t fLoGainNumPickup;   // The number of pickup events in the low-gain
    3030
    31   enum  { kHiGainSaturation, kExcluded };
     31  enum  { kHiGainSaturation, kExcluded, kValid };
    3232 
    3333public:
     
    6262  void SetNumPickup  ( const Float_t f ) { IsHiGainSaturation() ? fLoGainNumPickup = f  : fHiGainNumPickup = f ; }
    6363 
     64  void SetExcluded        ( const Bool_t  b = kTRUE );
    6465  void SetHiGainSaturation( const Bool_t  b = kTRUE );
    65   void SetExcluded        ( const Bool_t  b = kTRUE );
     66  void SetValid           ( const Bool_t  b = kTRUE );
    6667
    6768  // Getters
     
    8990  Int_t   GetPixId      () const { return fPixId ;  }
    9091
     92  Bool_t  IsHiGainSaturation() const;
    9193  Bool_t  IsExcluded()         const;
    92   Bool_t  IsHiGainSaturation() const;
     94  Bool_t  IsValid   ()        const;
    9395
    9496  ClassDef(MCalibrationPix, 1)  // Container for Calibration of one pixel
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.cc

    r3321 r3644  
    2828// MCalibrationQECam                                               
    2929//                                                               
    30 // Hold the calibrated QE information of the camera:
    31 //                                                               
    32 // 1) MCalibrationQECam initializes a TClonesArray whose elements are
    33 //    pointers to MCalibrationQEPix Containers
     30// Storage container for the calibrated Quantum Efficiency of the whole camera.
     31//
     32// Individual pixels have to be cast when retrieved e.g.:
     33// MCalibrationQEPix &avpix = (MCalibrationQEPix&)(*fQECam)[i]
     34//
     35// The following "calibration" constants can be retrieved from each pixel:
     36// - GetQE   ( const PulserColor_t color ): The mean quantum
     37//   efficiency obtained with the calibration pulser color (e.g. kGREEN, kBLUE, kUV)
     38// - GetQEErr( const PulserColor_t color ): The uncertainty
     39//   of the mean quantum efficiency.
     40//
     41// Averaged values over one whole area index (e.g. inner or outer pixels for
     42// the MAGIC camera), can be retrieved via:
     43// MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageArea(i)
     44//
     45// Averaged values over one whole camera sector can be retrieved via:
     46// MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageSector(i)
     47//
     48// Note the averageing has been done at the end of the calculation and NOT on an
     49// event-by-event basis (like in other classes deriving from MCalibrationCam).
     50//
     51// See also: MHCalibrationChargePix, MHCalibrationChargeCam, MCalibrationChargeCalc
     52//                                                                         
     53// The calculated values (types of GetPixelContent) are:
     54//
     55// 0: Mean Quantum Efficiency of the color: kCT1
     56// 1: Error of the Mean Quantum Efficiency of the color: kCT1
     57// 2: Mean Quantum Efficiency of the color: kGREEN
     58// 3: Error of the Mean Quantum Efficiency of the color: kGreen
     59// 4: Mean Quantum Efficiency of the color: kBLUE
     60// 5: Error of the Mean Quantum Efficiency of the color: kBlue
     61// 6: Mean Quantum Efficiency of the color: kUV
     62// 7: Error of the Mean Quantum Efficiency of the color: kUV
    3463//
    3564/////////////////////////////////////////////////////////////////////////////
     
    5180// Default constructor.
    5281//
    53 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry
    54 // Later, a call to MCalibrationQECam::InitSize(Int_t size) has to be performed
    55 //
    56 // Creates an MCalibrationBlindPix container
     82// Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
     83// to hold one container per pixel. Later, a call to MCalibrationQECam::InitSize()
     84// has to be performed (in MGeomApply).
    5785//
    5886MCalibrationQECam::MCalibrationQECam(const char *name, const char *title)
     
    6189    fTitle = title ? title : "Storage container for the calibrated Quantrum Efficiency of the camera";
    6290
    63     fPixels     = new TClonesArray("MCalibrationQEPix",1);
    64 
    65     Clear();
    66 }
    67 
    68 // --------------------------------------------------------------------------
    69 //
    70 MCalibrationQECam::~MCalibrationQECam()
    71 {
    72 
    73   //
    74   // delete fPixels should delete all Objects stored inside
    75   //
    76   delete fPixels;
    77 
    78 }
    79 
    80 // -------------------------------------------------------------------
    81 //
    82 void MCalibrationQECam::InitSize(const UInt_t i)
    83 {
    84   fPixels->ExpandCreate(i);
    85 }
    86 
    87 // --------------------------------------------------------------------------
    88 //
    89 // This function returns the current size of the TClonesArray
    90 // independently if the MCalibrationPix is filled with values or not.
    91 //
    92 // It is the size of the array fPixels.
    93 //
    94 Int_t MCalibrationQECam::GetSize() const
    95 {
    96   return fPixels->GetEntriesFast();
    97 }
    98 
    99 
    100 // --------------------------------------------------------------------------
    101 //
    102 // Get i-th pixel (pixel number)
    103 //
    104 MCalibrationQEPix &MCalibrationQECam::operator[](UInt_t i)
    105 {
    106   return *static_cast<MCalibrationQEPix*>(fPixels->UncheckedAt(i));
    107 }
    108 
    109 // --------------------------------------------------------------------------
    110 //
    111 // Get i-th pixel (pixel number)
    112 //
    113 const MCalibrationQEPix &MCalibrationQECam::operator[](UInt_t i) const
    114 {
    115   return *static_cast<MCalibrationQEPix*>(fPixels->UncheckedAt(i));
    116 }
    117 
    118 
    119 // --------------------------------------
    120 //
    121 void MCalibrationQECam::Clear(Option_t *o)
    122 {
    123 
    124   fPixels->ForEach(TObject, Clear)();
    125 
    126   return;
     91    fPixels           = new TClonesArray("MCalibrationQEPix",1);
     92    fAverageAreas     = new TClonesArray("MCalibrationQEPix",1);
     93    fAverageSectors   = new TClonesArray("MCalibrationQEPix",1);
     94
    12795}
    12896
     
    144112    {
    145113     
    146       if (!pix->IsExcluded() && pix->IsQEValid())
     114      if (!pix->IsExcluded() && pix->IsValid())
    147115        {
    148116            *fLog << all << "Pix " << pix->GetPixId()
     
    164132      {
    165133       
    166         if (!pix->IsExcluded() && !pix->IsQEValid())
     134        if (!pix->IsExcluded() && !pix->IsValid())
    167135          {
    168136            *fLog << all << "Pix " << pix->GetPixId()
     
    193161}
    194162
     163// --------------------------------------------------------------------
     164//                                                                         
     165// The calculated values (types) are:
     166//
     167// 0: Mean Quantum Efficiency of the color: kCT1
     168// 1: Error of the Mean Quantum Efficiency of the color: kCT1
     169// 2: Mean Quantum Efficiency of the color: kGREEN
     170// 3: Error of the Mean Quantum Efficiency of the color: kGreen
     171// 4: Mean Quantum Efficiency of the color: kBLUE
     172// 5: Error of the Mean Quantum Efficiency of the color: kBlue
     173// 6: Mean Quantum Efficiency of the color: kUV
     174// 7: Error of the Mean Quantum Efficiency of the color: kUV
    195175//
    196176Bool_t MCalibrationQECam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
     
    198178
    199179  if (idx > GetSize())
     180    return kFALSE;
     181
     182  MCalibrationQEPix &pix = (MCalibrationQEPix&)(*this)[idx];
     183
     184  if (pix.IsExcluded())
    200185    return kFALSE;
    201186
     
    203188    {
    204189    case 0:
    205       if ((*this)[idx].IsExcluded())
    206         return kFALSE;
    207       val = (*this)[idx].GetQE(kCT1);
     190      val = pix.GetQE(kCT1);
    208191      break;
    209192    case 1:
    210       if ((*this)[idx].IsExcluded())
    211         return kFALSE;
    212       val = (*this)[idx].GetQEErr(kCT1);
     193      val = pix.GetQEErr(kCT1);
     194      break;
     195    case 2:
     196      val = pix.GetQE(kGREEN);
     197      break;
     198    case 3:
     199      val = pix.GetQEErr(kGREEN);
     200      break;
     201    case 4:
     202      val = pix.GetQE(kBLUE);
     203      break;
     204    case 5:
     205      val = pix.GetQEErr(kBLUE);
     206      break;
     207    case 6:
     208      val = pix.GetQE(kUV);
     209      break;
     210    case 7:
     211      val = pix.GetQEErr(kUV);
    213212      break;
    214213    default:
     
    220219// --------------------------------------------------------------------------
    221220//
    222 // What MHCamera needs in order to draw an individual pixel in the camera
     221// Not yet implemented
    223222//
    224223void MCalibrationQECam::DrawPixelContent(Int_t idx) const
    225224{
    226     return;
    227 }
    228 
    229 
    230 
    231 
    232 
    233 
    234 
    235 
    236 
     225  return;
     226}
     227
     228
     229
     230
     231
     232
     233
     234
     235
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.h

    r3321 r3644  
    22#define MARS_MCalibrationQECam
    33
    4 #ifndef MARS_MParContainer
    5 #include "MParContainer.h"
    6 #endif
    7 #ifndef MARS_MCamEvent
    8 #include "MCamEvent.h"
     4#ifndef MARS_MCalibrationCam
     5#include "MCalibrationCam.h"
    96#endif
    107
    11 class TClonesArray;
    12 
    13 class MCalibrationQEPix;
    14 class MCalibrationQECam : public MParContainer, public MCamEvent
     8class MCalibrationQECam : public MCalibrationCam
    159{
    1610private:
    17  
    18   Int_t fNumPixels;
    19   TClonesArray *fPixels;                                        //-> Array of MCalibrationPix with fit results
    2011 
    2112public:
    2213
    2314  MCalibrationQECam(const char *name=NULL, const char *title=NULL);
    24   ~MCalibrationQECam();
    25  
    26   void Clear(    Option_t *o="" );
    27   void InitSize( const UInt_t i );
    28 
    29   // Getters
    30   Int_t  GetSize()               const;
    31   UInt_t GetNumPixels()          const { return fNumPixels; }
    32 
    33   // Others
    34   MCalibrationQEPix &operator[](UInt_t i);
    35   const MCalibrationQEPix &operator[](UInt_t i) const;
     15  ~MCalibrationQECam() {}
    3616 
    3717  // Prints
     
    4222  void DrawPixelContent(Int_t num) const;   
    4323
    44   ClassDef(MCalibrationQECam, 1)        // Container for calibration information of the camera
     24  ClassDef(MCalibrationQECam, 1)        // Container for Quantum Efficieny Calibration Results Camera
    4525};
    4626
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.cc

    r3321 r3644  
    2525/////////////////////////////////////////////////////////////////////////////
    2626//                                                                         //
    27 // MCalibrationChargePix                                                         //
     27// MCalibrationQEPix                                                       //
    2828//                                                                         //
    2929// Storage container of the calibrated Quantrum Efficiency of one pixel
     
    8989//
    9090MCalibrationQEPix::MCalibrationQEPix(const char *name, const char *title)
    91     : fPixId(-1)
    9291{
    9392
     
    105104void MCalibrationQEPix::Clear(Option_t *o)
    106105{
    107 
    108   SetExcluded               ( kFALSE );
    109   SetQEValid                ( kFALSE );
    110106
    111107  fQEGreen      =  -1.;
     
    119115  fQECT1Err     =  -1.;
    120116 
     117  MCalibrationPix::Clear();
     118
    121119}
    122120
     
    169167
    170168
    171 
    172 // --------------------------------------------------------------------------
    173 //
    174 // Set the Excluded Bit from outside
    175 //
    176 void MCalibrationQEPix::SetExcluded(Bool_t b )
    177 {
    178     b ?  SETBIT(fFlags, kExcluded) : CLRBIT(fFlags, kExcluded);
    179 }
    180 
    181 // --------------------------------------------------------------------------
    182 //
    183 // Set the Excluded Bit from outside
    184 //
    185 void MCalibrationQEPix::SetQEValid(Bool_t b )   
    186 {
    187   b ?  SETBIT(fFlags, kQEValid) : CLRBIT(fFlags, kQEValid);
    188 }
    189 
    190 
    191 Int_t MCalibrationQEPix::GetPixId()  const
    192 {
    193     return fPixId;
    194 }
    195 
    196169Float_t MCalibrationQEPix::GetQE(const PulserColor_t col )  const
    197170{
     
    240213}
    241214
    242 
    243 Bool_t MCalibrationQEPix::IsExcluded()            const
    244 {
    245    return TESTBIT(fFlags,kExcluded); 
    246 }
    247 
    248 
    249 Bool_t MCalibrationQEPix::IsQEValid()         const
    250 {
    251   return TESTBIT(fFlags, kQEValid); 
    252 }
    253 
    254 
     215// --------------------------------------------------------------
    255216//
    256217// The check return kTRUE if:
    257218//
    258 // 1) Pixel has a fitted charge greater than fQELimit*PedRMS
    259 // 2) Pixel has a fit error greater than fQEErrLimit
    260 // 3) Pixel has a fitted charge greater its fQERelErrLimit times its charge error
    261 // 4) Pixel has a charge sigma bigger than its Pedestal RMS
    262 //
     219// Not yet implemented!
     220//
    263221Bool_t MCalibrationQEPix::CheckQEValidity()
    264222{
    265223 
    266   SetQEValid();
     224  SetValid();
    267225  return kTRUE;
    268226}
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQEPix.h

    r3554 r3644  
    22#define MARS_MCalibrationQEPix
    33
    4 #ifndef MARS_MParContainer
    5 #include "MParContainer.h"
     4#ifndef MARS_MCalibrationPix
     5#include "MCalibrationPix.h"
    66#endif
    77
    8 class MCalibrationQEPix : public MParContainer
     8class MCalibrationQEPix : public MCalibrationPix
    99{
    1010private:
    1111
    12   Int_t fPixId;
    13 
    14   Float_t fQEGreen;
    15   Float_t fQEBlue;
    16   Float_t fQEUV;
    17   Float_t fQECT1;
     12  Float_t fQEGreen;          // The calibrated quantum efficiency at 520 nm
     13  Float_t fQEBlue;           // The calibrated quantum efficiency at 460 nm
     14  Float_t fQEUV;             // The calibrated quantum efficiency at 370 nm
     15  Float_t fQECT1;            // The calibrated quantum efficiency at 370 nm
    1816 
    19   Float_t fQEGreenErr;
    20   Float_t fQEBlueErr;
    21   Float_t fQEUVErr;
    22   Float_t fQECT1Err;   
     17  Float_t fQEGreenErr;       // The uncertainty about the calibrated QE at 520 nm
     18  Float_t fQEBlueErr;        // The uncertainty about the calibrated QE at 460 nm
     19  Float_t fQEUVErr;          // The uncertainty about the calibrated QE at 370 nm
     20  Float_t fQECT1Err;         // The uncertainty about the calibrated QE at 370 nm
    2321 
    24   Byte_t fFlags;
    25 
    26   enum { kExcluded, kQEValid };
    27 
    2822public:
    2923
     
    3731  void SetQEErr( const Float_t qeerr, const PulserColor_t col );
    3832
    39   void SetExcluded            (  const Bool_t b = kTRUE );
    40   void SetQEValid             (  const Bool_t b = kTRUE );
    41 
    4233  // Getters
    4334  Float_t GetQE   ( const PulserColor_t col )  const;
    4435  Float_t GetQEErr( const PulserColor_t col )  const;
    45   Int_t   GetPixId()          const;
    46 
    47   Bool_t IsExcluded()         const;
    48   Bool_t IsQEValid()          const;
    49 
    50   void SetPixId(const Int_t i)     { fPixId = i; }
    5136
    5237  // Miscellaneous
    5338  Bool_t CheckQEValidity();
    5439
    55   ClassDef(MCalibrationQEPix, 1)        // Container for calibrated Quantrum Efficieny of one pixel
     40  ClassDef(MCalibrationQEPix, 1)        // Container for Quantum Efficieny Calibration Results Pixel
    5641};
    5742
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.cc

    r3635 r3644  
    2727// MCalibrationRelTimeCam                                               
    2828//                                                               
    29 // Hold the whole Calibration results of the camera:
    30 //                                                               
    31 // 1) MCalibrationRelTimeCam initializes a TClonesArray whose elements are
    32 //    pointers to MCalibrationRelTimePix Containers
    33 //
     29// Storage container for relative arrival time calibration results         
     30// of the whole camera.
     31//
     32// Individual pixels have to be cast when retrieved e.g.:
     33// MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)(*fRelCam)[i]
     34//
     35// The following "calibration" constants can be retrieved from each pixel:
     36// - GetTimeOffset(): The mean offset in relative times,
     37//   has to be added to any calculated relative time in the camera.
     38// - GetTimePrecision(): The Gauss sigma of histogrammed relative arrival
     39//   times for the calibration run. Gives an estimate about the timing
     40//   resolution.
     41//
     42// ALL RELATIVE TIMES HAVE TO BE CALCULATED W.R.T. PIXEL IDX 1
     43// (HARDWARE NUMBER: 2) !!
     44//
     45// Averaged values over one whole area index (e.g. inner or outer pixels for
     46// the MAGIC camera), can be retrieved via:
     47// MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageArea(i)
     48//
     49// Averaged values over one whole camera sector can be retrieved via:
     50// MCalibrationRelTimePix &avpix = (MCalibrationRelTimePix&)fRelCam->GetAverageSector(i)
     51//
     52// Note the averageing has been done on an event-by-event basis. Resulting
     53// Sigma's of the Gauss fit have been multiplied with the square root of the number
     54// of involved pixels in order to make a direct comparison possible with the mean of
     55// sigmas.
     56//
     57// See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam             
     58//                                                                         
    3459// The calculated values (types of GetPixelContent) are:
    3560//
     
    3762// ==============
    3863//
    39 // 0: Fitted RelTime
    40 // 1: Error of fitted RelTime
    41 // 2: Sigma of fitted RelTime
    42 // 3: Error of Sigma of fitted RelTime
     64// 0: Mean Time Offset
     65// 1: Error of Mean Time Offset
     66// 2: Sigma of Time Offset == Time Resolution
     67// 3: Error of Sigma of Time Offset
    4368//
    4469// Useful variables derived from the fit results:
    4570// =============================================
    4671//
    47 // 4: Returned probability of Gauss fit to RelTime distribution
     72// 4: Returned probability of Gauss fit to Rel. Arrival Time distribution
    4873//
    4974/////////////////////////////////////////////////////////////////////////////
     
    6994// Default constructor.
    7095//
    71 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry
    72 // Later, a call to MCalibrationRelTimeCam::InitSize(Int_t size) has to be performed
    73 //
    74 // Creates an MCalibrationBlindPix container
     96// Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated
     97// to hold one container per pixel. Later, a call to MCalibrationRelTimeCam::InitSize()
     98// has to be performed (in MGeomApply).
     99//
     100// Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated
     101// to hold one container per pixel AREA. Later, a call to MCalibrationRelTimeCam::InitAreas()
     102// has to be performed (in MGeomApply).
     103//
     104// Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated
     105// to hold one container per camera SECTOR. Later, a call to MCalibrationRelTimeCam::InitSectors()
     106// has to be performed (in MGeomApply).
    75107//
    76108MCalibrationRelTimeCam::MCalibrationRelTimeCam(const char *name, const char *title)
     
    83115    fAverageSectors   = new TClonesArray("MCalibrationRelTimePix",1);
    84116
    85     Clear();
    86 
    87 }
    88 
    89 
    90 
    91 // --------------------------------------
    92 //
    93 void MCalibrationRelTimeCam::Clear(Option_t *o)
    94 {
    95 
    96   MCalibrationCam::Clear();
    97 
    98   CLRBIT(fFlags,kValid);
    99 
    100   return;
    101 }
    102 
    103 void MCalibrationRelTimeCam::SetValid(const Bool_t b)
    104 {
    105     b ? SETBIT(fFlags, kValid) : CLRBIT(fFlags, kValid);
    106 }
    107 
    108 
    109 Bool_t  MCalibrationRelTimeCam::IsValid()   const
    110 {
    111   return TESTBIT(fFlags,kValid);
    112117}
    113118
     
    115120//
    116121// Print first the well fitted pixels
    117 // and then the ones which are not FitValid
     122// and then the ones which are not Valid
    118123//
    119124void MCalibrationRelTimeCam::Print(Option_t *o) const
     
    254259// --------------------------------------------------------------------------
    255260//
    256 // What MHCamera needs in order to draw an individual pixel in the camera
     261// Calls MCalibrationPix::DrawClone()
    257262//
    258263void MCalibrationRelTimeCam::DrawPixelContent(Int_t idx) const
     
    261266}
    262267
    263 
    264 
    265 Bool_t MCalibrationRelTimeCam::GetConversion(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma)
    266 {
    267 
    268   MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*this)[ipx];
    269 
    270   mean  = pix.GetMeanConversion();
    271   err   = pix.GetConversionErr();
    272   sigma = pix.GetSigmaConversion();
    273 
    274   return kTRUE;
    275 }
    276 
    277 
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.h

    r3635 r3644  
    66#endif
    77
    8 class MCalibrationRelTimePix;
    9 class MBadPixelsPix;
    10 class MBadPixelsCam;
    118class MCalibrationRelTimeCam : public MCalibrationCam
    129{
    1310private:
    1411 
    15   enum  { kValid };
    16 
    1712public:
    1813
    1914  MCalibrationRelTimeCam(const char *name=NULL, const char *title=NULL);
    2015  ~MCalibrationRelTimeCam() {}
    21  
    22  
    23   void Clear(    Option_t *o="" );
    24 
    25   // Setters   
    26   void SetValid(    const Bool_t b = kTRUE );
    27 
    28   Bool_t  GetConversion(    Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma );
    29 
    30   Bool_t IsValid()   const;
    3116
    3217  // Prints
    3318  void Print(Option_t *o="") const;
    3419 
    35   // Draws
     20  // Others
     21  Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    3622  void DrawPixelContent(Int_t num) const;   
    3723 
    38   // Others
    39   Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    40 
    41   ClassDef(MCalibrationRelTimeCam, 1)   // Container for calibration of the camera
     24  ClassDef(MCalibrationRelTimeCam, 1)   // Container Rel. Arrival Time Calibration Results Camera
    4225};
    4326
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimePix.cc

    r3638 r3644  
    2525// MCalibrationRelTimePix                                                  //
    2626//                                                                         //
    27 // Storage container to hold informations about the calibrated arrival time//
    28 // value of one Pixel (PMT).                                               //
     27// Storage container for relative arrival time calibration results         //
     28// of one Pixel (PMT).                                                     //
     29// The following "calibration" constants can be retrieved:                 //
     30// - GetTimeOffset(): The mean offset in relative times,
     31//   has to be added to any calculated relative time in the camera.
     32// - GetTimePrecision(): The Gauss sigma of histogrammed relative arrival
     33//   times for the calibration run. Gives an estimate about the timing
     34//   resolution.
     35//
     36// ALL RELATIVE TIMES HAVE TO BE CALCULATED W.R.T. PIXEL IDX 1
     37// (HARDWARE NUMBER: 2) !!
     38//
     39// See also: MHCalibrationRelTimePix, MHCalibrationRelTimeCam              //
    2940//                                                                         //
    3041/////////////////////////////////////////////////////////////////////////////
     
    3647// --------------------------------------------------------------------------
    3748//
    38 // Default Constructor:
     49// Default Constructor
    3950//
    4051MCalibrationRelTimePix::MCalibrationRelTimePix(const char *name, const char *title)
    41     : fRelTimeFlags(0)
    4252{
    4353
    4454  fName  = name  ? name  : "MCalibrationRelTimePix";
    45   fTitle = title ? title : "Container of the fit results of MHCalibrationRelTimePixs ";
    46 
    47   Clear();
     55  fTitle = title ? title : "Results of MHCalibrationRelTimePix ";
    4856
    4957}
    5058
    51 // ------------------------------------------------------------------------
    52 //
    53 // Invalidate values
    54 //
    55 void MCalibrationRelTimePix::Clear(Option_t *o)
    56 {
    57 
    58   SetValid     ( kFALSE );
    59 
    60   fMeanConversion   =  -1.;
    61   fConversionVar    =  -1.;
    62   fSigmaConversion  =  -1.;
    63 
    64   MCalibrationPix::Clear();
    65 }
    66 
    67 
    68 // --------------------------------------------------------------------------
    69 //
    70 // Set the conversion factors from outside (only for MC)
    71 //
    72 void MCalibrationRelTimePix::SetConversion(Float_t c, Float_t err, Float_t sig)
    73 {
    74   fMeanConversion  = c;
    75   fConversionVar   = err*err;
    76   fSigmaConversion = sig;
    77 }
    78 
    79 
    80 // --------------------------------------------------------------------------
    81 //
    82 // Set the Excluded Bit from outside
    83 //
    84 void MCalibrationRelTimePix::SetValid(const Bool_t b )
    85 {
    86   b ?  SETBIT(fRelTimeFlags, kValid) : CLRBIT(fRelTimeFlags, kValid);
    87 }   
    88 
    89 
    90 Float_t MCalibrationRelTimePix::GetConversionErr()  const
    91 {
    92   if (fConversionVar < 0.)
    93     return -1.;
    94   return TMath::Sqrt(fConversionVar);
    95 }
    96 
    97 
    98 Bool_t MCalibrationRelTimePix::IsValid() const
    99 {
    100   return TESTBIT(fRelTimeFlags, kValid);
    101 }
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimePix.h

    r3638 r3644  
    1010private:
    1111
    12   Float_t fMeanConversion;     // The conversion factor to Phe's (F-factor method)
    13   Float_t fConversionVar;      // The error of the conversion factor to Phe's (F-factor method)
    14   Float_t fSigmaConversion;    // The sigma of conversion factor to Phe's (F-factor method)
    15 
    16   Byte_t fRelTimeFlags;        // The bit-field for the class-own bits
    17 
    18   enum  { kValid };             // The possible bits to be set
    19 
    2012public:
    2113
     
    2315  ~MCalibrationRelTimePix() {}
    2416 
    25   void Clear(Option_t *o="");
    26 
    27   // Conversion Factors
    28   void SetConversion   ( Float_t c, Float_t err, Float_t sig );
    29  
    30   // Setters
    31   void SetValid( const Bool_t b = kTRUE );
    32 
    33   Float_t GetMeanConversion()  const  { return fMeanConversion;  }
    34   Float_t GetConversionErr()   const;
    35   Float_t GetSigmaConversion() const  { return fSigmaConversion; }
    36 
    3717  Float_t GetTimeOffset()       const { return GetMean();        }
    3818  Float_t GetTimeOffsetErr()    const { return GetMeanErr();     }
     
    4020  Float_t GetTimePrecisionErr() const { return GetSigmaErr();    }
    4121
    42   Bool_t IsValid()              const;
    43 
    44   ClassDef(MCalibrationRelTimePix, 1)   // Container for Calibration of one pixel
     22  ClassDef(MCalibrationRelTimePix, 1)   // Container Rel. Arrival Time Calibration Results Pixel
    4523};
    4624
Note: See TracChangeset for help on using the changeset viewer.