3 /**************************************************************************
4 * Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
6 * Author: Per Thomas Hille for the ALICE HLT Project. *
7 * Contributors are mentioned in the code where appropriate. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
18 #include "AliHLTPHOSRawAnalyzerPeakFinderComponent.h"
19 #include "AliHLTCaloRawAnalyzerPeakFinder.h"
21 AliHLTPHOSRawAnalyzerPeakFinderComponent gAliHLTPHOSRawAnalyzerPeakFinderComponent;
23 //___________________________________________________________________________________________________________
24 AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent():AliHLTPHOSRawAnalyzerComponentv3()
26 fAnalyzerPtr = new AliHLTCaloRawAnalyzerPeakFinder();
28 if(1)//LoadPFVector() == kFALSE)
30 // cout << "Warning, could not load PF vectors" << endl;
34 // cout << "Loaded PF vectors" << endl;
39 //___________________________________________________________________________________________________________
40 AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent()
51 //___________________________________________________________________________________________________________
52 AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & ) : AliHLTPHOSRawAnalyzerComponentv3()
57 //-----------------------------------------------------------------------------------------------------------
59 AliHLTPHOSRawAnalyzerPeakFinderComponent::Deinit()
67 Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSRawAnalyzerCrudeComponent Deinit");
71 //___________________________________________________________________________________________________________
73 AliHLTPHOSRawAnalyzerPeakFinderComponent::GetComponentID()
75 return "PhosRawPeakFinder";
78 //___________________________________________________________________________________________________________
80 AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector()
82 return LoadPFVector(fCaloConstants->GetPFDEFAULTSTARTINDEX(), fCaloConstants->GetPFDEFAULTNSAMPLES(),
83 fCaloConstants->GetDEFAULTTAU(), fCaloConstants->GetDEFAULTFS() );
87 //___________________________________________________________________________________________________________
89 AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector(int startIndex, int nSamples, int tau, int fs)
92 char tmpPFPath[fCaloConstants->GetPFMAXPATHLENGTH()];
93 Double_t * tmpAVector = new Double_t[nSamples];
94 Double_t * tmpTVector = new Double_t[nSamples];
95 sprintf(tmpPFPath,"%s%s/start%dN%dtau%dfs%d.txt", getenv("ALICE_ROOT"), PFVECTORDIR, startIndex, nSamples, tau, fs);
97 fp = fopen(tmpPFPath, "r");
99 Int_t res = 0; //OD to get rid of warnings
102 for(int i=0; i < nSamples; i++)
104 res = fscanf(fp, "%lf", &tmpAVector[i]);
107 res = fscanf(fp, "\n");
109 for(int i=0; i < nSamples; i++)
111 res = fscanf(fp, "%lf", &tmpTVector[i]);
113 // fAnalyzerPtr->SetAVector(tmpAVector, nSamples);
114 // fAnalyzerPtr->SetTVector(tmpTVector, nSamples);
116 delete [] tmpAVector;
117 delete [] tmpTVector;
123 delete [] tmpAVector;
124 delete [] tmpTVector;
125 HLTFatal("ERROR: could not open PF vector file");
131 //___________________________________________________________________________________________________________
133 AliHLTPHOSRawAnalyzerPeakFinderComponent::Spawn()
135 return new AliHLTPHOSRawAnalyzerPeakFinderComponent;