#include "TFile.h"
#include "AliCaloPeakFinderVectors.h"
#include <iostream>
-//#include "AliEMCALRawUtils.h"
using namespace std;
AliCaloRawAnalyzerPeakFinder::AliCaloRawAnalyzerPeakFinder() :AliCaloRawAnalyzer("Peak-Finder", "PF"),
-// fAmp(0),
fPeakFinderVectors(0),
fRunOnAlien(false),
fIsInitialized(false)
AliCaloRawAnalyzerPeakFinder::InitOCDB(bool alien) const
{
// Setting the default OCDB pathe depending on wether we work locally or on the GRID.
- AliCDBManager::Instance()->SetDefaultStorage( alien == true ? "alien://$ALICE_ROOT/OCDB" : "local://$ALICE_ROOT/OCDB");
- AliCDBManager::Instance()->SetRun(100);
+ if( !AliCDBManager::Instance()->IsDefaultStorageSet ())
+ {
+ AliCDBManager::Instance()->SetDefaultStorage( alien == true ? "alien://$ALICE_ROOT/OCDB" : "local://$ALICE_ROOT/OCDB" );
+ AliCDBManager::Instance()->SetRun(100);
+ }
}
AliCaloFitResults
AliCaloRawAnalyzerPeakFinder::Evaluate( const vector<AliCaloBunchInfo> &bunchvector, const UInt_t altrocfg1, const UInt_t altrocfg2 )
{
+ // Evaluation of amplitude and TOF
if( fIsInitialized == false )
{
cout << __FILE__ << ":" << __LINE__ << "ERROR, peakfinder vectors not loaded" << endl;
}
if( TMath::Abs( (maxf - fAmp )/maxf ) > 0.1 )
{
- // cout << __FILE__ << ":" << __LINE__ << "WARNING: amp was" << fAmp <<", but was changed to "<< maxf << endl;
fAmp = maxf;
}
- // tof = timebinOffset - 0.01*tof/fAmp; // clock ticks
tof = timebinOffset - 0.01*tof/fAmp - fL1Phase/TIMEBINWITH; // clock
-
+
// use local-array time for chi2 estimate
Float_t chi2 = CalculateChi2(fAmp, tof-timebinOffset+maxrev, first, last);
Int_t ndf = last - first - 1; // nsamples - 2
for( int j=0; j < PF::SAMPLERANGE; j++)
{
pfv->GetVector( i, j, fPFAmpVectors[i][j] , fPFTofVectors[i][j],
- fPFAmpVectorsCoarse[i][j] , fPFTofVectorsCoarse[i][j] );
+ fPFAmpVectorsCoarse[i][j] , fPFTofVectorsCoarse[i][j] );
fPeakFinderVectors->SetVector( i, j, fPFAmpVectors[i][j], fPFTofVectors[i][j],
fPFAmpVectorsCoarse[i][j], fPFTofVectorsCoarse[i][j] );
if( entry != 0 )
{
-
- cout << __FILE__ << ":" << __LINE__ << ": Printing metadata !! " << endl;
- entry->PrintMetaData();
-
+ //cout << __FILE__ << ":" << __LINE__ << ": Printing metadata !! " << endl;
+ //entry->PrintMetaData();
AliCaloPeakFinderVectors *pfv = (AliCaloPeakFinderVectors *)entry->GetObject();
if( pfv == 0 )
{
cout << __FILE__ << ":" << __LINE__ << "_ ERRROR " << endl;
}
-
CopyVectors( pfv );
if( pfv != 0 )
fIsInitialized = true;
}
}
-
}
{
for(int m = 0; m < n ; m++ )
{
- fscanf(fp, "%lf\t", &fPFAmpVectors[i][j][m] );
+ fscanf(fp, "%lf\t", &fPFAmpVectors[i][j][m] );
fscanf(fpc, "%lf\t", &fPFAmpVectorsCoarse[i][j][m] );
}
fscanf(fp, "\n" );
fPeakFinderVectors->SetVector( i, j, fPFAmpVectors[i][j], fPFTofVectors[i][j],
fPFAmpVectorsCoarse[i][j], fPFTofVectorsCoarse[i][j] );
- fclose (fp);
- fclose (fpc);
}
- delete fp;
- delete fpc;
+ if(fp) fclose (fp );
+ if(fpc)fclose (fpc);
}
}