1 /**************************************************************************
2 * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Per Thomas Hille for the ALICE HLT Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 #include "AliHLTPHOSRawAnalyzerPeakFinderComponent.h"
17 #include "AliHLTPHOSRawAnalyzerPeakFinder.h"
19 #include "AliHLTPHOSCommonDefs.h"
22 AliHLTPHOSRawAnalyzerPeakFinderComponent gAliHLTPHOSRawAnalyzerPeakFinderComponent;
24 AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent():AliHLTPHOSRawAnalyzerComponent()
26 analyzerPtr = new AliHLTPHOSRawAnalyzerPeakFinder();
28 if(LoadPFVector() == kFALSE)
30 // cout << "Warning, could not load PF vectors" << endl;
34 // cout << "Loaded PF vectors" << endl;
39 AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent()
45 AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & ) : AliHLTPHOSRawAnalyzerComponent()
52 AliHLTPHOSRawAnalyzerPeakFinderComponent::GetComponentID()
54 return "PhosRawPeakFinder";
58 AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector()
60 return LoadPFVector(PF_DEFAULT_STARTINDEX, PF_DEFAULT_N_SAMPLES, DEFAULT_TAU, DEFAULT_FS );
65 AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector(int startIndex, int nSamples, int tau, int fs)
67 char tmpPFPath[PF_MAX_PATH_LENGTH];
68 Double_t tmpAVector[nSamples];
69 Double_t tmpTVector[nSamples];
70 sprintf(tmpPFPath,"%s%s/start%dN%dtau%dfs%d.txt", getenv("ALICE_ROOT"), PF_VECTOR_DIR, startIndex, nSamples, tau, fs);
72 fp = fopen(tmpPFPath, "r");
76 for(int i=0; i < nSamples; i++)
78 fscanf(fp, "%lf", &tmpAVector[i]);
83 for(int i=0; i < nSamples; i++)
85 fscanf(fp, "%lf", &tmpTVector[i]);
87 analyzerPtr->SetAVector(tmpAVector, nSamples);
88 analyzerPtr->SetTVector(tmpTVector, nSamples);
95 HLTFatal("ERROR: could not open PF vector file");
102 AliHLTPHOSRawAnalyzerPeakFinderComponent::Spawn()
104 return new AliHLTPHOSRawAnalyzerPeakFinderComponent;