source: trunk/MagicSoft/Mars/mcalib/MCalibrationChargeBlindCam.cc@ 5057

Last change on this file since 5057 was 4967, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 4.6 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// MCalibrationChargeBlindCam
28//
29// Base class for Blind Pixels Calibration results. Derived classes intialize
30// the actual values of the MCalibrationBlindPix's.
31//
32// Contains TClonesArrays for the following objects:
33// - fBlindPixels: Array of classes derived from MCalibrationChargeBlindPix, one entry
34// per blind pixel.
35//
36// All TClonesArrays have to enlarged by the corresponding calls to (e.g. in MGeomApply):
37// - InitSize()
38//
39// See also: MCalibrationChargeBlindCamOneOldStyle
40//
41/////////////////////////////////////////////////////////////////////////////
42#include "MCalibrationChargeBlindCam.h"
43#include "MCalibrationChargeBlindPix.h"
44
45#include "MParContainer.h"
46
47ClassImp(MCalibrationChargeBlindCam);
48
49using namespace std;
50// --------------------------------------------------------------------------
51//
52// Default constructor.
53//
54// Initializes:
55// - fPulserColor to kNONE
56//
57// Creates a TClonesArray of MCalibrationChargeBlindPix containers for the TClonesArray's:
58// - fBlindPixels
59// all initialized to 1 entry
60//
61// Later, a call to InitSize()
62// has to be performed in order to get the dimension correctly.
63//
64MCalibrationChargeBlindCam::MCalibrationChargeBlindCam(UInt_t nblind,const char *name, const char *title)
65 : fNumBlindPixels(nblind),
66 fPulserColor(MCalibrationCam::kNONE),
67 fBlindPixels(nblind)
68{
69
70 fName = name ? name : "MCalibrationChargeBlindCam";
71 fTitle = title ? title : "Calibration Information of blinded pixels in camera";
72
73 //
74 // make sure that the destructor delete all contained objects
75 //
76 fBlindPixels.SetOwner();
77
78 for (UInt_t i=0; i<nblind; i++)
79 fBlindPixels[i] = new MCalibrationChargeBlindPix;
80
81}
82
83// --------------------------------------
84//
85// Calls the ForEach macro for the TClonesArray fBlindPixels with the argument Clear()
86//
87void MCalibrationChargeBlindCam::Clear(Option_t *o)
88{
89 fBlindPixels.ForEach(TObject, Clear)();
90}
91
92// -----------------------------------------------------
93//
94// copy 'constructor'
95//
96void MCalibrationChargeBlindCam::Copy(TObject& object) const
97{
98
99 MCalibrationChargeBlindCam &calib = (MCalibrationChargeBlindCam&)object;
100 calib.fPulserColor = fPulserColor;
101 calib.fNumBlindPixels = fNumBlindPixels;
102
103 for (UInt_t i=0; i<fNumBlindPixels; i++)
104 {
105 calib.fBlindPixels[i] = new MCalibrationChargeBlindPix;
106 (*this)[i].Copy(calib[i]);
107 }
108}
109
110// --------------------------------------------------------------------------
111//
112// Get i-th blind pixel (pixel number)
113//
114MCalibrationChargeBlindPix &MCalibrationChargeBlindCam::operator[](UInt_t i)
115{
116 return *static_cast<MCalibrationChargeBlindPix*>(fBlindPixels.UncheckedAt(i));
117}
118
119// --------------------------------------------------------------------------
120//
121// Get i-th pixel (pixel number)
122//
123const MCalibrationChargeBlindPix &MCalibrationChargeBlindCam::operator[](UInt_t i) const
124{
125 return *static_cast<MCalibrationChargeBlindPix*>(fBlindPixels.UncheckedAt(i));
126}
127
128
129// --------------------------------------------------------------------------
130//
131// Print the results of the blind pixels
132//
133void MCalibrationChargeBlindCam::Print(Option_t *o) const
134{
135
136 fBlindPixels.Print();
137}
138
139// --------------------------------------------------------------------------
140//
141// Set color to this class and to the MCalibrationBlindPix's
142//
143void MCalibrationChargeBlindCam::SetColor ( const MCalibrationCam::PulserColor_t col )
144{
145
146 fPulserColor = col;
147 fBlindPixels.ForEach(MCalibrationChargeBlindPix, SetColor)(col);
148
149}
Note: See TracBrowser for help on using the repository browser.