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

Last change on this file since 6724 was 6038, checked in by gaug, 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}
67
68void MArrivalTime::InitSize(const UInt_t i)
69{
70 fData.Set(i);
71}
72
73// -------------------------------------------------------------------------
74//
75// Set the arrival time in one pixel
76//
77void MArrivalTime::SetTime(const Int_t i, const Float_t t)
78{
79 fData[i] = t;
80}
81
82
83void MArrivalTime::Print(Option_t *o) const
84{
85 *fLog << all << GetDescriptor() << ":" << endl;
86 for (int i=0; i<fData.GetSize(); i++)
87 *fLog << fData[i] << " ";
88 *fLog << endl;
89}
90
91// --------------------------------------------------------------------------
92//
93// Returns the arrival time value
94//
95Bool_t MArrivalTime::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
96{
97 if (idx<0 || idx>=fData.GetSize())
98 return kFALSE;
99
100 switch (type)
101 {
102 case 0:
103 val = fData[idx];
104 break;
105 default:
106 return kFALSE;
107 }
108
109 return val>=0;
110}
111
112void MArrivalTime::DrawPixelContent(Int_t num) const
113{
114 *fLog << warn << "MArrivalTime::DrawPixelContent - not available." << endl;
115}
Note: See TracBrowser for help on using the repository browser.