source: trunk/MagicSoft/Mars/mimage/MImagePar.cc@ 6489

Last change on this file since 6489 was 6489, checked in by tbretz, 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): Thomas Bretz, 8/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MImagePar
28//
29// Storage Container for new image parameters
30//
31// Class Version 2:
32// ----------------
33// - added Short_t fNumSinglePixels;
34// - added Float_t fSizeSinglePixels;
35// - added Float_t fSizeSubIslands;
36//
37// Class Version 1:
38// ----------------
39// Short_t fNumIslands; // number of islands found
40//
41// Short_t fNumHGSaturatedPixels; // number of pixels with saturating hi-gains
42// Short_t fNumSaturatedPixels; // number of pixels with saturating lo-gains
43//
44/////////////////////////////////////////////////////////////////////////////
45#include "MImagePar.h"
46
47#include "MLog.h"
48#include "MLogManip.h"
49
50#include "MCerPhotEvt.h"
51#include "MCerPhotPix.h"
52
53ClassImp(MImagePar);
54
55using namespace std;
56
57// --------------------------------------------------------------------------
58//
59// Default constructor.
60//
61MImagePar::MImagePar(const char *name, const char *title)
62{
63 fName = name ? name : "MImagePar";
64 fTitle = title ? title : "New image parameters";
65
66 Reset();
67}
68
69// --------------------------------------------------------------------------
70//
71void MImagePar::Reset()
72{
73 fNumIslands = -1;
74 fNumSinglePixels = -1;
75
76 fNumSatPixelsHG = -1;
77 fNumSatPixelsLG = -1;
78
79 fSizeSinglePixels = -1;
80 fSizeSubIslands = -1;
81 fSizeMainIsland = -1;
82}
83
84// --------------------------------------------------------------------------
85//
86// Calculation of new image parameters
87//
88void MImagePar::Calc(const MCerPhotEvt &evt)
89{
90 // Get number of saturating pixels
91 fNumSatPixelsHG = 0;
92 fNumSatPixelsLG = 0;
93
94 const UInt_t npixevt = evt.GetNumPixels();
95 for (UInt_t i=0; i<npixevt; i++)
96 {
97 const MCerPhotPix &pix = evt[i];
98
99 if (pix.IsPixelHGSaturated())
100 fNumSatPixelsHG++;
101 if (pix.IsPixelSaturated())
102 fNumSatPixelsLG++;
103 }
104
105 // Get number of islands
106 fNumIslands = evt.GetNumIslands();
107 fNumSinglePixels = evt.GetNumSinglePixels();
108 fSizeSinglePixels = evt.GetSizeSinglePixels();
109 fSizeSubIslands = evt.GetSizeSubIslands();
110 fSizeMainIsland = evt.GetSizeMainIsland();
111
112 SetReadyToSave();
113}
114
115// --------------------------------------------------------------------------
116//
117void MImagePar::Print(Option_t *) const
118{
119 *fLog << all;
120 *fLog << "Image Parameters (" << GetName() << ")" << endl;
121 *fLog << " - Num Islands [#] = " << fNumIslands << " Islands" << endl;
122 *fLog << " - Sat.Pixels (HG) [#] = " << fNumSatPixelsHG << " Pixels" << endl;
123 *fLog << " - Sat.Pixels (LG) [#] = " << fNumSatPixelsLG << " Pixels" << endl;
124 *fLog << " - Num rmvd CorePix [#] = " << fNumSinglePixels << " Pixels" << endl;
125 *fLog << " - Sz rmvd CorePix [#] = " << fSizeSinglePixels << " CerPhot" << endl;
126 *fLog << " - Size Sub Islands [#] = " << fSizeSubIslands << " CerPhot" << endl;
127 *fLog << " - Size Main Island [#] = " << fSizeMainIsland << " CerPhot" << endl;
128}
Note: See TracBrowser for help on using the repository browser.