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): Sebastian Raducci, 12/2003 <mailto:raducci@fisica.uniud.it>
|
---|
19 | ! Author(s): Markus Gaug 04/2004 <mailto:markus@ifae.es>
|
---|
20 | !
|
---|
21 | ! Copyright: MAGIC Software Development, 2000-2004
|
---|
22 | !
|
---|
23 | !
|
---|
24 | \* ======================================================================== */
|
---|
25 |
|
---|
26 | /////////////////////////////////////////////////////////////////////////////
|
---|
27 | //
|
---|
28 | // MArrivalTime
|
---|
29 | //
|
---|
30 | // Times are calculated using the TSpline5 Root Class
|
---|
31 | //
|
---|
32 | /////////////////////////////////////////////////////////////////////////////
|
---|
33 | #include "MArrivalTime.h"
|
---|
34 |
|
---|
35 | #include "MGeomCam.h"
|
---|
36 | #include "MGeomPix.h"
|
---|
37 |
|
---|
38 | #include "MLog.h"
|
---|
39 | #include "MLogManip.h"
|
---|
40 |
|
---|
41 | #include "MRawEvtPixelIter.h"
|
---|
42 | #include "MRawEvtData.h"
|
---|
43 |
|
---|
44 | ClassImp(MArrivalTime);
|
---|
45 |
|
---|
46 | using namespace std;
|
---|
47 |
|
---|
48 |
|
---|
49 | // --------------------------------------------------------------------------
|
---|
50 | //
|
---|
51 | // Creates an object containing the arrival time for each pixel in the event
|
---|
52 | //
|
---|
53 | MArrivalTime::MArrivalTime(const char *name, const char *title)
|
---|
54 | {
|
---|
55 | fName = name ? name : "MArrivalTime";
|
---|
56 | fTitle = title ? title : "Photons arrival times Information";
|
---|
57 | }
|
---|
58 |
|
---|
59 | // -------------------------------------------------------------------------
|
---|
60 | //
|
---|
61 | // Sets every pixel arrival time to -1
|
---|
62 | //
|
---|
63 | void MArrivalTime::Reset()
|
---|
64 | {
|
---|
65 | fData.Reset(-1);
|
---|
66 | fDataErr.Reset(-1);
|
---|
67 | }
|
---|
68 |
|
---|
69 | void MArrivalTime::InitSize(const UInt_t i)
|
---|
70 | {
|
---|
71 | fData.Set(i);
|
---|
72 | fDataErr.Set(i);
|
---|
73 | }
|
---|
74 |
|
---|
75 | // -------------------------------------------------------------------------
|
---|
76 | //
|
---|
77 | // Set the arrival time in one pixel
|
---|
78 | //
|
---|
79 | void MArrivalTime::SetTime(const Int_t i, const Float_t t)
|
---|
80 | {
|
---|
81 | fData[i] = t;
|
---|
82 | }
|
---|
83 |
|
---|
84 |
|
---|
85 | // -------------------------------------------------------------------------
|
---|
86 | //
|
---|
87 | // Set the arrival time error in one pixel
|
---|
88 | //
|
---|
89 | void MArrivalTime::SetTimeErr(const Int_t i, const Float_t t)
|
---|
90 | {
|
---|
91 | fDataErr[i] = t;
|
---|
92 | }
|
---|
93 |
|
---|
94 | // --------------------------------------------------------------------------
|
---|
95 | //
|
---|
96 | // Returns the arrival time value
|
---|
97 | //
|
---|
98 | Bool_t MArrivalTime::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
|
---|
99 | {
|
---|
100 | if (idx<0 || idx>=fData.GetSize())
|
---|
101 | return kFALSE;
|
---|
102 |
|
---|
103 | switch (type)
|
---|
104 | {
|
---|
105 | case 0:
|
---|
106 | case 1:
|
---|
107 | val = fData[idx];
|
---|
108 | break;
|
---|
109 | }
|
---|
110 |
|
---|
111 | return kTRUE;
|
---|
112 | }
|
---|
113 |
|
---|
114 | void MArrivalTime::DrawPixelContent(Int_t num) const
|
---|
115 | {
|
---|
116 | *fLog << warn << "MArrivalTime::DrawPixelContent - not available." << endl;
|
---|
117 | }
|
---|