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 *
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 *
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"
24 AliHLTPHOSAltroConfig::AliHLTPHOSAltroConfig() : fNPresamples(900),
26 fIsAltroZeroSupressed(false),
27 fIsAltroBaselineSubtraction(false)
31 // fNTotalSamples = fNPresamples + fNSamples ;
33 int tmpNPreSamples = 0;
35 char *tmpBaseDir = getenv("ALIHLT_BASEDIR");
36 char tmpFileName[256];
38 sprintf(tmpFileName, "%s/PHOS/hltAltroConfig.txt", tmpBaseDir);
42 FILE *fp = fopen(tmpFileName, "r");
46 printf("\nNSamples scanned from file is, ERROR \n");
47 printf("\nNPreSamples scanned from file is. ERROR\n");
48 PrintAltroDefaultValues();
53 fscanf(fp, "N_SAMPLES %d\n", &tmpNSamples);
54 fscanf(fp, "N_PRE_SAMPLES %d\n", &tmpNPreSamples);
55 fNSamples = tmpNSamples;
56 fNPresamples = tmpNPreSamples;
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();
70 printf( "\nERROR: could not find ALIHLT_BASEDIR\n" );
76 AliHLTPHOSAltroConfig::~AliHLTPHOSAltroConfig()
82 AliHLTPHOSAltroConfig:: PrintAltroDefaultValues()
85 printf("\n AliHLTPHOSAltroConfig Default Values\n");
86 printf("Presamples = %d\n", fNPresamples);
87 printf("NSamples = %d\n", fNSamples);
89 if(fIsAltroZeroSupressed == true)
91 printf("fIsAltroZeroSupressed = true\n");
95 printf("fIsAltroZeroSupressed = false\n");
99 if(fIsAltroBaselineSubtraction == true)
101 printf("fIsAltroBaselineSubtraction = true\n");
105 printf("fIsAltroBaselineSubtraction = false\n");
107 // `fIsSoftwareBaselinesubtraction
112 AliHLTPHOSAltroConfig::SetNPresSamples(int presamples)
115 fNPresamples = presamples;
119 AliHLTPHOSAltroConfig::SetNSamples(int samples)
126 AliHLTPHOSAltroConfig::SetAltroZeroSupression(bool isZeroSupressed)
129 fIsAltroZeroSupressed = isZeroSupressed;
133 AliHLTPHOSAltroConfig::SetAltroBaselineSubtraction(bool isAltroBaselineSubtraction)
136 fIsAltroBaselineSubtraction = isAltroBaselineSubtraction;