source: trunk/MagicSoft/Mars/mcalib/MCalibrationBlindCam.cc@ 5023

Last change on this file since 5023 was 5019, checked in by gaug, 20 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Markus Gaug 07/2004 <mailto:markus@ifae.es>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MCalibrationBlindCam
28//
29// Base class for Blind Pixels Calibration results. Derived classes intialize
30// the actual values of the MCalibrationBlindPix's.
31//
32// Contains TObjArrays for the following objects:
33// - fBlindPixels: Array of classes derived from MCalibrationBlindPix, one entry
34// per blind pixel.
35//
36// All TObjArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply):
37// - InitSize()
38//
39// See also: MCalibrationBlindCamOneOldStyle
40//
41/////////////////////////////////////////////////////////////////////////////
42#include "MCalibrationBlindCam.h"
43#include "MCalibrationBlindPix.h"
44
45#include <TObjArray.h>
46
47#include "MLogManip.h"
48
49ClassImp(MCalibrationBlindCam);
50
51using namespace std;
52// --------------------------------------------------------------------------
53//
54// Default constructor.
55//
56MCalibrationBlindCam::MCalibrationBlindCam(Int_t nblind,const char *name, const char *title)
57{
58
59 fName = name ? name : "MCalibrationBlindCam";
60 fTitle = title ? title : "Calibration Information of blinded pixels in camera";
61
62 InitSize(nblind);
63}
64
65void MCalibrationBlindCam::Add(const UInt_t a, const UInt_t b)
66{
67 for (UInt_t i=a; i<b; i++)
68 (*fPixels)[i] = new MCalibrationBlindPix;
69}
70
71// --------------------------------------------------------------------------
72//
73// Copy 'constructor'
74//
75void MCalibrationBlindCam::Copy(TObject& object) const
76{
77
78 MCalibrationBlindCam &calib = (MCalibrationBlindCam&)object;
79
80 // MParContainer::Copy(calib);
81
82 const UInt_t n = GetSize();
83 if (n != 0)
84 {
85 calib.InitSize(n);
86 for (UInt_t i=0; i<n; i++)
87 (*this)[i].Copy(calib[i]);
88 }
89}
90
91
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//
98void 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}
107
108
Note: See TracBrowser for help on using the repository browser.