]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/html/AliHLTPHOSRawAnalyzerPeakFinderComponent_8cxx-source.html
New component for writing calibration data to fxs (Oystein)
[u/mrichter/AliRoot.git] / HLT / PHOS / html / AliHLTPHOSRawAnalyzerPeakFinderComponent_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: AliHLTPHOSRawAnalyzerPeakFinderComponent.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>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>
22 00015 
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 &lt;cstdlib&gt;</span>
26 00019 <span class="preprocessor">#include "<a class="code" href="AliHLTPHOSCommonDefs_8h.html">AliHLTPHOSCommonDefs.h</a>"</span>
27 00020 
28 00021 
29 00022 
30 00023 
31 <a name="l00024"></a><a class="code" href="AliHLTPHOSRawAnalyzerPeakFinderComponent_8cxx.html#a0">00024</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html">AliHLTPHOSRawAnalyzerPeakFinderComponent</a> gAliHLTPHOSRawAnalyzerPeakFinderComponent;
32 00025 
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>()
34 00027 {
35 00028   fAnalyzerPtr = <span class="keyword">new</span> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinder.html">AliHLTPHOSRawAnalyzerPeakFinder</a>();
36 00029 
37 00030   <span class="keywordflow">if</span>(<a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">LoadPFVector</a>() == kFALSE)
38 00031     {
39 00032       <span class="comment">//      cout &lt;&lt; "Warning, could not load PF vectors" &lt;&lt; endl;</span>
40 00033     }
41 00034   <span class="keywordflow">else</span> 
42 00035     {
43 00036       <span class="comment">//    cout &lt;&lt; "Loaded PF vectors" &lt;&lt; endl;</span>
44 00037     }
45 00038 } 
46 00039 
47 00040 
48 <a name="l00041"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a1">00041</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#a1">AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent</a>()
49 00042 {
50 00043 
51 00044 }
52 00045 
53 00046 
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> &amp; ) : <a class="code" href="classAliHLTPHOSRawAnalyzerComponent.html">AliHLTPHOSRawAnalyzerComponent</a>()
55 00048 {
56 00049 
57 00050 }
58 00051 
59 00052 
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>()
62 00055 {
63 00056   <span class="keywordflow">return</span> <span class="stringliteral">"PhosRawPeakFinder"</span>;
64 00057 }
65 00058 
66 00059 Bool_t 
67 <a name="l00060"></a><a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">00060</a> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html#d0">AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector</a>()
68 00061 {
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> );
70 00063 }
71 00064 
72 00065 
73 00066 Bool_t 
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)
75 00068 {
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);
80 00073   FILE *fp;
81 00074   fp = fopen(tmpPFPath, <span class="stringliteral">"r"</span>);
82 00075   
83 00076   <span class="keywordflow">if</span>(fp != 0)
84 00077     {
85 00078       <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i &lt;  nSamples; i++)
86 00079         {
87 00080           fscanf(fp, <span class="stringliteral">"%lf"</span>, &amp;tmpAVector[i]);
88 00081         }
89 00082 
90 00083       fscanf(fp, <span class="stringliteral">"\n"</span>);
91 00084 
92 00085       <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i &lt; nSamples; i++)
93 00086         {
94 00087                   fscanf(fp, <span class="stringliteral">"%lf"</span>, &amp;tmpTVector[i]);
95 00088         }
96 00089       fAnalyzerPtr-&gt;<a class="code" href="classAliHLTPHOSRawAnalyzer.html#a16">SetAVector</a>(tmpAVector,  nSamples);
97 00090       fAnalyzerPtr-&gt;<a class="code" href="classAliHLTPHOSRawAnalyzer.html#a15">SetTVector</a>(tmpTVector,  nSamples);
98 00091       fclose(fp);
99 00092       <span class="keywordflow">return</span> kTRUE;
100 00093     }
101 00094   
102 00095   <span class="keywordflow">else</span>
103 00096     {
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;
106 00099     }
107 00100 }
108 00101 
109 00102 
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>()
112 00105 {
113 00106   <span class="keywordflow">return</span> <span class="keyword">new</span> <a class="code" href="classAliHLTPHOSRawAnalyzerPeakFinderComponent.html">AliHLTPHOSRawAnalyzerPeakFinderComponent</a>;
114 00107 }
115 00108 
116 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri May 4 04:49:52 2007 for AliHLTPHOS by&nbsp;
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>
119 </body>
120 </html>