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

Last change on this file since 6217 was 4826, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 3.0 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// Short_t fNumIslands; // number of islands found
32//
33// Short_t fNumHGSaturatedPixels; // number of pixels with saturating hi-gains
34// Short_t fNumSaturatedPixels; // number of pixels with saturating lo-gains
35//
36/////////////////////////////////////////////////////////////////////////////
37#include "MImagePar.h"
38
39#include "MLog.h"
40#include "MLogManip.h"
41
42#include "MCerPhotEvt.h"
43#include "MCerPhotPix.h"
44
45ClassImp(MImagePar);
46
47using namespace std;
48
49// --------------------------------------------------------------------------
50//
51// Default constructor.
52//
53MImagePar::MImagePar(const char *name, const char *title)
54{
55 fName = name ? name : "MImagePar";
56 fTitle = title ? title : "New image parameters";
57
58 Reset();
59}
60
61// --------------------------------------------------------------------------
62//
63void MImagePar::Reset()
64{
65 fNumIslands = -1;
66
67 fNumSatPixelsHG = -1;
68 fNumSatPixelsLG = -1;
69}
70
71// --------------------------------------------------------------------------
72//
73// Calculation of new image parameters
74//
75void MImagePar::Calc(const MCerPhotEvt &evt)
76{
77 // Get number of saturating pixels
78 fNumSatPixelsHG = 0;
79 fNumSatPixelsLG = 0;
80
81 const UInt_t npixevt = evt.GetNumPixels();
82 for (UInt_t i=0; i<npixevt; i++)
83 {
84 const MCerPhotPix &pix = evt[i];
85
86 if (pix.IsPixelHGSaturated())
87 fNumSatPixelsHG++;
88 if (pix.IsPixelSaturated())
89 fNumSatPixelsLG++;
90 }
91
92 // Get number of islands
93 fNumIslands = evt.GetNumIslands();
94
95 SetReadyToSave();
96}
97
98// --------------------------------------------------------------------------
99//
100void MImagePar::Print(Option_t *) const
101{
102 *fLog << all;
103 *fLog << "Image Parameters (" << GetName() << ")" << endl;
104 *fLog << " - Num Islands [#] = " << fNumIslands << " Islands" << endl;
105 *fLog << " - Sat.Pixels/HG [#] = " << fNumSatPixelsHG << " Pixels" << endl;
106 *fLog << " - Sat.Pixels/LG [#] = " << fNumSatPixelsLG << " Pixels" << endl;
107}
Note: See TracBrowser for help on using the repository browser.