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 <fstream>
|
---|
40 |
|
---|
41 | #include "MLog.h"
|
---|
42 | #include "MLogManip.h"
|
---|
43 |
|
---|
44 | #include "MCerPhotEvt.h"
|
---|
45 | #include "MCerPhotPix.h"
|
---|
46 |
|
---|
47 | ClassImp(MImagePar);
|
---|
48 |
|
---|
49 | using namespace std;
|
---|
50 |
|
---|
51 | // --------------------------------------------------------------------------
|
---|
52 | //
|
---|
53 | // Default constructor.
|
---|
54 | //
|
---|
55 | MImagePar::MImagePar(const char *name, const char *title)
|
---|
56 | {
|
---|
57 | fName = name ? name : "MImagePar";
|
---|
58 | fTitle = title ? title : "New image parameters";
|
---|
59 |
|
---|
60 | Reset();
|
---|
61 | }
|
---|
62 |
|
---|
63 | // --------------------------------------------------------------------------
|
---|
64 | //
|
---|
65 | void MImagePar::Reset()
|
---|
66 | {
|
---|
67 | fNumIslands = -1;
|
---|
68 |
|
---|
69 | fNumSatPixelsHG = -1;
|
---|
70 | fNumSatPixelsLG = -1;
|
---|
71 | }
|
---|
72 |
|
---|
73 | // --------------------------------------------------------------------------
|
---|
74 | //
|
---|
75 | // Calculation of new image parameters
|
---|
76 | //
|
---|
77 | void MImagePar::Calc(const MCerPhotEvt &evt)
|
---|
78 | {
|
---|
79 | // Get number of saturating pixels
|
---|
80 | fNumSatPixelsHG = 0;
|
---|
81 | fNumSatPixelsLG = 0;
|
---|
82 |
|
---|
83 | const UInt_t npixevt = evt.GetNumPixels();
|
---|
84 | for (UInt_t i=0; i<npixevt; i++)
|
---|
85 | {
|
---|
86 | const MCerPhotPix &pix = evt[i];
|
---|
87 |
|
---|
88 | if (pix.IsPixelHGSaturated())
|
---|
89 | fNumSatPixelsHG++;
|
---|
90 | if (pix.IsPixelSaturated())
|
---|
91 | fNumSatPixelsLG++;
|
---|
92 | }
|
---|
93 |
|
---|
94 | // Get number of islands
|
---|
95 | fNumIslands = evt.GetNumIslands();
|
---|
96 |
|
---|
97 | SetReadyToSave();
|
---|
98 | }
|
---|
99 |
|
---|
100 | // --------------------------------------------------------------------------
|
---|
101 | //
|
---|
102 | void MImagePar::Print(Option_t *) const
|
---|
103 | {
|
---|
104 | *fLog << all;
|
---|
105 | *fLog << "Image Parameters (" << GetName() << ")" << endl;
|
---|
106 | *fLog << " - Num Islands [#] = " << fNumIslands << " Islands" << endl;
|
---|
107 | *fLog << " - Sat.Pixels/HG [#] = " << fNumSatPixelsHG << " Pixels" << endl;
|
---|
108 | *fLog << " - Sat.Pixels/LG [#] = " << fNumSatPixelsLG << " Pixels" << endl;
|
---|
109 | }
|
---|