Ignore:
Timestamp:
09/14/04 20:56:15 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcalib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.h

    r4986 r5018  
    88class MCalibrationBlindCam : public MCalibrationCam
    99{
    10 public:
     10private:
     11
     12  void Add(const UInt_t a, const UInt_t b);
     13
     14 public:
    1115
    1216  MCalibrationBlindCam(Int_t nblind=1,const char *name=NULL, const char *title=NULL);
     
    1822  void  InitSize ( const UInt_t n );
    1923 
    20   ClassDef(MCalibrationBlindCam, 1) // Container Blind Pixels Calibration Results Camera
     24  ClassDef(MCalibrationBlindCam, 2) // Container Blind Pixels Calibration Results Camera
    2125};
    2226
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r4986 r5018  
    2929// Base class for Camera Calibration results.
    3030//
    31 // Contains TClonesArrays for the following objects:
     31// Contains TObjArrays for the following objects:
    3232// - fPixels:         Array of classes derived from MCalibrationPix, one entry
    3333//                    per pixel. Has to be created
     
    4242//                    per camera SECTOR. Is created automatically.
    4343//
    44 // All TClonesArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply):
     44// All TObjArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply):
    4545// - InitSize()
    4646// - InitAverageAreas()
     
    5050#include "MCalibrationCam.h"
    5151
    52 #include <TClonesArray.h>
     52#include <TObjArray.h>
    5353
    5454#include "MGeomCam.h"
     
    7979// - fNumLoGainFADCSlices to 0.
    8080//
    81 // Creates a TClonesArray of MBadPixelsPix containers for the TClonesArray's:
     81// Creates a TObjArray of MBadPixelsPix containers for the TObjArray's:
    8282// - fAverageBadAreas
    8383// - fAverageBadSectors
     
    8888//
    8989MCalibrationCam::MCalibrationCam(const char *name, const char *title)
    90     : fPulserColor(kNONE),
    91       fPixels(NULL), fAverageAreas(NULL), fAverageSectors(NULL),
    92       fAverageBadAreas(NULL), fAverageBadSectors(NULL)
    93 {
     90    : fPulserColor(kNONE)
     91{
     92
     93  fPixels = new TObjArray;
     94  fPixels->SetOwner();
     95
     96  fAverageAreas = new TObjArray;
     97  fAverageAreas->SetOwner();
     98 
     99  fAverageSectors = new TObjArray;
     100  fAverageSectors->SetOwner();
     101
     102  fAverageBadAreas = new TObjArray;
     103  fAverageBadAreas->SetOwner();
     104 
     105  fAverageBadSectors = new TObjArray;
     106  fAverageBadSectors->SetOwner();
     107
    94108
    95109  fNumHiGainFADCSlices.Set(1);
     
    99113// --------------------------------------------------------------------------
    100114//
    101 // Deletes the following TClonesArray's of MCalibrationPix containers (if exist):
     115// Deletes the following TObjArray's of MCalibrationPix containers (if exist):
    102116// - fPixels
    103117// - fAverageAreas
    104118// - fAverageSectors
    105119// 
    106 // Deletes the following TClonesArray's of MBadPixelsPix containers (if exist):
     120// Deletes the following TObjArray's of MBadPixelsPix containers (if exist):
    107121// - fAverageBadAreas
    108122// - fAverageBadSectors
     
    133147// --------------------------------------
    134148//
    135 // Calls the ForEach macro for the TClonesArray fPixels with the argument Clear()
     149// Calls the ForEach macro for the TObjArray fPixels with the argument Clear()
    136150//
    137151// Loops over the fAverageAreas, calling the function Clear() for
     
    205219// -------------------------------------------------------------------
    206220//
    207 // Calls TClonesArray::ExpandCreate() for fPixels
     221// Calls TObjArray::ExpandCreate() for fPixels
    208222//
    209223void MCalibrationCam::InitSize(const UInt_t i)
    210224{
    211   fPixels->ExpandCreate(i);
    212 }
     225
     226  const UInt_t save = GetSize();
     227 
     228  if (i==save)
     229    return;
     230 
     231  fPixels->Expand(i);
     232
     233  if (i>save)
     234    Add(save,i);
     235}
     236
     237void MCalibrationCam::Add(const UInt_t a, const UInt_t b)
     238{
     239  for (UInt_t i=a; i<b; i++)
     240    (*fPixels)[i] = new MCalibrationPix;
     241}
     242
     243void MCalibrationCam::AddArea(const UInt_t a, const UInt_t b)
     244{
     245  for (UInt_t i=a; i<b; i++)
     246    (*fAverageAreas)[i] = new MCalibrationPix;
     247}
     248
     249void MCalibrationCam::AddSector(const UInt_t a, const UInt_t b)
     250{
     251  for (UInt_t i=a; i<b; i++)
     252    (*fAverageSectors)[i] = new MCalibrationPix;
     253}
     254
    213255
    214256// -------------------------------------------------------------------
    215257//
    216 // Calls TClonesArray::ExpandCreate() for:
     258// Calls TObjArray::ExpandCreate() for:
    217259// - fAverageAreas
    218260// - fAverageBadAreas
     
    220262void MCalibrationCam::InitAverageAreas(const UInt_t i)
    221263{
    222   fAverageAreas->ExpandCreate(i);
    223   fAverageBadAreas->ExpandCreate(i);
    224 
    225   for (UInt_t j=0; j<i; j++)
    226     GetAverageArea(j).SetPixId(j);
    227  
     264
     265  const UInt_t save = GetAverageAreas();
     266
     267  if (i==save)
     268    return;
     269 
     270  fAverageAreas->Expand(i);
     271  fAverageBadAreas->Expand(i);
     272
    228273  fNumUnsuitable.Set(i);
    229274  fNumUnreliable.Set(i);
    230275  fNumHiGainFADCSlices.Set(i);
    231276  fNumLoGainFADCSlices.Set(i);
     277
     278  if (i < save)
     279    return;
     280
     281  for (UInt_t j=save; j<i; j++)
     282    (*fAverageBadAreas)[j] = new MBadPixelsPix;
     283 
     284  AddArea(save,i);
     285
     286  for (UInt_t j=save; j<i; j++)
     287    GetAverageArea(j).SetPixId(j);
     288
    232289}
    233290
    234291// -------------------------------------------------------------------
    235292//
    236 // Calls TClonesArray::ExpandCreate() for:
     293// Calls TObjArray::ExpandCreate() for:
    237294// - fAverageSectors
    238295// - fAverageBadSectors
     
    240297void MCalibrationCam::InitAverageSectors(const UInt_t i)
    241298{
    242   fAverageSectors->ExpandCreate(i);
    243   fAverageBadSectors->ExpandCreate(i);
    244 
    245   for (UInt_t j=0; j<i; j++)
     299
     300  const UInt_t save = GetAverageSectors();
     301
     302  if (i==save)
     303    return;
     304 
     305  fAverageSectors->Expand(i);
     306  fAverageBadSectors->Expand(i);
     307
     308  if (i < save)
     309    return;
     310
     311  for (UInt_t j=save; j<i; j++)
     312    (*fAverageBadSectors)[j] = new MBadPixelsPix;
     313 
     314  AddSector(save,i);
     315
     316  for (UInt_t j=save; j<i; j++)
    246317    GetAverageSector(j).SetPixId(j);
    247 
    248318}
    249319
     
    328398// --------------------------------------------------------------------------
    329399//
    330 // Returns the current size of the TClonesArray fAverageAreas
     400// Returns the current size of the TObjArray fAverageAreas
    331401// independently if the MCalibrationPix is filled with values or not.
    332402//
     
    338408// --------------------------------------------------------------------------
    339409//
    340 // Returns the current size of the TClonesArray fAverageSectors
     410// Returns the current size of the TObjArray fAverageSectors
    341411// independently if the MCalibrationPix is filled with values or not.
    342412//
     
    367437// --------------------------------------------------------------------------
    368438//
    369 // Returns the current size of the TClonesArray fPixels
     439// Returns the current size of the TObjArray fPixels
    370440// independently if the MCalibrationPix is filled with values or not.
    371441//
    372442const Int_t MCalibrationCam::GetSize() const
    373443{
    374   return fPixels->GetEntriesFast();
     444  return fPixels->GetEntries();
    375445}
    376446
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.cc

    r4986 r5018  
    7575#include "MCalibrationQECam.h"
    7676
    77 #include <TClonesArray.h>
     77#include <TObjArray.h>
    7878
    7979#include "MLog.h"
     
    9393// Default constructor.
    9494//
    95 // Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
    96 // to hold one container per pixel. Later, a call to MCalibrationQECam::InitSize()
    97 // has to be performed (in MGeomApply).
    98 //
    99 // Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
    100 // to hold one container per pixel AREA. Later, a call to MCalibrationQECam::InitAreas()
    101 // has to be performed (in MGeomApply).
    102 //
    103 // Creates a TClonesArray of MCalibrationQEPix containers, initialized to 1 entry, destinated
    104 // to hold one container per camera SECTOR. Later, a call to MCalibrationQECam::InitSectors()
    105 // has to be performed (in MGeomApply).
    106 //
    10795MCalibrationQECam::MCalibrationQECam(const char *name, const char *title)
    10896{
     
    11098    fTitle = title ? title : "Storage container for the calibrated Quantum Efficiency of the camera";
    11199
    112     fPixels             = new TClonesArray("MCalibrationQEPix",1);
    113     fAverageAreas       = new TClonesArray("MCalibrationQEPix",1);
    114     fAverageSectors     = new TClonesArray("MCalibrationQEPix",1);
    115     fAverageBadAreas    = new TClonesArray("MBadPixelsPix",1);
    116     fAverageBadSectors  = new TClonesArray("MBadPixelsPix",1);
    117 
    118100    fFlags.Set(MCalibrationCam::gkNumPulserColors);
    119101
    120102    Clear();
     103}
     104
     105void MCalibrationQECam::Add(const UInt_t a, const UInt_t b)
     106{
     107  for (UInt_t i=a; i<b; i++)
     108    (*fPixels)[i] = new MCalibrationQEPix;
     109}
     110
     111void MCalibrationQECam::AddArea(const UInt_t a, const UInt_t b)
     112{
     113  for (UInt_t i=a; i<b; i++)
     114    (*fAverageAreas)[i] = new MCalibrationQEPix;
     115}
     116
     117void MCalibrationQECam::AddSector(const UInt_t a, const UInt_t b)
     118{
     119  for (UInt_t i=a; i<b; i++)
     120    (*fAverageSectors)[i] = new MCalibrationQEPix;
    121121}
    122122
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.h

    r4967 r5018  
    2626         kPINDiodeMethodValid, kCombinedMethodValid }; // Possible validity bits
    2727
     28  void Add(const UInt_t a, const UInt_t b);
     29  void AddArea(const UInt_t a, const UInt_t b);
     30  void AddSector(const UInt_t a, const UInt_t b);
     31
     32 
    2833protected:
    2934
     
    7176  void    SetPINDiodeMethodValid   ( const Bool_t  b, MCalibrationCam::PulserColor_t col); 
    7277
    73   ClassDef(MCalibrationQECam, 1) // Container Quantum Efficieny Calibration Results Camera
     78  ClassDef(MCalibrationQECam, 2) // Container Quantum Efficieny Calibration Results Camera
    7479};
    7580
Note: See TracChangeset for help on using the changeset viewer.