AliFlowAnalysisWithQCumulants::AliFlowAnalysisWithQCumulants():
fTrack(NULL),
fHistList(NULL),
+ fWeightsList(NULL),
fAvMultIntFlowQC(NULL),
fQvectorComponents(NULL),
fIntFlowResultsQC(NULL),
fEventCounter(0),
fUsePhiWeights(kFALSE),
fUsePtWeights(kFALSE),
- fUseEtaWeights(kFALSE),
- fPhiWeights(),
- fPtWeights(),
- fEtaWeights()
+ fUseEtaWeights(kFALSE)
{
//constructor
fHistList = new TList();
-
+ fWeightsList = new TList();
+
fnBinsPt = AliFlowCommonConstants::GetNbinsPt();
fPtMin = AliFlowCommonConstants::GetPtMin();
fPtMax = AliFlowCommonConstants::GetPtMax();
fnBinsEta = AliFlowCommonConstants::GetNbinsEta();
fEtaMin = AliFlowCommonConstants::GetEtaMin();
fEtaMax = AliFlowCommonConstants::GetEtaMax();
-
- //to be improved
- fPhiWeights.Reset();
- fPtWeights.Reset();
- fEtaWeights.Reset();
}
AliFlowAnalysisWithQCumulants::~AliFlowAnalysisWithQCumulants()
{
- //desctructor
+ //destructor
delete fHistList;
+ delete fWeightsList;
}
//================================================================================================================
fmPrimePerEtaBin->SetYTitle("Counts");
//fHistList->Add(fOverlapPerEtaBin);
- //fEtaReq1nPrimePrimePOI
+ //fEtaReq1nPrimePrimePOIafvQvector1n=anEvent->GetQ(1*n
fEtaReq1nPrimePrimePOI = new TProfile("fEtaReq1nPrimePrimePOI","Re[q_{n}^{''}]",fnBinsEta,fEtaMin,fEtaMax,"s");
fEtaReq1nPrimePrimePOI->SetXTitle("#eta");
fEtaReq1nPrimePrimePOI->SetYTitle("Re[q_{n}^{''}]");
f8pDistribution->SetXTitle("<8>_{n,n,n,n|n,n,n,n}");
f8pDistribution->SetYTitle("Counts");
fHistList->Add(f8pDistribution);
-
- //phi weights
- //fHistList->Add(&fPhiWeights);
-
- //pt weights
- //fHistList->Add(&fPtWeights);
-
- //eta weights
- //fHistList->Add(&fEtaWeights);
}//end of Init()
//================================================================================================================
void AliFlowAnalysisWithQCumulants::Make(AliFlowEventSimple* anEvent)
{
//running over data
- //set the weights:
- if(fUsePhiWeights)
- {
- anEvent->SetUseWeightsPhi(fUsePhiWeights);
- anEvent->SetPhiWeights(&fPhiWeights);
- }
- if(fUsePtWeights)
- {
- anEvent->SetUseWeightsPt(fUsePtWeights);
- anEvent->SetPtWeights(&fPtWeights);
- }
- if(fUseEtaWeights)
- {
- anEvent->SetUseWeightsEta(fUseEtaWeights);
- anEvent->SetEtaWeights(&fEtaWeights);
- }
-
+
//get the total multiplicity nPrim of event:
Int_t nPrim = anEvent->NumberOfTracks();//nPrim = RPs + POIs + rest
afvQvector1n.Set(0.,0.);
afvQvector1n.SetMult(0);
- afvQvector1n=anEvent->GetQ(1*n);
-
+ afvQvector1n=anEvent->GetQ(1*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
+
afvQvector2n.Set(0.,0.);
afvQvector2n.SetMult(0);
- afvQvector2n=anEvent->GetQ(2*n);
-
+ afvQvector2n=anEvent->GetQ(2*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
+
afvQvector3n.Set(0.,0.);
afvQvector3n.SetMult(0);
- afvQvector3n=anEvent->GetQ(3*n);
+ afvQvector3n=anEvent->GetQ(3*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
afvQvector4n.Set(0.,0.);
afvQvector4n.SetMult(0);
- afvQvector4n=anEvent->GetQ(4*n);
-
+ afvQvector4n=anEvent->GetQ(4*n,fWeightsList,fUsePhiWeights,fUsePtWeights,fUseEtaWeights);
+
+
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// !!!! to be removed !!!!
if(dMult>1)
{
//fill the common control histogram (2nd order):
+
fCommonHists2nd->FillControlHistograms(anEvent);
two1n1n = (pow(afvQvector1n.Mod(),2.)-dMult)/(dMult*(dMult-1.)); //<2>_{n|n} = <cos(n*(phi1-phi2))>
//----------------------------------------------------------------------------------------------------------------
// setters and getters
//----------------------------------------------------------------------------------------------------------------
- TList* GetHistList() const {return this->fHistList;} //output histogram list
+ TList* GetHistList() const {return this->fHistList;}
+
+ void SetWeightsList(TList* wlist) {this->fWeightsList = wlist;}
+ TList* GetWeightsList() const {return this->fWeightsList;}
void SetIntFlowResults(TH1D* const ifr) {this->fIntFlowResultsQC = ifr;};
TH1D* GetIntFlowResults() const {return this->fIntFlowResultsQC;};
void SetFour1n1n1n1nPerPtBinRP(TProfile* const pb4PerPtBin1n1n1n1nRP) {this->f4PerPtBin1n1n1n1nRP = pb4PerPtBin1n1n1n1nRP;};
TProfile* GetFour1n1n1n1nPerPtBinRP() const {return this->f4PerPtBin1n1n1n1nRP;};
-
+
void SetTwo1n1nPerEtaBinRP(TProfile* const pb2PerEtaBin1n1nRP) {this->f2PerEtaBin1n1nRP = pb2PerEtaBin1n1nRP;};
TProfile* GetTwo1n1nPerEtaBinRP() const {return this->f2PerEtaBin1n1nRP;};
void SetDirectCorrelations(TProfile* const dc) {this->fDirectCorrelations = dc;};
TProfile* GetDirectCorrelations() const {return this->fDirectCorrelations;};
- void SetPhiWeights(TH1F const phiW) { this->fPhiWeights = phiW; this->fUsePhiWeights = kTRUE;};
- TH1F GetPhiWeights() const { return this->fPhiWeights;};
+ void SetUsePhiWeights(Bool_t const) {this->fUsePhiWeights = kTRUE;};
+ Bool_t GetUsePhiWeights() const {return this->fUsePhiWeights;};
- void SetPtWeights(TH1D const ptW) { this->fPtWeights = ptW; ; this->fUsePtWeights = kTRUE;};
- TH1D GetPtWeights() const { return this->fPtWeights;};
+ void SetUsePtWeights(Bool_t const) {this->fUsePtWeights = kTRUE;};
+ Bool_t GetUsePtWeights() const {return this->fUsePtWeights;};
- void SetEtaWeights(TH1D const etaW) { this->fEtaWeights = etaW; ; this->fUseEtaWeights = kTRUE;};
- TH1D GetEtaWeights() const { return this->fEtaWeights;};
+ void SetUseEtaWeights(Bool_t const) {this->fUseEtaWeights = kTRUE;};
+ Bool_t GetUseEtaWeights() const {return this->fUseEtaWeights;};
//----------------------------------------------------------------------------------------------------------------
private:
AliFlowTrackSimple* fTrack; //track
TList* fHistList; //list to hold all output histograms
+ TList* fWeightsList; //list to hold all histograms with weights
+
TProfile* fAvMultIntFlowQC; //average selected multiplicity (for int. flow)
TProfile* fQvectorComponents; //averages of Q-vector components (1st bin: <Q_x>, 2nd bin: <Q_y>, ...)
Double_t fEtaMax; //maximum eta
Int_t fEventCounter; //counting the number of events
- Bool_t fUsePhiWeights; // phi weights
- Bool_t fUsePtWeights; // v_2(pt) weights
- Bool_t fUseEtaWeights; // v_2(eta) weights
- TH1F fPhiWeights; // histogram with phi weights
- TH1D fPtWeights; // histogram with v_2(pt) weights
- TH1D fEtaWeights; // histogram with v_2(eta) weights
-
+ Bool_t fUsePhiWeights; //phi weights
+ Bool_t fUsePtWeights; //v_2(pt) weights
+ Bool_t fUseEtaWeights; //v_2(eta) weights
+
ClassDef(AliFlowAnalysisWithQCumulants, 0);
};
#include "Riostream.h"
#include "TObjArray.h"
#include "TFile.h"
+#include "TList.h"
#include "TMath.h"
#include "TH1F.h"
#include "TH1D.h"
AliFlowEventSimple::AliFlowEventSimple(Int_t aLenght):
fTrackCollection(NULL),
fNumberOfTracks(0),
- fEventNSelTracksIntFlow(0),
- fUseWeightsPhi(kFALSE),
- fUseWeightsPt(kFALSE),
- fUseWeightsEta(kFALSE),
- fPhiWeights(NULL),
- fPtWeights(NULL),
- fEtaWeights(NULL)
+ fEventNSelTracksIntFlow(0)
{
//constructor
fTrackCollection = new TObjArray(aLenght) ;
TObject(),
fTrackCollection(anEvent.fTrackCollection),
fNumberOfTracks(anEvent.fNumberOfTracks),
- fEventNSelTracksIntFlow(anEvent.fEventNSelTracksIntFlow),
- fUseWeightsPhi(anEvent.fUseWeightsPhi),
- fUseWeightsPt(anEvent.fUseWeightsPt),
- fUseWeightsEta(anEvent.fUseWeightsEta),
- fPhiWeights(anEvent.fPhiWeights),
- fPtWeights(anEvent.fPtWeights),
- fEtaWeights(anEvent.fEtaWeights)
+ fEventNSelTracksIntFlow(anEvent.fEventNSelTracksIntFlow)
{
//copy constructor
}
*fTrackCollection = *anEvent.fTrackCollection ;
fNumberOfTracks = anEvent.fNumberOfTracks;
fEventNSelTracksIntFlow = anEvent.fEventNSelTracksIntFlow;
- fUseWeightsPhi = anEvent.fUseWeightsPhi;
- fUseWeightsPt = anEvent.fUseWeightsPt;
- fUseWeightsEta = anEvent.fUseWeightsEta;
- fPhiWeights = anEvent.fPhiWeights;
- fPtWeights = anEvent.fPtWeights;
- fEtaWeights = anEvent.fEtaWeights;
return *this;
}
}
//-----------------------------------------------------------------------
-AliFlowVector AliFlowEventSimple::GetQ(Int_t n)
+AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
{
//calculate Q-vector in harmonic n without weights (default harmonic n=2)
Double_t dQX = 0.;
Double_t wPt=1.; //weight Pt
Double_t wEta=1.; //weight Eta
- if(fUseWeightsPhi)
+ TH1F *phiWeights = NULL;
+ TH1D *ptWeights = NULL;
+ TH1D *etaWeights = NULL;
+
+ if(weightsList)
{
- if(fPhiWeights)
+ if(usePhiWeights)
{
- nBinsPhi = fPhiWeights->GetNbinsX();
- }else{cout<<" WARNING: couldn't find histogram phi_weights in the file weightsForTheSecondRun.root"<<endl;}
- }
-
- if(fUseWeightsPt)
- {
- if(fPtWeights)
+ phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
+ if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
+ }
+ if(usePtWeights)
{
- dBinWidthPt = fPtWeights->GetBinWidth(1);//assuming that all bins have the same width
- dNormPt = fPtWeights->Integral();
- }else{cout<<" WARNING: couldn't find histogram pt_weights in the file weightsForTheSecondRun.root"<<endl;}
- }
-
- if(fUseWeightsEta)
- {
- if(fEtaWeights)
+ ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
+ if(ptWeights)
+ {
+ dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
+ dNormPt = ptWeights->Integral();
+ }
+ }
+ if(useEtaWeights)
{
- dBinWidthEta = fEtaWeights->GetBinWidth(1);//assuming that all bins have the same width
- dNormEta = fEtaWeights->Integral();
- }else{cout<<" WARNING: couldn't find histogram eta_weights in the file weightsForTheSecondRun.root"<<endl;}
- }
+ etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
+ if(etaWeights)
+ {
+ dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
+ dNormEta = etaWeights->Integral();
+ }
+ }
+ } // end of if(weightsList)
+
+ // loop over tracks
for(Int_t i=0;i<fNumberOfTracks;i++)
{
pTrack = (AliFlowTrackSimple*)TrackCollection()->At(i);
dPhi = pTrack->Phi();
dPt = pTrack->Pt();
dEta = pTrack->Eta();
+
//determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
- if(fUseWeightsPhi && fPhiWeights && (nBinsPhi!=0) && (fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())))!=0))
+ if(phiWeights && (nBinsPhi!=0) && (phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())))!=0))
{
- wPhi=pow(nBinsPhi*fPhiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi()))),-1);
+ wPhi=pow(nBinsPhi*phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi()))),-1);
}
//determine v'(pt) weight:
- if(fUseWeightsPt && fPtWeights && dBinWidthPt && dNormPt)
+ if(ptWeights && dBinWidthPt && dNormPt)
{
- wPt=fPtWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPt/dBinWidthPt)))/dNormPt;
+ wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPt/dBinWidthPt)))/dNormPt;
}
//determine v'(eta) weight:
- if(fUseWeightsEta && fEtaWeights && dBinWidthEta && dNormEta)
+ if(etaWeights && dBinWidthEta && dNormEta)
{
- wEta=fEtaWeights->GetBinContent(1+(Int_t)(TMath::Floor(dEta/dBinWidthEta)))/dNormEta;
- }
+ wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor(dEta/dBinWidthEta)))/dNormEta;
+ }
+
//building up the weighted Q-vector:
dQX += wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
dQY += wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
iUsedTracks++;
+
}//end of if (pTrack->UseForIntegratedFlow())
}//end of if (pTrack)
else {cerr << "no particle!!!"<<endl;}
void SetNumberOfTracks(Int_t nr) { this->fNumberOfTracks = nr; }
void SetEventNSelTracksIntFlow(Int_t nr) { this->fEventNSelTracksIntFlow = nr; }
- //setters and getters
- void SetUseWeightsPhi(Bool_t const uwPhi) { this->fUseWeightsPhi = uwPhi;};
- Bool_t GetUseWeightsPhi() const { return this->fUseWeightsPhi;};
-
- void SetUseWeightsPt(Bool_t const uwPt) { this->fUseWeightsPt = uwPt;};
- Bool_t GetUseWeightsPt() const { return this->fUseWeightsPt;};
-
- void SetUseWeightsEta(Bool_t const uwEta) { this->fUseWeightsEta = uwEta;};
- Bool_t GetUseWeightsEta() const { return this->fUseWeightsEta;};
-
- void SetPhiWeights(TH1F* const fphiw) { this->fPhiWeights = fphiw;};
- void SetPtWeights(TH1D* const fptw) { this->fPtWeights = fptw;};
- void SetEtaWeights(TH1D* const fetaw) { this->fEtaWeights = fetaw;};
-
AliFlowTrackSimple* GetTrack(Int_t i);
TObjArray* TrackCollection() const { return this->fTrackCollection; }
- AliFlowVector GetQ(Int_t n=2); //get Q-vector evaluated in harmonic n (default harmonic n=2)
-
+
+ AliFlowVector GetQ(Int_t n=2, TList *weightsList=NULL, Bool_t usePhiWeights=kFALSE, Bool_t usePtWeights=kFALSE, Bool_t useEtaWeights=kFALSE);
+
private:
TObjArray* fTrackCollection; // collection of tracks
Int_t fNumberOfTracks; // number of tracks
Int_t fEventNSelTracksIntFlow; // number of tracks selected for integrated flow calculation
- Bool_t fUseWeightsPhi; // phi weights
- Bool_t fUseWeightsPt; // v_2(pt) weights
- Bool_t fUseWeightsEta; // v_2(eta) weights
- TH1F *fPhiWeights; // phi weights
- TH1D *fPtWeights; // v_2(pt) weights
- TH1D *fEtaWeights; // v_2(eta) weights
-
ClassDef(AliFlowEventSimple,1) // macro for rootcint
};
-//=====================================================================================
-// Before using the macro makeWeightsForTheSecondRun.C you should already have
-// available the output .root files from various methods from the first run over data
-// without any weights. When calling this macro you must specify the analysis type
-// and the method from which output file you would like to make the weights for the
-// second run (for the cumulants, GFC and QC, you must also specify the order):
+//==========================================================================================
+// Before using the macro makeWeights.C you should already have available the output .root
+// files from various methods from the previous run over data (without any weights). When
+// calling this macro you must specify the analysis type and the method from which output
+// file you would like to make the weights for the next run (for the cumulants, GFC and QC,
+// you must also specify the order):
//
// 1. type of analysis can be: ESD, AOD, MC, ESDMC0 or ESDMC1;
//
// 2. method can be: MCEP, LYZ1, LYZ2, LYZEP, FQD, GFC or QC;
//
// 3. cumulant order can be: 2nd, 4th, 6th or 8th.
-//=====================================================================================
+//==========================================================================================
-void makeWeightsForTheSecondRun(TString type="ESD", TString method="GFC", TString cumulantOrder="4th")
+void makeWeights(TString type="ESD", TString method="GFC", TString cumulantOrder="4th")
{
//load needed libraries:
gSystem->AddIncludePath("-I$ROOTSYS/include");
}//end of if(pList)
}//end of if(file)
- //making the output file and storing the histograms needed for the weights:
- TFile* outputFile = new TFile("weightsForTheSecondRun.root","RECREATE");
+ //making the output file and creating the TList to hold the histograms with weights:
+ TFile* outputFile = new TFile("weights.root","RECREATE");
+ TList* listWeights = new TList();
//common control histos:
if(commonHist)
{
{
(commonHist->GetHistPhiInt())->Scale(1./norm);
}
- //writing the normalized histogram in output file:
- (commonHist->GetHistPhiInt())->Write();
- }else
- {
- cout<<" WARNING: the common control histos from the 1st run were not accessed."<<endl;
- }
+ listWeights->Add(commonHist->GetHistPhiInt());
+ }else{cout<<" WARNING: the common control histos from the 1st run were not accessed."<<endl;}
//common results histos:
if(commonHistRes)
{
- //diff. flow in pt from the first run:
+ //diff. flow (pt):
(commonHistRes->GetHistDiffFlowPtPOI())->SetName("pt_weights");
- (commonHistRes->GetHistDiffFlowPtPOI())->Write();
- //diff. flow in eta from the first run:
+ listWeights->Add(commonHistRes->GetHistDiffFlowPtPOI());
+ //diff. flow (eta):
(commonHistRes->GetHistDiffFlowEtaPOI())->SetName("eta_weights");
- (commonHistRes->GetHistDiffFlowEtaPOI())->Write();
- }else
- {
- cout<<" WARNING: the common results histos from the 1st run were not accessed."<<endl;
- }
+ listWeights->Add(commonHistRes->GetHistDiffFlowEtaPOI());
+ }else{cout<<" WARNING: the common results histos from the 1st run were not accessed."<<endl;}
- delete outputFile;
+ outputFile->WriteObject(listWeights,"weights","SingleKey");
+
+ delete listWeights;
+ delete outputFile;
}
+
+
+
#include "Riostream.h"
#include "TFile.h"
-//----------------------------------------------------------
-//RUN SETTINGS
+//--------------------------------------------------------------------------------------
+// RUN SETTINGS
//flow analysis method can be: (set to kTRUE or kFALSE)
Bool_t SP = kFALSE;
-Bool_t LYZ1 = kTRUE;
+Bool_t LYZ1 = kFALSE;
Bool_t LYZ2 = kFALSE;
Bool_t LYZEP = kFALSE;
Bool_t GFC = kTRUE;
Bool_t QC = kTRUE;
Bool_t FQD = kFALSE;
Bool_t MCEP = kFALSE; //does not work yet 24/12/08
-//----------------------------------------------------------
+//--------------------------------------------------------------------------------------
-//----------------------------------------------------------
-//CUT SETTINGS
+//--------------------------------------------------------------------------------------
+// CUT SETTINGS
//integrated selection
Double_t ptMaxInt = 10.;
Double_t ptMinInt = 0.;
Double_t phiMaxDiff = 7.5;
Double_t phiMinDiff = 0.;
Int_t PIDDiff = 211;
-//----------------------------------------------------------
+//--------------------------------------------------------------------------------------
-//----------------------------------------------------------
-//WEIGHTS SETTINGS
+//--------------------------------------------------------------------------------------
+// WEIGHTS SETTINGS
//to use or not to use the weights - that is a question!
-Bool_t useWeightsPhi = kFALSE;//Phi
-Bool_t useWeightsPt = kFALSE;//v'(pt)
-Bool_t useWeightsEta = kFALSE;//v'(eta)
-//----------------------------------------------------------
+Bool_t usePhiWeights = kFALSE; //Phi (correction for non-uniform azimuthal acceptance)
+Bool_t usePtWeights = kFALSE; //v'(pt) (differential flow in pt)
+Bool_t useEtaWeights = kFALSE; //v'(eta) (differential flow in eta)
+//--------------------------------------------------------------------------------------
Int_t offset = 0;
// flow event in AliRoot
AliFlowEventSimpleMaker* fEventMaker = new AliFlowEventSimpleMaker();
-
- /*
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- // !!!! to be removed
- // if weights are being used initialize the weight's histos in AliFlowEvenSimpleMaker:
- fEventMaker->SetUseWeightsPhi(useWeightsPhi);
- fEventMaker->SetUseWeightsPt(useWeightsPt);
- fEventMaker->SetUseWeightsEta(useWeightsEta);
- if(useWeightsPhi||useWeightsPt||useWeightsEta)
- {
- fEventMaker->Init(file);
- }
- //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- */
-
-
+
// In root
/*
// output histosgrams
gROOT->LoadMacro("code/AliFlowCommonHist.cxx+");
gROOT->LoadMacro("code/AliFlowCommonHistResults.cxx+");
- gROOT->LoadMacro("code/AliFlowLYZHist1.cxx+");fPhiWeights
+ gROOT->LoadMacro("code/AliFlowLYZHist1.cxx+");
gROOT->LoadMacro("code/AliFlowLYZHist2.cxx+");
// functions needed for various methods
cutsDiff->SetPhiMin(phiMinDiff);
cutsDiff->SetPID(PIDDiff);
- //weights:
- //open the file with the weights:
- TFile *file = NULL;
- TH1F *phiWeights = NULL;
- TH1D *ptWeights = NULL;
- TH1D *etaWeights = NULL;
+ //if the weights are used:
+ TFile *fileWithWeights = NULL;
+ TList *listWithWeights = NULL;
- if(useWeightsPhi||useWeightsPt||useWeightsEta)
+ if(usePhiWeights||usePtWeights||useEtaWeights)
{
- file = TFile::Open("weightsForTheSecondRun.root", "READ");
- if(useWeightsPhi) file->GetObject("phi_weights",phiWeights);
- if(useWeightsPt) file->GetObject("pt_weights",ptWeights);
- if(useWeightsEta) file->GetObject("eta_weights",etaWeights);
+ fileWithWeights = TFile::Open("weights.root","READ");
+ if(fileWithWeights)
+ {
+ listWithWeights = (TList*)fileWithWeights->Get("weights");
+ }else{cout<<" WARNING: the file <weights.root> with weights from the previous run was not accessed."<<endl;}
}
//flow methods:
if(QC) {
AliFlowAnalysisWithQCumulants* qc = new AliFlowAnalysisWithQCumulants();
qc->Init();
- if(useWeightsPhi) qc->SetPhiWeights(*phiWeights);
- if(useWeightsPt) qc->SetPtWeights(*ptWeights);
- if(useWeightsEta) qc->SetEtaWeights(*etaWeights);
+ if(listWithWeights) qc->SetWeightsList(listWithWeights);
+ if(usePhiWeights) qc->SetUsePhiWeights(usePhiWeights);
+ if(usePtWeights) qc->SetUsePtWeights(usePtWeights);
+ if(useEtaWeights) qc->SetUseEtaWeights(useEtaWeights);
}
//GFC = Generating Function Cumulants