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"
21 //ClassImp(AliHLTPHOSRawAnalyzerPeakFinderComponent)
22 AliHLTPHOSRawAnalyzerPeakFinderComponent gAliHLTPHOSRawAnalyzerPeakFinderComponent;
24 AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent():AliHLTPHOSRawAnalyzerComponent()
26 char tmpPFPath[PF_MAX_PATH_LENGTH];
27 cout <<"ALICE_ROOT ="<<getenv("ALICE_ROOT") << endl;
29 Double_t tmpAVector[PF_DEFAULT_N_SAMPLES];
30 Double_t tmpTVector[PF_DEFAULT_N_SAMPLES];
31 analyzerPtr = new AliHLTPHOSRawAnalyzerPeakFinder();
32 analyzerPtr->SetStartIndex(PF_DEFAULT_STARTINDEX);
34 sprintf(tmpPFPath,"%s%s/start%dN%dtau%dfs%d.txt", getenv("ALICE_ROOT"), PF_VECTOR_DIR, PF_DEFAULT_STARTINDEX, PF_DEFAULT_N_SAMPLES, DEFAULT_TAU, DEFAULT_FS);
36 cout <<"PF PATH =" << tmpPFPath << endl;
40 fp = fopen(tmpPFPath, "r");
44 for(int i=0; i < PF_DEFAULT_N_SAMPLES; i++)
46 fscanf(fp, "%lf", &tmpAVector[i]);
52 for(int i=0; i < PF_DEFAULT_N_SAMPLES; i++)
54 fscanf(fp, "%lf", &tmpTVector[i]);
57 analyzerPtr->SetAVector(tmpAVector, PF_DEFAULT_N_SAMPLES);
58 analyzerPtr->SetTVector(tmpTVector, PF_DEFAULT_N_SAMPLES);
66 HLTFatal("ERROR: could not open PF vector file");
67 // cout <<"AliHLTPHOSRawAnalyzerPeakFinderComponent, ERROR: could not open PF vector file" << endl;
73 AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent()
80 AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & ) : AliHLTPHOSRawAnalyzerComponent()
87 AliHLTPHOSRawAnalyzerPeakFinderComponent::GetComponentID()
89 //cout << "AliHLTPHOSRawAnalyzerPeakFinderComponent returning ID" << endl;
90 return "PhosRawPeakFinder";
95 AliHLTPHOSRawAnalyzerPeakFinderComponent::Spawn()
97 // cout << "AliHLTPHOSRawAnalyzerPeakFinderComponent spawning new instance" << endl;
98 return new AliHLTPHOSRawAnalyzerPeakFinderComponent;