+// $Id$
+
/**************************************************************************
* Copyright(c) 2006, ALICE Experiment at CERN, All rights reserved. *
* *
**************************************************************************/
#include "AliHLTPHOSRawAnalyzerPeakFinderComponent.h"
-#include "AliHLTPHOSRawAnalyzerPeakFinder.h"
-//#include <cstdlib>
-//#include "AliHLTPHOSCommonDefs.h"
-
+#include "AliHLTCaloRawAnalyzerPeakFinder.h"
AliHLTPHOSRawAnalyzerPeakFinderComponent gAliHLTPHOSRawAnalyzerPeakFinderComponent;
//___________________________________________________________________________________________________________
-AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent():AliHLTPHOSRawAnalyzerComponent()
+AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent():AliHLTPHOSRawAnalyzerComponentv3()
{
- fAnalyzerPtr = new AliHLTPHOSRawAnalyzerPeakFinder();
+ fAnalyzerPtr = new AliHLTCaloRawAnalyzerPeakFinder();
- if(LoadPFVector() == kFALSE)
+ if(1)//LoadPFVector() == kFALSE)
{
// cout << "Warning, could not load PF vectors" << endl;
}
AliHLTPHOSRawAnalyzerPeakFinderComponent::~AliHLTPHOSRawAnalyzerPeakFinderComponent()
{
+ if(fAnalyzerPtr)
+ {
+ delete fAnalyzerPtr;
+ fAnalyzerPtr = 0;
+ }
}
//___________________________________________________________________________________________________________
-AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & ) : AliHLTPHOSRawAnalyzerComponent()
+AliHLTPHOSRawAnalyzerPeakFinderComponent::AliHLTPHOSRawAnalyzerPeakFinderComponent(const AliHLTPHOSRawAnalyzerPeakFinderComponent & ) : AliHLTPHOSRawAnalyzerComponentv3()
{
}
+//-----------------------------------------------------------------------------------------------------------
+int
+AliHLTPHOSRawAnalyzerPeakFinderComponent::Deinit()
+{
+
+ if(fAnalyzerPtr)
+ {
+ delete fAnalyzerPtr;
+ fAnalyzerPtr = 0;
+ }
+ Logging(kHLTLogInfo, "HLT", "PHOS", ",AliHLTPHOSRawAnalyzerCrudeComponent Deinit");
+ return 0;
+}
//___________________________________________________________________________________________________________
const char*
Bool_t
AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector()
{
- return LoadPFVector(PF_DEFAULT_STARTINDEX, PF_DEFAULT_N_SAMPLES, DEFAULT_TAU, DEFAULT_FS );
+ return LoadPFVector(fCaloConstants->GetPFDEFAULTSTARTINDEX(), fCaloConstants->GetPFDEFAULTNSAMPLES(),
+ fCaloConstants->GetDEFAULTTAU(), fCaloConstants->GetDEFAULTFS() );
}
Bool_t
AliHLTPHOSRawAnalyzerPeakFinderComponent::LoadPFVector(int startIndex, int nSamples, int tau, int fs)
{
- char tmpPFPath[PF_MAX_PATH_LENGTH];
- Double_t tmpAVector[nSamples];
- Double_t tmpTVector[nSamples];
- sprintf(tmpPFPath,"%s%s/start%dN%dtau%dfs%d.txt", getenv("ALICE_ROOT"), PF_VECTOR_DIR, startIndex, nSamples, tau, fs);
+
+ char tmpPFPath[fCaloConstants->GetPFMAXPATHLENGTH()];
+ Double_t * tmpAVector = new Double_t[nSamples];
+ Double_t * tmpTVector = new Double_t[nSamples];
+ sprintf(tmpPFPath,"%s%s/start%dN%dtau%dfs%d.txt", getenv("ALICE_ROOT"), PFVECTORDIR, startIndex, nSamples, tau, fs);
FILE *fp;
fp = fopen(tmpPFPath, "r");
+ Int_t res = 0; //OD to get rid of warnings
if(fp != 0)
{
for(int i=0; i < nSamples; i++)
{
- fscanf(fp, "%lf", &tmpAVector[i]);
+ res = fscanf(fp, "%lf", &tmpAVector[i]);
}
- fscanf(fp, "\n");
+ res = fscanf(fp, "\n");
for(int i=0; i < nSamples; i++)
{
- fscanf(fp, "%lf", &tmpTVector[i]);
+ res = fscanf(fp, "%lf", &tmpTVector[i]);
}
- fAnalyzerPtr->SetAVector(tmpAVector, nSamples);
- fAnalyzerPtr->SetTVector(tmpTVector, nSamples);
+ // fAnalyzerPtr->SetAVector(tmpAVector, nSamples);
+ // fAnalyzerPtr->SetTVector(tmpTVector, nSamples);
fclose(fp);
+ delete [] tmpAVector;
+ delete [] tmpTVector;
return kTRUE;
}
else
{
+ delete [] tmpAVector;
+ delete [] tmpTVector;
HLTFatal("ERROR: could not open PF vector file");
return kFALSE;
}