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">
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="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</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="dirs.html">Directories</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>
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>
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>
30 00023 <span class="keyword">using</span> std::cout;
31 00024 <span class="keyword">using</span> std::endl;
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>)
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)
43 <a name="l00042"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a0">00042</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a0">AliHLTPHOSRawAnalyzerPeakFinder::AliHLTPHOSRawAnalyzerPeakFinder</a>():<a class="code" href="classAliHLTPHOSRawAnalyzer.html">AliHLTPHOSRawAnalyzer</a>(), fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0)
45 00044 <span class="comment">// cout <<"PeakFinder:You cannot invoke the Fitter without arguments"<<endl;;</span>
50 <a name="l00049"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a3">00049</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a3">AliHLTPHOSRawAnalyzerPeakFinder::~AliHLTPHOSRawAnalyzerPeakFinder</a>()
53 00052 } <span class="comment">//end AliHLTPHOSRawAnalyzerPeakFinder</span>
55 00054 <span class="keywordtype">void</span>
56 <a name="l00055"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a4">00055</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a4">AliHLTPHOSRawAnalyzerPeakFinder::SetTVector</a>(Double_t *tVec, Int_t size)
58 00057 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r2">fTVectorSize</a> = size;
60 00059 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">fTVectorPtr</a> != 0)
62 00061 <span class="keyword">delete</span> fTVectorPtr;
65 00064 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">fTVectorPtr</a> = <span class="keyword">new</span> Double_t[size];
67 00066 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i< size; i++)
69 00068 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">fTVectorPtr</a>[i] = tVec[i];
74 00073 <span class="keywordtype">void</span>
75 <a name="l00074"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a5">00074</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a5">AliHLTPHOSRawAnalyzerPeakFinder::SetAVector</a>(Double_t *aVec, Int_t size)
78 00077 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r3">fAVectorSize</a> = size;
80 00079 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a> != 0)
82 00081 <span class="keyword">delete</span> fAVectorPtr;
85 00084 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a> = <span class="keyword">new</span> Double_t[size];
87 00086 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i< size; i++)
89 00088 <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a>[i] = aVec[i];
93 00092 <span class="keywordtype">void</span>
94 <a name="l00093"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a6">00093</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a6">AliHLTPHOSRawAnalyzerPeakFinder::Evaluate</a>(Int_t start, Int_t length)
98 00097 Int_t tmpLength;
100 00099 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">fTVectorPtr</a> == 0 || <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a> == 0)
104 00103 <span class="keywordflow">else</span>
108 00107 <span class="keywordflow">if</span>(length < fTVectorSize)
110 00109 tmpLength = length;
112 00111 <span class="keywordflow">else</span>
114 00113 tmpLength = fTVectorSize;
117 00116 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i < tmpLength; i++)
119 00118 fDAmpl += <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a>[i]*fFloatDataPtr[i];
122 00121 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i < tmpLength; i++)
124 00123 fDTof += <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">fTVectorPtr</a>[i]*fFloatDataPtr[i];
127 00126 <span class="keywordflow">if</span>(fDAmpl > 900)
129 00128 Double_t tmpMax = <a class="code" href="classAliHLTPHOSRawAnalyzer.html#a18">GetMaxValue</a>(fFloatDataPtr, tmpLength);
130 00129 <span class="keywordflow">if</span>(tmpMax == 1023)
132 00131 fDAmpl = tmpMax;
136 00135 fDTof = fDTof/fDAmpl;
139 00138 } <span class="comment">//end Evaluate</span>
144 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by
145 <a href="http://www.doxygen.org/index.html">
146 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>