]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSAltroConfig.cxx
completely re-worked TPC CA tracking code (Sergey/Ivan)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSAltroConfig.cxx
1 /**************************************************************************
2  * This file is property of and copyright by the Experimental Nuclear     *
3  * Physics Group, Dep. of Physics                                         *
4  * University of Oslo, Norway, 2007                                       *
5  *                                                                        *
6  * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
7  * Contributors are mentioned in the code where appropriate.              *
8  * Please report bugs to perthi@fys.uio.no                                *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18 #include "AliHLTPHOSAltroConfig.h"
19 #include <stdio.h>
20 //#include <unistd.h>
21 #include <cstdlib>
22
23
24 AliHLTPHOSAltroConfig::AliHLTPHOSAltroConfig() : fNPresamples(900), 
25                                                  fNSamples(15), 
26                                                  fIsAltroZeroSupressed(false),
27                                                  fIsAltroBaselineSubtraction(false)
28
29
30 {
31   //  fNTotalSamples =  fNPresamples + fNSamples ; 
32   int tmpNSamples = 0;
33   int tmpNPreSamples = 0;
34
35   char *tmpBaseDir = getenv("ALIHLT_BASEDIR");
36   char tmpFileName[256];
37
38   sprintf(tmpFileName, "%s/PHOS/hltAltroConfig.txt", tmpBaseDir);
39
40   if(tmpBaseDir != 0)
41     {
42       FILE *fp = fopen(tmpFileName, "r");
43
44       if(fp == 0)
45         {
46           printf("\nNSamples scanned from file is, ERROR \n");
47           printf("\nNPreSamples scanned from file is. ERROR\n"); 
48           PrintAltroDefaultValues(); 
49         }
50       else
51         {
52           
53           fscanf(fp, "N_SAMPLES %d\n", &tmpNSamples); 
54           fscanf(fp, "N_PRE_SAMPLES %d\n", &tmpNPreSamples);
55           fNSamples = tmpNSamples;
56           fNPresamples = tmpNPreSamples;
57           //fNTotalSamples;
58           fNTotalSamples = fNSamples + fNPresamples;
59           //printf("\nNSamples scanned from file is %d\n", tmpNSamples);
60           //printf("\nNPreSamples scanned from file is %d\n", tmpNPreSamples); 
61           //printf("\nTotalSamplesSamples was set to  %d\n", fNTotalSamples); 
62           //PrintAltroDefaultValues(); 
63           fclose(fp);
64           
65         }
66
67     }
68   else
69     {
70       printf( "\nERROR: could not find ALIHLT_BASEDIR\n" );
71     }
72
73 }
74
75
76 AliHLTPHOSAltroConfig::~AliHLTPHOSAltroConfig()
77 {
78   //comment
79 }
80
81 void 
82 AliHLTPHOSAltroConfig:: PrintAltroDefaultValues()
83 {
84   //comment
85   printf("\n AliHLTPHOSAltroConfig Default  Values\n");
86   printf("Presamples = %d\n", fNPresamples);
87   printf("NSamples = %d\n", fNSamples);
88
89   if(fIsAltroZeroSupressed == true)
90     {
91       printf("fIsAltroZeroSupressed = true\n");
92     }
93   else
94     {
95       printf("fIsAltroZeroSupressed = false\n");
96     }
97
98   
99   if(fIsAltroBaselineSubtraction == true)
100     {
101       printf("fIsAltroBaselineSubtraction = true\n");
102     }
103   else
104     {
105       printf("fIsAltroBaselineSubtraction = false\n");
106     }
107   //    `fIsSoftwareBaselinesubtraction 
108 }
109
110
111 void 
112 AliHLTPHOSAltroConfig::SetNPresSamples(int presamples)
113 {
114   //comment
115   fNPresamples =  presamples;
116 }
117
118 void 
119 AliHLTPHOSAltroConfig::SetNSamples(int samples)
120 {
121   //comment
122   fNSamples = samples;
123 }
124
125 void 
126 AliHLTPHOSAltroConfig::SetAltroZeroSupression(bool isZeroSupressed)
127 {
128   //comment
129   fIsAltroZeroSupressed = isZeroSupressed;
130 }
131
132 void 
133 AliHLTPHOSAltroConfig::SetAltroBaselineSubtraction(bool isAltroBaselineSubtraction)
134 {
135   //comment
136   fIsAltroBaselineSubtraction = isAltroBaselineSubtraction;
137 }
138
139