fETAkac = new TF1("etakac",&etakac,etaMin,etaMax,0);
fETAba = new TF1("etabaryon",&etabaryon,etaMin,etaMax,0);
- TF1 *etaPic0 = new TF1("etapic",&etapic, -7, 7, 0);
- TF1 *etaKac0 = new TF1("etakac",&etakac, -7, 7, 0);
- TF1 *etaBar0 = new TF1("etabar",&etabaryon, -7, 7, 0);
+ TF1 etaPic0("etapic(-7,7)",&etapic, -7, 7, 0);
+ TF1 etaKac0("etakac(-7,7)",&etakac, -7, 7, 0);
+ TF1 etaBar0("etabar(-7,7)",&etabaryon, -7, 7, 0);
- TF1 *ptPic0 = new TF1("ptpi", &ptpi, 0., 15., 0);
- TF1 *ptKac0 = new TF1("ptka", &ptka, 0., 15., 0);
- TF1 *ptBar0 = new TF1("ptbar", &ptbaryon, 0., 15., 0);
+ TF1 ptPic0("ptpi(0,15)", &ptpi, 0., 15., 0);
+ TF1 ptKac0("ptka(0,15)", &ptka, 0., 15., 0);
+ TF1 ptBar0("ptbar(0,15)", &ptbaryon, 0., 15., 0);
- Float_t intETApi = etaPic0->Integral(-0.5, 0.5);
- Float_t intETAka = etaKac0->Integral(-0.5, 0.5);
- Float_t intETAba = etaBar0->Integral(-0.5, 0.5);
+ Float_t intETApi = etaPic0.Integral(-0.5, 0.5);
+ Float_t intETAka = etaKac0.Integral(-0.5, 0.5);
+ Float_t intETAba = etaBar0.Integral(-0.5, 0.5);
Float_t scalePi = 6979./(intETApi/1.5);
Float_t scaleKa = 657./(intETAka/2.0);
Float_t scaleBa = 364./(intETAba/2.0);
// Fraction of events corresponding to the selected pt-range
- Float_t intPt = (0.837*ptPic0->Integral(0, 15)+
- 0.105*ptKac0->Integral(0, 15)+
- 0.058*ptBar0->Integral(0, 15));
- Float_t intPtSel = (0.837*ptPic0->Integral(fPtMin, fPtMax)+
- 0.105*ptKac0->Integral(fPtMin, fPtMax)+
- 0.058*ptBar0->Integral(fPtMin, fPtMax));
+ Float_t intPt = (0.837*ptPic0.Integral(0, 15)+
+ 0.105*ptKac0.Integral(0, 15)+
+ 0.058*ptBar0.Integral(0, 15));
+ Float_t intPtSel = (0.837*ptPic0.Integral(fPtMin, fPtMax)+
+ 0.105*ptKac0.Integral(fPtMin, fPtMax)+
+ 0.058*ptBar0.Integral(fPtMin, fPtMax));
Float_t ptFrac = intPtSel/intPt;
// Fraction of events corresponding to the selected eta-range
- Float_t intETASel = (scalePi*etaPic0->Integral(etaMin, etaMax)+
- scaleKa*etaKac0->Integral(etaMin, etaMax)+
- scaleBa*etaBar0->Integral(etaMin, etaMax));
+ Float_t intETASel = (scalePi*etaPic0.Integral(etaMin, etaMax)+
+ scaleKa*etaKac0.Integral(etaMin, etaMax)+
+ scaleBa*etaBar0.Integral(etaMin, etaMax));
// Fraction of events corresponding to the selected phi-range
Float_t phiFrac = (fPhiMax-fPhiMin)/2/TMath::Pi();
fPtPara->SetNpx(npx);
- fYPara = new TF1("Y -Parametrization",fYParaFunc,fYMin,fYMax,0);
- TF1* ptPara = new TF1("Pt-Parametrization",fPtParaFunc,0,15,0);
- TF1* yPara = new TF1("Y -Parametrization",fYParaFunc,-6,6,0);
+ fYPara = new TF1("Y-Parametrization",fYParaFunc,fYMin,fYMax,0);
+ TF1 ptPara("Pt-Parametrization(0,15)",fPtParaFunc,0,15,0);
+ TF1 yPara("Y-Parametrization(-6,6)",fYParaFunc,-6,6,0);
//
// dN/dy| y=0
fdNdy0=fYParaFunc(&y1,&y2);
//
// Integral over generation region
- Float_t intYS = yPara ->Integral(fYMin, fYMax);
- Float_t intPt0 = ptPara->Integral(0,15);
- Float_t intPtS = ptPara->Integral(fPtMin,fPtMax);
+ Float_t intYS = yPara.Integral(fYMin, fYMax);
+ Float_t intPt0 = ptPara.Integral(0,15);
+ Float_t intPtS = ptPara.Integral(fPtMin,fPtMax);
Float_t phiWgt=(fPhiMax-fPhiMin)/2./TMath::Pi();
if (fAnalog == kAnalog) {
fYWgt = intYS/fdNdy0;
#include <TTree.h>
#include <TVector.h>
#include <TVirtualMC.h>
+#include <TString.h>
+#include <TF2.h>
#include "AliArrayBranch.h"
#include "AliClusters.h"
cerr<<"Can't open $ALICE_ROOT/TPC/AliTPCprf2d.root !\n" ;
exit(3);
}
+
+ TString s;
prfinner->Read("prf_07504_Gati_056068_d02");
+ //PH Set different names
+ s=prfinner->GetGRF()->GetName();
+ s+="in";
+ prfinner->GetGRF()->SetName(s.Data());
+
prfouter1->Read("prf_10006_Gati_047051_d03");
+ s=prfouter1->GetGRF()->GetName();
+ s+="out1";
+ prfouter1->GetGRF()->SetName(s.Data());
+
prfouter2->Read("prf_15006_Gati_047051_d03");
+ s=prfouter2->GetGRF()->GetName();
+ s+="out2";
+ prfouter2->GetGRF()->SetName(s.Data());
+
f->Close();
savedir->cd();
fOrigSigmaY=sigmaY;
sprintf(fType,"Gauss");
if (fGRF !=0 ) fGRF->Delete();
- fGRF = new TF2("fun",funGauss2D,-5.,5.,-5.,5.,4);
+ fGRF = new TF2("funGauss2D",funGauss2D,-5.,5.,-5.,5.,4);
funParam[0]=sigmaX;
funParam[1]=sigmaY;
fOrigSigmaY=sigmaY;
sprintf(fType,"Cosh");
if (fGRF !=0 ) fGRF->Delete();
- fGRF = new TF2("fun", funCosh2D,-5.,5.,-5.,5.,4);
+ fGRF = new TF2("funCosh2D", funCosh2D,-5.,5.,-5.,5.,4);
funParam[0]=sigmaX;
funParam[1]=sigmaY;
funParam[2]=fK;
fPadDistance=padDistance;
sprintf(fType,"Gati");
if (fGRF !=0 ) fGRF->Delete();
- fGRF = new TF2("fun", funGati2D,-5.,5.,-5.,5.,5);
+ fGRF = new TF2("funGati2D", funGati2D,-5.,5.,-5.,5.,5);
funParam[0]=padDistance;
funParam[1]=K3X;
if (strncmp(fType,"User",3)!=0){
delete fGRF;
if (strncmp(fType,"Gauss",3)==0)
- fGRF = new TF2("fun",funGauss2D,-5.,5.,-5.,5.,4);
+ fGRF = new TF2("funGauss2D",funGauss2D,-5.,5.,-5.,5.,4);
if (strncmp(fType,"Cosh",3)==0)
- fGRF = new TF2("fun",funCosh2D,-5.,5.,-5.,5.,4);
+ fGRF = new TF2("funCosh2D",funCosh2D,-5.,5.,-5.,5.,4);
if (strncmp(fType,"Gati",3)==0)
- fGRF = new TF2("fun",funGati2D,-5.,5.,-5.,5.,5);
+ fGRF = new TF2("funGati2D",funGati2D,-5.,5.,-5.,5.,5);
if (fGRF!=0) fGRF->SetParameters(funParam);
}
//calculate conversion coefitient to convert position to virtual wire
#include "TPad.h"
#include "TStyle.h"
#include "TH1.h"
+#include <TString.h>
extern TStyle * gStyle;
memcpy(this, &prf, sizeof(prf));
fcharge = new Float_t[fNRF];
memcpy(fcharge,prf.fcharge, fNRF);
- fGRF = new TF1(*(prf.fGRF));
-
+ fGRF = new TF1(*(prf.fGRF));
+ //PH Change the name (add 0 to the end)
+ TString s(fGRF->GetName());
+ s+="0";
+ fGRF->SetName(s.Data());
}
AliTPCRF1D & AliTPCRF1D::operator = (const AliTPCRF1D &prf)
fcharge = new Float_t[fNRF];
memcpy(fcharge,prf.fcharge, fNRF);
fGRF = new TF1(*(prf.fGRF));
+ //PH Change the name (add 0 to the end)
+ TString s(fGRF->GetName());
+ s+="0";
+ fGRF->SetName(s.Data());
return (*this);
}
fpadWidth = padWidth;
fkNorm = kNorm;
if (fGRF !=0 ) fGRF->Delete();
- fGRF = new TF1("fun",funGauss,-5,5,1);
+ fGRF = new TF1("funGauss",funGauss,-5,5,1);
funParam[0]=sigma;
forigsigma=sigma;
fGRF->SetParameters(funParam);
fpadWidth = padWidth;
fkNorm = kNorm;
if (fGRF !=0 ) fGRF->Delete();
- fGRF = new TF1("fun", funCosh, -5.,5.,2);
+ fGRF = new TF1("funCosh", funCosh, -5.,5.,2);
funParam[0]=sigma;
fGRF->SetParameters(funParam);
forigsigma=sigma;
fpadWidth = padWidth;
fkNorm = kNorm;
if (fGRF !=0 ) fGRF->Delete();
- fGRF = new TF1("fun", funGati, -5.,5.,2);
+ fGRF = new TF1("funGati", funGati, -5.,5.,2);
funParam[0]=padDistance;
funParam[1]=K3;
fGRF->SetParameters(funParam);
AliTPCRF1D::Class()->ReadBuffer(R__b, this);
//read functions
- if (strncmp(fType,"Gauss",3)==0) {delete fGRF; fGRF = new TF1("fun",funGauss,-5.,5.,4);}
- if (strncmp(fType,"Cosh",3)==0) {delete fGRF; fGRF = new TF1("fun",funCosh,-5.,5.,4);}
- if (strncmp(fType,"Gati",3)==0) {delete fGRF; fGRF = new TF1("fun",funGati,-5.,5.,4);}
+ if (strncmp(fType,"Gauss",3)==0) {delete fGRF; fGRF = new TF1("funGauss",funGauss,-5.,5.,4);}
+ if (strncmp(fType,"Cosh",3)==0) {delete fGRF; fGRF = new TF1("funCosh",funCosh,-5.,5.,4);}
+ if (strncmp(fType,"Gati",3)==0) {delete fGRF; fGRF = new TF1("funGati",funGati,-5.,5.,4);}
if (fGRF) fGRF->SetParameters(funParam);
} else {
AliTPCkineGrid pulls[5];
TH1F *hDum = new TH1F("name","title",100,-7.,7.);
- TF1 *g = new TF1("g","gaus");
+ TF1 g("g","gaus");
InitializeKineGrid("pulls");
InitializeKineGrid("DB");
// compute the sigma of the distributions
for(Int_t i=0; i<nTotBins; i++) {
if(hPulls0_[i].GetEntries()>10) {
- g->SetRange(-3.*hPulls0_[i].GetRMS(),3.*hPulls0_[i].GetRMS());
+ g.SetRange(-3.*hPulls0_[i].GetRMS(),3.*hPulls0_[i].GetRMS());
hPulls0_[i].Fit("g","R,Q,N");
- pulls[0].SetParam(i,g->GetParameter(2));
+ pulls[0].SetParam(i,g.GetParameter(2));
} else pulls[0].SetParam(i,-1.);
if(hPulls1_[i].GetEntries()>10) {
- g->SetRange(-3.*hPulls1_[i].GetRMS(),3.*hPulls1_[i].GetRMS());
+ g.SetRange(-3.*hPulls1_[i].GetRMS(),3.*hPulls1_[i].GetRMS());
hPulls1_[i].Fit("g","R,Q,N");
- pulls[1].SetParam(i,g->GetParameter(2));
+ pulls[1].SetParam(i,g.GetParameter(2));
} else pulls[1].SetParam(i,-1.);
if(hPulls2_[i].GetEntries()>10) {
- g->SetRange(-3.*hPulls2_[i].GetRMS(),3.*hPulls2_[i].GetRMS());
+ g.SetRange(-3.*hPulls2_[i].GetRMS(),3.*hPulls2_[i].GetRMS());
hPulls2_[i].Fit("g","R,Q,N");
- pulls[2].SetParam(i,g->GetParameter(2));
+ pulls[2].SetParam(i,g.GetParameter(2));
} else pulls[2].SetParam(i,-1.);
if(hPulls3_[i].GetEntries()>10) {
- g->SetRange(-3.*hPulls3_[i].GetRMS(),3.*hPulls3_[i].GetRMS());
+ g.SetRange(-3.*hPulls3_[i].GetRMS(),3.*hPulls3_[i].GetRMS());
hPulls3_[i].Fit("g","R,Q,N");
- pulls[3].SetParam(i,g->GetParameter(2));
+ pulls[3].SetParam(i,g.GetParameter(2));
} else pulls[3].SetParam(i,-1.);
if(hPulls4_[i].GetEntries()>10) {
- g->SetRange(-3.*hPulls4_[i].GetRMS(),3.*hPulls4_[i].GetRMS());
+ g.SetRange(-3.*hPulls4_[i].GetRMS(),3.*hPulls4_[i].GetRMS());
hPulls4_[i].Fit("g","R,Q,N");
- pulls[4].SetParam(i,g->GetParameter(2));
+ pulls[4].SetParam(i,g.GetParameter(2));
} else pulls[4].SetParam(i,-1.);
} // loop on bins
TH1F *hDumP4 = new TH1F("nameP4","dC",100,-0.0005,0.0005);
TH1F *hDumPt = new TH1F("namePt","dp_{T}/p_{T}",100,-0.5,0.5);
- TF1 *g = new TF1("g","gaus");
+ TF1 g("g","gaus");
// create histograms for the all the bins
TH1F *hP0_=NULL;
// compute the sigma of the distributions
for(Int_t i=0; i<nPtBins; i++) {
if(hP0_[i].GetEntries()>10) {
- g->SetRange(-3.*hP0_[i].GetRMS(),3.*hP0_[i].GetRMS());
+ g.SetRange(-3.*hP0_[i].GetRMS(),3.*hP0_[i].GetRMS());
hP0_[i].Fit("g","R,Q,N");
- dP0[i] = g->GetParameter(2);
+ dP0[i] = g.GetParameter(2);
} else dP0[i] = 0.;
if(hP4_[i].GetEntries()>10) {
- g->SetRange(-3.*hP4_[i].GetRMS(),3.*hP4_[i].GetRMS());
+ g.SetRange(-3.*hP4_[i].GetRMS(),3.*hP4_[i].GetRMS());
hP4_[i].Fit("g","R,Q,N");
- dP4[i] = g->GetParameter(2);
+ dP4[i] = g.GetParameter(2);
} else dP4[i] = 0.;
if(hPt_[i].GetEntries()>10) {
- g->SetRange(-3.*hPt_[i].GetRMS(),3.*hPt_[i].GetRMS());
+ g.SetRange(-3.*hPt_[i].GetRMS(),3.*hPt_[i].GetRMS());
hPt_[i].Fit("g","R,Q,N");
- dPtToPt[i] = 100.*g->GetParameter(2);
+ dPtToPt[i] = 100.*g.GetParameter(2);
} else dPtToPt[i] = 0.;
} // loop on bins