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

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