source: trunk/MagicSoft/Mars/manalysis/MArrivalTimeCalc.cc@ 2702

Last change on this file since 2702 was 2659, checked in by raducci, 21 years ago
*** empty log message ***
File size: 3.9 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!
20! Copyright: MAGIC Software Development, 2002-2003
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MArrivalTimeCalc
28//
29// This is a task that calculates the arrival times of photons.
30// For now, it returns the number of time slice containig the maximum value.
31//
32// P R E L I M I N A R Y
33// Other more sophisticated methods have to be implemented.
34//
35// Input Containers:
36// MRawEvtData
37//
38// Output Containers:
39// //MArrivalTime
40// MRawEvtData
41//////////////////////////////////////////////////////////////////////////////
42
43//#include "MArrivalTime.h"
44#include "MArrivalTimeCalc.h"
45
46#include "MParList.h"
47
48#include "MLog.h"
49#include "MLogManip.h"
50
51#include "MGeomCam.h"
52#include "MMcRunHeader.hxx"
53
54#include "MRawRunHeader.h"
55#include "MRawEvtData.h" // MRawEvtData::GetNumPixels
56#include "MCameraData.h"
57#include "MRawEvtPixelIter.h"
58
59ClassImp(MArrivalTimeCalc);
60
61using namespace std;
62
63// --------------------------------------------------------------------------
64//
65// Default constructor.
66//
67MArrivalTimeCalc::MArrivalTimeCalc(const char *name, const char *title)
68{
69 fName = name ? name : "MArrivalTimeCalc";
70 fTitle = title ? title : "Calculate photons arrival time";
71
72 AddToBranchList("MRawEvtData.fHiGainPixId");
73 AddToBranchList("MRawEvtData.fLoGainPixId");
74 AddToBranchList("MRawEvtData.fHiGainFadcSamples");
75 AddToBranchList("MRawEvtData.fLoGainFadcSamples");
76
77}
78
79// --------------------------------------------------------------------------
80//
81// The PreProcess searches for the following input containers:
82// - MRawRunHeader
83// - MRawEvtData
84// //- MArrivalTime
85// - MGeomCam
86//
87// The following output containers are also searched and created if
88// they were not found:
89// //- MArrivalTime
90// - MRawEvtData
91//
92
93Int_t MArrivalTimeCalc::PreProcess(MParList *pList)
94{
95 fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
96 if (!fRunHeader)
97 {
98 *fLog << err << "MRawRunHeader not found... aborting." << endl;
99 return kFALSE;
100 }
101
102 fRawEvt = (MRawEvtData*)pList->FindObject(AddSerialNumber("MRawEvtData"));
103 if (!fRawEvt)
104 {
105 *fLog << err << "MRawEvtData not found... aborting." << endl;
106 return kFALSE;
107 }
108
109 fGeom = (MGeomCam*)pList->FindObject("MGeomCam");
110 if (!fGeom)
111 {
112 *fLog << err << "MGeomCam not found... aborting." << endl;
113 return kFALSE;
114 }
115
116/* fArrTime = (MArrivalTime*)pList->FindCreateObj(AddSerialNumber("MArrivalTime"));
117 if (!fArrTime)
118 return kFALSE;
119*/
120 return kTRUE;
121}
122
123
124// --------------------------------------------------------------------------
125// Evaluation of the mean arrival times (for now it stands for the maximum in slices units)
126// per pixel and store them in the MArrivalTime container.
127//
128Int_t MArrivalTimeCalc::Process()
129{
130 MRawEvtPixelIter pixel(fRawEvt);
131
132 //fArrTime->Calc((const MRawEvtData&) *fRawEvt,(const MGeomCam&) *fGeom);
133 //fArrTime->SetReadyToSave();
134
135 //while (pixel.Next()){;}
136
137 return kTRUE;
138}
Note: See TracBrowser for help on using the repository browser.