source: trunk/MagicSoft/Mars/manalysis/MExtractedSignalCam.cc@ 2878

Last change on this file since 2878 was 2640, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.4 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 12/2003 <mailto:markus@ifae.es>
19! Author(s): Thomas Bretz 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2003
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MExtractedSignalCam //
29// //
30// Hold the Extracted Signal information for all pixels in the camera //
31// //
32/////////////////////////////////////////////////////////////////////////////
33#include "MExtractedSignalCam.h"
34#include "MExtractedSignalPix.h"
35
36#include <TClonesArray.h>
37
38#include "MLog.h"
39#include "MLogManip.h"
40
41#include "MGeomCam.h"
42
43ClassImp(MExtractedSignalCam);
44
45using namespace std;
46
47// --------------------------------------------------------------------------
48//
49// Default constructor. Creates a MExtractedSignalPix object for each pixel
50//
51MExtractedSignalCam::MExtractedSignalCam(const char *name, const char *title)
52{
53 fName = name ? name : "MExtractedSignalCam";
54 fTitle = title ? title : "Storage container for all Extracted Signal Information in the camera";
55
56 fArray = new TClonesArray("MExtractedSignalPix", 1);
57
58}
59
60// --------------------------------------------------------------------------
61//
62// Delete the array conatining the pixel pedest information
63//
64MExtractedSignalCam::~MExtractedSignalCam()
65{
66 delete fArray;
67}
68
69// --------------------------------------------------------------------------
70//
71// Set the size of the camera
72//
73void MExtractedSignalCam::InitSize(const UInt_t i)
74{
75 fArray->ExpandCreate(i);
76}
77
78// --------------------------------------------------------------------------
79//
80// Get the size of the MExtractedSignalCam
81//
82Int_t MExtractedSignalCam::GetSize() const
83{
84 return fArray->GetEntriesFast();
85}
86
87// --------------------------------------------------------------------------
88//
89// Get i-th pixel (pixel number)
90//
91MExtractedSignalPix &MExtractedSignalCam::operator[](Int_t i)
92{
93 return *static_cast<MExtractedSignalPix*>(fArray->UncheckedAt(i));
94}
95
96// --------------------------------------------------------------------------
97//
98// Get i-th pixel (pixel number)
99//
100MExtractedSignalPix &MExtractedSignalCam::operator[](Int_t i) const
101{
102 return *static_cast<MExtractedSignalPix*>(fArray->UncheckedAt(i));
103}
104
105
106void MExtractedSignalCam::Clear(Option_t *o)
107{
108 fArray->ForEach(TObject, Clear)();
109}
110
111void MExtractedSignalCam::Print(Option_t *o) const
112{
113 *fLog << all << GetDescriptor() << ":" << endl;
114 int id = 0;
115
116 TIter Next(fArray);
117 MExtractedSignalPix *pix;
118 while ((pix=(MExtractedSignalPix*)Next()))
119 {
120 id++;
121
122 if (!pix->IsValid())
123 continue;
124
125 *fLog << id-1 << ": " << endl;
126 pix->PrintOut();
127 }
128}
129
130Bool_t MExtractedSignalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
131{
132 switch (type)
133 {
134 case 0:
135 val = (*this)[idx].GetExtractedSignalHiGain();
136 break;
137 case 1:
138 val = (*this)[idx].GetExtractedSignalHiGainError();
139 break;
140 case 2:
141 val = (*this)[idx].GetExtractedSignalLoGain();
142 break;
143 case 3:
144 val = (*this)[idx].GetExtractedSignalLoGainError();
145 break;
146 default:
147 return kFALSE;
148 }
149 return val>=0;
150}
151
152void MExtractedSignalCam::DrawPixelContent(Int_t num) const
153{
154 *fLog << warn << "MExtractedSignaCam::DrawPixelContent - not available." << endl;
155}
Note: See TracBrowser for help on using the repository browser.