Ignore:
Timestamp:
09/15/04 22:12:28 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r5043 r5046  
    2828// Base class for intensity calibration results
    2929//
    30 // Contains TObjArrays for the following objects:
     30// Contains TOrdCollections for the following objects:
    3131// - fCams:  Array of classes derived from MCalibrationCam, one entry
    3232//           per calibration camera result. Has to be created
     
    4343#include "MCalibrationIntensityCam.h"
    4444
    45 #include <TObjArray.h>
     45#include <TOrdCollection.h>
    4646
    4747#include "MGeomCam.h"
     
    6464  fTitle = title ? title : "Base container for the Intensity Calibration";
    6565
    66   fCams = new TObjArray;
     66  fCams = new TOrdCollection;
    6767  fCams->SetOwner();
    6868 
     
    188188// -------------------------------------------------------------------
    189189//
    190 // Calls TObjArray::Expand() for fCams
    191 //
    192 void MCalibrationIntensityCam::InitSize(const UInt_t n)
    193 {
    194   fCams->Expand(n);
     190// Initialize the objects inside the TOrdCollection using the
     191// virtual function Add().
     192//
     193// InitSize can only increase the size, but not shrink.
     194//
     195// It can be called more than one time. New Containers are
     196// added only from the current size to the argument i.
     197//
     198void MCalibrationIntensityCam::InitSize(const UInt_t i)
     199{
     200
     201  const UInt_t save = GetSize();
     202
     203  if (i==save)
     204    return;
     205 
     206  if (i>save)
     207    Add(save,i);
     208}
     209
     210// -------------------------------------------------------------------
     211//
     212// Add MCalibrationCams in the ranges from - to. In order to initialize
     213// from MCalibrationCam derived containers, overwrite this function
     214//
     215void MCalibrationIntensityCam::Add(const UInt_t from, const UInt_t to)
     216{
     217  for (UInt_t i=from; i<to; i++)
     218    fCams->AddAt(new MCalibrationCam,i);
    195219}
    196220
     
    211235// --------------------------------------------------------------------------
    212236//
    213 // Returns the current size of the TObjArray fCams
     237// Returns the current size of the TOrdCollection fCams
    214238// independently if the MCalibrationCam is filled with values or not.
    215239//
    216240const Int_t MCalibrationIntensityCam::GetSize() const
    217241{
    218   return fCams->GetEntriesFast();
     242  return fCams->GetSize();
    219243}
    220244
     
    240264// --------------------------------------------------------------------------
    241265//
    242 // Returns the current size of the TObjArray fAverageAreas of the current camera.
     266// Returns the current size of the TOrdCollection fAverageAreas of the current camera.
    243267//
    244268const Int_t MCalibrationIntensityCam::GetAverageAreas() const
     
    285309// --------------------------------------------------------------------------
    286310//
    287 // Returns the current size of the TObjArray fAverageSectors or the current camera
     311// Returns the current size of the TOrdCollection fAverageSectors or the current camera
    288312//
    289313const Int_t MCalibrationIntensityCam::GetAverageSectors() const
Note: See TracChangeset for help on using the changeset viewer.