Changeset 5043 for trunk/MagicSoft


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r5039 r5043  
    6161
    6262 2004/09/15: Markus Gaug
     63
     64   * mcalib/MCalibration*Cam.[h,cc]
     65     - replace TObjArray by TOrdCollection, otherwise the streamer does not work
    6366
    6467   * mimage/MHillasCalc.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc

    r5031 r5043  
    3030// the actual values of the MCalibrationBlindPix's.
    3131//
    32 // Contains TObjArrays for the following objects:
    33 // - fBlindPixels:    Array of classes derived from MCalibrationBlindPix, one entry
    34 //                    per blind pixel.
     32// Contains TOrdCollections for the following objects:
     33// - fPixels:    Array of classes derived from MCalibrationBlindPix, one entry
     34//               per blind pixel.
    3535//
    36 // All TObjArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply):
     36// All TOrdCollections have to enlarged by the corresponding calls to (e.g. in MGeomApply):
    3737// - InitSize()
    3838//
    39 // See also: MCalibrationBlindCamOneOldStyle
     39// See also: MCalibrationBlindCamOneOldStyle, MCalibrationBlindCamTwoNewStyle
    4040//
    4141/////////////////////////////////////////////////////////////////////////////
     
    4343#include "MCalibrationBlindPix.h"
    4444
    45 #include <TObjArray.h>
     45#include <TOrdCollection.h>
    4646
    4747#include "MLogManip.h"
     
    6666{
    6767  for (UInt_t i=a; i<b; i++)
    68     (*fPixels)[i] = new MCalibrationBlindPix;
     68    fPixels->AddAt(new MCalibrationBlindPix,i);
    6969}
    7070
     
    7878  MCalibrationBlindCam &calib = (MCalibrationBlindCam&)object;
    7979 
    80   //  MParContainer::Copy(calib);
    81  
     80  MCalibrationCam::Copy(calib);
     81
     82  /* 
    8283  const UInt_t n = GetSize();
    8384  if (n != 0)
     
    8788        (*this)[i].Copy(calib[i]);
    8889    }
     90  */
    8991}
    9092
    9193
    92 // --------------------------------------------------------------------------
    93 //
    94 // Expands and creates new MCalibrationPix's. Cannot use ExpandCreate(), because
    95 // for some reason, the constructor of MCalibrationPix does not initialize the
    96 // Arrays correctly, then.
    97 //
    98 void MCalibrationBlindCam::InitSize( const UInt_t n)
    99 {
    100   const UInt_t size = GetSize();
    101   fPixels->Expand(n);
    102 
    103   for (UInt_t i=size; i<n; i++)
    104     (*fPixels)[i] = new MCalibrationBlindPix;
    105 
    106 }
    10794
    10895// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.cc

    r5042 r5043  
    2929// Base class for Camera Calibration results.
    3030//
    31 // Contains TObjArrays for the following objects:
     31// Contains TOrdCollections 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 TObjArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply):
     44// All TOrdCollections have to enlarged by the corresponding calls to (e.g. in MGeomApply):
    4545// - InitSize()
    4646// - InitAverageAreas()
     
    5050#include "MCalibrationCam.h"
    5151
    52 #include <TObjArray.h>
     52#include <TOrdCollection.h>
    5353
    5454#include "MGeomCam.h"
     
    8282// - fNumLoGainFADCSlices to 0.
    8383//
    84 // Creates a TObjArray of MBadPixelsPix containers for the TObjArray's:
     84// Creates a TOrdCollection of MBadPixelsPix containers for the TOrdCollection's:
    8585// - fAverageBadAreas
    8686// - fAverageBadSectors
     
    9494{
    9595
    96   fPixels = new TObjArray;
     96  fPixels = new TOrdCollection;
    9797  fPixels->SetOwner();
    9898
    99   fAverageAreas = new TObjArray;
     99  fAverageAreas = new TOrdCollection;
    100100  fAverageAreas->SetOwner();
    101101 
    102   fAverageSectors = new TObjArray;
     102  fAverageSectors = new TOrdCollection;
    103103  fAverageSectors->SetOwner();
    104104
    105   fAverageBadAreas = new TObjArray;
     105  fAverageBadAreas = new TOrdCollection;
    106106  fAverageBadAreas->SetOwner();
    107107 
    108   fAverageBadSectors = new TObjArray;
     108  fAverageBadSectors = new TOrdCollection;
    109109  fAverageBadSectors->SetOwner();
    110110
     
    221221// -------------------------------------------------------------------
    222222//
    223 // Calls TObjArray::ExpandCreate() for fPixels
    224223//
    225224void MCalibrationCam::InitSize(const UInt_t i)
     
    231230    return;
    232231 
    233   fPixels->Expand(i);
     232  // Pixels->Expand(i);
    234233
    235234  if (i>save)
     
    240239{
    241240  for (UInt_t i=a; i<b; i++)
    242     (*fPixels)[i] = new MCalibrationPix;
     241    fPixels->AddAt(new MCalibrationPix,i);
    243242}
    244243
     
    246245{
    247246  for (UInt_t i=a; i<b; i++)
    248     (*fAverageAreas)[i] = new MCalibrationPix;
     247    fAverageAreas->AddAt(new MCalibrationPix,i);
    249248}
    250249
     
    252251{
    253252  for (UInt_t i=a; i<b; i++)
    254     (*fAverageSectors)[i] = new MCalibrationPix;
     253    fAverageSectors->AddAt(new MCalibrationPix,i);
    255254}
    256255
     
    270269    return;
    271270 
    272   fAverageAreas->Expand(i);
    273   fAverageBadAreas->Expand(i);
     271  //fAverageAreas->Expand(i);
     272  //fAverageBadAreas->Expand(i);
    274273
    275274  fNumUnsuitable.Set(i);
     
    282281
    283282  for (UInt_t j=save; j<i; j++)
    284     (*fAverageBadAreas)[j] = new MBadPixelsPix;
     283    fAverageBadAreas->AddAt(new MBadPixelsPix,j);
    285284 
    286285  AddArea(save,i);
     
    305304    return;
    306305 
    307   fAverageSectors->Expand(i);
    308   fAverageBadSectors->Expand(i);
     306  //fAverageSectors->Expand(i);
     307  //fAverageBadSectors->Expand(i);
    309308
    310309  if (i < save)
     
    312311
    313312  for (UInt_t j=save; j<i; j++)
    314     (*fAverageBadSectors)[j] = new MBadPixelsPix;
     313    fAverageBadSectors->AddAt(new MBadPixelsPix,j);
    315314 
    316315  AddSector(save,i);
     
    405404const Int_t MCalibrationCam::GetAverageAreas() const
    406405{
    407   return fAverageAreas->GetEntriesFast();
     406  return fAverageAreas->GetSize();
    408407}
    409408
     
    415414const Int_t MCalibrationCam::GetAverageSectors() const
    416415{
    417   return fAverageSectors->GetEntriesFast();
     416  return fAverageSectors->GetSize();
    418417}
    419418
     
    425424MCalibrationPix &MCalibrationCam::operator[](UInt_t i)
    426425{
    427   return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i));
     426  return *static_cast<MCalibrationPix*>(fPixels->At(i));
    428427}
    429428
     
    434433const MCalibrationPix &MCalibrationCam::operator[](UInt_t i) const
    435434{
    436   return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i));
     435  return *static_cast<MCalibrationPix*>(fPixels->At(i));
    437436}
    438437
     
    444443const Int_t MCalibrationCam::GetSize() const
    445444{
    446   return fPixels->GetEntriesFast();
     445  return fPixels->GetSize();
    447446}
    448447
     
    453452MCalibrationPix &MCalibrationCam::GetAverageArea(const UInt_t i)
    454453{
    455   return *static_cast<MCalibrationPix*>(fAverageAreas->UncheckedAt(i));
     454  return *static_cast<MCalibrationPix*>(fAverageAreas->At(i));
    456455}
    457456
     
    462461const MCalibrationPix &MCalibrationCam::GetAverageArea(const UInt_t i) const
    463462{
    464   return *static_cast<MCalibrationPix*>(fAverageAreas->UncheckedAt(i));
     463  return *static_cast<MCalibrationPix*>(fAverageAreas->At(i));
    465464}
    466465
     
    471470MCalibrationPix &MCalibrationCam::GetAverageSector(const UInt_t i)
    472471{
    473   return *static_cast<MCalibrationPix*>(fAverageSectors->UncheckedAt(i));
     472  return *static_cast<MCalibrationPix*>(fAverageSectors->At(i));
    474473}
    475474
     
    480479const MCalibrationPix &MCalibrationCam::GetAverageSector(const UInt_t i) const
    481480{
    482   return *static_cast<MCalibrationPix*>(fAverageSectors->UncheckedAt(i));
     481  return *static_cast<MCalibrationPix*>(fAverageSectors->At(i));
    483482}
    484483
     
    489488MBadPixelsPix &MCalibrationCam::GetAverageBadArea(const UInt_t i)
    490489{
    491   return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i));
     490  return *static_cast<MBadPixelsPix*>(fAverageBadAreas->At(i));
    492491}
    493492
     
    498497const MBadPixelsPix &MCalibrationCam::GetAverageBadArea(const UInt_t i) const
    499498{
    500   return *static_cast<MBadPixelsPix*>(fAverageBadAreas->UncheckedAt(i));
     499  return *static_cast<MBadPixelsPix*>(fAverageBadAreas->At(i));
    501500}
    502501
     
    507506MBadPixelsPix &MCalibrationCam::GetAverageBadSector(const UInt_t i)
    508507{
    509   return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i));
     508  return *static_cast<MBadPixelsPix*>(fAverageBadSectors->At(i));
    510509}
    511510
     
    516515const MBadPixelsPix &MCalibrationCam::GetAverageBadSector(const UInt_t i) const
    517516{
    518   return *static_cast<MBadPixelsPix*>(fAverageBadSectors->UncheckedAt(i));
     517  return *static_cast<MBadPixelsPix*>(fAverageBadSectors->At(i));
    519518}
    520519
  • trunk/MagicSoft/Mars/mcalib/MCalibrationCam.h

    r5036 r5043  
    1515#endif
    1616
    17 class TObjArray;
     17class TOrdCollection;
    1818
    1919class MCalibrationPix;
     
    4444  PulserColor_t fPulserColor;        // Colour of the pulsed LEDs
    4545
    46   TObjArray *fPixels;                // Array of MCalibrationPix, one per pixel
    47   TObjArray *fAverageAreas;          // Array of MCalibrationPix, one per pixel area
    48   TObjArray *fAverageSectors;        // Array of MCalibrationPix, one per camera sector
    49   TObjArray *fAverageBadAreas;       // Array of MBadPixelsPix,   one per pixel area
    50   TObjArray *fAverageBadSectors;    // Array of MBadPixelsPix,   one per camera sector
     46  TOrdCollection *fPixels;            // Array of MCalibrationPix, one per pixel
     47  TOrdCollection *fAverageAreas;      // Array of MCalibrationPix, one per pixel area
     48  TOrdCollection *fAverageSectors;    // Array of MCalibrationPix, one per camera sector
     49  TOrdCollection *fAverageBadAreas;   // Array of MBadPixelsPix,   one per pixel area
     50  TOrdCollection *fAverageBadSectors; // Array of MBadPixelsPix,   one per camera sector
    5151
    5252  virtual void Add(const UInt_t a, const UInt_t b);
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc

    r5019 r5043  
    8282#include "MCalibrationChargeCam.h"
    8383
    84 #include <TObjArray.h>
     84#include <TOrdCollection.h>
    8585
    8686#include "MLog.h"
     
    118118}
    119119
     120// --------------------------------------------------------------------------
     121//
     122// Creates new MCalibrationCam only for the averaged areas:
     123// the rest has to be retrieved directly, e.g. via:
     124//
     125TObject *MCalibrationChargeCam::Clone(const char *) const
     126{
     127
     128  //
     129  // FIXME, this might be done faster and more elegant, by direct copy.
     130  //
     131  MCalibrationChargeCam *cam = new MCalibrationChargeCam(fName,fTitle);
     132
     133  cam->fNumUnsuitable        = fNumUnsuitable;
     134  cam->fNumUnreliable        = fNumUnreliable;
     135  cam->fNumHiGainFADCSlices  = fNumHiGainFADCSlices;
     136  cam->fNumLoGainFADCSlices  = fNumLoGainFADCSlices;
     137  cam->fPulserColor          = fPulserColor;
     138
     139  cam->fFlags                = fFlags;
     140
     141  cam->fNumPhotonsBlindPixelMethod      = fNumPhotonsBlindPixelMethod;
     142  cam->fNumPhotonsFFactorMethod         = fNumPhotonsFFactorMethod;
     143  cam->fNumPhotonsPINDiodeMethod        = fNumPhotonsPINDiodeMethod;
     144  cam->fNumPhotonsBlindPixelMethodErr   = fNumPhotonsBlindPixelMethodErr;
     145  cam->fNumPhotonsFFactorMethodErr      = fNumPhotonsFFactorMethodErr;
     146  cam->fNumPhotonsPINDiodeMethodErr     = fNumPhotonsPINDiodeMethodErr;
     147
     148  for (Int_t i=0; i<GetSize(); i++)
     149    cam->fPixels->AddAt((*this)[i].Clone(),i);
     150 
     151  for (Int_t i=0; i<GetAverageAreas(); i++)
     152    {
     153      cam->fAverageAreas->AddAt(GetAverageArea(i).Clone(),i);
     154      cam->fAverageBadAreas->AddAt(GetAverageBadArea(i).Clone(),i);
     155    }
     156  for (Int_t i=0; i<GetAverageSectors(); i++)
     157    {
     158      cam->fAverageSectors->AddAt(GetAverageSector(i).Clone(),i);
     159      cam->fAverageBadSectors->AddAt(GetAverageBadSector(i).Clone(),i);
     160    }
     161
     162  return cam;
     163}
     164
    120165
    121166void MCalibrationChargeCam::Add(const UInt_t a, const UInt_t b)
    122167{
    123168  for (UInt_t i=a; i<b; i++)
    124     (*fPixels)[i] = new MCalibrationChargePix;
     169    fPixels->AddAt(new MCalibrationChargePix,i);
    125170}
    126171
     
    129174{
    130175  for (UInt_t i=a; i<b; i++)
    131     (*fAverageAreas)[i] = new MCalibrationChargePix;
     176    fAverageAreas->AddAt(new MCalibrationChargePix,i);
    132177}
    133178
     
    135180{
    136181  for (UInt_t i=a; i<b; i++)
    137     (*fAverageSectors)[i] = new MCalibrationChargePix;
     182    fAverageSectors->AddAt(new MCalibrationChargePix,i);
    138183}
    139184
  • trunk/MagicSoft/Mars/mcalib/MCalibrationIntensityCam.cc

    r5030 r5043  
    6666  fCams = new TObjArray;
    6767  fCams->SetOwner();
    68 }
     68 
     69}
     70
    6971
    7072// --------------------------------------------------------------------------
     
    214216const Int_t MCalibrationIntensityCam::GetSize() const
    215217{
    216   return fCams->GetEntries();
     218  return fCams->GetEntriesFast();
    217219}
    218220
     
    223225MCalibrationPix &MCalibrationIntensityCam::operator[](UInt_t i)
    224226{
    225   return (*GetCam(GetSize()-1))[i];
     227  return (*GetCam())[i];
    226228}
    227229
     
    232234const MCalibrationPix &MCalibrationIntensityCam::operator[](UInt_t i) const
    233235{
    234   return (*GetCam(GetSize()-1))[i];
     236  return (*GetCam())[i];
    235237}
    236238
     
    242244const Int_t MCalibrationIntensityCam::GetAverageAreas() const
    243245{
    244   return GetCam(GetSize()-1)->GetAverageAreas();
     246  return GetCam()->GetAverageAreas();
    245247}
    246248
     
    251253MCalibrationPix  &MCalibrationIntensityCam::GetAverageArea(UInt_t i)
    252254{
    253   return GetCam(GetSize()-1)->GetAverageArea(i);
     255  return GetCam()->GetAverageArea(i);
    254256}
    255257
     
    260262const MCalibrationPix  &MCalibrationIntensityCam::GetAverageArea(UInt_t i) const
    261263{
    262   return GetCam(GetSize()-1)->GetAverageArea(i);
     264  return GetCam()->GetAverageArea(i);
    263265}
    264266
     
    269271MBadPixelsPix  &MCalibrationIntensityCam::GetAverageBadArea(UInt_t i)
    270272{
    271   return GetCam(GetSize()-1)->GetAverageBadArea(i);
     273  return GetCam()->GetAverageBadArea(i);
    272274}
    273275
     
    278280const MBadPixelsPix  &MCalibrationIntensityCam::GetAverageBadArea(UInt_t i) const
    279281{
    280   return GetCam(GetSize()-1)->GetAverageBadArea(i);
     282  return GetCam()->GetAverageBadArea(i);
    281283}
    282284
     
    287289const Int_t MCalibrationIntensityCam::GetAverageSectors() const
    288290{
    289   return GetCam(GetSize()-1)->GetAverageSectors();
     291  return GetCam()->GetAverageSectors();
    290292}
    291293
     
    296298MCalibrationPix  &MCalibrationIntensityCam::GetAverageSector(UInt_t i)
    297299{
    298   return GetCam(GetSize()-1)->GetAverageSector(i);
     300  return GetCam()->GetAverageSector(i);
    299301}
    300302
     
    305307const MCalibrationPix  &MCalibrationIntensityCam::GetAverageSector(UInt_t i) const
    306308{
    307   return GetCam(GetSize()-1)->GetAverageSector(i);
     309  return GetCam()->GetAverageSector(i);
    308310}
    309311
     
    314316MBadPixelsPix  &MCalibrationIntensityCam::GetAverageBadSector(UInt_t i)
    315317{
    316   return GetCam(GetSize()-1)->GetAverageBadSector(i);
     318  return GetCam()->GetAverageBadSector(i);
    317319}
    318320
     
    323325const MBadPixelsPix  &MCalibrationIntensityCam::GetAverageBadSector(UInt_t i) const
    324326{
    325   return GetCam(GetSize()-1)->GetAverageBadSector(i);
     327  return GetCam()->GetAverageBadSector(i);
    326328}
    327329
     
    333335MCalibrationCam *MCalibrationIntensityCam::GetCam(Int_t i)
    334336{
    335   return static_cast<MCalibrationCam*>(fCams->UncheckedAt(i==-1 ? GetSize()-1 : i));
     337  return static_cast<MCalibrationCam*>(fCams->Last());
    336338}
    337339
     
    342344const MCalibrationCam *MCalibrationIntensityCam::GetCam(Int_t i) const
    343345{
    344   return static_cast<MCalibrationCam*>(fCams->UncheckedAt(i==-1 ? GetSize()-1 : i));
     346  return static_cast<MCalibrationCam*>(fCams->Last());
    345347}
    346348
  • trunk/MagicSoft/Mars/mcalib/MCalibrationQECam.cc

    r5041 r5043  
    7575#include "MCalibrationQECam.h"
    7676
    77 #include <TObjArray.h>
     77#include <TOrdCollection.h>
    7878
    7979#include "MLog.h"
     
    106106{
    107107  for (UInt_t i=a; i<b; i++)
    108     (*fPixels)[i] = new MCalibrationQEPix;
     108    fPixels->AddAt(new MCalibrationQEPix,i);
    109109}
    110110
     
    112112{
    113113  for (UInt_t i=a; i<b; i++)
    114     (*fAverageAreas)[i] = new MCalibrationQEPix;
     114    fAverageAreas->AddAt(new MCalibrationQEPix,i);
    115115}
    116116
     
    118118{
    119119  for (UInt_t i=a; i<b; i++)
    120     (*fAverageSectors)[i] = new MCalibrationQEPix;
     120    fAverageSectors->AddAt(new MCalibrationQEPix,i);
    121121}
    122122
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.cc

    r5019 r5043  
    7676#include "MCalibrationCam.h"
    7777
    78 #include <TObjArray.h>
     78#include <TOrdCollection.h>
    7979
    8080#include "MLog.h"
     
    105105{
    106106  for (UInt_t i=a; i<b; i++)
    107     (*fPixels)[i] = new MCalibrationRelTimePix;
     107    fPixels->AddAt(new MCalibrationRelTimePix,i);
    108108}
    109109
     
    112112{
    113113  for (UInt_t i=a; i<b; i++)
    114     (*fAverageAreas)[i] = new MCalibrationRelTimePix;
     114    fAverageAreas->AddAt(new MCalibrationRelTimePix,i);
    115115}
    116116
     
    118118{
    119119  for (UInt_t i=a; i<b; i++)
    120     (*fAverageSectors)[i] = new MCalibrationRelTimePix;
     120    fAverageSectors->AddAt(new MCalibrationRelTimePix,i);
    121121}
    122122
Note: See TracChangeset for help on using the changeset viewer.