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

Last change on this file since 5400 was 5143, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 3.2 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
94void MArrivalTime::Print(Option_t *o) const
95{
96 *fLog << all << GetDescriptor() << ":" << endl;
97 for (int i=0; i<fData.GetSize(); i++)
98 *fLog << fData[i] << " ";
99 *fLog << endl;
100}
101
102// --------------------------------------------------------------------------
103//
104// Returns the arrival time value
105//
106Bool_t MArrivalTime::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
107{
108 if (idx<0 || idx>=fData.GetSize())
109 return kFALSE;
110
111 switch (type)
112 {
113 case 0:
114 val = fData[idx];
115 break;
116 default:
117 return kFALSE;
118 }
119
120 return val>=0;
121}
122
123void MArrivalTime::DrawPixelContent(Int_t num) const
124{
125 *fLog << warn << "MArrivalTime::DrawPixelContent - not available." << endl;
126}
Note: See TracBrowser for help on using the repository browser.