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: AliHLTPHOSRawAnalyzerPeakFinderComponent.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>AliHLTPHOSRawAnalyzerPeakFinderComponent.cxx</h1><a href="AliHLTPHOSRawAnalyzerPeakFinderComponent_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"> * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *</span>
10 00003 <span class="comment"> * *</span>
11 00004 <span class="comment"> * Author: Per Thomas Hille for the ALICE HLT Project. *</span>
12 00005 <span class="comment"> * Contributors are mentioned in the code where appropriate. *</span>
13 00006 <span class="comment"> * *</span>
14 00007 <span class="comment"> * Permission to use, copy, modify and distribute this software and its *</span>
15 00008 <span class="comment"> * documentation strictly for non-commercial purposes is hereby granted *</span>
16 00009 <span class="comment"> * without fee, provided that the above copyright notice appears in all *</span>
17 00010 <span class="comment"> * copies and that both the copyright notice and this permission notice *</span>
18 00011 <span class="comment"> * appear in the supporting documentation. The authors make no claims *</span>
19 00012 <span class="comment"> * about the suitability of this software for any purpose. It is *</span>
20 00013 <span class="comment"> * provided "as is" without express or implied warranty. *</span>
21 00014 <span class="comment"> **************************************************************************/</span>
23 00016 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRawAnalyzerPeakFinderComponent_8h.html">AliHLTPHOSRawAnalyzerPeakFinderComponent.h</a>"</span>
24 00017 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSRawAnalyzerPeakFinder_8h.html">AliHLTPHOSRawAnalyzerPeakFinder.h</a>"</span>
25 00018 <span class="preprocessor">#include <cstdlib></span>
26 00019 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSCommonDefs_8h.html">AliHLTPHOSCommonDefs.h</a>"</span>
31 <a name="l00024"></a><a class="code" href="AliHLTPHOSRawAnalyzerPeakFinderComponent_8cxx.html#a0">00024</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html">AliHLTPHOSRawAnalyzerPeakFinderComponent</a> gAliHLTPHOSRawAnalyzerPeakFinderComponent;
33 <a name="l00026"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a0">00026</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a0">AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent</a>():<a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html">AliHLTPHOSRawAnalyzerComponent</a>()
35 00028 fAnalyzerPtr = <span class="keyword">new</span> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html">AliHLTPHOSRawAnalyzerPeakFinder</a>();
37 00030 <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">LoadPFVector</a>() == kFALSE)
39 00032 <span class="comment">// cout << "Warning, could not load PF vectors" << endl;</span>
41 00034 <span class="keywordflow">else</span>
43 00036 <span class="comment">// cout << "Loaded PF vectors" << endl;</span>
48 <a name="l00041"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a1">00041</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a1">AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent</a>()
54 <a name="l00047"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d2">00047</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a0">AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent</a>(<span class="keyword">const</span> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html">AliHLTPHOSRawAnalyzerPeakFinderComponent</a> & ) : <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html">AliHLTPHOSRawAnalyzerComponent</a>()
60 00053 <span class="keyword">const</span> <span class="keywordtype">char</span>*
61 <a name="l00054"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a2">00054</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a2">AliHLTPHOSRawAnalyzerPeakFinderComponent::GetComponentID</a>()
63 00056 <span class="keywordflow">return</span> <span class="stringliteral">"PhosRawPeakFinder"</span>;
67 <a name="l00060"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">00060</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector</a>()
69 00062 <span class="keywordflow">return</span> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">LoadPFVector</a>(<a class="code" href="AliHLTPHOSCommonDefs_8h.html#a22">PF_DEFAULT_STARTINDEX</a>, <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a21">PF_DEFAULT_N_SAMPLES</a>, <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a25">DEFAULT_TAU</a>, <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a26">DEFAULT_FS</a> );
74 <a name="l00067"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d1">00067</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector</a>(<span class="keywordtype">int</span> startIndex, <span class="keywordtype">int</span> nSamples, <span class="keywordtype">int</span> tau, <span class="keywordtype">int</span> fs)
76 00069 <span class="keywordtype">char</span> tmpPFPath[PF_MAX_PATH_LENGTH];
77 00070 Double_t tmpAVector[nSamples];
78 00071 Double_t tmpTVector[nSamples];
79 00072 sprintf(tmpPFPath,<span class="stringliteral">"%s%s/start%dN%dtau%dfs%d.txt"</span>, getenv(<span class="stringliteral">"ALICE_ROOT"</span>), <a class="code" href="AliHLTPHOSCommonDefs_8h.html#a20">PF_VECTOR_DIR</a>, startIndex, nSamples, tau, fs);
81 00074 fp = fopen(tmpPFPath, <span class="stringliteral">"r"</span>);
83 00076 <span class="keywordflow">if</span>(fp != 0)
85 00078 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i < nSamples; i++)
87 00080 fscanf(fp, <span class="stringliteral">"%lf"</span>, &tmpAVector[i]);
90 00083 fscanf(fp, <span class="stringliteral">"\n"</span>);
92 00085 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i < nSamples; i++)
94 00087 fscanf(fp, <span class="stringliteral">"%lf"</span>, &tmpTVector[i]);
96 00089 fAnalyzerPtr-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#a16">SetAVector</a>(tmpAVector, nSamples);
97 00090 fAnalyzerPtr-><a class="code" href="classAliHLTPHOSRawAnalyzer.html#a15">SetTVector</a>(tmpTVector, nSamples);
99 00092 <span class="keywordflow">return</span> kTRUE;
102 00095 <span class="keywordflow">else</span>
104 00097 <a class="code" href="AliHLTLogging_8h.html#a7">HLTFatal</a>(<span class="stringliteral">"ERROR: could not open PF vector file"</span>);
105 00098 <span class="keywordflow">return</span> kFALSE;
110 00103 <a class="code" href="classAliHLTComponent.html">AliHLTComponent</a>*
111 <a name="l00104"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a3">00104</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a3">AliHLTPHOSRawAnalyzerPeakFinderComponent::Spawn</a>()
113 00106 <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html">AliHLTPHOSRawAnalyzerPeakFinderComponent</a>;
116 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by
117 <a href="http://www.doxygen.org/index.html">
118 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>