//
//////////////////////////////////////////////////////////////////////////////
+#include "Riostream.h"
#include "TF1.h"
#include "TFile.h"
#include "TObjString.h"
#include "AliPMDddldata.h"
#include "AliPMDCalibGain.h"
+using std::ifstream;
ClassImp(AliPMDCalibGain)
AliPMDCalibGain::AliPMDCalibGain():
// Pedestal extraction from the PMD_PED.root file
// To be called once at the beginning
- Int_t det, sm, row, col;
- Float_t mean, rms;
+ Int_t det=0, sm=0, row=0, col=0;
+ Float_t mean=0., rms=0.;
TFile *pedfile = new TFile(rootFile);
// HotChannel extraction from the PMD_HOT.root file
// To be called once at the beginning
- Int_t det, sm, row, col;
- Float_t flag;
+ Int_t det=0, sm=0, row=0, col=0;
+ Float_t flag=0.;
TFile *hotmapfile = new TFile(rootFile);
for (Int_t idet = 0; idet < kDet; idet++)
{
- for (Int_t ismn = 0; ismn < kMaxSMN; idet++)
+ for (Int_t ismn = 0; ismn < kMaxSMN; ismn++)
{
- for (Int_t irow = 0; irow < kMaxRow; idet++)
+ for (Int_t irow = 0; irow < kMaxRow; irow++)
{
- for (Int_t icol = 0; icol < kMaxCol; idet++)
+ for (Int_t icol = 0; icol < kMaxCol; icol++)
{
- fHotFlag[idet][kMaxSMN][kMaxRow][kMaxCol] = 0.;
+ fHotFlag[idet][ismn][irow][icol] = 0.;
}
}
}
{
// Read the variables from the file
- fpw = fopen(tempFile,"r");
-
- Float_t smcount, smiso;
- Float_t cellcount, celliso;
+ ifstream intmpfile;
+ intmpfile.open(tempFile);
+
+ Int_t iddet = 0, issm = 0, irrow = 0, iccol = 0;
+ Float_t smcount = 0., smiso = 0.;
+ Float_t cellcount = 0., celliso = 0.;
for (Int_t idet = 0; idet < kDet; idet++)
{
for (Int_t ism = 0; ism < kMaxSMN; ism++)
{
- fscanf(fpw,"%d %d %f %f",&idet,&ism,&smcount,&smiso);
-
+ intmpfile >> iddet >> issm >> smcount >> smiso;
fSMCount[idet][ism] = smcount;
fSMIso[idet][ism] = smiso;
}
{
for (Int_t icol = 0; icol < kMaxCol; icol++)
{
- fscanf(fpw,"%d %d %d %d %f %f",&idet,&ism,&irow,&icol,
- &cellcount,&celliso);
-
+ intmpfile >> iddet >> issm >> irrow >> iccol
+ >> cellcount >> celliso;
fCellCount[idet][ism][irow][icol] = cellcount;
fCellIso[idet][ism][irow][icol] = celliso;
}
}
}
- fclose(fpw);
+
+ intmpfile.close();
}
// ------------------------------------------------------------------------ //
Int_t neibx[6] = {1,0,-1,-1,0,1};
Int_t neiby[6] = {0,1,1,0,-1,-1};
- Int_t id1,jd1; //neighbour row/col
- Int_t isocount; //number of neighbours with 0 signal
+ Int_t id1 = 0,jd1 = 0; //neighbour row/col
+ Int_t isocount = 0; //number of neighbours with 0 signal
Float_t d1[kDet][kMaxSMN][kMaxRow][kMaxCol];
void AliPMDCalibGain::Analyse(TTree *gaintree, TTree *meantree)
{
// Calculates the mean
- Int_t det, sm, row, col;
- Float_t gain;
+ Int_t det = 0, sm = 0, row = 0, col = 0;
+ Float_t gain = 0.;
Float_t cellmean = 0.;
Float_t modmean[2][24];
void AliPMDCalibGain::FindHotCell(TTree *hottree, Float_t xvar)
{
// Calculates the mean
- Int_t det, sm, row, col;
- Float_t flag;
- Float_t meannhit;
- Float_t meanSqnhit;
- Float_t sigmanhit,nhitcut;
+ Int_t det = 0, sm = 0, row = 0, col = 0;
+ Float_t flag = 0.;
+ Float_t meannhit = 0.;
+ Float_t meanSqnhit = 0.;
+ Float_t sigmanhit = 0.,nhitcut = 0.;
//Float_t xvar = 5.;