source: trunk/MagicSoft/Mars/msignal/MExtractedSignalBlindPixel.cc@ 4374

Last change on this file since 4374 was 4374, checked in by gaug, 20 years ago
*** empty log message ***
File size: 3.9 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 02/2004 <mailto:markus@ifae.es>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MExtractedSignalBlindPixel
28//
29// The storage container of the extracted signal of the calibration Blind Pixel(s).
30// Additionally, the number of saturated Slices are stored.
31// There is place for various blind pixels set into the camera in July. Default
32// is one blind pixel.
33//
34// Default values for the extracted signals are: gkSignalInitializer
35//
36/////////////////////////////////////////////////////////////////////////////
37#include "MExtractedSignalBlindPixel.h"
38
39#include "MLog.h"
40#include "MLogManip.h"
41
42ClassImp(MExtractedSignalBlindPixel);
43
44using namespace std;
45
46static const Int_t gkSignalInitializer = 99999;
47
48// ------------------------------------------------------------------------
49//
50//
51// Sets:
52// - the dimenstion of fBlindPixelIdx to 1
53// - the dimenstion of fExtractedSignal to 1
54// - the dimenstion of fNumSaturated to 1
55// - the dimenstion of fPed. to 1;
56// - the dimenstion of fPedErr. to 1;)
57// - the dimenstion of fPedRms. to 1;
58// - the dimenstion of fPedRmsErr. to 1;
59//
60// Calls:
61// - Clear()
62//
63MExtractedSignalBlindPixel::MExtractedSignalBlindPixel(const char* name, const char* title)
64{
65
66 fName = name ? name : "MExtractedSignalBlindPixel";
67 fTitle = title ? title : "Container of the Extracted Signals";
68
69 fBlindPixelIdx.Set(1);
70 fExtractedSignal.Set(1);
71 fNumSaturated.Set(1);
72
73 fPed.Set(1);
74 fPedErr.Set(1);
75 fPedRms.Set(1);
76 fPedRmsErr.Set(1);
77
78 Clear();
79}
80
81// ------------------------------------------------------------------------
82//
83// Set values of:
84// - fNumSaturated
85// - fExtractedSignal
86// to gkSignalInitializer
87//
88void MExtractedSignalBlindPixel::Clear(Option_t *o)
89{
90
91 for (Int_t i=0;i<fBlindPixelIdx.GetSize();i++)
92 {
93 fNumSaturated .AddAt(gkSignalInitializer,i);
94 fExtractedSignal.AddAt(gkSignalInitializer,i);
95 }
96}
97
98// ------------------------------------------------------------------------
99//
100// Set number num of used FADC slices, starting from (including) first
101//
102void MExtractedSignalBlindPixel::SetUsedFADCSlices(const Byte_t first, const Byte_t num)
103{
104 fFirst = first;
105 fNumFADCSamples = num;
106}
107
108// --------------------------------------------------------------------------------------------
109//
110// Returns true, if fExtractedSignal is greater or equal 0 and smaller than gkSignalInitializer
111//
112Bool_t MExtractedSignalBlindPixel::IsValid( const Int_t i ) const
113{
114 return fExtractedSignal.At(i) >= 0 && fExtractedSignal.At(i) < gkSignalInitializer;
115}
116
117// --------------------------------------------------------------------------------------------
118//
119// Prints for all stored blind pixels the ID, the signal and the number of saturated slices
120//
121void MExtractedSignalBlindPixel::Print(Option_t *o) const
122{
123
124 for (Int_t i=0;i<fBlindPixelIdx.GetSize();i++)
125 {
126
127 *fLog << "Blind Pixel ID: " << fBlindPixelIdx.At(i)
128 << ": Signal: " << fExtractedSignal.At(i)
129 << " Saturated Slices: " << fNumSaturated.At(i)
130 << endl;
131 }
132}
Note: See TracBrowser for help on using the repository browser.