+ //copy content of profile into TH1D and add error and fill the AliFlowCommonHistResults
+
+ //v as a function of eta for RP selection
+ for(Int_t b=0;b<iNbinsEta;b++) {
+ Double_t dv2pro = fHistProVetaRP->GetBinContent(b);
+ Double_t dNprime = fCommonHists->GetEntriesInEtaBinRP(b);
+ Double_t dErrdifcomb = 0.; //set error to zero
+ Double_t dErr2difcomb = 0.; //set error to zero
+ //calculate error
+ if (dNprime!=0.) {
+ for (Int_t theta=0;theta<iNtheta;theta++) {
+ Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
+ Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
+ TMath::Cos(dTheta));
+ Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
+ TMath::Cos(dTheta));
+ dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
+ TMath::BesselJ1(dJ01)))*
+ ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
+ (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
+ } //loop over theta
+ }
+
+ if (dErr2difcomb!=0.) {
+ dErr2difcomb /= iNtheta;
+ dErrdifcomb = TMath::Sqrt(dErr2difcomb);
+ }
+ else {dErrdifcomb = 0.;}
+ //fill TH1D
+ fCommonHistsRes->FillDifferentialFlowEtaRP(b, dv2pro, dErrdifcomb);
+ } //loop over bins b
+
+
+ //v as a function of eta for POI selection
+ for(Int_t b=0;b<iNbinsEta;b++) {
+ Double_t dv2pro = fHistProVetaPOI->GetBinContent(b);
+ Double_t dNprime = fCommonHists->GetEntriesInEtaBinPOI(b);
+ Double_t dErrdifcomb = 0.; //set error to zero
+ Double_t dErr2difcomb = 0.; //set error to zero
+ //calculate error
+ if (dNprime!=0.) {
+ for (Int_t theta=0;theta<iNtheta;theta++) {
+ Double_t dTheta = ((double)theta/iNtheta)*TMath::Pi();
+ Double_t dApluscomb = TMath::Exp((dJ01*dJ01)/(2*dChi*dChi)*
+ TMath::Cos(dTheta));
+ Double_t dAmincomb = TMath::Exp(-(dJ01*dJ01)/(2*dChi*dChi)*
+ TMath::Cos(dTheta));
+ dErr2difcomb += (TMath::Cos(dTheta)/(4*dNprime*TMath::BesselJ1(dJ01)*
+ TMath::BesselJ1(dJ01)))*
+ ((dApluscomb*TMath::BesselJ0(2*dJ01*TMath::Sin(dTheta/2))) -
+ (dAmincomb*TMath::BesselJ0(2*dJ01*TMath::Cos(dTheta/2))));
+ } //loop over theta
+ }
+
+ if (dErr2difcomb!=0.) {
+ dErr2difcomb /= iNtheta;
+ dErrdifcomb = TMath::Sqrt(dErr2difcomb);
+ }
+ else {dErrdifcomb = 0.;}
+ //fill TH1D
+ fCommonHistsRes->FillDifferentialFlowEtaPOI(b, dv2pro, dErrdifcomb);
+ } //loop over bins b
+
+
+
+ //v as a function of Pt for RP selection