]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/html/AliHLTPHOSRawAnalyzerPeakFinder_8cxx-source.html
New component for writing calibration data to fxs (Oystein)
[u/mrichter/AliRoot.git] / HLT / PHOS / html / AliHLTPHOSRawAnalyzerPeakFinder_8cxx-source.html
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&nbsp;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&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;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 &lt;perthi@fys.uio.no&gt; 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 &lt;iostream&gt;</span>
28 00021 <span class="preprocessor">#include &lt;cmath&gt;</span>
29 00022 
30 00023 <span class="keyword">using</span> std::cout;
31 00024 <span class="keyword">using</span> std::endl;
32 00025 
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 
35 00028 
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>&amp;):<a class="code" href="classAliHLTPHOSRawAnalyzer.html">AliHLTPHOSRawAnalyzer</a>() , fTVectorPtr(0), fAVectorPtr(0), fTVectorSize(0), fAVectorSize(0)
37 00030 {
38 00031 
39 00032 
40 00033 }
41 00034 
42 00035 
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)
44 00043 {
45 00044   <span class="comment">//  cout &lt;&lt;"PeakFinder:You cannot invoke the Fitter without arguments"&lt;&lt;endl;;</span>
46 00045 }
47 00046 
48 00047 
49 00048 
50 <a name="l00049"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a3">00049</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a3">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#a4">00055</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a4">AliHLTPHOSRawAnalyzerPeakFinder::SetTVector</a>(Double_t *tVec, Int_t size)
57 00056 {
58 00057   <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r2">fTVectorSize</a> = size;
59 00058 
60 00059   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">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#r0">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&lt; size; i++)
68 00067     {
69 00068       <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">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#a5">00074</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#a5">AliHLTPHOSRawAnalyzerPeakFinder::SetAVector</a>(Double_t *aVec, Int_t size)
76 00075 {
77 00076     
78 00077   <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r3">fAVectorSize</a> = size;
79 00078 
80 00079   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">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#r1">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&lt; size; i++)
88 00087     {
89 00088       <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a>[i] = aVec[i];
90 00089     }
91 00090 }
92 00091 
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)
95 00094 {
96 00095   fDTof = 0;
97 00096   fDAmpl = 0;
98 00097   Int_t tmpLength;
99 00098 
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)
101 00100     {
102 00101 
103 00102     }
104 00103   <span class="keywordflow">else</span>
105 00104     {
106 00105  
107 00106      
108 00107       <span class="keywordflow">if</span>(length &lt;  fTVectorSize)
109 00108         {
110 00109           tmpLength = length;
111 00110         }
112 00111       <span class="keywordflow">else</span>
113 00112         {
114 00113           tmpLength = fTVectorSize;
115 00114         }
116 00115       
117 00116       <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i &lt; tmpLength; i++)
118 00117         {  
119 00118           fDAmpl += <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r1">fAVectorPtr</a>[i]*fFloatDataPtr[i];    
120 00119         }
121 00120 
122 00121       <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i &lt; tmpLength; i++)
123 00122         {   
124 00123           fDTof += <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html#r0">fTVectorPtr</a>[i]*fFloatDataPtr[i]; 
125 00124         }
126 00125       
127 00126       <span class="keywordflow">if</span>(fDAmpl &gt; 900)
128 00127         {
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)
131 00130             {
132 00131               fDAmpl = tmpMax;
133 00132             }
134 00133         }
135 00134 
136 00135       fDTof = fDTof/fDAmpl;
137 00136 
138 00137     }
139 00138 } <span class="comment">//end Evaluate</span>
140 00139 
141 00140 
142 00141 
143 00142 
144 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by&nbsp;
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>
147 </body>
148 </html>