]>
Commit | Line | Data |
---|---|---|
8562a9e6 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
2 | <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> | |
3 | <title>AliHLTPHOS: AliHLTPHOSRawAnalyzerPeakFinder.cxx Source File</title> | |
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> | |
5 | </head><body> | |
6 | <!-- Generated by Doxygen 1.3.9.1 --> | |
7 | <div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> | |
eace7fcd | 8 | <h1>AliHLTPHOSRawAnalyzerPeakFinder.cxx</h1><a href="AliHLTPHOSRawAnalyzerPeakFinder_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/**************************************************************************</span> |
9 | 00002 <span class="comment"> * This file is property of and copyright by the Experimental Nuclear *</span> | |
10 | 00003 <span class="comment"> * Physics Group, Dep. of Physics *</span> | |
11 | 00004 <span class="comment"> * University of Oslo, Norway, 2007 *</span> | |
12 | 00005 <span class="comment"> * * </span> | |
13 | 00006 <span class="comment"> * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*</span> | |
14 | 00007 <span class="comment"> * Contributors are mentioned in the code where appropriate. *</span> | |
15 | 00008 <span class="comment"> * Please report bugs to perthi@fys.uio.no * </span> | |
16 | 00009 <span class="comment"> * *</span> | |
17 | 00010 <span class="comment"> * Permission to use, copy, modify and distribute this software and its *</span> | |
18 | 00011 <span class="comment"> * documentation strictly for non-commercial purposes is hereby granted *</span> | |
19 | 00012 <span class="comment"> * without fee, provided that the above copyright notice appears in all *</span> | |
20 | 00013 <span class="comment"> * copies and that both the copyright notice and this permission notice *</span> | |
21 | 00014 <span class="comment"> * appear in the supporting documentation. The authors make no claims *</span> | |
22 | 00015 <span class="comment"> * about the suitability of this software for any purpose. It is *</span> | |
23 | 00016 <span class="comment"> * provided "as is" without express or implied warranty. *</span> | |
24 | 00017 <span class="comment"> **************************************************************************/</span> | |
25 | 00018 | |
26 | 00019 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRawAnalyzerPeakFinder_8h.html">AliHLTPHOSRawAnalyzerPeakFinder.h</a>"</span> | |
27 | 00020 <span class="preprocessor">#include <iostream></span> | |
28 | 00021 <span class="preprocessor">#include <cmath></span> | |
8562a9e6 | 29 | 00022 |
eace7fcd | 30 | 00023 <span class="keyword">using</span> std::cout; |
31 | 00024 <span class="keyword">using</span> std::endl; | |
8562a9e6 | 32 | 00025 |
eace7fcd | 33 | <a name="l00026"></a><a class="code" href="AliHLTPHOSRawAnalyzerPeakFinder_8cxx.html#a0">00026</a> <a class="code" href="AliHLTPHOSRawAnalyzerPeakFinder_8cxx.html#a0">ClassImp</a>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html">AliHLTPHOSRawAnalyzerPeakFinder</a>) |
34 | 00027 | |
8562a9e6 | 35 | 00028 |
eace7fcd | 36 | 00029 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html">AliHLTPHOSRawAnalyzerPeakFinder</a>::<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html">AliHLTPHOSRawAnalyzerPeakFinder</a>(const <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html">AliHLTPHOSRawAnalyzerPeakFinder</a>&):<a class="code" href="classAliHLTPHOSRawAnalyzer.html">AliHLTPHOSRawAnalyzer</a>() , fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0) |
37 | 00030 { | |
8562a9e6 | 38 | 00031 |
eace7fcd | 39 | 00032 |
40 | 00033 } | |
41 | 00034 | |
42 | 00035 | |
43 | <a name="l00042"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera0">00042</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera0">AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder</a>():<a class="code" href="classAliHLTPHOSRawAnalyzer.html">AliHLTPHOSRawAnalyzer</a>(), fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0) | |
44 | 00043 { | |
45 | 00044 <span class="comment">// cout <<"PeakFinder:You cannot invoke the Fitter without arguments"<<endl;;</span> | |
46 | 00045 } | |
47 | 00046 | |
8562a9e6 | 48 | 00047 |
eace7fcd | 49 | 00048 |
50 | <a name="l00049"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera3">00049</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera3">AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder</a>() | |
51 | 00050 { | |
52 | 00051 | |
53 | 00052 } <span class="comment">//end AliHLTPHOSRawAnalyzerPeakFinder</span> | |
54 | 00053 | |
55 | 00054 <span class="keywordtype">void</span> | |
56 | <a name="l00055"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera4">00055</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera4">AliHLTPHOSRawAnalyzerPeakFinder::SetTVector</a>(Double_t *tVec, Int_t size) | |
57 | 00056 { | |
58 | 00057 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr2">fTVectorSize</a> = size; | |
59 | 00058 | |
60 | 00059 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr0">fTVectorPtr</a> != 0) | |
61 | 00060 { | |
62 | 00061 <span class="keyword">delete</span> fTVectorPtr; | |
63 | 00062 } | |
64 | 00063 | |
65 | 00064 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr0">fTVectorPtr</a> = <span class="keyword">new</span> Double_t[size]; | |
66 | 00065 | |
67 | 00066 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i< size; i++) | |
68 | 00067 { | |
69 | 00068 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr0">fTVectorPtr</a>[i] = tVec[i]; | |
70 | 00069 } | |
71 | 00070 } | |
72 | 00071 | |
73 | 00072 | |
74 | 00073 <span class="keywordtype">void</span> | |
75 | <a name="l00074"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera5">00074</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera5">AliHLTPHOSRawAnalyzerPeakFinder::SetAVector</a>(Double_t *aVec, Int_t size) | |
76 | 00075 { | |
77 | 00076 | |
78 | 00077 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr3">fAVectorSize</a> = size; | |
79 | 00078 | |
80 | 00079 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr1">fAVectorPtr</a> != 0) | |
81 | 00080 { | |
82 | 00081 <span class="keyword">delete</span> fAVectorPtr; | |
83 | 00082 } | |
84 | 00083 | |
85 | 00084 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr1">fAVectorPtr</a> = <span class="keyword">new</span> Double_t[size]; | |
86 | 00085 | |
87 | 00086 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i< size; i++) | |
8562a9e6 | 88 | 00087 { |
eace7fcd | 89 | 00088 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr1">fAVectorPtr</a>[i] = aVec[i]; |
90 | 00089 } | |
91 | 00090 } | |
92 | 00091 | |
93 | 00105 <span class="keywordtype">void</span> | |
94 | 00106 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFindera6">AliHLTPHOSRawAnalyzerPeakFinder::Evaluate</a>(<span class="keywordtype">int</span> start, <span class="keywordtype">int</span> length) | |
95 | 00107 { | |
96 | 00108 <span class="comment">// printf("\n AliHLTPHOSRawAnalyzerPeakFinder::Evaluat from index %d to %d\n", start, start + length);</span> | |
97 | 00109 fDTof = 0; | |
98 | 00110 fDAmpl = 0; | |
99 | 00111 Int_t tmpLength; | |
100 | 00112 | |
101 | 00113 | |
102 | 00114 <span class="keywordflow">if</span>(fTVectorPtr == 0 || fAVectorPtr == 0) | |
103 | 00115 { | |
104 | 00116 <span class="comment">// printf("\nError: the peakfinder vectors are not specified, aborting !!!\n");</span> | |
105 | 00117 } | |
106 | 00118 <span class="keywordflow">else</span> | |
107 | 00119 { | |
108 | 00120 | |
109 | 00121 <span class="keywordflow">if</span>(length < fTVectorSize) | |
110 | 00122 { | |
111 | 00123 tmpLength = length; | |
112 | 00124 } | |
113 | 00125 <span class="keywordflow">else</span> | |
114 | 00126 { | |
115 | 00127 tmpLength = fTVectorSize; | |
116 | 00128 } | |
117 | 00129 | |
118 | 00130 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i < tmpLength; i++) | |
119 | 00131 { | |
120 | 00132 <a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp6">fDAmpl</a> += <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr1">fAVectorPtr</a>[i]*<a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp0">fFloatDataPtr</a>[i]; | |
121 | 00133 } | |
122 | 00134 | |
123 | 00135 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i < tmpLength; i++) | |
124 | 00136 { | |
125 | 00137 <a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp5">fDTof</a> += <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#AliHLTPHOSRawAnalyzerPeakFinderr0">fTVectorPtr</a>[i]*<a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp0">fFloatDataPtr</a>[i]; | |
126 | 00138 } | |
127 | 00139 | |
128 | 00140 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp6">fDAmpl</a> > 900) | |
129 | 00141 { | |
130 | 00142 Double_t tmpMax = <a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFindera18">GetMaxValue</a>(fFloatDataPtr, tmpLength); | |
131 | 00143 <span class="keywordflow">if</span>(tmpMax == 1023) | |
132 | 00144 { | |
133 | 00145 <a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp6">fDAmpl</a> = tmpMax; | |
134 | 00146 } | |
135 | 00147 } | |
136 | 00148 | |
137 | 00149 <a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp5">fDTof</a> = <a class="code" href="classAliHLTPHOSRawAnalyzer.html#AliHLTPHOSRawAnalyzerPeakFinderp5">fDTof</a>/fDAmpl; | |
138 | 00150 | |
139 | 00151 } | |
140 | 00152 } <span class="comment">//end Evaluate</span> | |
141 | 00153 | |
142 | 00154 | |
143 | 00155 | |
144 | 00156 | |
145 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Feb 18 22:17:03 2007 for AliHLTPHOS by | |
8562a9e6 | 146 | <a href="http://www.doxygen.org/index.html"> |
147 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address> | |
148 | </body> | |
149 | </html> |