source: trunk/MagicSoft/Mars/msignal/MArrivalTime.cc@ 4693

Last change on this file since 4693 was 4577, 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): 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
44ClassImp(MArrivalTime);
45
46using namespace std;
47
48
49// --------------------------------------------------------------------------
50//
51// Creates an object containing the arrival time for each pixel in the event
52//
53MArrivalTime::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//
63void MArrivalTime::Reset()
64{
65 fData.Reset(-1);
66 fDataErr.Reset(-1);
67}
68
69void 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//
79void 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//
89void 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//
98Bool_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
114void MArrivalTime::DrawPixelContent(Int_t num) const
115{
116 *fLog << warn << "MArrivalTime::DrawPixelContent - not available." << endl;
117}
Note: See TracBrowser for help on using the repository browser.