1 | /* ======================================================================== *\
|
---|
2 | ! $Name: not supported by cvs2svn $:$Id: MExtractTime.cc,v 1.24 2007-03-03 22:48:30 tbretz Exp $
|
---|
3 | ! --------------------------------------------------------------------------
|
---|
4 | !
|
---|
5 | ! *
|
---|
6 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
7 | ! * Software. It is distributed to you in the hope that it can be a useful
|
---|
8 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
9 | ! * It is distributed WITHOUT ANY WARRANTY.
|
---|
10 | ! *
|
---|
11 | ! * Permission to use, copy, modify and distribute this software and its
|
---|
12 | ! * documentation for any purpose is hereby granted without fee,
|
---|
13 | ! * provided that the above copyright notice appear in all copies and
|
---|
14 | ! * that both that copyright notice and this permission notice appear
|
---|
15 | ! * in supporting documentation. It is provided "as is" without express
|
---|
16 | ! * or implied warranty.
|
---|
17 | ! *
|
---|
18 | !
|
---|
19 | !
|
---|
20 | ! Author(s): Markus Gaug, 04/2004 <mailto:markus@ifae.es>
|
---|
21 | ! Author(s): Thomas Bretz, 04/2004 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
22 | !
|
---|
23 | ! Copyright: MAGIC Software Development, 2000-2006
|
---|
24 | !
|
---|
25 | !
|
---|
26 | \* ======================================================================== */
|
---|
27 |
|
---|
28 | //////////////////////////////////////////////////////////////////////////////
|
---|
29 | //
|
---|
30 | // MExtractTime
|
---|
31 | //
|
---|
32 | // Base class for the signal extractors, used the functions
|
---|
33 | // FindTimeHiGain() and FindTimeLoGain() to extract the signal and
|
---|
34 | // substract the pedestal value
|
---|
35 | //
|
---|
36 | // The following figure gives and example of possible inheritance trees.
|
---|
37 | // An extractor class can inherit from each of the following base classes:
|
---|
38 | // - MExtractor
|
---|
39 | // - MExtractTime
|
---|
40 | // - MExtractTimeAndCharge
|
---|
41 | //
|
---|
42 | //Begin_Html
|
---|
43 | /*
|
---|
44 | <img src="images/ExtractorClasses.gif">
|
---|
45 | */
|
---|
46 | //End_Html
|
---|
47 | //
|
---|
48 | // The following variables have to be set by the derived class and
|
---|
49 | // do not have defaults:
|
---|
50 | // - fNumHiGainSamples
|
---|
51 | // - fNumLoGainSamples
|
---|
52 | // - fSqrtHiGainSamples
|
---|
53 | // - fSqrtLoGainSamples
|
---|
54 | //
|
---|
55 | // Input Containers:
|
---|
56 | // MRawEvtData
|
---|
57 | // MRawRunHeader
|
---|
58 | // MPedestalCam
|
---|
59 | //
|
---|
60 | // Output Containers:
|
---|
61 | // MArrivalTimeCam
|
---|
62 | //
|
---|
63 | //////////////////////////////////////////////////////////////////////////////
|
---|
64 | #include "MExtractTime.h"
|
---|
65 |
|
---|
66 | #include <fstream>
|
---|
67 |
|
---|
68 | #include "MLog.h"
|
---|
69 | #include "MLogManip.h"
|
---|
70 |
|
---|
71 | #include "MParList.h"
|
---|
72 |
|
---|
73 | #include "MRawEvtData.h"
|
---|
74 | #include "MRawEvtPixelIter.h"
|
---|
75 | #include "MRawRunHeader.h"
|
---|
76 |
|
---|
77 | #include "MPedestalCam.h"
|
---|
78 | #include "MPedestalPix.h"
|
---|
79 |
|
---|
80 | #include "MArrivalTimeCam.h"
|
---|
81 | #include "MArrivalTimePix.h"
|
---|
82 |
|
---|
83 | ClassImp(MExtractTime);
|
---|
84 |
|
---|
85 | using namespace std;
|
---|
86 |
|
---|
87 | const TString MExtractTime::fgNameTimeCam = "MArrivalTimeCam";
|
---|
88 |
|
---|
89 | // --------------------------------------------------------------------------
|
---|
90 | //
|
---|
91 | // Default constructor.
|
---|
92 | //
|
---|
93 | // Set:
|
---|
94 | // - all pointers to NULL
|
---|
95 | // - all variables to 0
|
---|
96 | // - fSaturationLimit to fgSaturationLimit
|
---|
97 | // - fNameTimeCam to fgNameTimeCam
|
---|
98 | //
|
---|
99 | // Call:
|
---|
100 | // - AddToBranchList("MRawEvtData.*")
|
---|
101 | //
|
---|
102 | MExtractTime::MExtractTime(const char *name, const char *title)
|
---|
103 | : fArrTime(NULL)
|
---|
104 | {
|
---|
105 |
|
---|
106 | fName = name ? name : "MExtractTime";
|
---|
107 | fTitle = title ? title : "Base class for signal extractors";
|
---|
108 |
|
---|
109 | SetNameTimeCam();
|
---|
110 | }
|
---|
111 |
|
---|
112 | // --------------------------------------------------------------------------
|
---|
113 | //
|
---|
114 | // The PreProcess searches for the following input containers:
|
---|
115 | // - MRawEvtData
|
---|
116 | // - MRawRunHeader
|
---|
117 | // - MPedestalCam
|
---|
118 | //
|
---|
119 | // The following output containers are also searched and created if
|
---|
120 | // they were not found:
|
---|
121 | //
|
---|
122 | // - MArrivalTimeCam
|
---|
123 | //
|
---|
124 | Int_t MExtractTime::PreProcess(MParList *pList)
|
---|
125 | {
|
---|
126 | fArrTime = (MArrivalTimeCam*)pList->FindCreateObj("MArrivalTimeCam",AddSerialNumber(fNameTimeCam));
|
---|
127 | if (!fArrTime)
|
---|
128 | return kFALSE;
|
---|
129 |
|
---|
130 | return PreProcessStd(pList);
|
---|
131 | }
|
---|
132 |
|
---|
133 |
|
---|
134 | void MExtractTime::Print(Option_t *o) const
|
---|
135 | {
|
---|
136 | MExtractor::Print(o);
|
---|
137 | if (HasLoGain())
|
---|
138 | *fLog << " Offset Lo-Gain: " << fOffsetLoGain << endl;
|
---|
139 | }
|
---|