ROOT logo
// 0       1       2       3       4  5  6 	        7     8             9                            10         11
// nsyield,asyield,nswidth,aswidth,v2,v3,nsasyieldratio,v3/v2,remainingpeak,remainingjetyield/ridgeyield,chi2(v2v3),baseline
const char* graphTitles[] = { "NS Ridge Yield", "AS Ridge Yield", "NS Width", "AS Width", "v2", "v3", "NS Yield / AS Yield", "v3 / v2", "remaining peak in %", "remaining jet / NS yield in %", "chi2/ndf", "baseline", "v1" };
const Int_t NGraphs = 28; // pt index
const Int_t NHists = 13; 
TGraphErrors*** graphs = 0;

const char* kCorrFuncTitle = "#frac{1}{#it{N}_{trig}} #frac{d^{2}#it{N}_{assoc}}{d#Delta#etad#Delta#varphi} (rad^{-1})";
// const char* kCorrFuncTitle = "1/N_{trig} dN_{assoc}/d#Delta#etad#Delta#varphi (1/rad)";
const char* kProjYieldTitlePhi = "1/#it{N}_{trig} d#it{N}_{assoc}/d#Delta#varphi per #Delta#eta (rad^{-1})";
const char* kProjYieldTitleEta = "1/#it{N}_{trig} d#it{N}_{assoc}/d#Delta#eta per #Delta#varphi (rad^{-1})";
// const char* kProjYieldTitlePhiOrEta = "1/N_{trig} dN_{assoc}/d#Delta#varphi (1/rad) , dN_{assoc}/d#Delta#eta";
const char* kProjYieldTitlePhiOrEta = "#frac{1}{#it{N}_{trig}} #frac{d#it{N}_{assoc}}{d#Delta#varphi} (rad^{-1}) , d#it{N}_{assoc}/d#Delta#eta";

Float_t etaMax = 4.0;
Bool_t gUseAnalyticalVn=0;
Bool_t gDoSubtraction=1;
Bool_t gDoEtaGap=1;
Bool_t gDoEtaGapAS=0;
Bool_t gExcludeNearSidePeakFromPhiProj=0;
Int_t gBinning = 0;

void CreateGraphStructure()
{
  graphs = new TGraphErrors**[NGraphs];
  for (Int_t i=0; i<NGraphs; i++)
    {
      graphs[i] = new TGraphErrors*[NHists];
      for (Int_t j=0; j<NHists; j++)
	{
	  graphs[i][j] = new TGraphErrors;
	  graphs[i][j]->GetYaxis()->SetTitle(graphTitles[j]);
	}
    }
}

void WriteGraphs(const char* outputFileName = "graphs.root")
{
  TFile::Open(outputFileName, "RECREATE");
  for (Int_t i=0; i<NGraphs; i++)
    for (Int_t j=0; j<NHists; j++)
      {
	if (!graphs[i][j])
	  continue;
	graphs[i][j]->GetYaxis()->SetTitle(graphTitles[j]);
	graphs[i][j]->Write(Form("graph_%d_%d", i, j));
      }

  gFile->Close();
}

void ReadGraphs(const char* fileName = "graphs.root")
{
  CreateGraphStructure();
  TFile* file = TFile::Open(fileName);
  for (Int_t i=0; i<NGraphs; i++)
    for (Int_t j=0; j<NHists; j++)
      graphs[i][j] = (TGraphErrors*) file->Get(Form("graph_%d_%d", i, j));
}

void AddPoint(TGraphErrors* graph, Float_t x, Float_t y, Float_t xe, Float_t ye)
{
  graph->SetPoint(graph->GetN(), x, y);
  graph->SetPointError(graph->GetN() - 1, xe, ye);
}

void DrawLatex(Float_t x, Float_t y, Int_t color, const char* text, Float_t textSize = 0.06)
{
  TLatex* latex = new TLatex(x, y, text);
  latex->SetNDC();
  latex->SetTextSize(textSize);
  latex->SetTextColor(color);
  latex->Draw();
}

void PadFor2DCorr()
{
  gPad->SetPad(0, 0, 1, 1);
  gPad->SetLeftMargin(0.2);
  gPad->SetTopMargin(0.05);
  gPad->SetRightMargin(0.05);
  gPad->SetBottomMargin(0.05);
  gPad->SetTheta(61.62587);
  gPad->SetPhi(45);
}

void DivideGraphs(TGraphErrors* graph1, TGraphErrors* graph2)
{
  //   graph1->Print();
  //   graph2->Print();

  graph1->Sort();
  graph2->Sort();

  for (Int_t bin1 = 0; bin1 < graph1->GetN(); bin1++)
    {
      Float_t x = graph1->GetX()[bin1];

      Int_t bin2 = 0;
      for (bin2 = 0; bin2<graph2->GetN(); bin2++)
	if (graph2->GetX()[bin2] >= x)
	  break;

      if (bin2 == graph2->GetN())
	bin2--;

      if (bin2 > 0)
	if (TMath::Abs(graph2->GetX()[bin2-1] - x) < TMath::Abs(graph2->GetX()[bin2] - x))
	  bin2--;

      if (graph1->GetY()[bin1] == 0 || graph2->GetY()[bin2] == 0 || bin2 == graph2->GetN())
	{
	  Printf("%d %d removed", bin1, bin2);
	  graph1->RemovePoint(bin1--);
	  continue;
	}

      Float_t graph2Extrapolated = graph2->GetY()[bin2];
      if (TMath::Abs(x - graph2->GetX()[bin2]) > 0.0001)
	{
	  Printf("%f %f %d %d not found", x, graph2->GetX()[bin2], bin1, bin2);
	  graph1->RemovePoint(bin1--);
	  continue;
	}

      Float_t value = graph1->GetY()[bin1] / graph2Extrapolated;
      Float_t error = value * TMath::Sqrt(TMath::Power(graph1->GetEY()[bin1] / graph1->GetY()[bin1], 2) + TMath::Power(graph2->GetEY()[bin2] / graph2->GetY()[bin2], 2));

      graph1->GetY()[bin1] = value;
      graph1->GetEY()[bin1] = error;

      //     Printf("%d %d %f %f %f %f", bin1, bin2, x, graph2Extrapolated, value, error);
    }
}

void GraphShiftX(TGraphErrors* graph, Float_t offset)
{
  for (Int_t i=0; i<graph->GetN(); i++)
    graph->GetX()[i] += offset;
}

TGraphErrors* ReadHepdata(const char* fileName, Bool_t errorsAreAdded = kFALSE, Int_t skipYErrors = 0, Int_t skipXerrors = 1)
{
  // expected format: x [x2] y [ye] [ye2] [xe]
  //
  // skipYErrors:   0 --> ye present
  //                1 --> no errors ye
  //                2 --> y and ye are lower and upper error, i.e. y' = (y + ye) / 2 and ye = (ye - y) / 2
  //                3 --> ye and ye2 are stat and syst error, will be added in quadrature
  // 
  // skipXerrors:   0 --> xe present
  //                1 --> no errors xe
  //                2 --> x2 present, xe not present and is calculated from x2 - x
  
  ifstream fin(fileName);

  graph = new TGraphErrors(0);

  Double_t sum = 0;

  while (fin.good())
    {
      char buffer[2000];
      if (fin.peek() == '#')
	{
	  fin.getline(buffer, 2000);
	  continue;
	}
  
      Double_t x = -1;
      Double_t x2 = -1;
      Double_t y = -1;
      Double_t ye = 0;
      Double_t xe = 0;

      fin >> x;
    
      if (skipXerrors == 2)
	{
	  fin >> x2;
	  xe = (x2 - x + 1) / 2;
	  x = x + (x2 - x) / 2;
	}
    
      fin >> y;

      if (y == -1)
	continue;

      if (skipYErrors == 0)
	{
	  ye = -1;
	  fin >> ye;
	  if (ye == -1)
	    continue;
	}
      else if (skipYErrors == 2)
	{
	  ye = -1;
	  fin >> ye;
	  if (ye == -1)
	    continue;
      
	  Double_t newy = (y + ye) / 2;
	  ye = (ye - y) / 2;
	  y = newy;
	}
      else if (skipYErrors == 3)
	{
	  ye = -1;
	  fin >> ye;
	  if (ye == -1)
	    continue;
      
	  Double_t ye2 = -1;
	  fin >> ye2;
	  if (ye2 == -1)
	    continue;

	  ye = TMath::Sqrt(ye*ye + ye2*ye2);
	}

      if (skipXerrors == 0)
	{
	  xe = -1;
	  fin >> xe;
	  if (xe == -1)
	    continue;
	}

      //Printf("%f %f %f %f", x, y, xe, ye);

      if (errorsAreAdded)
	ye -= y;

      graph->SetPoint(graph->GetN(), x, y);
      graph->SetPointError(graph->GetN()-1, xe, ye);

      sum += y;
    
      // read rest until end of line...
      fin.getline(buffer, 2000);
    }
  fin.close();

  Printf("%s: %f", fileName, sum);

  return graph;
}

TH2* SubtractEtaGapNS(TH2* hist, Float_t etaLimit, Float_t outerLimit, Bool_t drawEtaGapDist = kFALSE)
{
  TString histName(hist->GetName());
  Int_t etaBins = 0;

  TH1D* etaGap = hist->ProjectionX(histName + "_1", TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)), hist->GetYaxis()->FindBin(-etaLimit - 0.01));
  //   Printf("%f", etaGap->GetEntries());
  if (etaGap->GetEntries() > 0)
    etaBins += hist->GetYaxis()->FindBin(-etaLimit - 0.01) - TMath::Max(1, hist->GetYaxis()->FindBin(-outerLimit + 0.01)) + 1;

  TH1D* tracksTmp = hist->ProjectionX(histName + "_2", hist->GetYaxis()->FindBin(etaLimit + 0.01), TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)));
  //   Printf("%f", tracksTmp->GetEntries());
  if (tracksTmp->GetEntries() > 0)
    etaBins += TMath::Min(hist->GetYaxis()->GetNbins(), hist->GetYaxis()->FindBin(outerLimit - 0.01)) - hist->GetYaxis()->FindBin(etaLimit + 0.01) + 1;
  
  etaGap->Add(tracksTmp);

  // get per bin result
  if (etaBins > 0)
    etaGap->Scale(1.0 / etaBins);
 
  for (Int_t i=1; i<=etaGap->GetNbinsX()/2; i++)
    {
      //     Printf("%d -> %d", i, etaGap->GetNbinsX()+1-i);
      etaGap->SetBinContent(etaGap->GetNbinsX()+1-i, etaGap->GetBinContent(i));
      etaGap->SetBinError(etaGap->GetNbinsX()+1-i, etaGap->GetBinError(i));
    }
  
  if (drawEtaGapDist)
    {
      TH1D* centralRegion = hist->ProjectionX(histName + "_3", hist->GetYaxis()->FindBin(-etaLimit + 0.01), hist->GetYaxis()->FindBin(etaLimit - 0.01));
    
      //    centralRegion->Scale(1.0 / (hist->GetYaxis()->FindBin(etaLimit - 0.01) - hist->GetYaxis()->FindBin(-etaLimit + 0.01) + 1));
      centralRegion->Scale(hist->GetXaxis()->GetBinWidth(1));

      TCanvas* c = new TCanvas("SubtractEtaGap", "SubtractEtaGap", 800, 800);
      gPad->SetLeftMargin(0.13);
      centralRegion->SetStats(0);
      TString label(centralRegion->GetTitle());
      label.ReplaceAll(".00", " GeV/#it{c}");
      label.ReplaceAll(".0", " GeV/#it{c}");
      centralRegion->SetTitle(label);
      centralRegion->SetLineColor(3);
      centralRegion->Draw();
      //     centralRegion->GetYaxis()->SetTitle(kProjYieldTitlePhi);
      centralRegion->GetYaxis()->SetTitleOffset(1.6);
      TH1* copy = etaGap->DrawCopy("SAME");
      copy->Scale(hist->GetXaxis()->GetBinWidth(1));
      copy->Scale((hist->GetYaxis()->FindBin(etaLimit - 0.01) - hist->GetYaxis()->FindBin(-etaLimit + 0.01) + 1));
      copy->SetLineColor(2);
      TLegend* legend = new TLegend(0.41, 0.73, 0.69, 0.85);
      legend->SetFillColor(0);
      legend->AddEntry(centralRegion, Form("|#Delta#eta| < %.1f", etaLimit), "L");
      legend->AddEntry(copy, Form("%.1f < |#Delta#eta| < %.1f (scaled)", etaLimit, outerLimit), "L");
      legend->Draw();
    
      //     DrawLatex(0.705, 0.62, 1, "Pb-Pb 2.76 TeV", 0.025);
      //     DrawLatex(0.705, 0.58, 1, "Stat. unc. only", 0.025);
    }
  
  //   new TCanvas; etaGap->DrawCopy();
  
  TH2* histTmp2D = (TH2*) hist->Clone("histTmp2D");
  histTmp2D->Reset();
  
  for (Int_t xbin=1; xbin<=histTmp2D->GetNbinsX(); xbin++)
    for (Int_t y=1; y<=histTmp2D->GetNbinsY(); y++)
      histTmp2D->SetBinContent(xbin, y, etaGap->GetBinContent(xbin));
    
  hist->Add(histTmp2D, -1);  
  return histTmp2D;
}

TH1* GetProjections(Int_t i, Int_t j, Int_t centr, char** label, Float_t etaBegin = 1.0, TH1** etaProj = 0)
{
  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr));
  if (!hist1)
    return 0;
  hist1 = (TH2*) hist1->Clone(Form("%s_%.1f", hist1->GetName(), etaBegin));

  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
  
  hist1->Rebin2D(2, 1); hist1->Scale(0.5);
  
  //   new TCanvas; hist1->Draw("surf1");
  
  if (etaBegin > 0)
    SubtractEtaGapNS(hist1, etaBegin, etaMax, kTRUE);
  
  tokens = TString(hist1->GetTitle()).Tokenize("-");
  centralityStr = new TString;
  if (tokens->GetEntries() > 2)
    *centralityStr = tokens->At(2)->GetName();
  if (tokens->GetEntries() > 3)
    *centralityStr = *centralityStr + "-" + tokens->At(3)->GetName();
  *label = centralityStr->Data();
  //   Printf("%s", label);
  
  proj1x = ((TH2*) hist1)->ProjectionX(Form("proj1x_%d_%d_%d_%.1f", i, j, centr, etaBegin), hist1->GetYaxis()->FindBin(-etaMax+0.01), hist1->GetYaxis()->FindBin(etaMax-0.01));
  proj1x->GetXaxis()->SetTitleOffset(1);
  proj1x->Scale(hist1->GetYaxis()->GetBinWidth(1));

  proj1y = ((TH2*) hist1)->ProjectionY(Form("proj1y_%d_%d_%d_%.1f", i, j, centr, etaBegin), hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
  proj1y->Scale(hist1->GetXaxis()->GetBinWidth(1));
  proj1y->GetXaxis()->SetTitleOffset(1);
  proj1y->GetXaxis()->SetRangeUser(-1.99, 1.99);
  Float_t etaPhiScale = 1.0 * (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1) / (hist1->GetYaxis()->FindBin(etaMax-0.01) - hist1->GetYaxis()->FindBin(-etaMax+0.01) + 1);
  
  if (gStudySystematic == 20)
    {
      Printf(">>>>>>>>>>>> Applying non-closure systematics <<<<<<<<<<<<");
      file2 = TFile::Open("non_closure.root");
      non_closure = (TH1*) file2->Get(Form("non_closure_all_%d_%d_%d", i, j, 0));
      for (Int_t bin=1; bin<=non_closure->GetNbinsX(); bin++)
	non_closure->SetBinError(bin, 0);
    
      proj1x->Multiply(non_closure);  
    }
  
  Float_t zyam = 0;
  if (0)
    {  
      clone = (TH1*) proj1x->Clone();
      clone->Fit("pol0", "0", "", TMath::Pi()/2 - 0.2, TMath::Pi()/2);
      zyam = clone->GetFunction("pol0")->GetParameter(0);
    }
  else
    {
      //     zyam = (proj1x->GetBinContent(proj1x->FindBin(TMath::Pi()/2)) + proj1x->GetBinContent(proj1x->FindBin(-TMath::Pi()/2))) / 2;
      //     zyam = proj1x->GetBinContent(proj1x->FindBin(TMath::Pi()/2));
      zyam = proj1x->GetBinContent(proj1x->FindBin(1.3));
      //     zyam = proj1x->GetMinimum();
    }
    
  proj1x->Add(new TF1("func", "-1", -100, 100), zyam);
  proj1y->Add(new TF1("func", "-1", -100, 100), zyam * etaPhiScale);
  
  proj1x->Scale(1.0 / (2.0 * etaMax));
  
  if (etaProj != 0)
    *etaProj = proj1y;
  return proj1x;
}

TH1* GetProjectionsNew(Int_t i, Int_t j, Int_t centr, char** label, Float_t etaBegin = 1.0, TH1** etaProj = 0)
{
  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr));
  if (!hist1)
    return 0;
  hist1 = (TH2*) hist1->Clone(Form("%s_%.1f", hist1->GetName(), etaBegin));

  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
  
  hist1->Rebin2D(2, 1); hist1->Scale(0.5);
  
  //   new TCanvas; hist1->Draw("surf1");
  
  tokens = TString(hist1->GetTitle()).Tokenize("-");
  centralityStr = new TString;
  if (tokens->GetEntries() > 2)
    *centralityStr = tokens->At(2)->GetName();
  if (tokens->GetEntries() > 3)
    *centralityStr = *centralityStr + "-" + tokens->At(3)->GetName();
  *label = centralityStr->Data();
  //   Printf("%s", label);
  
  if (etaBegin > 0)
    {
      proj1x = ((TH2*) hist1)->ProjectionX(Form("proj1x_%d_%d_%d_%.1f", i, j, centr, etaBegin), hist1->GetYaxis()->FindBin(-etaMax+0.01), hist1->GetYaxis()->FindBin(etaMax-0.01));
      proj1x->GetXaxis()->SetTitleOffset(1);
      proj1x->Scale(hist1->GetYaxis()->GetBinWidth(1));

      proj1xR1 = ((TH2*) hist1)->ProjectionX(Form("proj2x_%d_%d_%d_%.1f", i, j, centr, etaBegin), hist1->GetYaxis()->FindBin(-etaMax+0.01), hist1->GetYaxis()->FindBin(-etaBegin-0.01));
      proj1xR2 = ((TH2*) hist1)->ProjectionX(Form("proj3x_%d_%d_%d_%.1f", i, j, centr, etaBegin), hist1->GetYaxis()->FindBin(etaBegin+0.01), hist1->GetYaxis()->FindBin(etaMax-0.01));
      proj1xR1->Add(proj1xR2);
    
      proj1xR1->GetXaxis()->SetTitleOffset(1);
      proj1xR1->Scale(hist1->GetYaxis()->GetBinWidth(1));
    
      proj1xR1->Scale((1.0 * hist1->GetYaxis()->FindBin(etaMax-0.01) - hist1->GetYaxis()->FindBin(-etaMax+0.01) + 1) / (hist1->GetYaxis()->FindBin(-etaBegin-0.01) - hist1->GetYaxis()->FindBin(-etaMax+0.01) + 1 + hist1->GetYaxis()->FindBin(etaMax-0.01) - hist1->GetYaxis()->FindBin(etaBegin+0.01) + 1));
    
      // mirror
      for (Int_t i=1; i<=proj1xR1->GetNbinsX()/2; i++)
	{
	  //     Printf("%d -> %d", i, etaGap->GetNbinsX()+1-i);
	  proj1xR1->SetBinContent(proj1xR1->GetNbinsX()+1-i, proj1xR1->GetBinContent(i));
	  proj1xR1->SetBinError(proj1xR1->GetNbinsX()+1-i, proj1xR1->GetBinError(i));
	}
    
      proj1x->Add(proj1xR1, -1);
    
      proj1x->Scale(1.0 / (2.0 * etaMax));
  
      //     new TCanvas; proj1xR1->DrawCopy();
    }
  else
    {
      proj1x = ((TH2*) hist1)->ProjectionX(Form("proj1x_%d_%d_%d_%.1f", i, j, centr, etaBegin), hist1->GetYaxis()->FindBin(-etaMax+0.01), hist1->GetYaxis()->FindBin(etaMax-0.01));
      proj1x->GetXaxis()->SetTitleOffset(1);
      proj1x->Scale(hist1->GetYaxis()->GetBinWidth(1));

      proj1x->Scale(1.0 / (2.0 * etaMax));
    }

  if (gStudySystematic == 20)
    {
      Printf(">>>>>>>>>>>> Applying non-closure systematics <<<<<<<<<<<<");
      file2 = TFile::Open("non_closure.root");
      non_closure = (TH1*) file2->Get(Form("non_closure_all_%d_%d_%d", i, j, 0));
      for (Int_t bin=1; bin<=non_closure->GetNbinsX(); bin++)
	non_closure->SetBinError(bin, 0);
    
      proj1x->Multiply(non_closure);  
    }
  
  Float_t zyam = 0;
  if (0)
    {  
      clone = (TH1*) proj1x->Clone();
      clone->Fit("pol0", "0", "", TMath::Pi()/2 - 0.2, TMath::Pi()/2);
      zyam = clone->GetFunction("pol0")->GetParameter(0);
    }
  else
    {
      //     zyam = (proj1x->GetBinContent(proj1x->FindBin(TMath::Pi()/2)) + proj1x->GetBinContent(proj1x->FindBin(-TMath::Pi()/2))) / 2;
      //     zyam = proj1x->GetBinContent(proj1x->FindBin(TMath::Pi()/2));
      zyam = proj1x->GetBinContent(proj1x->FindBin(1.3));
      //     zyam = proj1x->GetMinimum();
    }
    
  proj1x->Add(new TF1("func", "-1", -100, 100), zyam);
  
  return proj1x;
}

void DrawEtaDep(const char* fileName, Int_t i, Int_t j, Int_t centr)
{
  c = new TCanvas;
  gPad->SetGridx();
  gPad->SetGridy();
  
  TFile::Open(fileName);

  legend = new TLegend(0.8, 0.6, 0.99, 0.99);
  legend->SetFillColor(0);

  for (Int_t n=0; n<4; n++)
    {
      Float_t eta = 0.8 + n * 0.2;
      const char* label = 0;
      TH1* hist = GetProjections(i, j, centr, &label, eta);
      hist->SetStats(0);	
      hist->SetLineColor(n+1);
      hist->Draw((n == 0) ? "" : "SAME");
      legend->AddEntry(hist, Form("|#Delta#eta| > %.1f", eta));
    }
  legend->Draw();
}


void DrawProjections(const char* fileName, Int_t i, Int_t j, Float_t eta = 1.0, Bool_t etaPhi = kFALSE)
{
  c = new TCanvas;
  gPad->SetGridx();
  gPad->SetGridy();
  
  TFile::Open(fileName);

  legend = new TLegend(0.8, 0.6, 0.99, 0.99);
  legend->SetFillColor(0);
  
  Int_t colors[] = { 1, 2, 1, 4, 6, 2 };
  Int_t markers[] = { 1, 1, 5, 1, 1, 5 };
  
  TH1* first = 0;
  
  Float_t min = 100;
  Float_t max = -100;
  
  for (Int_t centr=0; centr<6; centr++)
    {
      /*    if (centr >= 5)
	    continue;*/
      const char* label = 0;
      TH1* etaHist = 0;
      TH1* hist = GetProjectionsNew(i, j, centr, &label, eta, &etaHist);
      if (!hist)
	continue;
      if (etaPhi)
	hist = etaHist;
      hist->SetStats(0);
      hist->SetLineColor(colors[centr]);
      hist->SetMarkerColor(colors[centr]);
      hist->SetMarkerStyle(markers[centr]);
      if (etaPhi)
	hist->GetXaxis()->SetRangeUser(-1.79, 1.79);
      c->cd();
      hist->Draw((centr == 0) ? "" : "SAME");
      min = TMath::Min(min, hist->GetMinimum());
      max = TMath::Max(max, hist->GetMaximum());
      if (!first)
	first = hist;
      legend->AddEntry(hist, label);
      //     break;
    }
  first->GetYaxis()->SetRangeUser(min * 1.1, max * 1.1);
  legend->Draw();
  
  c->SaveAs(Form("%s_%d_%d.png", (etaPhi) ? "eta" : "phi", i, j));
  
  return;
  
  c = new TCanvas;
  gPad->SetGridx();
  gPad->SetGridy();
  
  ppHist = GetProjections(i, j, 2, &label);
  
  for (Int_t centr=0; centr<6; centr++)
    {
      if (centr >= 4 || centr == 2)
	continue;
      const char* label = 0;
      TH1* hist = GetProjections(i, j, centr, &label);
      hist->SetStats(0);
      hist->SetLineColor(centr+1);
      hist->Divide(ppHist);
      hist->GetYaxis()->SetRangeUser(1, 3);
      hist->Draw((centr == 0) ? "" : "SAME");
    }
  legend->Draw();
  
  c->SaveAs(Form("phi_%d_%d_ratio.png", i, j));
}

void CompareProjections(const char* fileName, Int_t i, Int_t j, Int_t centr)
{
  TFile::Open(fileName);

  const char* label = 0;
  TH1* etaHist = 0;
  TH1* hist = GetProjections(i, j, centr, &label, -1, &etaHist);
  if (!hist)
    continue;
  TH1* hist2 = GetProjections(i, j, centr, &label, 1.2, &etaHist);

  c = new TCanvas;
  gPad->SetGridx();
  gPad->SetGridy();
  
  hist->SetStats(0);
  hist->SetMarkerStyle(20);
  hist->Draw("");

  hist2->SetMarkerStyle(21);
  hist2->SetMarkerColor(2);
  hist2->SetLineColor(2);
  hist2->Draw("SAME");
}

void DrawProjectionsAll(const char* fileName, Float_t eta = 1, Bool_t etaPhi = kFALSE)
{
  DrawProjections(fileName, 0, 1, eta, etaPhi);
  DrawProjections(fileName, 0, 2, eta, etaPhi);
  DrawProjections(fileName, 1, 1, eta, etaPhi);
  DrawProjections(fileName, 1, 2, eta, etaPhi);
  DrawProjections(fileName, 1, 3, eta, etaPhi);
  DrawProjections(fileName, 2, 3, eta, etaPhi);
}

void DrawProjectionsRidge(const char* fileName, Int_t i, Int_t j, Int_t centr1, Int_t centr2)
{
  Float_t etaLimit = 1.0;
  Float_t outerLimit = 1.6;
  
  TFile::Open(fileName);
  
  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr1));
  TH2* hist2 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr2));
  
  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
  hist2->Scale(1.0 / hist2->GetYaxis()->GetBinWidth(1));

  SubtractEtaGapNS(hist1, etaLimit, outerLimit, kFALSE);
  
  proj1y = ((TH2*) hist1)->ProjectionY("proj1y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
  proj1x = ((TH2*) hist1)->ProjectionX("proj1x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));
  
  Float_t etaPhiScale = 1.0 * (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1) / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1);
  Printf("%f", etaPhiScale);
  
  proj1y->GetXaxis()->SetTitleOffset(1);
  proj1x->GetXaxis()->SetTitleOffset(1);
  
  clone = (TH1*) proj1x->Clone();
  clone->Fit("pol0", "0", "", 1.2, 1.8);
  Float_t zyam = clone->GetFunction("pol0")->GetParameter(0);

  proj1x->Add(new TF1("func", "-1", -100, 100), zyam);
  proj1y->Add(new TF1("func", "-1", -100, 100), zyam * etaPhiScale);
  
  new TCanvas("c", "c", 800, 800);
  gPad->SetLeftMargin(0.15);
  //   hist1->SetTitle("");

  hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
  hist1->GetXaxis()->SetTitleOffset(1.5);
  hist1->GetYaxis()->SetTitleOffset(2);
  hist1->SetStats(kFALSE);
  hist1->DrawCopy("SURF1");
  
  proj2y = ((TH2*) hist2)->ProjectionY("proj2y", hist1->GetXaxis()->FindBin(-0.5), hist1->GetXaxis()->FindBin(0.5));
  proj2x = ((TH2*) hist2)->ProjectionX("proj2x", hist1->GetYaxis()->FindBin(-1.79), hist1->GetYaxis()->FindBin(1.79));

  //   proj2y->Scale(1.0 / (hist1->GetXaxis()->FindBin(0.5) - hist1->GetXaxis()->FindBin(-0.5) + 1));
  //   proj2x->Scale(1.0 / (hist1->GetYaxis()->FindBin(1.79) - hist1->GetYaxis()->FindBin(-1.79) + 1));
 
  clone = (TH1*) proj2x->Clone();
  clone->Fit("pol0", "0", "", 1.2, 1.8);
  zyam = clone->GetFunction("pol0")->GetParameter(0);

  proj2x->Add(new TF1("func", "-1", -100, 100), zyam);
  proj2y->Add(new TF1("func", "-1", -100, 100), zyam * etaPhiScale);

  proj2y->SetLineColor(2); proj2x->SetLineColor(2);
  
  new TCanvas; proj1y->Draw(); proj2y->Draw("SAME"); gPad->SetGridx(); gPad->SetGridy();
  new TCanvas; proj1x->Draw(); proj2x->Draw("SAME"); gPad->SetGridx(); gPad->SetGridy();
  
  new TCanvas("c2", "c2", 800, 800);
  gPad->SetLeftMargin(0.15);
  //   hist2->SetTitle("");
  hist2->GetYaxis()->SetRangeUser(-1.79, 1.79);
  hist2->GetXaxis()->SetTitleOffset(1.5);
  hist2->GetYaxis()->SetTitleOffset(2);
  hist2->SetStats(kFALSE);
  hist2->DrawCopy("SURF1");
}

void CalculateIAA(Int_t i, Int_t j, Int_t centr, Float_t etaBegin, Double_t& nsPeak, Double_t& nsPeakE, Double_t& asPeak, Double_t& asPeakE, Double_t& nsRidge, Double_t& nsRidgeE, char** label, Bool_t subtractRidge)
{
  TH2* hist = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr));
  if (!hist)
    {
      nsPeak = 0;
      nsPeakE = 0;
      asPeak = 0;
      asPeakE = 0;
      nsRidge = 0;
      nsRidgeE = 0;
      return;
    }
  
  //   new TCanvas; hist->Draw("COLZ");
  
  TH2* hist1 = (TH2*) hist->Clone();
  hist1->Reset();
  
  // copy to one quadrant
  for (Int_t x=1; x<=hist->GetNbinsX(); x++)
    for (Int_t y=1; y<=hist->GetNbinsY(); y++)
      {
	Int_t xTarget = x;
	if (hist->GetXaxis()->GetBinCenter(x) < 0)
	  xTarget = hist->GetXaxis()->FindBin(-1.0 * hist->GetXaxis()->GetBinCenter(x));
	else if (hist->GetXaxis()->GetBinCenter(x) > TMath::Pi())
	  xTarget = hist->GetXaxis()->FindBin(TMath::TwoPi() - hist->GetXaxis()->GetBinCenter(x));
      
	Int_t yTarget = y;
	if (hist->GetYaxis()->GetBinCenter(y) < 0)
	  yTarget = hist->GetYaxis()->FindBin(-1.0 * hist->GetYaxis()->GetBinCenter(y));
      
	//       Printf("%d %d --> %d %d", x, y, xTarget, yTarget);
      
	Float_t value = 0;
	Float_t error = 0;
	value += hist->GetBinContent(x, y);
	error += hist->GetBinError(x, y) * hist->GetBinError(x, y);

	value += hist1->GetBinContent(xTarget, yTarget);
	error += hist1->GetBinError(xTarget, yTarget) * hist1->GetBinError(xTarget, yTarget);

	error = TMath::Sqrt(error);
      
	hist1->SetBinContent(xTarget, yTarget, value);
	hist1->SetBinError(xTarget, yTarget, error);
      }
  
  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
  new TCanvas; hist1->Draw("COLZ");
  //   new TCanvas; hist1->Draw("SURF1");
  
  tokens = TString(hist1->GetTitle()).Tokenize("-");
  centralityStr = new TString;
  if (tokens->GetEntries() > 1)
    {
      *centralityStr = tokens->At(0)->GetName();
      *centralityStr = *centralityStr + "-" + tokens->At(1)->GetName();
    }
  *label = centralityStr->Data();

  Int_t phi1 = hist1->GetXaxis()->FindBin(0.0001);
  Int_t phi3 = hist1->GetXaxis()->FindBin(TMath::Pi()/2 - 0.3);
  Int_t phi2 = phi3 - 1;
  Int_t phi4 = hist1->GetXaxis()->FindBin(TMath::Pi()/2 - 0.1);
  Int_t phi5 = phi4 + 1;
  Int_t phi6 = hist1->GetXaxis()->FindBin(TMath::Pi() - 0.0001);
  //   Printf("phi = %d %d %d %d %d %d", phi1, phi2, phi3, phi4, phi5, phi6);
  
  Int_t eta1 = hist1->GetYaxis()->FindBin(0.0001);
  Int_t eta2 = hist1->GetYaxis()->FindBin(etaBegin - 0.0001);
  Int_t eta3 = eta2 + 1;
  Int_t eta4 = hist1->GetYaxis()->FindBin(etaMax - 0.0001);
  //   Printf("eta = %d %d %d %d", eta1, eta2, eta3, eta4);
  
  Double_t zyamYieldE, zyamYieldE1, zyamYieldE2;
  nsPeak              = hist1->IntegralAndError(phi1, phi2, eta1, eta2, nsPeakE, "width");
  nsRidge             = hist1->IntegralAndError(phi1, phi2, eta3, eta4, nsRidgeE, "width");
  asPeak              = hist1->IntegralAndError(phi5, phi6, eta1, eta4, asPeakE, "width");
  Double_t zyamYield  = hist1->IntegralAndError(phi3, phi4, eta1, eta4, zyamYieldE, "width");
  Double_t zyamYield1 = hist1->IntegralAndError(phi3, phi4, eta1, eta2, zyamYieldE1, "width");
  Double_t zyamYield2 = hist1->IntegralAndError(phi3, phi4, eta3, eta4, zyamYieldE2, "width");
  
  // factor 4 from folding to one quadrant above
  Double_t zyamYield2Density = zyamYield2 / (hist1->GetXaxis()->GetBinUpEdge(phi4) - hist1->GetXaxis()->GetBinLowEdge(phi3)) / (hist1->GetYaxis()->GetBinUpEdge(eta4) - hist1->GetYaxis()->GetBinLowEdge(eta3)) / 4;
  Double_t zyamYieldE2Density = zyamYieldE2 / (hist1->GetXaxis()->GetBinUpEdge(phi4) - hist1->GetXaxis()->GetBinLowEdge(phi3)) / (hist1->GetYaxis()->GetBinUpEdge(eta4) - hist1->GetYaxis()->GetBinLowEdge(eta3)) / 4;
  
  Double_t nsZyamScaling = 1.0 * (phi2 - phi1 + 1) / (phi4 - phi3 + 1);
  Double_t asZyamScaling = 1.0 * (phi6 - phi5 + 1) / (phi4 - phi3 + 1);
  //   Printf("%f %f", nsZyamScaling, asZyamScaling);
  
  nsPeak -= zyamYield1 * nsZyamScaling;
  nsPeakE = TMath::Sqrt(zyamYieldE1 * zyamYieldE1 * nsZyamScaling * nsZyamScaling + nsPeakE * nsPeakE);
  
  nsRidge -= zyamYield2 * nsZyamScaling;
  nsRidgeE = TMath::Sqrt(zyamYieldE2 * zyamYieldE2 * nsZyamScaling * nsZyamScaling + nsRidgeE * nsRidgeE);

  asPeak -= zyamYield * asZyamScaling;
  asPeakE = TMath::Sqrt(zyamYieldE * zyamYieldE * asZyamScaling * asZyamScaling + asPeakE * asPeakE);
  
  if (subtractRidge)
    {
      Double_t nsRidgeScaling = 1.0 * (eta2 - eta1 + 1) / (eta4 - eta3 + 1);
      Double_t asRidgeScaling = 1.0 * (eta4 - eta1 + 1) / (eta4 - eta3 + 1);
    
      nsPeak -= nsRidge * nsRidgeScaling;
      asPeak -= nsRidge * asRidgeScaling;
      nsPeakE = TMath::Sqrt(nsRidgeE * nsRidgeE * nsRidgeScaling * nsRidgeScaling + nsPeakE * nsPeakE);
      asPeakE = TMath::Sqrt(nsRidgeE * nsRidgeE * asRidgeScaling * asRidgeScaling + asPeakE * asPeakE);
    }

  nsRidge /= (etaMax - etaBegin) * 2;
  nsRidgeE /= (etaMax - etaBegin) * 2;
  
  Printf("Peak yields (%d %d %d): %f +- %f; %f +- %f; %f +- %f; %f +- %f", i, j, centr, nsPeak, nsPeakE, asPeak, asPeakE, nsRidge, nsRidgeE, zyamYield2Density, zyamYieldE2Density);

  //   Printf("");
}

void PlotIAA(const char* fileName)
{
  Int_t colors[] = { 1, 2, 3, 4, 6, 7 };
  Int_t markers[] = { 20, 21, 22, 23, 24, 25 };
  
  if (0)
    {
      Int_t n = 6;
      Int_t is[] = { 0, 0, 1, 1, 1, 2 };
      Int_t js[] = { 1, 2, 1, 2, 3, 3 };
  
      Int_t centralityBins = 6;
      Float_t centralityX[] = { 10, 30, 110, 50, 80, 120 };
      Float_t centralityEX[] = { 10, 10, 0, 10, 20, 0 };
    }
  else if (0)
    {
      Int_t n = 3;
      Int_t is[] = { 0, 1, 2, 3 };
      Int_t js[] = { 1, 2, 3, 4 };

      Int_t centralityBins = 4;
      Float_t centralityX[] = { 1.5, 6.5, 30, 75 };
      Float_t centralityEX[] = { 1.5, 2.5, 20, 25 };
    }
  else
    {
      Int_t n = 1;
      Int_t is[] = { 0 };
      Int_t js[] = { 1 };
  
      Int_t centralityBins = 6;
      Float_t centralityX[] = { 10, 30, 110, 50, 80, 120 };
      Float_t centralityEX[] = { 10, 10, 0, 10, 20, 0 };
    }
  
  const char* graphTitles[] = { "NS Yield", "AS Yield", "NS Ridge" };

  TCanvas* canvas[3];
  for (Int_t ci=0; ci<3; ci++)
    {
      canvas[ci] = new TCanvas;
      gPad->SetGridx();
      gPad->SetGridy();
    }
  
  TFile::Open(fileName);

  legend = new TLegend(0.4, 0.6, 0.99, 0.99);
  legend->SetFillColor(0);

  for (Int_t i=0; i<n; i++)
    {
      TGraphErrors* graph[5];
      for (Int_t ci=0; ci<5; ci++)
	graph[ci] = new TGraphErrors;

      char* label = 0;
      for (Int_t c=0; c<centralityBins; c++)
	{
	  Double_t nsYield, nsError, asYield, asError, nsRidge, nsRidgeE;
	  CalculateIAA(is[i], js[i], c, 1.2, nsYield, nsError, asYield, asError, nsRidge, nsRidgeE, &label, kTRUE);

	  AddPoint(graph[0], centralityX[c], nsYield, centralityEX[c], nsError);
	  AddPoint(graph[1], centralityX[c], asYield, centralityEX[c], asError);
	  AddPoint(graph[2], centralityX[c], nsRidge, centralityEX[c], nsRidgeE);

	  //       if (c != 2 && c != 5)
	  {
	    CalculateIAA(is[i], js[i], c, 1.2, nsYield, nsError, asYield, asError, nsRidge, nsRidgeE, &label, kFALSE);
	    AddPoint(graph[3], centralityX[c], nsYield, 0, nsError);
	    AddPoint(graph[4], centralityX[c], asYield, 0, asError);
	  }
	}

      for (Int_t ci=0; ci<3; ci++)
	{
	  canvas[ci]->cd();
	  graph[ci]->SetMarkerStyle(markers[i]);
	  graph[ci]->SetMarkerColor(colors[i]);
	  graph[ci]->SetLineColor(colors[i]);
	  graph[ci]->Draw((i == 0) ? "AP" : "PSAME");
	  graph[ci]->GetYaxis()->SetTitle(graphTitles[ci]);
	  graph[ci]->GetYaxis()->SetRangeUser(0, 1);
	}
      for (Int_t ci=3; ci<5; ci++)
	{
	  canvas[ci-3]->cd();
	  graph[ci]->SetLineColor(colors[i]);
	  graph[ci]->Sort();
	  graph[ci]->Draw("LSAME");
	}
    
      legend->AddEntry(graph[0], label, "P");
    }
  
  canvas[0]->cd();
  legend->Draw();
  canvas[0]->SaveAs("ns_yield.png");

  canvas[1]->cd();
  legend->Draw();
  canvas[1]->SaveAs("as_yield.png");

  canvas[2]->cd();
  legend->Draw();
  canvas[2]->SaveAs("ns_ridge.png");
}

void Draw2D(const char* fileName, Int_t i, Int_t j, Int_t centr)
{
  TFile::Open(fileName);
  
  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr));
  if (!hist1)
    return 0;
  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
  
  //   hist1->Rebin2D(2, 2); hist1->Scale(0.25);
  
  hist1->GetYaxis()->SetRangeUser(-1.79, 1.79);
  new TCanvas; 
  hist1->DrawCopy("SURF1");
}

void CorrelationSubtraction(const char* fileName, Int_t i, Int_t j, Int_t centr)
{
  CreateGraphStructure();

  CorrelationSubtraction(fileName, i, j, centr, graphs[0], 0);
}

void CorrelationSubtractionAll(const char* fileName, Int_t centr = 0)
{
  Int_t n = 6;
  Int_t is[] = { 0, 1, 1, 2, 2, 2, 3 };
  Int_t js[] = { 1, 1, 2, 1, 2, 3, 3 };

  CreateGraphStructure();

  for (Int_t i=0; i<n; i++)
    CorrelationSubtraction(fileName, is[i], js[i], centr, graphs[0], 0);
}

Int_t gStudySystematic = 0; // 10 = exclusion zone to 0.5; 11 = exclusion off; 12 = exclusion 0.8 and mirror to AS; 13 = scale peripheral; 14 = exclusion 1.2; 20 = non closure; 30 = baseline; 40 = track cuts;  41 = pair cuts; 50/51 = cms comparison; 60 = other peripheral bin ; 70 = 2 Sigma PID
Int_t gParticleSpecie = 0;//0:Hadrons 1:Pions 2:Kaons 3:Protons
const char* gParticleSpecieName[] = {"Hadrons","Pions","Kaons","Protons"};

void SetParticleSpecie(Int_t ParticleSpecie=0){
  gParticleSpecie=ParticleSpecie;
}

void CorrelationSubtractionHistogram(const char* fileName, Bool_t centralityAxis = kTRUE, const char* outputFileName = "graphs.root",const char* inputFileNameHadrons)
{
  if (gBinning == 0)
  {
    Int_t n = 6; //merging og 2.5 - 4
    Int_t is[] =    { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    Int_t js[] =    { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
    Bool_t symm[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
  }
  
  if (gBinning == 1)
  {
    // for extraction when trigger pT is from whole range
    Int_t n = 7;
    Int_t is[] =    { 0, 0, 0, 0, 0, 0, 0 };
    Int_t js[] =    { 1, 2, 3, 4, 5, 6, 9 };
    Bool_t symm[] = { 1, 1, 1, 1, 1, 1, 1 };
  }

  if (gBinning == 2)
  {
    // default with all bins
    Int_t n = 15+6+7;
    // sorted by pT,T
    Int_t is[] =    { 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6 };
    Int_t js[] =    { 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7 };
    Bool_t symm[] = { 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1 };
  }

  if (gBinning == 3)
  {
    // less bins for v3
    Int_t n = 3;
    Int_t is[] = { 0, 1, 2 };
    Int_t js[] = { 1, 2, 3 };
    Bool_t symm[] = { 1, 1, 1 };
  }

  if (gBinning == 4)
  {
    // default with all but only symmetric bins
    Int_t n = 6;
    // sorted by pT,T
    Int_t is[] =    { 0, 1, 2, 3, 4, 5, 8 };
    Int_t js[] =    { 1, 2, 3, 4, 5, 6, 9 };
    Bool_t symm[] = { 1, 1, 1, 1, 1, 1, 1 };
  }

  Int_t centralityBins =(gDoSubtraction)?4:5;

  Int_t colors[] = { 1, 2, 3, 4, 6, 7 };
  Int_t markers[] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 };

  CreateGraphStructure();
  
  Float_t yMax[] = { 0.1, 2, 0.4, 4, 1.5, 50, 50, 4 };

  TCanvas* canvas[8];
  for (Int_t ci=0; ci<8; ci++)
    {
      canvas[ci] = new TCanvas;
      gPad->SetGridx();
      gPad->SetGridy();
      dummy = new TH2F("dummy", Form(";%s;%s", (centralityAxis) ? "Event class" : "<mult>", graphTitles[(ci < 3) ? ci*2 : ci+3]), 100, 0,(gDoSubtraction)? 60:100, 100, 0, yMax[ci]);
      if (ci == 0)
	dummy->GetYaxis()->SetTitle("Yield");
      if (ci == 1)
	dummy->GetYaxis()->SetTitle("Width");
      if (ci == 2)
	dummy->GetYaxis()->SetTitle("v2 , v3");
      dummy->SetStats(0);
      dummy->Draw();
    }
  
  legend = new TLegend(0.4, 0.6, 0.99, 0.99);
  legend->SetFillColor(0);

  legend2 = new TLegend(0.4, 0.6, 0.99, 0.99);
  legend2->SetFillColor(0);

  for (Int_t i=0; i<n; i++)
    {
      for (Int_t c=0; c<centralityBins; c++)
	{
	  if (c == 2)
	    continue;
      
	  Double_t nsYield, nsYieldE, asYield, asYieldE, nsWidth, nsWidthE, asWidth, asWidthE, v2, v2E, v3, v3E, centrality;
	  CorrelationSubtraction(fileName, is[i], js[i], c, graphs[i], 1.5 * (-n/2 + i), kTRUE, symm[i], centralityAxis);
	}

      for (Int_t ci=0; ci<6; ci++)
	{
	  canvas[ci/2]->cd();

	  graphs[i][ci]->SetMarkerStyle(markers[i%14]);
	  graphs[i][ci]->SetMarkerColor((ci % 2 == 0) ? 1 : 2);
	  graphs[i][ci]->SetLineColor((ci % 2 == 0) ? 1 : 2);
	  graphs[i][ci]->GetXaxis()->SetTitle(dummy->GetXaxis()->GetTitle());
	  graphs[i][ci]->Draw("PSAME");
	}
    
      for (Int_t ci=6; ci<11; ci++)
	{
	  canvas[ci-3]->cd();

	  graphs[i][ci]->SetMarkerStyle(markers[i%14]);
	  graphs[i][ci]->SetMarkerColor(1);
	  graphs[i][ci]->SetLineColor(1);
	  graphs[i][ci]->GetXaxis()->SetTitle(dummy->GetXaxis()->GetTitle());
	  graphs[i][ci]->Draw("PSAME");
	}

      legend->AddEntry(graphs[i][0], graphs[i][0]->GetTitle(), "P");
      if (symm[i])
	legend2->AddEntry(graphs[i][0], graphs[i][0]->GetTitle(), "P");
    }
  
  const char* fileNames[] = { "ridge_yield.png", "ridge_width.png", "v2_v3.png", "ridge_yield_ratio.png", "v3_over_v2.png", "remaining_peak.png", "remaining_jet.png", "chi2ndf.png" };
  
  for (Int_t ci=0; ci<8; ci++)
    {
      canvas[ci]->cd();
      if (ci == 2 || ci == 4)
	legend2->Draw();
      else
	legend->Draw();
      canvas[ci]->SaveAs(fileNames[ci]);
    }
  
  if (gStudySystematic != 0)
    Printf(">>>>>>>>>>>> WARNING: gStudySystematic set to %d", gStudySystematic);
  if (gParticleSpecie != 0){
    Printf("\033[1;31m\n>>Unfold v2 of particle %d with hadron file %s\033[m", gParticleSpecie,inputFileNameHadrons);
    UnfoldUsingVnHadrons(graphs,inputFileNameHadrons,4);  
    Printf("\033[1;31m\n>>Unfold v3 of particle %d with hadron file %s\033[m", gParticleSpecie,inputFileNameHadrons);
    UnfoldUsingVnHadrons(graphs,inputFileNameHadrons,5);  
  }
  WriteGraphs(outputFileName);
}

void CorrelationSubtraction(const char* fileName, Int_t i, Int_t j, Int_t centr, TGraphErrors** graph, Float_t axisOffset, Bool_t silent = kFALSE, Bool_t symmetricpT = kFALSE, Bool_t centralityAxis = kTRUE)
{
  Printf(Form("Getting dphi_%d_%d_%d from %s", i, j, centr,fileName));
  TFile::Open(fileName);
  
  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr));
  TH2* hist2 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, ((gStudySystematic == 60) ? 6 : 4)));
  TH1* refMult = (TH1*) gFile->Get("refMult");

  if (!hist1 || !hist2)
    return;

  hist1 = (TH2*) hist1->Clone();
  hist2 = (TH2*) hist2->Clone();
  
  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
  hist2->Scale(1.0 / hist2->GetYaxis()->GetBinWidth(1));
  
  //   hist1->Scale(1.0 / 283550); hist2->Scale(1.0 / 190000); // for 1, 2, 0
  //   hist1->Scale(1.0 / 283550); hist2->Scale(1.0 / 75000); // for 2, 3, 0
  //   hist1->Scale(1.0 / 283550); hist2->Scale(1.0 / 100000); // for 2, 2, 0
  
  tokens = TString(hist1->GetTitle()).Tokenize("-");
  if (tokens->GetEntries() > 1)
    {
      TString centralityStr;
      centralityStr = tokens->At(0)->GetName();
      centralityStr = centralityStr + "-" + tokens->At(1)->GetName();
      //     Printf("%s", centralityStr.Data());
      for (Int_t gID=0; gID<NHists; gID++)
	{
	  TString xTitle = graph[gID]->GetXaxis()->GetTitle();
	  TString yTitle = graph[gID]->GetYaxis()->GetTitle();
	  //       Printf("%s", centralityStr.Data());
	  graph[gID]->SetTitle(centralityStr);
	  graph[gID]->GetXaxis()->SetTitle(xTitle);
	  graph[gID]->GetYaxis()->SetTitle(yTitle);
	  //       Printf("%s %s", yTitle.Data(), graph[gID]->GetYaxis()->GetTitle());
	}
      Double_t centrality = -1;
      if (tokens->GetEntries() == 4)
	centrality = 0.5 * (TString(tokens->At(3)->GetName()).Atoi() + TString(tokens->At(2)->GetName()).Atoi());
    }
  
//   hist1->GetYaxis()->SetRangeUser(-1.99, 1.99); hist2->GetYaxis()->SetRangeUser(-1.99, 1.99);
  if (!silent)
    {
      new TCanvas; 
      copy = (TH2*) hist1->DrawCopy("SURF1");
//       copy->Rebin2D(2, 2);
//       copy->Scale(0.25);
//       copy->GetYaxis()->SetRangeUser(-1.59, 1.59);
    
      new TCanvas; 
      copy = (TH2*) hist2->DrawCopy("SURF1");
//       copy->Rebin2D(2, 2);
//       copy->Scale(0.25);
//       copy->GetYaxis()->SetRangeUser(-1.59, 1.59);
    }
  
  if (gStudySystematic == 13)
    {
      Float_t factor[10][10][10][4];
    
      if (1)
	{
	  // From Leonardo, Apr 18th 2013
	  factor[0][1][0][0] = 0.130;
	  factor[0][1][1][0] = 0.115;
	  factor[0][1][3][0] = 0.089;
	  factor[1][2][0][0] = 0.106;
	  factor[1][2][1][0] = 0.088;
	  factor[1][2][3][0] = 0.069;
	  factor[2][3][0][0] = 0.085;
	  factor[2][3][1][0] = 0.074;
	  factor[2][3][3][0] = 0.056;
	  factor[3][4][0][0] = 0.055;
	  factor[3][4][1][0] = 0.059;
	  factor[3][4][3][0] = 0.034;
	  factor[4][5][0][0] = 0.021;
	  factor[4][5][1][0] = 0.034;
	  factor[4][5][3][0] = 0.025;
	  factor[0][1][0][1] = 0.134;
	  factor[0][1][1][1] = 0.121;
	  factor[0][1][3][1] = 0.092;
	  factor[1][2][0][1] = 0.110;
	  factor[1][2][1][1] = 0.090;
	  factor[1][2][3][1] = 0.071;
	  factor[2][3][0][1] = 0.085;
	  factor[2][3][1][1] = 0.068;
	  factor[2][3][3][1] = 0.048;
	  factor[3][4][0][1] = 0.055;
	  factor[3][4][1][1] = 0.066;
	  factor[3][4][3][1] = 0.045;
	  factor[4][5][0][1] = -0.010;
	  factor[4][5][1][1] = 0.002;
	  factor[4][5][3][1] = 0.004;
	  factor[0][1][0][2] = 0.040;
	  factor[0][1][1][2] = 0.062;
	  factor[0][1][3][2] = 0.050;
	  factor[1][2][0][2] = 0.108;
	  factor[1][2][1][2] = 0.099;
	  factor[1][2][3][2] = 0.096;
	  factor[2][3][0][2] = 0.083;
	  factor[2][3][1][2] = 0.081;
	  factor[2][3][3][2] = 0.061;
	  factor[3][4][0][2] = 0.049;
	  factor[3][4][1][2] = 0.072;
	  factor[3][4][3][2] = 0.024;
	  factor[4][5][0][2] = 0.023;
	  factor[4][5][1][2] = 0.049;
	  factor[4][5][3][2] = 0.018;
	  factor[0][1][0][3] = -0.192;
	  factor[0][1][1][3] = 0.003;
	  factor[0][1][3][3] = 0.093;
	  factor[1][2][0][3] = 0.001;
	  factor[1][2][1][3] = -0.008;
	  factor[1][2][3][3] = 0.054;
	  factor[2][3][0][3] = 0.083;
	  factor[2][3][1][3] = 0.090;
	  factor[2][3][3][3] = 0.071;
	  factor[3][4][0][3] = 0.140;
	  factor[3][4][1][3] = 0.163;
	  factor[3][4][3][3] = 0.095;
	  factor[4][5][0][3] = 0.078;
	  factor[4][5][1][3] = 0.055;
	  factor[4][5][3][3] = 0.081;
	}
      Printf("i=%d  j=%d centr=%d",i,j,centr);
      Printf("Using factor[i][j][centr][gParticleSpecie] %f", factor[i][j][centr][gParticleSpecie]);
      hist2->Scale(1.0 + factor[i][j][centr][gParticleSpecie]);
    }
  
  const Float_t etaFlat = 1.2;
  const Float_t centralEta = 0.5;

  projCentral = hist1->ProjectionY(Form("%s_proj3y", hist1->GetName()), hist1->GetXaxis()->FindBin(-0.7), hist1->GetXaxis()->FindBin(0.7));
  projCentral->Scale(hist1->GetXaxis()->GetBinWidth(1));
  projCentral2 = hist2->ProjectionY(Form("%s_proj4y", hist2->GetName()), hist2->GetXaxis()->FindBin(-0.7), hist2->GetXaxis()->FindBin(0.7));
  projCentral2->Scale(hist2->GetXaxis()->GetBinWidth(1));

  Float_t yEta1 = projCentral->FindBin(-etaMax+0.01);
  Float_t yEta2 = projCentral->FindBin(-etaFlat-0.01);
  Float_t yEta3 = projCentral->FindBin(-centralEta+0.01);
  Float_t yEta4 = projCentral->FindBin(centralEta-0.01);
  Float_t yEta5 = projCentral->FindBin(etaFlat+0.01);
  Float_t yEta6 = projCentral->FindBin(etaMax-0.01);
  Float_t yBaseline = (projCentral->Integral(yEta1, yEta2) + projCentral->Integral(yEta5, yEta6)) / (yEta2 - yEta1 + 1 + yEta6 - yEta5 + 1);
  Float_t yPeak = projCentral->Integral(yEta3, yEta4, "width") - yBaseline * (yEta4 - yEta3 + 1) * projCentral->GetBinWidth(1);
  Printf("Peak (unsubtracted): %f %f", yBaseline, yPeak);

  if (!silent)
    {
      Float_t yBaseline = (projCentral->Integral(yEta1, yEta2) + projCentral->Integral(yEta5, yEta6)) / (yEta2 - yEta1 + 1 + yEta6 - yEta5 + 1);
      Float_t yBaseline2 = (projCentral2->Integral(yEta1, yEta2) + projCentral2->Integral(yEta5, yEta6)) / (yEta2 - yEta1 + 1 + yEta6 - yEta5 + 1);
      Printf("baselines: %f %f", yBaseline, yBaseline2);
    
      projCentral2->Add(new TF1("flat", "1", -5, 5), yBaseline - yBaseline2);
    
      new TCanvas; 
      projCentral->DrawCopy();
      projCentral2->SetLineColor(2);
      projCentral2->DrawCopy("SAME");
    }
  
  Float_t xValue1 = -1;
  Float_t xValue2 = -1;
  Float_t xValue1vn = -1;
  Float_t xValue2vn = -1;
  if (centralityAxis)
    {
      xValue1 = centrality + axisOffset;
      xValue2 = xValue1 + 0.5;
      xValue1vn = centrality + (Int_t) axisOffset;
      xValue2vn = xValue1vn + 0.5;
    }
  else
    {
      if (centrality > 0)
	{
	  xValue1 = refMult->GetBinContent(refMult->GetXaxis()->FindBin(centrality));
	  xValue2 = xValue1;
	  xValue1vn = xValue1;
	  xValue2vn = xValue1;
	  //       Printf("%f %f %f", centrality, xValue1, xValue2);
	}
    }
  
  Float_t exclusion = (gDoEtaGap)?2.0:0.;
  if (gStudySystematic == 10)
    exclusion = 0.5;
  else if (gStudySystematic == 11)
    exclusion = 0.0;
  else if (gStudySystematic == 14 || gStudySystematic == 51)
    exclusion = 1.2;
  
  Int_t eta1 = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(-etaMax + 0.001)));
  Int_t eta2 = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(-exclusion - 0.001)));
  Int_t eta3 = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(exclusion + 0.001)));
  Int_t eta6 = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(etaMax - 0.001)));
  Int_t phi1Z = hist1->GetXaxis()->FindBin(TMath::Pi()/2 - 0.2);
  Int_t phi2Z = hist1->GetXaxis()->FindBin(TMath::Pi()/2 + 0.2);
  
  Printf("%d %d %d %d", eta1, eta2, eta3, eta6);

  //   new TCanvas; tmpProj = hist1->ProjectionX("tmp", eta1, eta6); tmpProj->Scale(hist1->GetYaxis()->GetBinWidth(1)); tmpProj->Scale(1.0 / (etaMax * 2)); tmpProj->Draw();
  
  Double_t baseLineE;
  Float_t baseLine = hist1->IntegralAndError(phi1Z, phi2Z, eta1, eta6, baseLineE);
  baseLine /= (phi2Z - phi1Z + 1) * (eta6 - eta1 + 1);
  baseLineE /= (phi2Z - phi1Z + 1) * (eta6 - eta1 + 1);
  Double_t baseLineE2;
  Float_t baseLine2 = hist2->IntegralAndError(phi1Z, phi2Z, eta1, eta6, baseLineE2);
  baseLine2 /= (phi2Z - phi1Z + 1) * (eta6 - eta1 + 1);
  baseLineE2 /= (phi2Z - phi1Z + 1) * (eta6 - eta1 + 1);
  
  // get baseline of peripheral bin with large eta gap
  Int_t eta1Alternative = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(-etaMax + 0.001)));
  Int_t eta2Alternative = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(-1.2 - 0.001)));
  Int_t eta3Alternative = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(1.2 + 0.001)));
  Int_t eta6Alternative = TMath::Min(hist1->GetNbinsY(), TMath::Max(1, hist1->GetYaxis()->FindBin(etaMax - 0.001)));
  Int_t phi1ZAlternative = hist1->GetXaxis()->FindBin(-TMath::Pi()/2 + 0.001);
  Int_t phi2ZAlternative = hist1->GetXaxis()->FindBin( TMath::Pi()/2 - 0.001);
  
  Printf("%d %d %d %d", eta1Alternative, eta2Alternative, eta3Alternative, eta6Alternative);
  
  Float_t baseLine2NSGapE = 0, baseLine2NSGapE2 = 0;
  Float_t baseLine2NSGap = 0;
  Int_t bins = 0;
  if (eta1Alternative != eta2Alternative)
  {
    baseLine2NSGap += hist2->IntegralAndError(phi1ZAlternative, phi2ZAlternative, eta1Alternative, eta2Alternative, baseLine2NSGapE);
    bins += eta2Alternative - eta1Alternative + 1;
  }
  if (eta3Alternative != eta6Alternative)
  {
    baseLine2NSGap += hist2->IntegralAndError(phi1ZAlternative, phi2ZAlternative, eta3Alternative, eta6Alternative, baseLine2NSGapE2);
    bins += eta6Alternative - eta3Alternative + 1;
  }
  baseLine2NSGapE = TMath::Sqrt(baseLine2NSGapE * baseLine2NSGapE + baseLine2NSGapE2 * baseLine2NSGapE2);
  baseLine2NSGap /= (phi2ZAlternative - phi1ZAlternative + 1) * bins;
  baseLine2NSGapE /= (phi2ZAlternative - phi1ZAlternative + 1) * bins;
  
  if(gDoSubtraction)hist1->Add(hist2, -1);
  
  // phi projection
  // NS
  proj = hist1->ProjectionX(Form("%s_proj1x", hist1->GetName()));

  //   proj2 = hist1->ProjectionX(Form("%s_proj2x", hist1->GetName()), eta3, eta6);
//   proj->Add(proj2, 1);
  
  // AS
  if (gDoEtaGapAS)
  {
    projAS = hist1->ProjectionX(Form("%s_proj3x", hist1->GetName()), eta1, eta2);
    projAS2 = hist1->ProjectionX(Form("%s_proj4x", hist1->GetName()), eta3, eta6);
    projAS->Add(projAS2, 1);
    
    projAS->Scale(1.0 * (eta6 - eta1 + 1) / (eta6 - eta3 + 1 + eta2 - eta1 + 1));
  }
  else
  {
    projAS = hist1->ProjectionX(Form("%s_proj3x", hist1->GetName()), eta1, eta6);
  }
  
  // match NS and AS yield
//   proj->Scale(1.0 * (eta6 - eta1 + 1) / (eta6 - eta3 + 1 + eta2 - eta1 + 1));

  // copy AS
//   for (Int_t bin=proj->FindBin(TMath::Pi()/2+0.001); bin<=proj->GetNbinsX(); bin++)
//     {
//       //     Printf("%d %f", bin, projAS->GetBinContent(bin));
//       proj->SetBinContent(bin, projAS->GetBinContent(bin));
//       proj->SetBinError(bin, projAS->GetBinError(bin));
//     }
  
  if (gStudySystematic == 12)
    {
      // get difference between exclusion 0.8 and 0.0, shift to AS, remove from AS
      Printf("\nParticleSpecie: %d",gParticleSpecie);
      projAll = hist1->ProjectionX(Form("%s_proj4x", hist1->GetName()), eta2+1, eta3-1);
      projAll->Add(proj, -1.0 * (eta3-1 - (eta2+1) + 1) / (eta6 - eta1 + 1));
  
      if (!silent)
	{
	  new TCanvas; projAll->DrawCopy();
	}

      // From Leonardo, Apr 18th 2013
      Float_t ratioNSAS[10][10][10][4];
      ratioNSAS[0][1][4][0] = 3.166786;
      ratioNSAS[1][2][4][0] = 1.595074;
      ratioNSAS[2][3][4][0] = 1.451555;
      ratioNSAS[3][4][4][0] = 1.371433;
      ratioNSAS[4][5][4][0] = 1.581739;
      ratioNSAS[0][1][4][1] = 3.177672;
      ratioNSAS[1][2][4][1] = 1.628396;
      ratioNSAS[2][3][4][1] = 1.497103;
      ratioNSAS[3][4][4][1] = 1.430801;
      ratioNSAS[4][5][4][1] = 1.627891;
      ratioNSAS[0][1][4][2] = 2.820564;
      ratioNSAS[1][2][4][2] = 1.526886;
      ratioNSAS[2][3][4][2] = 1.415753;
      ratioNSAS[3][4][4][2] = 1.195244;
      ratioNSAS[4][5][4][2] = 1.519867;
      ratioNSAS[0][1][4][3] = 1.825534;
      ratioNSAS[1][2][4][3] = 1.143225;
      ratioNSAS[2][3][4][3] = 1.090177;
      ratioNSAS[3][4][4][3] = 1.239809;
      ratioNSAS[4][5][4][3] = 1.091130;
      
      Printf("i=%d  j=%d centr=%d",i,j,centr);
      Printf("Using NS/AS ratio %f", ratioNSAS[i][j][4][gParticleSpecie]);

      for (Int_t k=0; k<=projAll->GetNbinsX()/2; k++)
	{
	  //     Printf("%d -> %d", i, projAll->GetNbinsX()+1-i);
	  projAll->SetBinContent(projAll->GetNbinsX()+1-k, projAll->GetBinContent(k) / ratioNSAS[i][j][4][gParticleSpecie]);
	  projAll->SetBinError(projAll->GetNbinsX()+1-k, projAll->GetBinError(k) / ratioNSAS[i][j][4][gParticleSpecie]);
      
	  projAll->SetBinContent(k, 0);
	  projAll->SetBinError(k, 0);
	}
      if (!silent)
	{
	  new TCanvas; projAll->DrawCopy();
	}
    
      //     new TCanvas; proj->DrawCopy();
      proj->Add(projAll, -1);
      //     new TCanvas; proj->DrawCopy();
    }
  
//   proj->Scale(hist1->GetYaxis()->GetBinWidth(1));
//   proj->Scale(1.0 / (etaMax * 2));
  proj->Scale(1.0 / hist1->GetNbinsY());
  proj->Rebin(2); proj->Scale(0.5);
  
  if(gExcludeNearSidePeakFromPhiProj)
    {
      Double_t phicut=1.;
      for(Int_t ibin=1;ibin<=proj->GetNbinsX();ibin++)
	if(TMath::Abs(proj->GetBinCenter(ibin))<phicut)
	  {
	    proj->SetBinContent(ibin,0);
	    proj->SetBinError(ibin,0);
	  }
    }
  
  if (gStudySystematic == 20)
    {
      Printf(">>>>>>>>>>>> Applying non-closure systematics <<<<<<<<<<<<");
      Printf(">> Non closure ratio from file non_closure_%s.root",gParticleSpecieName[gParticleSpecie]);
      file2 = TFile::Open(Form("non_closure_files/non_closure_%s.root",gParticleSpecieName[gParticleSpecie]));
      non_closure = (TH1*) file2->Get(Form("non_closure_%d_%d_%d", i, j, 0));
      for (Int_t bin=1; bin<=non_closure->GetNbinsX(); bin++)
	non_closure->SetBinError(bin, 0);
    
      proj->Multiply(non_closure);
    }
  
  //   proj = hist1->ProjectionX("proj1x", hist1->GetYaxis()->FindBin(0.5), eta6);

  // eta projection
  Int_t binEtaProj1 = 1;
  Int_t binEtaProj2 = hist1->GetXaxis()->FindBin(-TMath::Pi()/3-0.001);
  Int_t binEtaProj3 = binEtaProj2 + 1;
  Int_t binEtaProj4 = hist1->GetXaxis()->FindBin(TMath::Pi()/3-0.001);
  Int_t binEtaProj5 = binEtaProj4+1;
  Int_t binEtaProj6 = hist1->GetXaxis()->FindBin(TMath::Pi()-TMath::Pi()/3-0.001);
  Int_t binEtaProj7 = binEtaProj6+1;
  Int_t binEtaProj8 = hist1->GetXaxis()->FindBin(TMath::Pi()+TMath::Pi()/3-0.001);
  Int_t binEtaProj9 = binEtaProj8+1;
  Int_t binEtaProj10 = hist1->GetNbinsX();
  Printf("%d %d %d %d %d %d %d %d %d %d", binEtaProj1, binEtaProj2, binEtaProj3, binEtaProj4, binEtaProj5, binEtaProj6, binEtaProj7, binEtaProj8, binEtaProj9, binEtaProj10);
  
  etaProj = hist1->ProjectionY(Form("%s_proj1y", hist1->GetName()), binEtaProj3, binEtaProj4);
  etaProj->Scale(1.0 / (binEtaProj4 - binEtaProj3 + 1));
  etaProj2 = hist1->ProjectionY(Form("%s_proj2y", hist1->GetName()), binEtaProj7, binEtaProj8);
  etaProj2->Scale(1.0 / (binEtaProj8 - binEtaProj7 + 1));
  etaProj3 = hist1->ProjectionY(Form("%s_proj5y", hist1->GetName()), binEtaProj1, binEtaProj2);
  etaProj3b = hist1->ProjectionY(Form("%s_proj5by", hist1->GetName()), binEtaProj5, binEtaProj6);
  etaProj3c = hist1->ProjectionY(Form("%s_proj5cy", hist1->GetName()), binEtaProj9, binEtaProj10);
  etaProj3->Add(etaProj3b);
  etaProj3->Add(etaProj3c);
  etaProj3->Scale(1.0 / (binEtaProj2 - binEtaProj1 + 1 + binEtaProj6 - binEtaProj5 + 1 + binEtaProj10 - binEtaProj9 + 1));

  Float_t ySubBaseline = (etaProj->Integral(yEta1, yEta2) + etaProj->Integral(yEta5, yEta6)) / (yEta2 - yEta1 + 1 + yEta6 - yEta5 + 1);
  Float_t ySubPeak = etaProj->Integral(yEta3, yEta4, "width") - ySubBaseline * (yEta4 - yEta3 + 1) * etaProj->GetBinWidth(1);
  Printf("Peak (subtracted): %f %f (%.2f%% of unsubtracted peak)", ySubBaseline, ySubPeak, ySubPeak / yPeak * 100);
  Printf("    factor[%d][%d][%d][%d] = %.3f;", i, j, centr, gParticleSpecie, ySubPeak / yPeak);
  AddPoint(graph[8], xValue1, 100.0 * ySubPeak / yPeak, 0, 0);
  
//   hist1->Rebin2D(4, 4); hist1->Scale(1.0 / 16);
//   hist1->GetYaxis()->SetRangeUser(-1.99, 1.99);
  
  TString fitOption = "0I";
  if (!silent)
    {
      c = new TCanvas("c", "c", 600, 600);

      PadFor2DCorr();
    
//       hist1->GetYaxis()->SetRangeUser(-1.59, 1.59);
      hist1->GetXaxis()->SetTitleOffset(1.7);
      hist1->GetYaxis()->SetTitleOffset(2);
      hist1->GetZaxis()->SetTitle(kCorrFuncTitle);
      hist1->GetZaxis()->SetTitleOffset(2);
      hist1->GetZaxis()->SetNdivisions(504);
      hist1->SetStats(kFALSE);
      hist1->GetZaxis()->CenterTitle(kTRUE);
      hist1->GetYaxis()->CenterTitle(kTRUE);
      hist1->GetXaxis()->CenterTitle(kTRUE);
      hist1->GetXaxis()->SetTitle("#Delta#varphi (rad)");
      hist1->GetYaxis()->SetNdivisions(505);
    
      TString label(hist1->GetTitle());
      hist1->SetTitle("");
      //label.ReplaceAll("00", "");
      //label.ReplaceAll(".0", "");
      TObjArray* objArray = label.Tokenize("-");
      TPaveText* paveText = new TPaveText(0.03, 0.86, 0.44, 0.97, "BRNDC");
      paveText->SetTextSize(0.035);
      paveText->SetFillColor(0);
      paveText->SetShadowColor(0);
      paveText->SetBorderSize(0);
      paveText->SetFillStyle(0);
      TString tmpStr(objArray->At(0)->GetName());
      tmpStr.ReplaceAll("p_", "#it{p}_");
      paveText->AddText(tmpStr + "GeV/#it{c}");

      TString tmpStr(objArray->At(1)->GetName());
      tmpStr.ReplaceAll("p_", "#it{p}_");
      paveText->AddText(tmpStr + "GeV/#it{c}");
  
      TString label2(hist2->GetTitle());
      TObjArray* objArray2 = label2.Tokenize("-");

      TPaveText* paveText2 = new TPaveText(0.65, 0.86, 0.98, 0.97, "BRNDC");
      paveText2->SetTextSize(0.035);
      paveText2->SetBorderSize(0);
      paveText2->SetFillColor(0);
      paveText2->SetFillStyle(0);
      paveText2->SetShadowColor(0);
      paveText2->AddText("p-Pb #sqrt{s_{NN}} = 5.02 TeV");
      if (objArray->GetEntries() > 3 && objArray2->GetEntries() > 3)
	{
	  TString centrBeginStr;
	  centrBeginStr = objArray->At(2)->GetName();
	  centrBeginStr.ReplaceAll(" ", "");
	  TString centrEndStr;
	  centrEndStr = objArray2->At(2)->GetName();
	  centrEndStr.ReplaceAll(" ", "");
	  if(gDoSubtraction)paveText2->AddText(Form("(%s-%s) - (%s-%s)", centrBeginStr.Data(), objArray->At(3)->GetName(), centrEndStr.Data(), objArray2->At(3)->GetName()));
	  else paveText2->AddText(Form("(%s-%s)", centrBeginStr.Data(), objArray->At(3)->GetName()));
	}
      
      hist1->DrawCopy("SURF1");
      paveText->Draw();
      paveText2->Draw();
      gPad->GetCanvas()->SaveAs(Form("ridge_%d_%d.png", i, j));
      //gPad->GetCanvas()->SaveAs(Form("ridge_%d_%d.eps", i, j));
      //gPad->GetCanvas()->SaveAs("fig3a.eps");
    
      Float_t fontSize = 0.05;

      c3 = new TCanvas("c3", "c3", 600, 400);
      gPad->SetLeftMargin(0.12);
      gPad->SetRightMargin(0.01);
      gPad->SetBottomMargin(0.12);
      gPad->SetTopMargin(0.01);
      etaProj->SetTitle();
      //     etaProj->GetYaxis()->SetNdivisions(505);
      etaProj->GetYaxis()->SetLabelSize(fontSize);
      etaProj->GetXaxis()->SetLabelSize(fontSize);
      etaProj->GetXaxis()->SetTitleSize(fontSize);
      etaProj->GetYaxis()->SetTitleSize(fontSize);
      etaProj->GetYaxis()->SetTitle(kProjYieldTitleEta);
      etaProj->GetYaxis()->SetTitleOffset(1.1);
      etaProj->SetStats(0);
      etaProj->GetXaxis()->SetNdivisions(505);
      etaProj->Rebin(2); etaProj->Scale(0.5);
      etaProj2->Rebin(2); etaProj2->Scale(0.5);
      etaProj3->Rebin(2); etaProj3->Scale(0.5);
      etaProj->Rebin(2); etaProj->Scale(0.5);
      etaProj2->Rebin(2); etaProj2->Scale(0.5);
      etaProj3->Rebin(2); etaProj3->Scale(0.5);
//       etaProj->GetXaxis()->SetRangeUser(-1.99, 1.99);
      //     etaProj->GetYaxis()->SetRangeUser(TMath::Min(etaProj->GetMinimum(), etaProj3->GetMinimum()) * 0.8, TMath::Max(etaProj->GetMaximum(), etaProj3->GetMaximum()) * 1.2);
      etaProj->GetYaxis()->SetRangeUser(proj->GetMinimum(0.00001) * 0.98, proj->GetMaximum() * 1.1);
      etaProj2->SetLineColor(2); etaProj2->SetMarkerColor(2);
      etaProj3->SetLineColor(4); etaProj3->SetMarkerColor(4);
      etaProj->SetMarkerStyle(24);
      etaProj2->SetMarkerStyle(25);
      etaProj3->SetMarkerStyle(26);
      etaProj->DrawCopy("E0 X0");
      etaProj2->DrawCopy("E0 X0 SAME");
      etaProj3->DrawCopy("E0 X0 SAME");
    
      legend5 = new TLegend(0.48, 0.74, 0.92, 0.97);
      legend5->SetBorderSize(0);
      legend5->SetTextSize(fontSize);
      legend5->SetFillColor(0);
      legend5->AddEntry(etaProj,  "|#Delta#varphi| < #pi/3", "P");
      legend5->AddEntry(etaProj2, "|#Delta#varphi - #pi| < #pi/3", "P");
      //     legend5->AddEntry(etaProj3, "#pi/3 < |#Delta#varphi| < 2#pi/3, #Delta#varphi > 4#pi/3", "P");
      legend5->AddEntry(etaProj3, "Remaining #Delta#varphi", "P");
      legend5->Draw();
    
      c = new TCanvas("c2", "c2", 600, 400);
      gPad->SetLeftMargin(0.12);
      gPad->SetRightMargin(0.01);
      gPad->SetBottomMargin(0.12);
      gPad->SetTopMargin(0.01);
    
      proj->SetStats(0);
      //     proj->GetYaxis()->SetNdivisions(505);
      proj->GetXaxis()->SetTitle("#Delta#varphi (rad)");
      proj->GetYaxis()->SetTitle(kProjYieldTitlePhi);
      proj->GetYaxis()->SetTitleOffset(1.1);
      proj->GetYaxis()->SetLabelSize(fontSize);
      proj->GetXaxis()->SetLabelSize(fontSize);
      proj->GetXaxis()->SetTitleSize(fontSize);
      proj->GetYaxis()->SetTitleSize(fontSize);
      proj->SetTitle();
      proj->SetMarkerStyle(21);
      proj->SetMarkerSize(0.7);
      //proj->SetMinimum(proj->GetMinimum() * 0.98); proj->SetMaximum(proj->GetMaximum() * 1.065);
      //proj->GetYaxis()->SetRangeUser(proj->GetMinimum(0.00001) * 0.98,proj->GetMaximum() * 1.6);
      proj->GetYaxis()->SetRangeUser(proj->GetMinimum(0.00001) * 0.98,proj->GetMaximum() * 1.05);
      proj->Draw("E0 X0");
      fitOption = "I";
    
      if (0)
	{
	  Printf("\nPer-trigger yield per unit of delta eta (y) as function of delta phi (x) in the bin %s", centralityStr.Data());
	  Printf("Systematic uncertainties are mostly correlated and affect the baseline. Uncorrelated uncertainties are less than 1%% and not indicated explicitly in the table below.");

	  for (Int_t k=1; k<=proj->GetNbinsX(); k++)
	    Printf("x = %.2f, y = %.4f +- %.4f (stat)", proj->GetXaxis()->GetBinCenter(k), proj->GetBinContent(k), proj->GetBinError(k));
	}
    }
  
  fileProj = TFile::Open("dphi_proj.root", "UPDATE");
  proj->Write(Form("proj_%d_%d_%d_%d", i, j, centr, gStudySystematic));
  fileProj->Close();

  TF1* v2 = new TF1("func", "[0]+2*[1]*cos(2*x)", -5, 5);
  v2->SetLineStyle(2);
  //   v2->SetLineWidth(1);
  
  TF1* v2v3 = new TF1("func", "[0]+2*[1]*cos(2*x)+2*[2]*cos(3*x)+2*[3]*cos(x)", -5, 5);

  v2v3->SetLineColor(1);
  //   v2v3->FixParameter(2, 0);
//   proj->Fit(v2, fitOption);
  //   return;
  
  fitOption += "+";
  proj->Fit(v2v3, fitOption, "E0 X0");
  
  if(gDoSubtraction){
    Float_t min = v2v3->GetMinimum();
    Printf("Minimum for the yield extraction from the fit %f",min);
  }else{
    //get the minimum value (not using GetMinimum() because it can be that same bins are 0, when we remove the NS peak in the delta_phi projection)
    Float_t min = 99999;
    for(Int_t ibin=1;ibin<=proj->GetNbinsX();ibin++){
      if(proj->GetBinContent(ibin)==0)continue;
      if(proj->GetBinContent(ibin)<min)min=proj->GetBinContent(ibin);
    }
    Printf("Minimum for the yield extraction from the projection %f",min);
  }
  
  Float_t diffMinParam0 = v2v3->GetParameter(0) - v2v3->GetMinimum();
  Printf("Chi2: %f ndf: %d chi2/ndf %f:Min: %f %f", v2v3->GetChisquare(), v2v3->GetNDF(), v2v3->GetChisquare() / v2v3->GetNDF(), min, diffMinParam0);
  AddPoint(graph[10], xValue1, v2v3->GetChisquare() / v2v3->GetNDF(), 0, 0);
  
  AddPoint(graph[11], xValue1, baseLine + diffMinParam0, 0, baseLineE);
  //   AddPoint(graph[11], xValue1, baseLine, 0, baseLineE);

  
  
  Float_t v2value = 0, v2E = 0, v3 = 0, v3E = 0;
  if(gUseAnalyticalVn){//analytic calculation of vv
    Printf("vn calculated analytically!");
    v2value = CalculateVnAnalytically(proj,2,(gDoSubtraction)?baseLine2:0.);//baseline2 is the peripheral one
    v2E = CalculateVnErrAnalytically(proj,2,(gDoSubtraction)?baseLine2:0.,(gDoSubtraction)?baseLineE2:0.);
    if (symmetricpT)
      AddPoint(graph[4], xValue1vn, v2value, 0, v2E);
    v3 = CalculateVnAnalytically(proj,3,(gDoSubtraction)?baseLine2:0.);//baseline2 is the peripheral one
    v3E = CalculateVnErrAnalytically(proj,3,(gDoSubtraction)?baseLine2:0.,(gDoSubtraction)?baseLineE2:0);
    if (symmetricpT)
      AddPoint(graph[5], xValue2vn, v3, 0, v3E);
    
    if (0 && !silent)
    {
      proj->Fit("pol0", "+W");
      Float_t v0 = proj->GetFunction("pol0")->GetParameter(0);
      Float_t v1 = CalculateVnAnalyticallyRaw(proj,1,(gDoSubtraction)?baseLine2:0.);//baseline2 is the peripheral one
      Printf("%f", v1);
      Float_t v4 = 0;//CalculateVnAnalyticallyRaw(proj,4,(gDoSubtraction)?baseLine2:0.);//baseline2 is the peripheral one
      
      Float_t scaleBaseline = 1;
      if (gDoSubtraction)
	scaleBaseline = v0 * (v0+baseLine2);

      TF1* v1v2v3v4 = new TF1("func", "[0]*(1+2*[1]*cos(2*x)+2*[2]*cos(3*x)+2*[3]*cos(x)+2*[4]*cos(4*x))", -5, 5);
      v1v2v3v4->SetParameters((Double_t) v0, (Double_t) v2value*v2value / scaleBaseline, (Double_t) v3*v3 * scaleBaseline, (Double_t) v1 / scaleBaseline, (Double_t) v4 / scaleBaseline);
      v1v2v3v4->SetLineColor(4);
      v1v2v3v4->Draw("SAME");

      TF1* v2only = (TF1*) v1v2v3v4->Clone("v2only");
      v2only->SetParameters((Double_t) v0, (Double_t) v2value*v2value);
      v2only->SetLineColor(4);
      v2only->SetLineStyle(2);      
      v2only->Draw("SAME");
    }
  }else{//v2 calculated from the fit 
    Printf("vn calculated from fit!");
    if (v2v3->GetParameter(1) > 0)
      {
// 	if (0)
	{
	  v2value = TMath::Sqrt(v2v3->GetParameter(1) / (baseLine + diffMinParam0));
	  v2E = 0.5 * v2value * TMath::Sqrt(v2v3->GetParError(1) * v2v3->GetParError(1) / v2v3->GetParameter(1) / v2v3->GetParameter(1) + baseLineE * baseLineE / baseLine / baseLine);
	  Printf("-> v2 = %f +- %f (%f %f = %f)", v2value, v2E, baseLine, diffMinParam0, baseLine + diffMinParam0);
	}
// 	else
	{
	  v2value = TMath::Sqrt(v2v3->GetParameter(1) / (v2v3->GetParameter(0) + baseLine2NSGap));
	  v2E = 0.5 * v2value * TMath::Sqrt(v2v3->GetParError(1) * v2v3->GetParError(1) / v2v3->GetParameter(1) / v2v3->GetParameter(1) + v2v3->GetParError(0) * v2v3->GetParError(0) / v2v3->GetParameter(0) / v2v3->GetParameter(0) + baseLine2NSGapE * baseLine2NSGapE / baseLine2NSGap / baseLine2NSGap);
	  Printf("-> v2 = %f +- %f (%f %f = %f)", v2value, v2E, v2v3->GetParameter(0), baseLine2NSGap, v2v3->GetParameter(0) + baseLine2NSGap);
	}
    	if (symmetricpT)
    	  AddPoint(graph[4], xValue1vn, v2value, 0, v2E);
      }
    
    if (v2v3->GetParameter(2) > 0)
      {
	v3 = TMath::Sqrt(v2v3->GetParameter(2) / (baseLine + diffMinParam0));
	v3E = 0.5 * v3 * TMath::Sqrt(v2v3->GetParError(2) * v2v3->GetParError(2) / v2v3->GetParameter(2) / v2v3->GetParameter(2) + baseLineE * baseLineE / baseLine / baseLine);
	if (symmetricpT)
	  AddPoint(graph[5], xValue2vn, v3, 0, v3E);
      }
      
// 	Float_t v1 = TMath::Sqrt(TMath::Abs(v2v3->GetParameter(3)) / (baseLine + diffMinParam0));
// 	Float_t v1E = 0.5 * v1 * TMath::Sqrt(v2v3->GetParError(3) * v2v3->GetParError(3) / v2v3->GetParameter(3) / v2v3->GetParameter(3) + baseLineE * baseLineE / baseLine / baseLine);
// 	if (v2v3->GetParameter(3) < 0)
// 	  v1 = -v1;

	Float_t v1 = TMath::Abs(v2v3->GetParameter(3)) / (baseLine + diffMinParam0);
	Float_t v1E = v1 * TMath::Sqrt(v2v3->GetParError(3) * v2v3->GetParError(3) / v2v3->GetParameter(3) / v2v3->GetParameter(3) + baseLineE * baseLineE / baseLine / baseLine);

	if (symmetricpT)
	  AddPoint(graph[12], xValue2vn, v1, 0, v1E);
// 	Printf("v1: %f %f", v1, v1E);
  }
  
  if (v2value > 0 && v3 > 0 && symmetricpT)
    {
      Float_t v3v2Ratio = v3 / v2value;
      Float_t v3v2RatioE = v3v2Ratio * TMath::Sqrt( v2E * v2E / v2value / v2value + v3E * v3E / v3 / v3 );
      AddPoint(graph[7], xValue1vn, v3v2Ratio, 0, v3v2RatioE);
    }
  
  Printf("Baseline: %f +- %f; v2 = %f +- %f; v3 = %f +- %f", baseLine, baseLineE, v2value, v2E, v3, v3E);
  
  if (gStudySystematic == 30)
    {
      // alternative way for baseline
    
      parabola = new TF1("parabola", "[0] + [1]*(x - [2])**2",  0, TMath::Pi());
      parabola->SetLineColor(3);
      parabola->SetParameters(min, -0.1, TMath::Pi() / 2);
      //     parabola->SetParLimits(1, 0, 1);
      proj->Fit(parabola, fitOption, "", TMath::Pi() / 2 - 1, TMath::Pi() / 2 + 1);
      //     proj->Fit(parabola, fitOption, "", 0.1, 2);
    
      min = parabola->GetParameter(0);
      Printf("New baseline: %f", min);
    }

  fitOption += "R";
  
  if (0)
    {
      // single gauss fit
    
      TF1* gaus1 = new TF1("gaus1", "[0]+gaus(1)", -0.5 * TMath::Pi(), 0.5 * TMath::Pi());
      gaus1->SetParameters(min, 1, 0, 1);
      //   gaus1->FixParameter(0, min);
      gaus1->FixParameter(2, 0);
      gaus1->SetParLimits(1, 0.001, 10);
      gaus1->SetParLimits(3, 0.1, 2);
      gaus1->SetLineColor(3);
      proj->Fit(gaus1, fitOption);
    
      TF1* gaus2 = new TF1("gaus2", "[0]+gaus(1)", 0.5 * TMath::Pi(), 1.5 * TMath::Pi());
      gaus2->SetParameters(min, 1, TMath::Pi(), 1);
      gaus2->FixParameter(2, TMath::Pi());
      gaus2->SetParLimits(1, 0.001, 10);
      gaus2->SetParLimits(3, 0.1, 2);
      gaus2->SetLineColor(3);
      proj->Fit(gaus2, fitOption);
  
      AddPoint(graph[2], xValue1, gaus1->GetParameter(3), 0, gaus1->GetParError(3));
      AddPoint(graph[3], xValue2, gaus2->GetParameter(3), 0, gaus2->GetParError(3));
    }
  else if (0)
    {
      // combined gauss fit
    
      TF1* gausBoth = new TF1("gaus2", "[0]+[1]*(exp(-0.5*(x/[2])**2)+exp(-0.5*((x-TMath::TwoPi())/[2])**2))+[3]*(exp(-0.5*((x-TMath::Pi())/[4])**2)+exp(-0.5*((x+TMath::Pi())/[4])**2))", -0.5 * TMath::Pi(), 1.5 * TMath::Pi());
      gausBoth->SetParameters(min, 1, 1, 1, 1);
      //   gausBoth->FixParameter(0, min);
      gausBoth->SetParLimits(1, 0.0001, 10);
      gausBoth->SetParLimits(3, 0.0001, 10);
      gausBoth->SetParLimits(2, 0.1, 4);
      gausBoth->SetParLimits(4, 0.1, 4);
      gausBoth->SetLineColor(6);
    
      proj->Fit(gausBoth, fitOption);
  
      AddPoint(graph[2], xValue1, gausBoth->GetParameter(2), 0, gausBoth->GetParError(3));
      AddPoint(graph[3], xValue2, gausBoth->GetParameter(4), 0, gausBoth->GetParError(4));
    }
  else
    {
      // RMS without baseline
      projRMS = (TH1*) proj->Clone();
      projRMS->Add(new TF1("f", "1", -10, 10), -min);
      projRMS->GetXaxis()->SetRangeUser(-TMath::Pi()/2 + 0.01, TMath::Pi()/2 - 0.01);
      AddPoint(graph[2], xValue1, projRMS->GetRMS(), 0, projRMS->GetRMSError());
      projRMS->GetXaxis()->SetRangeUser(TMath::Pi()/2 + 0.01, 3 * TMath::Pi()/2 - 0.01);
      AddPoint(graph[3], xValue2, projRMS->GetRMS(), 0, projRMS->GetRMSError());
      //     new TCanvas; projRMS->Draw(); return;
    }
  
  //   new TCanvas; gausBoth->Draw(); return;

  if (!silent)
    {
      TF1* v2v3_v1 = new TF1("func", "[0]+2*[1]*cos(x)", -5, 5);
      v2v3_v1->SetParameters(v2v3->GetParameter(0), v2v3->GetParameter(3));
      v2v3_v1->SetLineStyle(3);
      v2v3_v1->SetLineColor(4);
//       v2v3_v1->SetLineWidth(1);
      v2v3_v1->Draw("SAME");
      TF1* v2v3_v2 = new TF1("func", "[0]+2*[1]*cos(2*x)", -5, 5);
      v2v3_v2->SetParameters(v2v3->GetParameter(0), v2v3->GetParameter(1));
      v2v3_v2->SetLineStyle(2);
      v2v3_v2->SetLineColor(2);
//       v2v3_v2->SetLineWidth(1);
      v2v3_v2->Draw("SAME");
      TF1* v2v3_v3 = new TF1("func", "[0]+2*[1]*cos(3*x)", -5, 5);
      v2v3_v3->SetParameters(v2v3->GetParameter(0), v2v3->GetParameter(2));
      v2v3_v3->SetLineStyle(4);
      v2v3_v3->SetLineColor(6);
//       v2v3_v3->SetLineWidth(1);
      v2v3_v3->Draw("SAME");
    
      line = new TLine(-0.5 * TMath::Pi(), min, 1.5 * TMath::Pi(), min);
      line->SetLineWidth(2);
      line->SetLineColor(4);
      line->Draw();

      legend = new TLegend(0.47, 0.65, 0.88, 0.95);
      legend->SetFillColor(0);
      legend->SetBorderSize(0);

      legend->AddEntry(proj, "Data", "P");
      legend->AddEntry(v2v3, "a_{0} + a_{2} cos(2#Delta#varphi) + a_{3} cos(3#Delta#varphi)", "L");
      legend->AddEntry(v2, "a_{0} + a_{2} cos(2#Delta#varphi)", "L");
      legend->AddEntry(line, "Baseline for yield extraction", "L");

      legend->SetTextSize(fontSize);
      legend->Draw();
    
      //     paveText3 = (TPaveText*) paveText2->Clone();
      //     paveText3->SetX1NDC(0.16);
      //     paveText3->SetY1NDC(0.77);
      //     paveText3->SetX2NDC(0.42);
      //     paveText3->SetY2NDC(0.94);
      //     paveText3->Draw();
      paveText4 = (TPaveText*) paveText2->Clone();
      paveText4->SetTextSize(fontSize);
      paveText4->SetX1NDC(0.16);
      paveText4->SetY1NDC(0.68);
      paveText4->SetX2NDC(0.42);
      paveText4->SetY2NDC(0.96);

      TString tmpStr(objArray->At(0)->GetName());
      tmpStr.ReplaceAll("p_", "#it{p}_");
      tmpStr.ReplaceAll("00", "");
      paveText4->AddText(tmpStr + "GeV/#it{c}");

      TString tmpStr(objArray->At(1)->GetName());
      tmpStr.ReplaceAll("p_", "#it{p}_");
      tmpStr.ReplaceAll("00", "");
      paveText4->AddText(tmpStr + "GeV/#it{c}");
    
      paveText4->Draw();
    
      //     DrawLatex(0.27, 0.19, 1, Form("%sGeV/#it{c}       %sGeV/#it{c}", objArray->At(0)->GetName(), objArray->At(1)->GetName()), fontSize);
    
      gPad->GetCanvas()->SaveAs(Form("ridge_fit_%d_%d.png", i, j));
      gPad->GetCanvas()->SaveAs(Form("ridge_fit_%d_%d.eps", i, j));
      gPad->GetCanvas()->SaveAs("fig3b.eps");
    
      c3->cd();
      paveText3 = (TPaveText*) paveText4->Clone();
      paveText3->Draw();
      gPad->GetCanvas()->SaveAs(Form("ridge_eta_%d_%d.png", i, j));
      gPad->GetCanvas()->SaveAs(Form("ridge_eta_%d_%d.eps", i, j));
      gPad->GetCanvas()->SaveAs("fig3c.eps");
    }
  
  if (gStudySystematic != 50 && gStudySystematic != 51)
    {
      Int_t phi1 = 1;
      Int_t phi2 = proj->FindBin(TMath::Pi()/2-0.001);
      Int_t phi3 = phi2 + 1;
      Int_t phi4 = proj->GetNbinsX();
    }
  else
    {
      Printf(">>>> Using |dphi| < 1.2 <<<<");
      Int_t phi1 = proj->FindBin(-1.2);;
      Int_t phi2 = proj->FindBin(1.2);
      Int_t phi3 = proj->FindBin(TMath::Pi() - 1.2);
      Int_t phi4 = proj->FindBin(TMath::Pi() + 1.2);
      Printf("%d %d %d %d", phi1, phi2, phi3, phi4);
    }
  
  Double_t nsYield, asYield, nsYieldE, asYieldE;
  
  nsYield = proj->IntegralAndError(phi1, phi2, nsYieldE, "width");
  nsYield -= min * proj->GetBinWidth(1) * (phi2 - phi1 + 1);
  
  asYield = proj->IntegralAndError(phi3, phi4, asYieldE, "width");
  asYield -= min * proj->GetBinWidth(1) * (phi4 - phi3 + 1);
  
  AddPoint(graph[0], xValue1, nsYield, 0, nsYieldE);
  AddPoint(graph[1], xValue2, asYield, 0, asYieldE);
  
  if (nsYieldE > 0 && asYieldE > 0)
    AddPoint(graph[6], xValue1, nsYield / asYield, 0, nsYield / asYield * TMath::Sqrt(nsYieldE * nsYieldE / nsYield / nsYield + asYieldE * asYieldE / asYield / asYield));
  
  AddPoint(graph[9], xValue1, 100.0 * ySubPeak / (etaMax * 2) / nsYield, 0, 0);
  
  Printf("Yields: %f +- %f ; %f +- %f", nsYield, nsYieldE, asYield, asYieldE);
  Printf("Yield ratio: %f   baseline for yield %f",nsYield / asYield,min);

}

Int_t colors[] = { 1, 2, 3, 4, kGray+1, 6, 7, 8 };

void DrawSeveral(Int_t n, const char** graphFiles, Int_t id)
{
  ReadGraphs(graphFiles[0]);
  TGraphErrors*** base = graphs;

  Float_t yMax[] = { 0.1, 0.1, 2, 2, 0.25, 0.25, 4, 1.5, 50, 50, 4, 4, 0.5 };
  Int_t markers[] = { 20, 21, 22, 23, 24, 25, 26 };

  TString baseName(graphFiles[0]);
  baseName.ReplaceAll(".", "_");
  TCanvas* canvas = new TCanvas(Form("%s_%d", baseName.Data(), id), Form("%s_%d", baseName.Data(), id), 800, 600);
  //   Printf("%p", canvas);
  gPad->SetGridx();
  gPad->SetGridy();
  dummy = new TH2F(Form("hist_%s_%d", graphFiles[0], id), Form(";%s;%s", graphs[0][id]->GetXaxis()->GetTitle(), graphs[0][id]->GetYaxis()->GetTitle()), 100, 0, 60, 100, (yMax[id] > 0) ? 0 : yMax[id], (yMax[id] > 0) ? yMax[id] : 0);
  dummy->SetStats(0);
  dummy->DrawCopy();
  
  TCanvas* canvas2 = new TCanvas(Form("%s_%d_ratio", baseName.Data(), id), Form("%s_%d", baseName.Data(), id), 800, 600);
  gPad->SetGridx();
  gPad->SetGridy();
  dummy = new TH2F(Form("hist_%s_%d_ratio", graphFiles[0], id), Form(";%s;%s ratio", graphs[0][id]->GetXaxis()->GetTitle(), graphs[0][id]->GetYaxis()->GetTitle()), 100, 0, 60, 100, 0, 2);
  dummy->SetStats(0);
  dummy->DrawCopy();

  legend = new TLegend(0.4, 0.6, 0.99, 0.99);
  legend->SetFillColor(0);
  
  for (Int_t fc = 0; fc<n; fc++)
    {
      ReadGraphs(graphFiles[fc]);
    
      for (Int_t i=0; i<NGraphs; i++)
	{
	  if (TString(graphFiles[0]).Contains("cms") && i != 2 && i != 5) continue;
    
	  canvas->cd();
	  //       Printf("%p", canvas);
	  graphs[i][id]->SetMarkerStyle(markers[i%8]);
	  graphs[i][id]->SetMarkerColor(colors[fc]);
	  graphs[i][id]->SetLineColor(colors[fc]);
	  GraphShiftX((TGraphErrors*) graphs[i][id]->DrawClone("PSAME"), 0.5 / n * fc);

	  if (fc == 0 && graphs[i][id]->GetN() > 0)
	    legend->AddEntry(graphs[i][id], graphs[i][id]->GetTitle(), "P");
      
	  if (fc > 0)
	    {
	      canvas2->cd();
	      DivideGraphs(graphs[i][id], base[i][id]);
	      GraphShiftX((TGraphErrors*) graphs[i][id]->DrawClone("PSAME"), 0.5 / n * fc);
	    }
	}
    }

  canvas->cd();
  legend->Draw();
  canvas->SaveAs(Form("%s.eps", canvas->GetName()));

  canvas2->cd();
  legend->Draw();
  canvas2->SaveAs(Form("%s.eps", canvas2->GetName()));
}

void CMSRidge()
{
  CreateGraphStructure();
  
  // scaling done for zyam level difference (note that the values in fig2 have to be multiplied by 2 due to the |dphi| instead of dphi
  
  // Fig3a
  // 0.334516912727  0.0104728088208
  // 0.721360493366  0.0263651653896
  // 1.1900579331  0.0301999626238
  // 1.68965302436  0.024186548724
  // 2.19286114745  0.0123441101352
  // 2.69021366723  0.00994871155963
  // 3.38790257273  0.00434394401877

  //   AddPoint(graphs[0][0], 55.3, 0.0263651653896, 0, 0);
  AddPoint(graphs[2][0], 55.383968, 0.0301999626238 * 0.72 * 2 / 1.336, 0, 0);
  AddPoint(graphs[5][0], 55.383968, 0.0123441101352 * 0.154 * 2 / 0.229, 0, 0);
  
  // Fig3b
  // 128.344370861  0.0254622516556
  // 98.1456953642  0.0154940397351
  // 56.6225165563  0.00493774834437
  // 17.6158940397  0.00037880794702
  // Ref multiplicity for centrality 0.000000 to 3.000000: 55.284322
  // Ref multiplicity for centrality 3.000000 to 10.000000: 41.124550
  // Ref multiplicity for centrality 10.000000 to 50.000000: 24.334303
  // Ref multiplicity for centrality 50.000000 to 100.000000: 8.008294

  //   AddPoint(graphs[2][0], 55.3, 0.0254622516556, 0, 0);
  AddPoint(graphs[2][0], 40.649288, 0.0154940397351 * 0.5 * 2 / 0.985, 0, 0);
  AddPoint(graphs[2][0], 23.783224, 0.00493774834437 * 0.29 * 2 / 0.506, 0, 0);

  WriteGraphs("graphs_cms.root");
}

void ALICECMSMethod()
{
  CreateGraphStructure();
  
  AddPoint(graphs[2][0], 10, 0.027, 0, 0);
  AddPoint(graphs[4][0], 10, 0.115 / 1.34 * 1, 0, 0);
  AddPoint(graphs[5][0], 10, 0.019 / 0.152 * 0.126, 0, 0);
  
  AddPoint(graphs[2][4], 10, 0.09, 0, 0);
  //   AddPoint(graphs[4][4], 10, 0.115, 0, 0);
  AddPoint(graphs[5][4], 10, 0.137, 0, 0);

  AddPoint(graphs[2][5], 10, 0.04, 0, 0);
  //   AddPoint(graphs[4][5], 10, 0.046, 0, 0);
  AddPoint(graphs[5][5], 10, 0.06, 0, 0);

  WriteGraphs("graphs_alice_cmsmethod.root");
}

void GetSystematic(const char* baseFile = "dphi_corr_pA_121119_3.root",TString fileTag = "graphs_121119",TString fileTagHadrons = "graphs_121119")
{
  TString baseFile2="0";
  fileProj = TFile::Open("dphi_proj.root", "RECREATE");
  fileProj->Close();
  
  gROOT->SetBatch(kTRUE);
  
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + ".root",fileTagHadrons + ".root");
  
  gStudySystematic = 10;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_exclusion05.root",fileTagHadrons + "_exclusion05.root");
  
  gStudySystematic = 11;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_exclusion00.root",fileTagHadrons + "_exclusion00.root");

  gStudySystematic = 12;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_exclusionAS.root",fileTagHadrons + "_exclusionAS.root");

  gStudySystematic = 13;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_exclusionScale.root",fileTagHadrons + "_exclusionScale.root");

  gStudySystematic = 14;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_exclusion12.root",fileTagHadrons + "_exclusion12.root");
    
  gStudySystematic = 20;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_nonclosure.root",fileTagHadrons + "_nonclosure.root");
  
  gStudySystematic = 30;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_baseline.root",fileTagHadrons + "_baseline.root");
  
  gStudySystematic = 40;
  baseFile2=Form("~/Dropbox/pid-ridge/pPb/dphi_corr_LHC13bc_AOD126_20130417_%s_SystTrkCuts.root",gParticleSpecieName[gParticleSpecie]);
  CorrelationSubtractionHistogram(baseFile2.Data(), kTRUE, fileTag + "_trackcuts.root",fileTagHadrons + "_trackcuts.root");
  
  gStudySystematic = 41;
  baseFile2=Form("~/Dropbox/pid-ridge/pPb/dphi_corr_LHC13bc_AOD126_20130417_%s_PairCuts.root",gParticleSpecieName[gParticleSpecie]);
  CorrelationSubtractionHistogram(baseFile2.Data(), kTRUE, fileTag + "_paircuts.root",fileTagHadrons + "_paircuts.root");

  gStudySystematic = 60;
  CorrelationSubtractionHistogram(baseFile, kTRUE, fileTag + "_otherperipheral.root",fileTagHadrons + "_otherperipheral.root");
  
  if(gParticleSpecie!=0)
    {//PID
      gStudySystematic = 70;
      baseFile2=Form("~/Dropbox/pid-ridge/pPb/dphi_corr_LHC13bc_AOD126_20130417_%s_Syst2Sig.root",gParticleSpecieName[gParticleSpecie]);
      CorrelationSubtractionHistogram(baseFile2.Data(), kTRUE, fileTag + "_syst2sig.root",fileTagHadrons + "_syst2sig.root");
      
      gStudySystematic = 71;
      baseFile2=Form("~/Dropbox/pid-ridge/pPb/dphi_corr_LHC13bc_AOD126_20130417_%s_Syst1Sig.root",gParticleSpecieName[gParticleSpecie]);
      CorrelationSubtractionHistogram(baseFile2.Data(), kTRUE, fileTag + "_syst1sig.root",fileTagHadrons + "_syst1sig.root");
      
      gStudySystematic = 72;
      baseFile2=Form("~/Dropbox/pid-ridge/pPb/dphi_corr_LHC13bc_AOD126_20130417_%s_SystExclusive.root",gParticleSpecieName[gParticleSpecie]);
      CorrelationSubtractionHistogram(baseFile2.Data(), kTRUE, fileTag + "_systexclusive.root",fileTagHadrons + "_systexclusive.root");
      
    }
}
  
void DrawSystematics(TString fileTag = "graphs_121119")
{
  if (0)
    {
      const Int_t n = 6;
      const char* filesBase[] = { "", "_exclusion05", "_exclusion12", "_exclusion00", "_exclusionAS", "_exclusionScale" };
    }
  else if(1)
    {
      const Int_t n = 6;
      const char* filesBase[] = { "", "_paircuts" ,"_trackcuts", "_nonclosure", "_baseline", "_otherperipheral" };
    }
  else
    {
      const Int_t n = 4;
      const char* filesBase[] = { "", "_syst2sig" ,"_syst1sig", "_systexclusive"};
    }
  
  const char* files[n];
  for (Int_t i=0; i<n; i++)
    {
      str = new TString;
      str->Form("%s%s.root", fileTag.Data(), filesBase[i]);
      files[i] = str->Data();
    }
  
  const Int_t plots = 3;
  Int_t ids[7] = { 0, 1, 4 };
  
  for (Int_t i=0; i<plots; i++)
    {
      DrawSeveral(n, files, ids[i]);
      //     break;
    }
  
  new TCanvas;
  for (Int_t i=0; i<n; i++)
    DrawLatex(0.2, 0.9 - 0.1 * i, colors[i], files[i]);
}

void DrawSeveral(const char* graphFile1, const char* graphFile2, const char* graphFile3, Int_t id)
{
  const char* files[3] = { graphFile1, graphFile2, graphFile3 };
  Int_t n = 1;
  if (graphFile2)
    n++;
  if (graphFile3)
    n++;
  
  DrawSeveral(n, files, id);
}
  
void DrawYield(const char* graphFile)
{
  DrawGraph(graphFile, 0, 1, "Ridge yield per #Delta#eta", "fig4b.eps", kTRUE);
}

void DrawRMS(const char* graphFile)
{
  DrawGraph(graphFile, 2, 3, "#sigma", 0);
}

void Drawv2v3(const char* graphFile)
{
  DrawGraph(graphFile, 4, 5, "#it{v}_{2} , #it{v}_{3}", "fig4a.eps");
}

void AddSystUnc(TGraphErrors* graph, Float_t syst020, Float_t syst2060)
{
  for (Int_t j=0; j<graph->GetN(); j++)
    {
      Float_t syst = syst2060;
      if (graph->GetX()[j] < 20)
	syst = syst020;
  
      //     Printf("%d %f", j, syst);
      graph->GetEY()[j] = TMath::Sqrt(graph->GetEY()[j] * graph->GetEY()[j] + syst * syst * graph->GetY()[j] * graph->GetY()[j]);
    }
}

void SetSystUnc(TGraphErrors* graph, Float_t syst020, Float_t syst2060)
{
  for (Int_t j=0; j<graph->GetN(); j++)
    {
      Float_t syst = syst2060;
      if (graph->GetX()[j] < 20)
	syst = syst020;
  
      //     Printf("%d %f", j, syst);
      graph->GetEY()[j] = syst * graph->GetY()[j];
    }
}

void SetXError(TGraphErrors* graph, Float_t value)
{
  for (Int_t j=0; j<graph->GetN(); j++)
    graph->GetEX()[j] = value;
}

void DrawGraph(const char* graphFile, Int_t id1, Int_t id2, const char* yLabel = 0, const char* outputFileName, Bool_t corrGraph = kFALSE)
{
  ReadGraphs(graphFile);
  TGraphErrors*** graphsSyst = graphs;
  ReadGraphs(graphFile);
  TGraphErrors*** graphsCombinedError = graphs;
  ReadGraphs(graphFile);
  
  if (yLabel == 0)
    yLabel = graphs[0][id1]->GetYaxis()->GetTitle();
  
  Float_t yMax[] = { 0.12, 0.12, 2, 2, 0.2, 0.25, 4, 1.5, 50, 50, 4 };
  Int_t markers[] = { 20, 21, 22, 23, 29, 33 };
  Int_t markers2[] = { 24, 25, 26, 32, 30, 27 };
  Float_t markerSize[] = { 1.7, 1.7, 1.7, 1.7, 2.0, 2.0 };

  if (1)
    {
      // default systs (for all pT, centr)
      Float_t syst020Array[] = { 0.16, 0.18, 0.15, 0.15, 0.14, 0.23 };
      Float_t syst2060Array[] = { 0.23, 0.25, 0.23, 0.23, 0.18, 0.42 };
    
      // 0.5<1 0.5<1
      Float_t syst020ArrayGr0[] = { 0.23, 0.25, 0.15, 0.15, 0.14, 0.23 };
      Float_t syst2060ArrayGr0[] = { 0.42, 0.43, 0.23, 0.23, 0.18, 0.42 };

      for (Int_t i=0; i<NGraphs; i++)
	{
	  Float_t syst020 = syst020Array[id1];
	  Float_t syst2060 = syst2060Array[id1];
      
	  if (i == 0)
	    {
	      syst020 = syst020ArrayGr0[id1];
	      syst2060 = syst2060ArrayGr0[id1];
	    }
      
	  //       Printf("%d %d %f %f", i, id1, syst020, syst2060);
	  SetSystUnc(graphsSyst[i][id1], syst020, syst2060);
	  AddSystUnc(graphsCombinedError[i][id1], syst020, syst2060);
	  SetXError(graphsSyst[i][id1], 0.3);

	  Float_t syst020 = syst020Array[id2];
	  Float_t syst2060 = syst2060Array[id2];
      
	  if (i == 0)
	    {
	      syst020 = syst020ArrayGr0[id2];
	      syst2060 = syst2060ArrayGr0[id2];
	    }

	  SetSystUnc(graphsSyst[i][id2], syst020, syst2060);
	  AddSystUnc(graphsCombinedError[i][id2], syst020, syst2060);
	  SetXError(graphsSyst[i][id2], 0.3);
	}
    
      //     graphs[0][id1]->Print();
    }
  
  const char* eventClass[] = { "0-20%", "20-40%", "40-60%" };
  Printf("\n%s:", graphTitles[id1]);
  for (Int_t i=0; i<3; i++)
    {
      Printf("Event class: %s minus 60-100%%", eventClass[i]);
    
      for (Int_t j=0; j<NGraphs; j++)
	if (graphs[j][id1]->GetN() > i)
	  Printf("%s: %.4f +- %.4f (stat) +- %.4f (syst)", graphs[j][id1]->GetTitle(), graphs[j][id1]->GetY()[i], graphs[j][id1]->GetEY()[i], graphsSyst[j][id1]->GetEY()[i]);
    }
    
  Printf("\n%s:", graphTitles[id2]);
  for (Int_t i=0; i<3; i++)
    {
      Printf("Event class: %s minus 60-100%%", eventClass[i]);
    
      for (Int_t j=0; j<NGraphs; j++)
	if (graphs[j][id2]->GetN() > i)
	  Printf("%s: %.4f +- %.4f (stat) +- %.4f (syst)", graphs[j][id2]->GetTitle(), graphs[j][id2]->GetY()[i], graphs[j][id2]->GetEY()[i], graphsSyst[j][id2]->GetEY()[i]);
    }

  TCanvas* canvas = new TCanvas;
  gPad->SetTopMargin(0.03);
  gPad->SetRightMargin(0.01);
  gPad->SetLeftMargin(0.14);
  gPad->SetBottomMargin(0.13);
  //   gPad->SetGridx();
  //   gPad->SetGridy();
  TH2F* dummy = new TH2F("dummy", Form(";%s;%s", graphs[0][id1]->GetXaxis()->GetTitle(), yLabel), 3, 0, 60, 100, 0, yMax[id1]);
  dummy->GetYaxis()->SetTitleOffset(1.1);
  dummy->SetStats(0);
  dummy->GetYaxis()->SetNdivisions(505);
  dummy->GetXaxis()->SetLabelSize(0.06);
  dummy->GetYaxis()->SetLabelSize(0.06);
  dummy->GetXaxis()->SetTitleSize(0.06);
  dummy->GetYaxis()->SetTitleSize(0.06);
  dummy->Draw();
  
  if (strcmp(graphs[0][id1]->GetXaxis()->GetTitle(), "Event class") == 0)
    {
      dummy->GetXaxis()->SetBinLabel(1, "0-20%");
      dummy->GetXaxis()->SetBinLabel(2, "20-40%");
      dummy->GetXaxis()->SetBinLabel(3, "40-60%");
      dummy->GetXaxis()->SetLabelSize(0.09);
      dummy->GetXaxis()->SetTitleOffset(1);
    }
  
  legend = new TLegend((id1 == 4) ? 0.47 : 0.33, (id1 == 4) ? 0.70 : 0.55, 0.95, 0.92);
  legend->SetNColumns(2);
  if (id1 == 0 || id1 == 2)
    legend->SetHeader("Near side   Away side");
  else if (id1 == 4)
    legend->SetHeader("  #it{v}_{2}       #it{v}_{3}");
    
  legend->SetFillColor(0);
  legend->SetBorderSize(0);

  if (1)
    {
      Int_t fillStyle[11] = { 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010, 3011 };
    
      for (Int_t i=0; i<NGraphs; i++)
	{
	  graphsSyst[i][id1]->SetMarkerStyle(1);
	  graphsSyst[i][id1]->SetMarkerColor(1);
	  graphsSyst[i][id1]->SetLineColor(1);
	  graphsSyst[i][id1]->SetFillColor(1);
	  graphsSyst[i][id1]->SetFillStyle(3001);
	  graphsSyst[i][id1]->Draw("2SAME");

	  graphsSyst[i][id2]->SetMarkerStyle(1);
	  graphsSyst[i][id2]->SetMarkerColor(2);
	  graphsSyst[i][id2]->SetLineColor(2);
	  graphsSyst[i][id2]->SetFillColor(2);
	  graphsSyst[i][id2]->SetFillStyle(3001);
	  graphsSyst[i][id2]->Draw("2SAME");
	}
    }
  else
    Printf(">>>>>>>>>>>> SKIPPING SYST");

  
  for (Int_t i=0; i<NGraphs; i++)
    {
      graphs[i][id1]->SetMarkerStyle(markers[i]);
      graphs[i][id1]->SetMarkerSize(markerSize[i]);
      graphs[i][id1]->SetMarkerColor(1);
      graphs[i][id1]->SetLineColor(1);
      graphs[i][id1]->Draw("PSAME");

      graphs[i][id2]->SetMarkerStyle(markers2[i]);
      graphs[i][id2]->SetMarkerSize(markerSize[i]);
      graphs[i][id2]->SetMarkerColor(2);
      graphs[i][id2]->SetLineColor(2);
      graphs[i][id2]->Draw("PSAME");

      TString label(graphs[i][id1]->GetTitle());
      label.ReplaceAll(".00", ".0");
      label.ReplaceAll(".50", ".5");
    
    
      /*    label.ReplaceAll(".0", " GeV/#it{c}");
	    label.ReplaceAll(".5", ".5 GeV/#it{c}");*/
      TObjArray* objArray = label.Tokenize("-");
      label.Form("%s-%s", objArray->At(0)->GetName(), objArray->At(1)->GetName());
      label.ReplaceAll("-", ";");
    
      if (id1 == 4)
	{
	  // reduce label
	  label.ReplaceAll(" ", "");
	  label.ReplaceAll(";", "<");
	  tokens = label.Tokenize("<");
	  label.Form("%s < %s < %s < %s ", tokens->At(0)->GetName(), tokens->At(1)->GetName(), tokens->At(4)->GetName(), tokens->At(5)->GetName());
	}
    
      label.ReplaceAll("p_", "#it{p}_");
      label += "GeV/#it{c}";

      if (graphs[i][id1]->GetN() > 0)
	{
	  legend->AddEntry(graphs[i][id1], (id1 == 4) ? " " : "    ", "P");
	  legend->AddEntry(graphs[i][id2], label, "P");
	}
    }
  
  legend->Draw();
  DrawLatex(0.7, 0.92, 1, "p-Pb #sqrt{s_{NN}} = 5.02 TeV", 0.04);
  
  canvas->SaveAs(outputFileName);
  
  if (!corrGraph)
    return;
  
  corr = new TGraphErrors;
  for (Int_t i=0; i<NGraphs; i++)
    {
      for (Int_t j=0; j<graphs[i][id1]->GetN(); j++)
	AddPoint(corr, graphsCombinedError[i][id1]->GetY()[j], graphsCombinedError[i][id2]->GetY()[j], graphsCombinedError[i][id1]->GetEY()[j], graphsCombinedError[i][id2]->GetEY()[j]);
    }

  new TCanvas;
  gPad->SetTopMargin(0.03);
  gPad->SetRightMargin(0.02);
  gPad->SetLeftMargin(0.14);
  gPad->SetBottomMargin(0.13);
  TString titleString;
  titleString.Form(";%s;%s", graphs[0][id1]->GetYaxis()->GetTitle(), graphs[0][id2]->GetYaxis()->GetTitle());
  titleString.ReplaceAll("NS", "Near-side");
  titleString.ReplaceAll("AS", "Away-side");
  titleString.ReplaceAll("Ridge Yield", "ridge yield per #Delta#eta");
  dummy = new TH2F("dummy2", titleString, 100, 0, 0.095, 100, 1e-5, 0.095);
  dummy->GetYaxis()->SetTitleOffset(1.1);
  dummy->SetStats(0);
  dummy->GetXaxis()->SetNdivisions(505);
  dummy->GetYaxis()->SetNdivisions(505);
  dummy->GetXaxis()->SetLabelSize(0.06);
  dummy->GetYaxis()->SetLabelSize(0.06);
  dummy->GetXaxis()->SetTitleSize(0.06);
  dummy->GetYaxis()->SetTitleSize(0.06);
  dummy->Draw();

  corr->Draw("PSAME");
  
  line = new TLine(0, 0, 0.095, 0.095);
  line->SetLineWidth(2);
  line->SetLineStyle(2);
  line->Draw();

  DrawLatex(0.18, 0.92, 1, "p-Pb #sqrt{s_{NN}} = 5.02 TeV", 0.04);
}

void PaperCorrFuncAll(const char* fileName)
{
  Int_t n = 6;
  Int_t is[] = { 0, 1, 1, 2, 2, 2, 3 };
  Int_t js[] = { 1, 1, 2, 1, 2, 3, 3 };
  Int_t centr[] = { 0, 1, 3, 4 };

  for (Int_t i=0; i<n; i++)
    for (Int_t j=0; j<4; j++)
      PaperCorrFunc(fileName, is[i], js[i], centr[j]);
}

void PaperCorrFunc(const char* fileName, Int_t i = 2, Int_t j = 2, Int_t centr = 0)
{
  TFile::Open(fileName);
  
  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centr));

  if (!hist1)
    return 0;
  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));

  hist1 = (TH2*) hist1->Clone();
  hist1->Rebin2D(2, 2); hist1->Scale(0.25);
  //   hist1->Rebin2D(2, 1); hist1->Scale(0.5);
  
  hist1->GetYaxis()->SetRangeUser(-1.99, 1.99);
  hist1->GetXaxis()->SetTitleOffset(1.5);
  hist1->GetYaxis()->SetTitleOffset(2);
  hist1->GetZaxis()->SetTitle(kCorrFuncTitle);
  hist1->SetStats(kFALSE);
  hist1->GetZaxis()->SetTitleOffset(2);
  hist1->GetZaxis()->SetNdivisions(504);
  hist1->SetStats(kFALSE);
  hist1->GetZaxis()->CenterTitle(kTRUE);
  hist1->GetYaxis()->CenterTitle(kTRUE);
  hist1->GetXaxis()->CenterTitle(kTRUE);
  hist1->GetYaxis()->SetNdivisions(505);
  hist1->GetXaxis()->SetTitle("#Delta#varphi (rad)");

  c = new TCanvas("c", "c", 600, 600);
  gPad->SetPad(0, 0, 1, 1);
  gPad->SetLeftMargin(0.2);

  TString label(hist1->GetTitle());
  hist1->SetTitle("");
  label.ReplaceAll(".00", "");
  label.ReplaceAll(".0", "");
  //   label.ReplaceAll(".00", " GeV/#it{c}");
  //   label.ReplaceAll(".0", " GeV/#it{c}");
  TObjArray* objArray = label.Tokenize("-");
  TPaveText* paveText = new TPaveText(0.03, 0.86, 0.44, 0.97, "BRNDC");
  paveText->SetTextSize(0.035);
  paveText->SetFillColor(0);
  paveText->SetShadowColor(0);
  paveText->SetBorderSize(0);
  paveText->SetFillStyle(0);
  
  TString tmpStr(objArray->At(0)->GetName());
  tmpStr.ReplaceAll("p_", "#it{p}_");
  paveText->AddText(tmpStr + "GeV/#it{c}");

  TString tmpStr(objArray->At(1)->GetName());
  tmpStr.ReplaceAll("p_", "#it{p}_");
  paveText->AddText(tmpStr + "GeV/#it{c}");
  //   paveText->AddText(objArray->At(1)->GetName());

  TPaveText* paveText2 = new TPaveText(0.63, 0.86, 0.97, 0.97, "BRNDC");
  paveText2->SetTextSize(0.035);
  paveText2->SetBorderSize(0);
  paveText2->SetFillColor(0);
  paveText2->SetFillStyle(0);
  paveText2->SetShadowColor(0);
  if (objArray->GetEntries() == 4)
    {
      paveText2->AddText(Form("p-Pb #sqrt{s_{NN}} = 5.02 TeV"));
      paveText2->AddText(Form("%s-%s", objArray->At(2)->GetName(), objArray->At(3)->GetName()));
    }
  else
    paveText2->AddText(Form("%s #sqrt{s} = 2.76 TeV", objArray->At(2)->GetName()));

  hist1->Draw("SURF1");
  paveText->Draw();
  paveText2->Draw();
  
  if (i == 2 && j == 2 && centr == 0)
    c->SaveAs("fig1b.eps");
  else if (i == 2 && j == 2 && centr == 4)
    c->SaveAs("fig1a.eps");
  
  c->SaveAs(Form("corr_%d_%d_%d.eps", i, j, centr));
}

void ExtractSystematics(const char* fileName = "dphi_proj.root")
{
  Int_t i = 2; Int_t j = 2;
  //   Int_t i = 0; Int_t j = 1;
  Int_t centr = 0;
  
  Int_t nSyst = 8;
  Int_t syst[] = { 0, 10, 11, 12, 13, 20, 30, 40 };
  
  TFile::Open(fileName);
  base = (TH1*) gFile->Get(Form("proj_%d_%d_%d_%d", i, j, centr, syst[0]));
  
  c = new TCanvas;
  //   base->Rebin(2); base->Scale(0.5);
  base->Draw();
  
  Float_t baseValue = base->Integral() / base->GetNbinsX();
  //   (base->GetBinContent(1) + base->GetBinContent(base->GetNbinsX()/2+1)) / 2;
  
  c2 = new TCanvas;
  c3 = new TCanvas;
  
  Int_t color = 2;

  for (Int_t n = 1; n<nSyst; n++)
    {
      hist = (TH1*) gFile->Get(Form("proj_%d_%d_%d_%d", i, j, centr, syst[n]));
      if (!hist)
	continue;
    
      //     hist->Rebin(2); hist->Scale(0.5);
      c->cd();
      hist->SetLineColor(color++);
      Float_t baseValue2 = hist->Integral() / hist->GetNbinsX();
      Printf("%f %f", baseValue, baseValue2);
      //     hist->Add(new TF1("func", "1", -5, 5), baseValue - baseValue2);
      hist->Scale(baseValue / baseValue2);
      hist->DrawCopy("SAME");
    
      c2->cd();
      hist->DrawCopy((n == 1) ? "HIST" : "HIST SAME")->Divide(base);

      c3->cd();
      hist->Add(base, -1);
      hist->DrawCopy((n == 1) ? "HIST" : "HIST SAME")->GetYaxis()->SetRangeUser(-0.1, 0.1);
    }
}

void GetProjectionSystematics(Float_t eta)
{
  fileProj = TFile::Open("dphi_proj2.root", "RECREATE");
  fileProj->Close();

  Int_t i = 2; Int_t j = 2;
  //   Int_t i = 0; Int_t j = 1;

  Int_t n = 5;
  const char* files[] = { "dphi_corr_pA_121119_3.root", "dphi_corr_pA_121116_global.root", "dphi_corr_pA_121119_3.root", "dphi_corr_pA_121116_hybrid.root" /*pair cuts*/, "dphi_corr_pA_121119_hijing.root" };
  
  for (Int_t centr=0; centr<6; centr++)
    {
      for (Int_t k=0; k<n; k++)
	{
	  gStudySystematic = 0;
	  if (k == 2)
	    gStudySystematic = 20;
      
	  TFile::Open(files[k]);
	  const char* label = 0;
	  TH1* hist = GetProjections(i, j, centr, &label, eta);
	  if (!hist)
	    continue;
      
	  fileProj = TFile::Open("dphi_proj2.root", "UPDATE");
	  hist->Write(Form("proj_%d_%d_%d_%d", i, j, centr, k*10));
	  fileProj->Close();
	}
    }
}

void CMSPlot()
{
  Int_t centrArr[] = { 0, 1, 3, 4 };
  Int_t nCentr = 4;
  
  //   Int_t i = 1; Int_t j = 2;
  Int_t i = 2; Int_t j = 2;

  if (1)
    {
      const char* labels[] = { "Data", "HIJING", "DPMJET" };
      //   const char* files[] = { "dphi_corr_pA_121119_3.root", "dphi_corr_121121_hijing_uncorrected.root", "dphi_corr_121121_dpmjet_uncorrected.root" };
      //     const char* files[] = { "dphi_corr_pA_121119_3.root", "dphi_corr_121121_hijing_step0.root", "dphi_corr_121121_dpmjet_step0.root" };
      const char* files[] = { "dphi_corr_pA_121121_cmsmethod.root", "dphi_corr_121122_cmsmethod_hijing_step0.root", "dphi_corr_121122_cmsmethod_dpmjet_step0.root" };
      //     const char* files[] = { "dphi_corr_pA_121122_cnd_cmsmethod.root", "dphi_corr_121122_cmsmethod_hijing_cnd_step0.root", 0 };
      Int_t nFiles = 3;
    }
  else
    {
      const char* labels[] = { "ALICE method", "CMS method" };
      //     const char* files[] = { "dphi_corr_pA_121119_3.root", "dphi_corr_pA_121121_cmsmethod.root" };
      const char* files[] = { "dphi_corr_121121_hijing_step0.root", "dphi_corr_121122_cmsmethod_hijing_step0.root" };
      Int_t nFiles = 2;
    }
  
  Int_t colors[] = { 1, 2, 4 };
  
  c = new TCanvas("c", "c", 800, 800);
  c->Divide(2, 2);
  
  Float_t maxValue = -1;
  for (Int_t centr = 0; centr < nCentr; centr++)
    {
      c->cd(centr+1);
    
      legend = new TLegend(0.15, 0.55, 0.46, 0.85);
      legend->SetFillColor(0);
    
      for (Int_t fileId = 0; fileId < nFiles; fileId++)
	{
	  if (files[fileId] == 0)
	    continue;
      
	  TFile::Open(files[fileId]);
  
	  TH2* hist1 = (TH2*) gFile->Get(Form("dphi_%d_%d_%d", i, j, centrArr[centr]));
	  if (!hist1)
	    return 0;
	  hist1 = (TH2*) hist1->Clone(Form("%s_%.1f", hist1->GetName(), 0.0));

	  // NOTE fix normalization. these 2d correlations come out of AliUEHist normalized by dphi bin width, but not deta
	  hist1->Scale(1.0 / hist1->GetYaxis()->GetBinWidth(1));
      
	  tokens = TString(hist1->GetTitle()).Tokenize("-");
	  centralityStr = new TString;
	  if (tokens->GetEntries() > 2)
	    *centralityStr = tokens->At(2)->GetName();
	  if (tokens->GetEntries() > 3)
	    *centralityStr = *centralityStr + "-" + tokens->At(3)->GetName();
      
	  Float_t etaMin = 1.0;
      
	  proj1x = hist1->ProjectionX(Form("proj1x_%d_%d_%d_%d", i, j, centr, fileId), hist1->GetYaxis()->FindBin(-etaMax+0.01), hist1->GetYaxis()->FindBin(-etaMin-0.01));
	  proj2x = hist1->ProjectionX(Form("proj2x_%d_%d_%d_%d", i, j, centr, fileId), hist1->GetYaxis()->FindBin(etaMin+0.01), hist1->GetYaxis()->FindBin(etaMax-0.01));
	  proj1x->Add(proj2x);
      
	  proj1x->Scale(hist1->GetYaxis()->GetBinWidth(1));
	  proj1x->Scale(1.0 / (etaMax - etaMin) / 2);

	  proj1x->Rebin(2); proj1x->Scale(0.5);
	  proj1x->Rebin(2); proj1x->Scale(0.5);
      
	  // zyam
	  Float_t zyam = proj1x->Integral(proj1x->FindBin(TMath::Pi()/2 - 0.5), proj1x->FindBin(TMath::Pi()/2 + 0.5)) / (proj1x->FindBin(TMath::Pi()/2 + 0.5) - proj1x->FindBin(TMath::Pi()/2 - 0.5) + 1);
	  proj1x->Add(new TF1("f", "1", -5, 5), -zyam);

	  proj1x->SetStats(kFALSE);
	  proj1x->GetXaxis()->SetTitleOffset(1);
      
	  proj1x->SetLineColor(colors[fileId]);
	  if (maxValue < 0)
	    maxValue = proj1x->GetMaximum() * 2;
	  proj1x->SetMaximum(maxValue);
	  //       proj1x->SetMinimum(-0.01);
	  proj1x->Draw((fileId == 0) ? "" : "SAME");
      
	  legend->AddEntry(proj1x, labels[fileId]);
	}
      legend->Draw();
    }
}

void FourierFactorization(const char* fileName)
{
  ReadGraphs(fileName);
  
  Int_t n = 6;
  Int_t is[] =    { 0, 1, 1, 2, 2, 2, 3 };
  Int_t js[] =    { 1, 1, 2, 1, 2, 3, 3 };
  Bool_t symm[] = { 1, 0, 1, 0, 0, 1, 0 };

  Int_t graphID = 5;
  
  TGraphErrors** symmGraphs[] = { graphs[0], graphs[2], graphs[5] };
  
  for (Int_t i=0; i<symmGraphs[0][graphID]->GetN(); i++)
    {
      Printf("%d", i);
      graphs[1][graphID]->GetY()[i] = TMath::Sqrt(symmGraphs[0][graphID]->GetY()[i] * symmGraphs[1][graphID]->GetY()[i]);
      graphs[3][graphID]->GetY()[i] = TMath::Sqrt(symmGraphs[2][graphID]->GetY()[i] * symmGraphs[1][graphID]->GetY()[i]);
      graphs[4][graphID]->GetY()[i] = TMath::Sqrt(symmGraphs[2][graphID]->GetY()[i] * symmGraphs[2][graphID]->GetY()[i]);
    }
  
  //   graphs[1][graphID]->Draw("A*");
  
  WriteGraphs();
}

void CompareATLAS()
{
  atlas = ReadHepdata("/home/jgrosseo/Dropbox/alice-paper-paridge/comparison_atlas/atlas_figaux10.txt", kFALSE, 1, 1);
  atlas->SetMarkerStyle(20);
  atlas->Draw("PA");
  atlas->SetTitle("");
  atlas->GetXaxis()->SetTitle("p_{T} (GeV/c)");
  atlas->GetYaxis()->SetTitle("s_{2} / v_{2}");
  atlas->GetYaxis()->SetRangeUser(0.02, 0.18);

  alice = new TGraphErrors;
  AddPoint(alice, 0.75, 0.0583503, 0.25, 0.00831755);
  AddPoint(alice, 1.5, 0.0953562, 0.5, 0.0134597);
  AddPoint(alice, 3, 0.128309, 1, 0.0189634);
  
  alice->SetMarkerStyle(21);
  alice->SetLineColor(2);
  alice->SetMarkerColor(2);
  alice->Draw("PSAME");
}

Double_t CalculateVnAnalyticallyRaw(TH1* proj,Int_t n, Float_t BaseLineShift){
  //proj->Print("all");
  Double_t num=0;
  Double_t den=0;
  Printf("BaseLineShift %f",BaseLineShift);
  for(Int_t ibin=1;ibin<=proj->GetNbinsX();ibin++){
    if(proj->GetBinContent(ibin)==0)continue;
    num+=TMath::Cos(n*proj->GetBinCenter(ibin))*(proj->GetBinContent(ibin)+BaseLineShift);
    den+=proj->GetBinContent(ibin)+BaseLineShift;
    //Printf("num %f   den %f BaselineShift %f",num,den,BaseLineShift);
  }
  Double_t vn=num/den;
  return vn;
}

Double_t CalculateVnAnalytically(TH1* proj,Int_t n, Float_t BaseLineShift){
  Double_t vn=CalculateVnAnalyticallyRaw(proj, n, BaseLineShift);
  if (vn < 0)
    return 0;
  Printf("v2 Value: %f",TMath::Sqrt(vn));
  return TMath::Sqrt(vn);
}

Double_t CalculateVnErrAnalytically(TH1* proj,Int_t n, Float_t BaseLineShift, Double_t BaseLineShiftError){  
  Double_t I=0;
  Double_t v2=CalculateVnAnalytically(proj,n,BaseLineShift);
  if (v2 <= 0)
    return 0;
  
  for(Int_t ibin=1;ibin<=proj->GetNbinsX();ibin++){
    if(proj->GetBinContent(ibin)==0)continue;
    I+=proj->GetBinContent(ibin)+BaseLineShift;
  }
  Double_t sigma2=0;
  for(Int_t ibin=1;ibin<=proj->GetNbinsX();ibin++){
    if(proj->GetBinContent(ibin)==0)continue;
    Double_t ck=TMath::Cos(n*proj->GetBinCenter(ibin));
    sigma2+=(ck-v2)*(ck-v2)*(proj->GetBinError(ibin)+BaseLineShiftError)*(proj->GetBinError(ibin)+BaseLineShiftError);
  }
  sigma2=sigma2/(I*I);
  
  Double_t vnerr=TMath::Sqrt(sigma2);
  //we take the sqrt of vn
  vnerr=vnerr/(2*v2);
  return vnerr;
}


void UnfoldUsingVnHadrons(TGraphErrors*** Inputgraphs,const char* graphFileHadrons,Int_t id)
{
  //create a new set of graphs
  TGraphErrors*** graphsHadrons = new TGraphErrors**[NGraphs];
  for (Int_t i=0; i<NGraphs; i++)
    {
      graphsHadrons[i] = new TGraphErrors*[NHists];
      for (Int_t j=0; j<NHists; j++)
	{
	  graphsHadrons[i][j] = new TGraphErrors;
	  graphsHadrons[i][j]->GetYaxis()->SetTitle(graphTitles[j]);
	}
    }
  //get the hadron ones
  TFile* fileHadrons = TFile::Open(graphFileHadrons);
  for (Int_t i=0; i<NGraphs; i++)
    for (Int_t j=0; j<NHists; j++)
      graphsHadrons[i][j] = (TGraphErrors*) fileHadrons->Get(Form("graph_%d_%d", i, j));
  
  for (Int_t i=0; i<NGraphs; i++){
    Printf("\nUnfolding %s with hadron file %s",Inputgraphs[i][id]->GetTitle(),graphsHadrons[i][id]->GetTitle());
    Printf("\033[1;51mInput graph\033[m");
    Inputgraphs[i][id]->Print("all");
    Printf("\033[1;51mHadron graph\033[m");
    graphsHadrons[i][id]->Print("all");
    for(Int_t ipoint=0;ipoint<Inputgraphs[i][id]->GetN();ipoint++){//loop over the input file
      Double_t y=0,x=0,xHadrons=0,yHadrons=0;
      Double_t ey=0,ex=0,exHadrons=0,eyHadrons=0;
      Inputgraphs[i][id]->GetPoint(ipoint,x,y);
      Int_t ipointHad=0;
      Bool_t NoHad=0;
      graphsHadrons[i][id]->GetPoint(ipointHad,xHadrons,yHadrons);
      while(xHadrons!=x){//Get the same bin of hadrons, doesn't take directly ipoint because some points might be missing in one of the two histos
	ipointHad++;
	graphsHadrons[i][id]->GetPoint(ipointHad,xHadrons,yHadrons);
	if(ipointHad>10){//the hadron point is missing
	  NoHad=1;
	  break;
	}
      }
      if(NoHad)continue;//if hadron measurement is missing skip the point (unfolding not possible)
      ex=Inputgraphs[i][id]->GetErrorX(ipoint);
      ey=Inputgraphs[i][id]->GetErrorY(ipoint);
      exHadrons=graphsHadrons[i][id]->GetErrorX(ipointHad);
      eyHadrons=graphsHadrons[i][id]->GetErrorY(ipointHad);
      printf("(v%d) Input file: %f  %f +- %f  Hadrons: %f  %f +- %f",(id==4)?2:3,x,y,ey,xHadrons,yHadrons,eyHadrons);
      Double_t unfoldedVal=(y*y)/yHadrons;
      Inputgraphs[i][id]->SetPoint(ipoint,x,unfoldedVal);
      Inputgraphs[i][id]->SetPointError(ipoint,ex,unfoldedVal*TMath::Sqrt((2*ey/y)*(2*ey/y)+(eyHadrons/yHadrons)*(eyHadrons/yHadrons)));
      Inputgraphs[i][id]->GetPoint(ipoint,x,y);
      ex=Inputgraphs[i][id]->GetErrorX(ipoint);
      ey=Inputgraphs[i][id]->GetErrorY(ipoint);
      Printf("  AfterCorrection:  %f  %f +- %f",x,y,ey);
    }
  }
  delete graphsHadrons;
  fileHadrons->Close();
  delete fileHadrons;
}

TString gReferenceFile;
void DivideOutReferenceParticle(const char* graphFile, const char* outputFile = "graphs.root")
{
  ReadGraphs(gReferenceFile);
  TGraphErrors*** graphsHadrons = graphs;
  
  ReadGraphs(graphFile);

  for (Int_t graphID = 4; graphID <= 4; graphID++) //v2 + v3
  {
    const Int_t posFullPt = 6; // position where vn for unfolding is located (i.e. full pT,a and pT,t range)
    Bool_t allPt = TString(graphFile).Contains("allpt");
    Int_t maxPt = (allPt) ? posFullPt : NGraphs;
    for (Int_t i=0; i<maxPt; i++)
    {
      Int_t referencePos = (allPt) ? posFullPt : i;
      for (Int_t j=0; j<graphs[i][graphID]->GetN(); j++)
      {
	printf("%d %d: %f %f ", i, j, graphs[i][graphID]->GetY()[j], graphsHadrons[referencePos][graphID]->GetY()[j]);
	if (graphs[i][graphID]->GetY()[j] <= 1e-6)
	{
	  Printf("");
	  continue;
	}
	if (graphsHadrons[referencePos][graphID]->GetY()[j] <= 1e-6)
	{
	  graphs[i][graphID]->GetY()[j] = 0;
	  graphs[i][graphID]->GetEY()[j] = 0;
	  Printf("");
	  continue;
	}
	Float_t relError = graphs[i][graphID]->GetEY()[j] / graphs[i][graphID]->GetY()[j];
	graphs[i][graphID]->GetY()[j] = graphs[i][graphID]->GetY()[j] * graphs[i][graphID]->GetY()[j] / graphsHadrons[referencePos][graphID]->GetY()[j];
	graphs[i][graphID]->GetEY()[j] = graphs[i][graphID]->GetY()[j] * TMath::Sqrt(TMath::Power(2.0 * relError, 2) + TMath::Power(graphsHadrons[referencePos][graphID]->GetEY()[j] / graphsHadrons[referencePos][graphID]->GetY()[j], 2));
	Printf("%f +- %f", graphs[i][graphID]->GetY()[j], graphs[i][graphID]->GetEY()[j]);
      }
    }
  }

  WriteGraphs(outputFile);
}

void ExtractForSkalarProductComparison(TString inputFileNameBase, TString outputFileNameBase, Bool_t divideOut)
{
  gDoSubtraction = 1;
//   gDoSubtraction = 0; //gUseAnalyticalVn = 1;

  if (1)
  {
    gDoEtaGap = 1; 
//     gDoEtaGapAS = 1;
    CorrelationSubtractionHistogram(inputFileNameBase + ".root", kTRUE, outputFileNameBase + ".root", 0);
    if (divideOut)
      DivideOutReferenceParticle(outputFileNameBase + ".root", outputFileNameBase + "_unfolded.root");
  }
  else
  {
    gDoEtaGap = 0; 
  //   gDoEtaGapAS = 0;
    CorrelationSubtractionHistogram(inputFileNameBase + ".root", kTRUE, outputFileNameBase + "_nogap.root", 0);
    if (divideOut)
      DivideOutReferenceParticle(outputFileNameBase + "_nogap.root", outputFileNameBase + "_nogap_unfolded.root");
  }
}

void ExtractForSkalarProductComparisonAllSpecies()
{
  gROOT->SetBatch(kTRUE);

  TString baseInput("dphi_corr_LHC13bc_20130604");
  TString baseOutput("graphs_130618_otherbaseline");
//   baseOutput += "_nosub";
//   TString postfix("_wingremoved");
  TString postfix;
  
  if (1)
  {
    gBinning = 0;
    gReferenceFile = baseOutput + ".root";
    ExtractForSkalarProductComparison(baseInput + "_Hadrons" + postfix, baseOutput, kTRUE); 
    ExtractForSkalarProductComparison(baseInput + "_Pions" + postfix, baseOutput + "_pions", kTRUE);
    ExtractForSkalarProductComparison(baseInput + "_Protons" + postfix, baseOutput + "_protons", kTRUE);
    ExtractForSkalarProductComparison(baseInput + "_Kaons" + postfix, baseOutput + "_kaons", kTRUE);
  }
  
  if (0)
  {
    gBinning = 1;
    baseInput += "_allpt";
    baseOutput += "_allpt";
    gReferenceFile = baseOutput + ".root";
    ExtractForSkalarProductComparison(baseInput + "_55_Hadrons_symmetrized" + postfix, baseOutput, kTRUE); 
    ExtractForSkalarProductComparison(baseInput + "_63_Pions" + postfix, baseOutput + "_pions", kTRUE);
    ExtractForSkalarProductComparison(baseInput + "_63_Protons" + postfix, baseOutput + "_protons", kTRUE);
    ExtractForSkalarProductComparison(baseInput + "_63_Kaons" + postfix, baseOutput + "_kaons", kTRUE);
  }
}

void Test()
{
  TString baseOutput("graphs_130503");
  const char* arr[] = { "", "_pions", "_protons", "_kaons"};
  
  for (Int_t i=1; i<4; i++)
  {
    ReadGraphs(baseOutput + arr[i] + ".root");
    UnfoldUsingVnHadrons(graphs, baseOutput + ".root", 4);
    WriteGraphs(baseOutput + arr[i] + "_unfolded2.root");
  }
}
 pA_PID_Fwd.C:1
 pA_PID_Fwd.C:2
 pA_PID_Fwd.C:3
 pA_PID_Fwd.C:4
 pA_PID_Fwd.C:5
 pA_PID_Fwd.C:6
 pA_PID_Fwd.C:7
 pA_PID_Fwd.C:8
 pA_PID_Fwd.C:9
 pA_PID_Fwd.C:10
 pA_PID_Fwd.C:11
 pA_PID_Fwd.C:12
 pA_PID_Fwd.C:13
 pA_PID_Fwd.C:14
 pA_PID_Fwd.C:15
 pA_PID_Fwd.C:16
 pA_PID_Fwd.C:17
 pA_PID_Fwd.C:18
 pA_PID_Fwd.C:19
 pA_PID_Fwd.C:20
 pA_PID_Fwd.C:21
 pA_PID_Fwd.C:22
 pA_PID_Fwd.C:23
 pA_PID_Fwd.C:24
 pA_PID_Fwd.C:25
 pA_PID_Fwd.C:26
 pA_PID_Fwd.C:27
 pA_PID_Fwd.C:28
 pA_PID_Fwd.C:29
 pA_PID_Fwd.C:30
 pA_PID_Fwd.C:31
 pA_PID_Fwd.C:32
 pA_PID_Fwd.C:33
 pA_PID_Fwd.C:34
 pA_PID_Fwd.C:35
 pA_PID_Fwd.C:36
 pA_PID_Fwd.C:37
 pA_PID_Fwd.C:38
 pA_PID_Fwd.C:39
 pA_PID_Fwd.C:40
 pA_PID_Fwd.C:41
 pA_PID_Fwd.C:42
 pA_PID_Fwd.C:43
 pA_PID_Fwd.C:44
 pA_PID_Fwd.C:45
 pA_PID_Fwd.C:46
 pA_PID_Fwd.C:47
 pA_PID_Fwd.C:48
 pA_PID_Fwd.C:49
 pA_PID_Fwd.C:50
 pA_PID_Fwd.C:51
 pA_PID_Fwd.C:52
 pA_PID_Fwd.C:53
 pA_PID_Fwd.C:54
 pA_PID_Fwd.C:55
 pA_PID_Fwd.C:56
 pA_PID_Fwd.C:57
 pA_PID_Fwd.C:58
 pA_PID_Fwd.C:59
 pA_PID_Fwd.C:60
 pA_PID_Fwd.C:61
 pA_PID_Fwd.C:62
 pA_PID_Fwd.C:63
 pA_PID_Fwd.C:64
 pA_PID_Fwd.C:65
 pA_PID_Fwd.C:66
 pA_PID_Fwd.C:67
 pA_PID_Fwd.C:68
 pA_PID_Fwd.C:69
 pA_PID_Fwd.C:70
 pA_PID_Fwd.C:71
 pA_PID_Fwd.C:72
 pA_PID_Fwd.C:73
 pA_PID_Fwd.C:74
 pA_PID_Fwd.C:75
 pA_PID_Fwd.C:76
 pA_PID_Fwd.C:77
 pA_PID_Fwd.C:78
 pA_PID_Fwd.C:79
 pA_PID_Fwd.C:80
 pA_PID_Fwd.C:81
 pA_PID_Fwd.C:82
 pA_PID_Fwd.C:83
 pA_PID_Fwd.C:84
 pA_PID_Fwd.C:85
 pA_PID_Fwd.C:86
 pA_PID_Fwd.C:87
 pA_PID_Fwd.C:88
 pA_PID_Fwd.C:89
 pA_PID_Fwd.C:90
 pA_PID_Fwd.C:91
 pA_PID_Fwd.C:92
 pA_PID_Fwd.C:93
 pA_PID_Fwd.C:94
 pA_PID_Fwd.C:95
 pA_PID_Fwd.C:96
 pA_PID_Fwd.C:97
 pA_PID_Fwd.C:98
 pA_PID_Fwd.C:99
 pA_PID_Fwd.C:100
 pA_PID_Fwd.C:101
 pA_PID_Fwd.C:102
 pA_PID_Fwd.C:103
 pA_PID_Fwd.C:104
 pA_PID_Fwd.C:105
 pA_PID_Fwd.C:106
 pA_PID_Fwd.C:107
 pA_PID_Fwd.C:108
 pA_PID_Fwd.C:109
 pA_PID_Fwd.C:110
 pA_PID_Fwd.C:111
 pA_PID_Fwd.C:112
 pA_PID_Fwd.C:113
 pA_PID_Fwd.C:114
 pA_PID_Fwd.C:115
 pA_PID_Fwd.C:116
 pA_PID_Fwd.C:117
 pA_PID_Fwd.C:118
 pA_PID_Fwd.C:119
 pA_PID_Fwd.C:120
 pA_PID_Fwd.C:121
 pA_PID_Fwd.C:122
 pA_PID_Fwd.C:123
 pA_PID_Fwd.C:124
 pA_PID_Fwd.C:125
 pA_PID_Fwd.C:126
 pA_PID_Fwd.C:127
 pA_PID_Fwd.C:128
 pA_PID_Fwd.C:129
 pA_PID_Fwd.C:130
 pA_PID_Fwd.C:131
 pA_PID_Fwd.C:132
 pA_PID_Fwd.C:133
 pA_PID_Fwd.C:134
 pA_PID_Fwd.C:135
 pA_PID_Fwd.C:136
 pA_PID_Fwd.C:137
 pA_PID_Fwd.C:138
 pA_PID_Fwd.C:139
 pA_PID_Fwd.C:140
 pA_PID_Fwd.C:141
 pA_PID_Fwd.C:142
 pA_PID_Fwd.C:143
 pA_PID_Fwd.C:144
 pA_PID_Fwd.C:145
 pA_PID_Fwd.C:146
 pA_PID_Fwd.C:147
 pA_PID_Fwd.C:148
 pA_PID_Fwd.C:149
 pA_PID_Fwd.C:150
 pA_PID_Fwd.C:151
 pA_PID_Fwd.C:152
 pA_PID_Fwd.C:153
 pA_PID_Fwd.C:154
 pA_PID_Fwd.C:155
 pA_PID_Fwd.C:156
 pA_PID_Fwd.C:157
 pA_PID_Fwd.C:158
 pA_PID_Fwd.C:159
 pA_PID_Fwd.C:160
 pA_PID_Fwd.C:161
 pA_PID_Fwd.C:162
 pA_PID_Fwd.C:163
 pA_PID_Fwd.C:164
 pA_PID_Fwd.C:165
 pA_PID_Fwd.C:166
 pA_PID_Fwd.C:167
 pA_PID_Fwd.C:168
 pA_PID_Fwd.C:169
 pA_PID_Fwd.C:170
 pA_PID_Fwd.C:171
 pA_PID_Fwd.C:172
 pA_PID_Fwd.C:173
 pA_PID_Fwd.C:174
 pA_PID_Fwd.C:175
 pA_PID_Fwd.C:176
 pA_PID_Fwd.C:177
 pA_PID_Fwd.C:178
 pA_PID_Fwd.C:179
 pA_PID_Fwd.C:180
 pA_PID_Fwd.C:181
 pA_PID_Fwd.C:182
 pA_PID_Fwd.C:183
 pA_PID_Fwd.C:184
 pA_PID_Fwd.C:185
 pA_PID_Fwd.C:186
 pA_PID_Fwd.C:187
 pA_PID_Fwd.C:188
 pA_PID_Fwd.C:189
 pA_PID_Fwd.C:190
 pA_PID_Fwd.C:191
 pA_PID_Fwd.C:192
 pA_PID_Fwd.C:193
 pA_PID_Fwd.C:194
 pA_PID_Fwd.C:195
 pA_PID_Fwd.C:196
 pA_PID_Fwd.C:197
 pA_PID_Fwd.C:198
 pA_PID_Fwd.C:199
 pA_PID_Fwd.C:200
 pA_PID_Fwd.C:201
 pA_PID_Fwd.C:202
 pA_PID_Fwd.C:203
 pA_PID_Fwd.C:204
 pA_PID_Fwd.C:205
 pA_PID_Fwd.C:206
 pA_PID_Fwd.C:207
 pA_PID_Fwd.C:208
 pA_PID_Fwd.C:209
 pA_PID_Fwd.C:210
 pA_PID_Fwd.C:211
 pA_PID_Fwd.C:212
 pA_PID_Fwd.C:213
 pA_PID_Fwd.C:214
 pA_PID_Fwd.C:215
 pA_PID_Fwd.C:216
 pA_PID_Fwd.C:217
 pA_PID_Fwd.C:218
 pA_PID_Fwd.C:219
 pA_PID_Fwd.C:220
 pA_PID_Fwd.C:221
 pA_PID_Fwd.C:222
 pA_PID_Fwd.C:223
 pA_PID_Fwd.C:224
 pA_PID_Fwd.C:225
 pA_PID_Fwd.C:226
 pA_PID_Fwd.C:227
 pA_PID_Fwd.C:228
 pA_PID_Fwd.C:229
 pA_PID_Fwd.C:230
 pA_PID_Fwd.C:231
 pA_PID_Fwd.C:232
 pA_PID_Fwd.C:233
 pA_PID_Fwd.C:234
 pA_PID_Fwd.C:235
 pA_PID_Fwd.C:236
 pA_PID_Fwd.C:237
 pA_PID_Fwd.C:238
 pA_PID_Fwd.C:239
 pA_PID_Fwd.C:240
 pA_PID_Fwd.C:241
 pA_PID_Fwd.C:242
 pA_PID_Fwd.C:243
 pA_PID_Fwd.C:244
 pA_PID_Fwd.C:245
 pA_PID_Fwd.C:246
 pA_PID_Fwd.C:247
 pA_PID_Fwd.C:248
 pA_PID_Fwd.C:249
 pA_PID_Fwd.C:250
 pA_PID_Fwd.C:251
 pA_PID_Fwd.C:252
 pA_PID_Fwd.C:253
 pA_PID_Fwd.C:254
 pA_PID_Fwd.C:255
 pA_PID_Fwd.C:256
 pA_PID_Fwd.C:257
 pA_PID_Fwd.C:258
 pA_PID_Fwd.C:259
 pA_PID_Fwd.C:260
 pA_PID_Fwd.C:261
 pA_PID_Fwd.C:262
 pA_PID_Fwd.C:263
 pA_PID_Fwd.C:264
 pA_PID_Fwd.C:265
 pA_PID_Fwd.C:266
 pA_PID_Fwd.C:267
 pA_PID_Fwd.C:268
 pA_PID_Fwd.C:269
 pA_PID_Fwd.C:270
 pA_PID_Fwd.C:271
 pA_PID_Fwd.C:272
 pA_PID_Fwd.C:273
 pA_PID_Fwd.C:274
 pA_PID_Fwd.C:275
 pA_PID_Fwd.C:276
 pA_PID_Fwd.C:277
 pA_PID_Fwd.C:278
 pA_PID_Fwd.C:279
 pA_PID_Fwd.C:280
 pA_PID_Fwd.C:281
 pA_PID_Fwd.C:282
 pA_PID_Fwd.C:283
 pA_PID_Fwd.C:284
 pA_PID_Fwd.C:285
 pA_PID_Fwd.C:286
 pA_PID_Fwd.C:287
 pA_PID_Fwd.C:288
 pA_PID_Fwd.C:289
 pA_PID_Fwd.C:290
 pA_PID_Fwd.C:291
 pA_PID_Fwd.C:292
 pA_PID_Fwd.C:293
 pA_PID_Fwd.C:294
 pA_PID_Fwd.C:295
 pA_PID_Fwd.C:296
 pA_PID_Fwd.C:297
 pA_PID_Fwd.C:298
 pA_PID_Fwd.C:299
 pA_PID_Fwd.C:300
 pA_PID_Fwd.C:301
 pA_PID_Fwd.C:302
 pA_PID_Fwd.C:303
 pA_PID_Fwd.C:304
 pA_PID_Fwd.C:305
 pA_PID_Fwd.C:306
 pA_PID_Fwd.C:307
 pA_PID_Fwd.C:308
 pA_PID_Fwd.C:309
 pA_PID_Fwd.C:310
 pA_PID_Fwd.C:311
 pA_PID_Fwd.C:312
 pA_PID_Fwd.C:313
 pA_PID_Fwd.C:314
 pA_PID_Fwd.C:315
 pA_PID_Fwd.C:316
 pA_PID_Fwd.C:317
 pA_PID_Fwd.C:318
 pA_PID_Fwd.C:319
 pA_PID_Fwd.C:320
 pA_PID_Fwd.C:321
 pA_PID_Fwd.C:322
 pA_PID_Fwd.C:323
 pA_PID_Fwd.C:324
 pA_PID_Fwd.C:325
 pA_PID_Fwd.C:326
 pA_PID_Fwd.C:327
 pA_PID_Fwd.C:328
 pA_PID_Fwd.C:329
 pA_PID_Fwd.C:330
 pA_PID_Fwd.C:331
 pA_PID_Fwd.C:332
 pA_PID_Fwd.C:333
 pA_PID_Fwd.C:334
 pA_PID_Fwd.C:335
 pA_PID_Fwd.C:336
 pA_PID_Fwd.C:337
 pA_PID_Fwd.C:338
 pA_PID_Fwd.C:339
 pA_PID_Fwd.C:340
 pA_PID_Fwd.C:341
 pA_PID_Fwd.C:342
 pA_PID_Fwd.C:343
 pA_PID_Fwd.C:344
 pA_PID_Fwd.C:345
 pA_PID_Fwd.C:346
 pA_PID_Fwd.C:347
 pA_PID_Fwd.C:348
 pA_PID_Fwd.C:349
 pA_PID_Fwd.C:350
 pA_PID_Fwd.C:351
 pA_PID_Fwd.C:352
 pA_PID_Fwd.C:353
 pA_PID_Fwd.C:354
 pA_PID_Fwd.C:355
 pA_PID_Fwd.C:356
 pA_PID_Fwd.C:357
 pA_PID_Fwd.C:358
 pA_PID_Fwd.C:359
 pA_PID_Fwd.C:360
 pA_PID_Fwd.C:361
 pA_PID_Fwd.C:362
 pA_PID_Fwd.C:363
 pA_PID_Fwd.C:364
 pA_PID_Fwd.C:365
 pA_PID_Fwd.C:366
 pA_PID_Fwd.C:367
 pA_PID_Fwd.C:368
 pA_PID_Fwd.C:369
 pA_PID_Fwd.C:370
 pA_PID_Fwd.C:371
 pA_PID_Fwd.C:372
 pA_PID_Fwd.C:373
 pA_PID_Fwd.C:374
 pA_PID_Fwd.C:375
 pA_PID_Fwd.C:376
 pA_PID_Fwd.C:377
 pA_PID_Fwd.C:378
 pA_PID_Fwd.C:379
 pA_PID_Fwd.C:380
 pA_PID_Fwd.C:381
 pA_PID_Fwd.C:382
 pA_PID_Fwd.C:383
 pA_PID_Fwd.C:384
 pA_PID_Fwd.C:385
 pA_PID_Fwd.C:386
 pA_PID_Fwd.C:387
 pA_PID_Fwd.C:388
 pA_PID_Fwd.C:389
 pA_PID_Fwd.C:390
 pA_PID_Fwd.C:391
 pA_PID_Fwd.C:392
 pA_PID_Fwd.C:393
 pA_PID_Fwd.C:394
 pA_PID_Fwd.C:395
 pA_PID_Fwd.C:396
 pA_PID_Fwd.C:397
 pA_PID_Fwd.C:398
 pA_PID_Fwd.C:399
 pA_PID_Fwd.C:400
 pA_PID_Fwd.C:401
 pA_PID_Fwd.C:402
 pA_PID_Fwd.C:403
 pA_PID_Fwd.C:404
 pA_PID_Fwd.C:405
 pA_PID_Fwd.C:406
 pA_PID_Fwd.C:407
 pA_PID_Fwd.C:408
 pA_PID_Fwd.C:409
 pA_PID_Fwd.C:410
 pA_PID_Fwd.C:411
 pA_PID_Fwd.C:412
 pA_PID_Fwd.C:413
 pA_PID_Fwd.C:414
 pA_PID_Fwd.C:415
 pA_PID_Fwd.C:416
 pA_PID_Fwd.C:417
 pA_PID_Fwd.C:418
 pA_PID_Fwd.C:419
 pA_PID_Fwd.C:420
 pA_PID_Fwd.C:421
 pA_PID_Fwd.C:422
 pA_PID_Fwd.C:423
 pA_PID_Fwd.C:424
 pA_PID_Fwd.C:425
 pA_PID_Fwd.C:426
 pA_PID_Fwd.C:427
 pA_PID_Fwd.C:428
 pA_PID_Fwd.C:429
 pA_PID_Fwd.C:430
 pA_PID_Fwd.C:431
 pA_PID_Fwd.C:432
 pA_PID_Fwd.C:433
 pA_PID_Fwd.C:434
 pA_PID_Fwd.C:435
 pA_PID_Fwd.C:436
 pA_PID_Fwd.C:437
 pA_PID_Fwd.C:438
 pA_PID_Fwd.C:439
 pA_PID_Fwd.C:440
 pA_PID_Fwd.C:441
 pA_PID_Fwd.C:442
 pA_PID_Fwd.C:443
 pA_PID_Fwd.C:444
 pA_PID_Fwd.C:445
 pA_PID_Fwd.C:446
 pA_PID_Fwd.C:447
 pA_PID_Fwd.C:448
 pA_PID_Fwd.C:449
 pA_PID_Fwd.C:450
 pA_PID_Fwd.C:451
 pA_PID_Fwd.C:452
 pA_PID_Fwd.C:453
 pA_PID_Fwd.C:454
 pA_PID_Fwd.C:455
 pA_PID_Fwd.C:456
 pA_PID_Fwd.C:457
 pA_PID_Fwd.C:458
 pA_PID_Fwd.C:459
 pA_PID_Fwd.C:460
 pA_PID_Fwd.C:461
 pA_PID_Fwd.C:462
 pA_PID_Fwd.C:463
 pA_PID_Fwd.C:464
 pA_PID_Fwd.C:465
 pA_PID_Fwd.C:466
 pA_PID_Fwd.C:467
 pA_PID_Fwd.C:468
 pA_PID_Fwd.C:469
 pA_PID_Fwd.C:470
 pA_PID_Fwd.C:471
 pA_PID_Fwd.C:472
 pA_PID_Fwd.C:473
 pA_PID_Fwd.C:474
 pA_PID_Fwd.C:475
 pA_PID_Fwd.C:476
 pA_PID_Fwd.C:477
 pA_PID_Fwd.C:478
 pA_PID_Fwd.C:479
 pA_PID_Fwd.C:480
 pA_PID_Fwd.C:481
 pA_PID_Fwd.C:482
 pA_PID_Fwd.C:483
 pA_PID_Fwd.C:484
 pA_PID_Fwd.C:485
 pA_PID_Fwd.C:486
 pA_PID_Fwd.C:487
 pA_PID_Fwd.C:488
 pA_PID_Fwd.C:489
 pA_PID_Fwd.C:490
 pA_PID_Fwd.C:491
 pA_PID_Fwd.C:492
 pA_PID_Fwd.C:493
 pA_PID_Fwd.C:494
 pA_PID_Fwd.C:495
 pA_PID_Fwd.C:496
 pA_PID_Fwd.C:497
 pA_PID_Fwd.C:498
 pA_PID_Fwd.C:499
 pA_PID_Fwd.C:500
 pA_PID_Fwd.C:501
 pA_PID_Fwd.C:502
 pA_PID_Fwd.C:503
 pA_PID_Fwd.C:504
 pA_PID_Fwd.C:505
 pA_PID_Fwd.C:506
 pA_PID_Fwd.C:507
 pA_PID_Fwd.C:508
 pA_PID_Fwd.C:509
 pA_PID_Fwd.C:510
 pA_PID_Fwd.C:511
 pA_PID_Fwd.C:512
 pA_PID_Fwd.C:513
 pA_PID_Fwd.C:514
 pA_PID_Fwd.C:515
 pA_PID_Fwd.C:516
 pA_PID_Fwd.C:517
 pA_PID_Fwd.C:518
 pA_PID_Fwd.C:519
 pA_PID_Fwd.C:520
 pA_PID_Fwd.C:521
 pA_PID_Fwd.C:522
 pA_PID_Fwd.C:523
 pA_PID_Fwd.C:524
 pA_PID_Fwd.C:525
 pA_PID_Fwd.C:526
 pA_PID_Fwd.C:527
 pA_PID_Fwd.C:528
 pA_PID_Fwd.C:529
 pA_PID_Fwd.C:530
 pA_PID_Fwd.C:531
 pA_PID_Fwd.C:532
 pA_PID_Fwd.C:533
 pA_PID_Fwd.C:534
 pA_PID_Fwd.C:535
 pA_PID_Fwd.C:536
 pA_PID_Fwd.C:537
 pA_PID_Fwd.C:538
 pA_PID_Fwd.C:539
 pA_PID_Fwd.C:540
 pA_PID_Fwd.C:541
 pA_PID_Fwd.C:542
 pA_PID_Fwd.C:543
 pA_PID_Fwd.C:544
 pA_PID_Fwd.C:545
 pA_PID_Fwd.C:546
 pA_PID_Fwd.C:547
 pA_PID_Fwd.C:548
 pA_PID_Fwd.C:549
 pA_PID_Fwd.C:550
 pA_PID_Fwd.C:551
 pA_PID_Fwd.C:552
 pA_PID_Fwd.C:553
 pA_PID_Fwd.C:554
 pA_PID_Fwd.C:555
 pA_PID_Fwd.C:556
 pA_PID_Fwd.C:557
 pA_PID_Fwd.C:558
 pA_PID_Fwd.C:559
 pA_PID_Fwd.C:560
 pA_PID_Fwd.C:561
 pA_PID_Fwd.C:562
 pA_PID_Fwd.C:563
 pA_PID_Fwd.C:564
 pA_PID_Fwd.C:565
 pA_PID_Fwd.C:566
 pA_PID_Fwd.C:567
 pA_PID_Fwd.C:568
 pA_PID_Fwd.C:569
 pA_PID_Fwd.C:570
 pA_PID_Fwd.C:571
 pA_PID_Fwd.C:572
 pA_PID_Fwd.C:573
 pA_PID_Fwd.C:574
 pA_PID_Fwd.C:575
 pA_PID_Fwd.C:576
 pA_PID_Fwd.C:577
 pA_PID_Fwd.C:578
 pA_PID_Fwd.C:579
 pA_PID_Fwd.C:580
 pA_PID_Fwd.C:581
 pA_PID_Fwd.C:582
 pA_PID_Fwd.C:583
 pA_PID_Fwd.C:584
 pA_PID_Fwd.C:585
 pA_PID_Fwd.C:586
 pA_PID_Fwd.C:587
 pA_PID_Fwd.C:588
 pA_PID_Fwd.C:589
 pA_PID_Fwd.C:590
 pA_PID_Fwd.C:591
 pA_PID_Fwd.C:592
 pA_PID_Fwd.C:593
 pA_PID_Fwd.C:594
 pA_PID_Fwd.C:595
 pA_PID_Fwd.C:596
 pA_PID_Fwd.C:597
 pA_PID_Fwd.C:598
 pA_PID_Fwd.C:599
 pA_PID_Fwd.C:600
 pA_PID_Fwd.C:601
 pA_PID_Fwd.C:602
 pA_PID_Fwd.C:603
 pA_PID_Fwd.C:604
 pA_PID_Fwd.C:605
 pA_PID_Fwd.C:606
 pA_PID_Fwd.C:607
 pA_PID_Fwd.C:608
 pA_PID_Fwd.C:609
 pA_PID_Fwd.C:610
 pA_PID_Fwd.C:611
 pA_PID_Fwd.C:612
 pA_PID_Fwd.C:613
 pA_PID_Fwd.C:614
 pA_PID_Fwd.C:615
 pA_PID_Fwd.C:616
 pA_PID_Fwd.C:617
 pA_PID_Fwd.C:618
 pA_PID_Fwd.C:619
 pA_PID_Fwd.C:620
 pA_PID_Fwd.C:621
 pA_PID_Fwd.C:622
 pA_PID_Fwd.C:623
 pA_PID_Fwd.C:624
 pA_PID_Fwd.C:625
 pA_PID_Fwd.C:626
 pA_PID_Fwd.C:627
 pA_PID_Fwd.C:628
 pA_PID_Fwd.C:629
 pA_PID_Fwd.C:630
 pA_PID_Fwd.C:631
 pA_PID_Fwd.C:632
 pA_PID_Fwd.C:633
 pA_PID_Fwd.C:634
 pA_PID_Fwd.C:635
 pA_PID_Fwd.C:636
 pA_PID_Fwd.C:637
 pA_PID_Fwd.C:638
 pA_PID_Fwd.C:639
 pA_PID_Fwd.C:640
 pA_PID_Fwd.C:641
 pA_PID_Fwd.C:642
 pA_PID_Fwd.C:643
 pA_PID_Fwd.C:644
 pA_PID_Fwd.C:645
 pA_PID_Fwd.C:646
 pA_PID_Fwd.C:647
 pA_PID_Fwd.C:648
 pA_PID_Fwd.C:649
 pA_PID_Fwd.C:650
 pA_PID_Fwd.C:651
 pA_PID_Fwd.C:652
 pA_PID_Fwd.C:653
 pA_PID_Fwd.C:654
 pA_PID_Fwd.C:655
 pA_PID_Fwd.C:656
 pA_PID_Fwd.C:657
 pA_PID_Fwd.C:658
 pA_PID_Fwd.C:659
 pA_PID_Fwd.C:660
 pA_PID_Fwd.C:661
 pA_PID_Fwd.C:662
 pA_PID_Fwd.C:663
 pA_PID_Fwd.C:664
 pA_PID_Fwd.C:665
 pA_PID_Fwd.C:666
 pA_PID_Fwd.C:667
 pA_PID_Fwd.C:668
 pA_PID_Fwd.C:669
 pA_PID_Fwd.C:670
 pA_PID_Fwd.C:671
 pA_PID_Fwd.C:672
 pA_PID_Fwd.C:673
 pA_PID_Fwd.C:674
 pA_PID_Fwd.C:675
 pA_PID_Fwd.C:676
 pA_PID_Fwd.C:677
 pA_PID_Fwd.C:678
 pA_PID_Fwd.C:679
 pA_PID_Fwd.C:680
 pA_PID_Fwd.C:681
 pA_PID_Fwd.C:682
 pA_PID_Fwd.C:683
 pA_PID_Fwd.C:684
 pA_PID_Fwd.C:685
 pA_PID_Fwd.C:686
 pA_PID_Fwd.C:687
 pA_PID_Fwd.C:688
 pA_PID_Fwd.C:689
 pA_PID_Fwd.C:690
 pA_PID_Fwd.C:691
 pA_PID_Fwd.C:692
 pA_PID_Fwd.C:693
 pA_PID_Fwd.C:694
 pA_PID_Fwd.C:695
 pA_PID_Fwd.C:696
 pA_PID_Fwd.C:697
 pA_PID_Fwd.C:698
 pA_PID_Fwd.C:699
 pA_PID_Fwd.C:700
 pA_PID_Fwd.C:701
 pA_PID_Fwd.C:702
 pA_PID_Fwd.C:703
 pA_PID_Fwd.C:704
 pA_PID_Fwd.C:705
 pA_PID_Fwd.C:706
 pA_PID_Fwd.C:707
 pA_PID_Fwd.C:708
 pA_PID_Fwd.C:709
 pA_PID_Fwd.C:710
 pA_PID_Fwd.C:711
 pA_PID_Fwd.C:712
 pA_PID_Fwd.C:713
 pA_PID_Fwd.C:714
 pA_PID_Fwd.C:715
 pA_PID_Fwd.C:716
 pA_PID_Fwd.C:717
 pA_PID_Fwd.C:718
 pA_PID_Fwd.C:719
 pA_PID_Fwd.C:720
 pA_PID_Fwd.C:721
 pA_PID_Fwd.C:722
 pA_PID_Fwd.C:723
 pA_PID_Fwd.C:724
 pA_PID_Fwd.C:725
 pA_PID_Fwd.C:726
 pA_PID_Fwd.C:727
 pA_PID_Fwd.C:728
 pA_PID_Fwd.C:729
 pA_PID_Fwd.C:730
 pA_PID_Fwd.C:731
 pA_PID_Fwd.C:732
 pA_PID_Fwd.C:733
 pA_PID_Fwd.C:734
 pA_PID_Fwd.C:735
 pA_PID_Fwd.C:736
 pA_PID_Fwd.C:737
 pA_PID_Fwd.C:738
 pA_PID_Fwd.C:739
 pA_PID_Fwd.C:740
 pA_PID_Fwd.C:741
 pA_PID_Fwd.C:742
 pA_PID_Fwd.C:743
 pA_PID_Fwd.C:744
 pA_PID_Fwd.C:745
 pA_PID_Fwd.C:746
 pA_PID_Fwd.C:747
 pA_PID_Fwd.C:748
 pA_PID_Fwd.C:749
 pA_PID_Fwd.C:750
 pA_PID_Fwd.C:751
 pA_PID_Fwd.C:752
 pA_PID_Fwd.C:753
 pA_PID_Fwd.C:754
 pA_PID_Fwd.C:755
 pA_PID_Fwd.C:756
 pA_PID_Fwd.C:757
 pA_PID_Fwd.C:758
 pA_PID_Fwd.C:759
 pA_PID_Fwd.C:760
 pA_PID_Fwd.C:761
 pA_PID_Fwd.C:762
 pA_PID_Fwd.C:763
 pA_PID_Fwd.C:764
 pA_PID_Fwd.C:765
 pA_PID_Fwd.C:766
 pA_PID_Fwd.C:767
 pA_PID_Fwd.C:768
 pA_PID_Fwd.C:769
 pA_PID_Fwd.C:770
 pA_PID_Fwd.C:771
 pA_PID_Fwd.C:772
 pA_PID_Fwd.C:773
 pA_PID_Fwd.C:774
 pA_PID_Fwd.C:775
 pA_PID_Fwd.C:776
 pA_PID_Fwd.C:777
 pA_PID_Fwd.C:778
 pA_PID_Fwd.C:779
 pA_PID_Fwd.C:780
 pA_PID_Fwd.C:781
 pA_PID_Fwd.C:782
 pA_PID_Fwd.C:783
 pA_PID_Fwd.C:784
 pA_PID_Fwd.C:785
 pA_PID_Fwd.C:786
 pA_PID_Fwd.C:787
 pA_PID_Fwd.C:788
 pA_PID_Fwd.C:789
 pA_PID_Fwd.C:790
 pA_PID_Fwd.C:791
 pA_PID_Fwd.C:792
 pA_PID_Fwd.C:793
 pA_PID_Fwd.C:794
 pA_PID_Fwd.C:795
 pA_PID_Fwd.C:796
 pA_PID_Fwd.C:797
 pA_PID_Fwd.C:798
 pA_PID_Fwd.C:799
 pA_PID_Fwd.C:800
 pA_PID_Fwd.C:801
 pA_PID_Fwd.C:802
 pA_PID_Fwd.C:803
 pA_PID_Fwd.C:804
 pA_PID_Fwd.C:805
 pA_PID_Fwd.C:806
 pA_PID_Fwd.C:807
 pA_PID_Fwd.C:808
 pA_PID_Fwd.C:809
 pA_PID_Fwd.C:810
 pA_PID_Fwd.C:811
 pA_PID_Fwd.C:812
 pA_PID_Fwd.C:813
 pA_PID_Fwd.C:814
 pA_PID_Fwd.C:815
 pA_PID_Fwd.C:816
 pA_PID_Fwd.C:817
 pA_PID_Fwd.C:818
 pA_PID_Fwd.C:819
 pA_PID_Fwd.C:820
 pA_PID_Fwd.C:821
 pA_PID_Fwd.C:822
 pA_PID_Fwd.C:823
 pA_PID_Fwd.C:824
 pA_PID_Fwd.C:825
 pA_PID_Fwd.C:826
 pA_PID_Fwd.C:827
 pA_PID_Fwd.C:828
 pA_PID_Fwd.C:829
 pA_PID_Fwd.C:830
 pA_PID_Fwd.C:831
 pA_PID_Fwd.C:832
 pA_PID_Fwd.C:833
 pA_PID_Fwd.C:834
 pA_PID_Fwd.C:835
 pA_PID_Fwd.C:836
 pA_PID_Fwd.C:837
 pA_PID_Fwd.C:838
 pA_PID_Fwd.C:839
 pA_PID_Fwd.C:840
 pA_PID_Fwd.C:841
 pA_PID_Fwd.C:842
 pA_PID_Fwd.C:843
 pA_PID_Fwd.C:844
 pA_PID_Fwd.C:845
 pA_PID_Fwd.C:846
 pA_PID_Fwd.C:847
 pA_PID_Fwd.C:848
 pA_PID_Fwd.C:849
 pA_PID_Fwd.C:850
 pA_PID_Fwd.C:851
 pA_PID_Fwd.C:852
 pA_PID_Fwd.C:853
 pA_PID_Fwd.C:854
 pA_PID_Fwd.C:855
 pA_PID_Fwd.C:856
 pA_PID_Fwd.C:857
 pA_PID_Fwd.C:858
 pA_PID_Fwd.C:859
 pA_PID_Fwd.C:860
 pA_PID_Fwd.C:861
 pA_PID_Fwd.C:862
 pA_PID_Fwd.C:863
 pA_PID_Fwd.C:864
 pA_PID_Fwd.C:865
 pA_PID_Fwd.C:866
 pA_PID_Fwd.C:867
 pA_PID_Fwd.C:868
 pA_PID_Fwd.C:869
 pA_PID_Fwd.C:870
 pA_PID_Fwd.C:871
 pA_PID_Fwd.C:872
 pA_PID_Fwd.C:873
 pA_PID_Fwd.C:874
 pA_PID_Fwd.C:875
 pA_PID_Fwd.C:876
 pA_PID_Fwd.C:877
 pA_PID_Fwd.C:878
 pA_PID_Fwd.C:879
 pA_PID_Fwd.C:880
 pA_PID_Fwd.C:881
 pA_PID_Fwd.C:882
 pA_PID_Fwd.C:883
 pA_PID_Fwd.C:884
 pA_PID_Fwd.C:885
 pA_PID_Fwd.C:886
 pA_PID_Fwd.C:887
 pA_PID_Fwd.C:888
 pA_PID_Fwd.C:889
 pA_PID_Fwd.C:890
 pA_PID_Fwd.C:891
 pA_PID_Fwd.C:892
 pA_PID_Fwd.C:893
 pA_PID_Fwd.C:894
 pA_PID_Fwd.C:895
 pA_PID_Fwd.C:896
 pA_PID_Fwd.C:897
 pA_PID_Fwd.C:898
 pA_PID_Fwd.C:899
 pA_PID_Fwd.C:900
 pA_PID_Fwd.C:901
 pA_PID_Fwd.C:902
 pA_PID_Fwd.C:903
 pA_PID_Fwd.C:904
 pA_PID_Fwd.C:905
 pA_PID_Fwd.C:906
 pA_PID_Fwd.C:907
 pA_PID_Fwd.C:908
 pA_PID_Fwd.C:909
 pA_PID_Fwd.C:910
 pA_PID_Fwd.C:911
 pA_PID_Fwd.C:912
 pA_PID_Fwd.C:913
 pA_PID_Fwd.C:914
 pA_PID_Fwd.C:915
 pA_PID_Fwd.C:916
 pA_PID_Fwd.C:917
 pA_PID_Fwd.C:918
 pA_PID_Fwd.C:919
 pA_PID_Fwd.C:920
 pA_PID_Fwd.C:921
 pA_PID_Fwd.C:922
 pA_PID_Fwd.C:923
 pA_PID_Fwd.C:924
 pA_PID_Fwd.C:925
 pA_PID_Fwd.C:926
 pA_PID_Fwd.C:927
 pA_PID_Fwd.C:928
 pA_PID_Fwd.C:929
 pA_PID_Fwd.C:930
 pA_PID_Fwd.C:931
 pA_PID_Fwd.C:932
 pA_PID_Fwd.C:933
 pA_PID_Fwd.C:934
 pA_PID_Fwd.C:935
 pA_PID_Fwd.C:936
 pA_PID_Fwd.C:937
 pA_PID_Fwd.C:938
 pA_PID_Fwd.C:939
 pA_PID_Fwd.C:940
 pA_PID_Fwd.C:941
 pA_PID_Fwd.C:942
 pA_PID_Fwd.C:943
 pA_PID_Fwd.C:944
 pA_PID_Fwd.C:945
 pA_PID_Fwd.C:946
 pA_PID_Fwd.C:947
 pA_PID_Fwd.C:948
 pA_PID_Fwd.C:949
 pA_PID_Fwd.C:950
 pA_PID_Fwd.C:951
 pA_PID_Fwd.C:952
 pA_PID_Fwd.C:953
 pA_PID_Fwd.C:954
 pA_PID_Fwd.C:955
 pA_PID_Fwd.C:956
 pA_PID_Fwd.C:957
 pA_PID_Fwd.C:958
 pA_PID_Fwd.C:959
 pA_PID_Fwd.C:960
 pA_PID_Fwd.C:961
 pA_PID_Fwd.C:962
 pA_PID_Fwd.C:963
 pA_PID_Fwd.C:964
 pA_PID_Fwd.C:965
 pA_PID_Fwd.C:966
 pA_PID_Fwd.C:967
 pA_PID_Fwd.C:968
 pA_PID_Fwd.C:969
 pA_PID_Fwd.C:970
 pA_PID_Fwd.C:971
 pA_PID_Fwd.C:972
 pA_PID_Fwd.C:973
 pA_PID_Fwd.C:974
 pA_PID_Fwd.C:975
 pA_PID_Fwd.C:976
 pA_PID_Fwd.C:977
 pA_PID_Fwd.C:978
 pA_PID_Fwd.C:979
 pA_PID_Fwd.C:980
 pA_PID_Fwd.C:981
 pA_PID_Fwd.C:982
 pA_PID_Fwd.C:983
 pA_PID_Fwd.C:984
 pA_PID_Fwd.C:985
 pA_PID_Fwd.C:986
 pA_PID_Fwd.C:987
 pA_PID_Fwd.C:988
 pA_PID_Fwd.C:989
 pA_PID_Fwd.C:990
 pA_PID_Fwd.C:991
 pA_PID_Fwd.C:992
 pA_PID_Fwd.C:993
 pA_PID_Fwd.C:994
 pA_PID_Fwd.C:995
 pA_PID_Fwd.C:996
 pA_PID_Fwd.C:997
 pA_PID_Fwd.C:998
 pA_PID_Fwd.C:999
 pA_PID_Fwd.C:1000
 pA_PID_Fwd.C:1001
 pA_PID_Fwd.C:1002
 pA_PID_Fwd.C:1003
 pA_PID_Fwd.C:1004
 pA_PID_Fwd.C:1005
 pA_PID_Fwd.C:1006
 pA_PID_Fwd.C:1007
 pA_PID_Fwd.C:1008
 pA_PID_Fwd.C:1009
 pA_PID_Fwd.C:1010
 pA_PID_Fwd.C:1011
 pA_PID_Fwd.C:1012
 pA_PID_Fwd.C:1013
 pA_PID_Fwd.C:1014
 pA_PID_Fwd.C:1015
 pA_PID_Fwd.C:1016
 pA_PID_Fwd.C:1017
 pA_PID_Fwd.C:1018
 pA_PID_Fwd.C:1019
 pA_PID_Fwd.C:1020
 pA_PID_Fwd.C:1021
 pA_PID_Fwd.C:1022
 pA_PID_Fwd.C:1023
 pA_PID_Fwd.C:1024
 pA_PID_Fwd.C:1025
 pA_PID_Fwd.C:1026
 pA_PID_Fwd.C:1027
 pA_PID_Fwd.C:1028
 pA_PID_Fwd.C:1029
 pA_PID_Fwd.C:1030
 pA_PID_Fwd.C:1031
 pA_PID_Fwd.C:1032
 pA_PID_Fwd.C:1033
 pA_PID_Fwd.C:1034
 pA_PID_Fwd.C:1035
 pA_PID_Fwd.C:1036
 pA_PID_Fwd.C:1037
 pA_PID_Fwd.C:1038
 pA_PID_Fwd.C:1039
 pA_PID_Fwd.C:1040
 pA_PID_Fwd.C:1041
 pA_PID_Fwd.C:1042
 pA_PID_Fwd.C:1043
 pA_PID_Fwd.C:1044
 pA_PID_Fwd.C:1045
 pA_PID_Fwd.C:1046
 pA_PID_Fwd.C:1047
 pA_PID_Fwd.C:1048
 pA_PID_Fwd.C:1049
 pA_PID_Fwd.C:1050
 pA_PID_Fwd.C:1051
 pA_PID_Fwd.C:1052
 pA_PID_Fwd.C:1053
 pA_PID_Fwd.C:1054
 pA_PID_Fwd.C:1055
 pA_PID_Fwd.C:1056
 pA_PID_Fwd.C:1057
 pA_PID_Fwd.C:1058
 pA_PID_Fwd.C:1059
 pA_PID_Fwd.C:1060
 pA_PID_Fwd.C:1061
 pA_PID_Fwd.C:1062
 pA_PID_Fwd.C:1063
 pA_PID_Fwd.C:1064
 pA_PID_Fwd.C:1065
 pA_PID_Fwd.C:1066
 pA_PID_Fwd.C:1067
 pA_PID_Fwd.C:1068
 pA_PID_Fwd.C:1069
 pA_PID_Fwd.C:1070
 pA_PID_Fwd.C:1071
 pA_PID_Fwd.C:1072
 pA_PID_Fwd.C:1073
 pA_PID_Fwd.C:1074
 pA_PID_Fwd.C:1075
 pA_PID_Fwd.C:1076
 pA_PID_Fwd.C:1077
 pA_PID_Fwd.C:1078
 pA_PID_Fwd.C:1079
 pA_PID_Fwd.C:1080
 pA_PID_Fwd.C:1081
 pA_PID_Fwd.C:1082
 pA_PID_Fwd.C:1083
 pA_PID_Fwd.C:1084
 pA_PID_Fwd.C:1085
 pA_PID_Fwd.C:1086
 pA_PID_Fwd.C:1087
 pA_PID_Fwd.C:1088
 pA_PID_Fwd.C:1089
 pA_PID_Fwd.C:1090
 pA_PID_Fwd.C:1091
 pA_PID_Fwd.C:1092
 pA_PID_Fwd.C:1093
 pA_PID_Fwd.C:1094
 pA_PID_Fwd.C:1095
 pA_PID_Fwd.C:1096
 pA_PID_Fwd.C:1097
 pA_PID_Fwd.C:1098
 pA_PID_Fwd.C:1099
 pA_PID_Fwd.C:1100
 pA_PID_Fwd.C:1101
 pA_PID_Fwd.C:1102
 pA_PID_Fwd.C:1103
 pA_PID_Fwd.C:1104
 pA_PID_Fwd.C:1105
 pA_PID_Fwd.C:1106
 pA_PID_Fwd.C:1107
 pA_PID_Fwd.C:1108
 pA_PID_Fwd.C:1109
 pA_PID_Fwd.C:1110
 pA_PID_Fwd.C:1111
 pA_PID_Fwd.C:1112
 pA_PID_Fwd.C:1113
 pA_PID_Fwd.C:1114
 pA_PID_Fwd.C:1115
 pA_PID_Fwd.C:1116
 pA_PID_Fwd.C:1117
 pA_PID_Fwd.C:1118
 pA_PID_Fwd.C:1119
 pA_PID_Fwd.C:1120
 pA_PID_Fwd.C:1121
 pA_PID_Fwd.C:1122
 pA_PID_Fwd.C:1123
 pA_PID_Fwd.C:1124
 pA_PID_Fwd.C:1125
 pA_PID_Fwd.C:1126
 pA_PID_Fwd.C:1127
 pA_PID_Fwd.C:1128
 pA_PID_Fwd.C:1129
 pA_PID_Fwd.C:1130
 pA_PID_Fwd.C:1131
 pA_PID_Fwd.C:1132
 pA_PID_Fwd.C:1133
 pA_PID_Fwd.C:1134
 pA_PID_Fwd.C:1135
 pA_PID_Fwd.C:1136
 pA_PID_Fwd.C:1137
 pA_PID_Fwd.C:1138
 pA_PID_Fwd.C:1139
 pA_PID_Fwd.C:1140
 pA_PID_Fwd.C:1141
 pA_PID_Fwd.C:1142
 pA_PID_Fwd.C:1143
 pA_PID_Fwd.C:1144
 pA_PID_Fwd.C:1145
 pA_PID_Fwd.C:1146
 pA_PID_Fwd.C:1147
 pA_PID_Fwd.C:1148
 pA_PID_Fwd.C:1149
 pA_PID_Fwd.C:1150
 pA_PID_Fwd.C:1151
 pA_PID_Fwd.C:1152
 pA_PID_Fwd.C:1153
 pA_PID_Fwd.C:1154
 pA_PID_Fwd.C:1155
 pA_PID_Fwd.C:1156
 pA_PID_Fwd.C:1157
 pA_PID_Fwd.C:1158
 pA_PID_Fwd.C:1159
 pA_PID_Fwd.C:1160
 pA_PID_Fwd.C:1161
 pA_PID_Fwd.C:1162
 pA_PID_Fwd.C:1163
 pA_PID_Fwd.C:1164
 pA_PID_Fwd.C:1165
 pA_PID_Fwd.C:1166
 pA_PID_Fwd.C:1167
 pA_PID_Fwd.C:1168
 pA_PID_Fwd.C:1169
 pA_PID_Fwd.C:1170
 pA_PID_Fwd.C:1171
 pA_PID_Fwd.C:1172
 pA_PID_Fwd.C:1173
 pA_PID_Fwd.C:1174
 pA_PID_Fwd.C:1175
 pA_PID_Fwd.C:1176
 pA_PID_Fwd.C:1177
 pA_PID_Fwd.C:1178
 pA_PID_Fwd.C:1179
 pA_PID_Fwd.C:1180
 pA_PID_Fwd.C:1181
 pA_PID_Fwd.C:1182
 pA_PID_Fwd.C:1183
 pA_PID_Fwd.C:1184
 pA_PID_Fwd.C:1185
 pA_PID_Fwd.C:1186
 pA_PID_Fwd.C:1187
 pA_PID_Fwd.C:1188
 pA_PID_Fwd.C:1189
 pA_PID_Fwd.C:1190
 pA_PID_Fwd.C:1191
 pA_PID_Fwd.C:1192
 pA_PID_Fwd.C:1193
 pA_PID_Fwd.C:1194
 pA_PID_Fwd.C:1195
 pA_PID_Fwd.C:1196
 pA_PID_Fwd.C:1197
 pA_PID_Fwd.C:1198
 pA_PID_Fwd.C:1199
 pA_PID_Fwd.C:1200
 pA_PID_Fwd.C:1201
 pA_PID_Fwd.C:1202
 pA_PID_Fwd.C:1203
 pA_PID_Fwd.C:1204
 pA_PID_Fwd.C:1205
 pA_PID_Fwd.C:1206
 pA_PID_Fwd.C:1207
 pA_PID_Fwd.C:1208
 pA_PID_Fwd.C:1209
 pA_PID_Fwd.C:1210
 pA_PID_Fwd.C:1211
 pA_PID_Fwd.C:1212
 pA_PID_Fwd.C:1213
 pA_PID_Fwd.C:1214
 pA_PID_Fwd.C:1215
 pA_PID_Fwd.C:1216
 pA_PID_Fwd.C:1217
 pA_PID_Fwd.C:1218
 pA_PID_Fwd.C:1219
 pA_PID_Fwd.C:1220
 pA_PID_Fwd.C:1221
 pA_PID_Fwd.C:1222
 pA_PID_Fwd.C:1223
 pA_PID_Fwd.C:1224
 pA_PID_Fwd.C:1225
 pA_PID_Fwd.C:1226
 pA_PID_Fwd.C:1227
 pA_PID_Fwd.C:1228
 pA_PID_Fwd.C:1229
 pA_PID_Fwd.C:1230
 pA_PID_Fwd.C:1231
 pA_PID_Fwd.C:1232
 pA_PID_Fwd.C:1233
 pA_PID_Fwd.C:1234
 pA_PID_Fwd.C:1235
 pA_PID_Fwd.C:1236
 pA_PID_Fwd.C:1237
 pA_PID_Fwd.C:1238
 pA_PID_Fwd.C:1239
 pA_PID_Fwd.C:1240
 pA_PID_Fwd.C:1241
 pA_PID_Fwd.C:1242
 pA_PID_Fwd.C:1243
 pA_PID_Fwd.C:1244
 pA_PID_Fwd.C:1245
 pA_PID_Fwd.C:1246
 pA_PID_Fwd.C:1247
 pA_PID_Fwd.C:1248
 pA_PID_Fwd.C:1249
 pA_PID_Fwd.C:1250
 pA_PID_Fwd.C:1251
 pA_PID_Fwd.C:1252
 pA_PID_Fwd.C:1253
 pA_PID_Fwd.C:1254
 pA_PID_Fwd.C:1255
 pA_PID_Fwd.C:1256
 pA_PID_Fwd.C:1257
 pA_PID_Fwd.C:1258
 pA_PID_Fwd.C:1259
 pA_PID_Fwd.C:1260
 pA_PID_Fwd.C:1261
 pA_PID_Fwd.C:1262
 pA_PID_Fwd.C:1263
 pA_PID_Fwd.C:1264
 pA_PID_Fwd.C:1265
 pA_PID_Fwd.C:1266
 pA_PID_Fwd.C:1267
 pA_PID_Fwd.C:1268
 pA_PID_Fwd.C:1269
 pA_PID_Fwd.C:1270
 pA_PID_Fwd.C:1271
 pA_PID_Fwd.C:1272
 pA_PID_Fwd.C:1273
 pA_PID_Fwd.C:1274
 pA_PID_Fwd.C:1275
 pA_PID_Fwd.C:1276
 pA_PID_Fwd.C:1277
 pA_PID_Fwd.C:1278
 pA_PID_Fwd.C:1279
 pA_PID_Fwd.C:1280
 pA_PID_Fwd.C:1281
 pA_PID_Fwd.C:1282
 pA_PID_Fwd.C:1283
 pA_PID_Fwd.C:1284
 pA_PID_Fwd.C:1285
 pA_PID_Fwd.C:1286
 pA_PID_Fwd.C:1287
 pA_PID_Fwd.C:1288
 pA_PID_Fwd.C:1289
 pA_PID_Fwd.C:1290
 pA_PID_Fwd.C:1291
 pA_PID_Fwd.C:1292
 pA_PID_Fwd.C:1293
 pA_PID_Fwd.C:1294
 pA_PID_Fwd.C:1295
 pA_PID_Fwd.C:1296
 pA_PID_Fwd.C:1297
 pA_PID_Fwd.C:1298
 pA_PID_Fwd.C:1299
 pA_PID_Fwd.C:1300
 pA_PID_Fwd.C:1301
 pA_PID_Fwd.C:1302
 pA_PID_Fwd.C:1303
 pA_PID_Fwd.C:1304
 pA_PID_Fwd.C:1305
 pA_PID_Fwd.C:1306
 pA_PID_Fwd.C:1307
 pA_PID_Fwd.C:1308
 pA_PID_Fwd.C:1309
 pA_PID_Fwd.C:1310
 pA_PID_Fwd.C:1311
 pA_PID_Fwd.C:1312
 pA_PID_Fwd.C:1313
 pA_PID_Fwd.C:1314
 pA_PID_Fwd.C:1315
 pA_PID_Fwd.C:1316
 pA_PID_Fwd.C:1317
 pA_PID_Fwd.C:1318
 pA_PID_Fwd.C:1319
 pA_PID_Fwd.C:1320
 pA_PID_Fwd.C:1321
 pA_PID_Fwd.C:1322
 pA_PID_Fwd.C:1323
 pA_PID_Fwd.C:1324
 pA_PID_Fwd.C:1325
 pA_PID_Fwd.C:1326
 pA_PID_Fwd.C:1327
 pA_PID_Fwd.C:1328
 pA_PID_Fwd.C:1329
 pA_PID_Fwd.C:1330
 pA_PID_Fwd.C:1331
 pA_PID_Fwd.C:1332
 pA_PID_Fwd.C:1333
 pA_PID_Fwd.C:1334
 pA_PID_Fwd.C:1335
 pA_PID_Fwd.C:1336
 pA_PID_Fwd.C:1337
 pA_PID_Fwd.C:1338
 pA_PID_Fwd.C:1339
 pA_PID_Fwd.C:1340
 pA_PID_Fwd.C:1341
 pA_PID_Fwd.C:1342
 pA_PID_Fwd.C:1343
 pA_PID_Fwd.C:1344
 pA_PID_Fwd.C:1345
 pA_PID_Fwd.C:1346
 pA_PID_Fwd.C:1347
 pA_PID_Fwd.C:1348
 pA_PID_Fwd.C:1349
 pA_PID_Fwd.C:1350
 pA_PID_Fwd.C:1351
 pA_PID_Fwd.C:1352
 pA_PID_Fwd.C:1353
 pA_PID_Fwd.C:1354
 pA_PID_Fwd.C:1355
 pA_PID_Fwd.C:1356
 pA_PID_Fwd.C:1357
 pA_PID_Fwd.C:1358
 pA_PID_Fwd.C:1359
 pA_PID_Fwd.C:1360
 pA_PID_Fwd.C:1361
 pA_PID_Fwd.C:1362
 pA_PID_Fwd.C:1363
 pA_PID_Fwd.C:1364
 pA_PID_Fwd.C:1365
 pA_PID_Fwd.C:1366
 pA_PID_Fwd.C:1367
 pA_PID_Fwd.C:1368
 pA_PID_Fwd.C:1369
 pA_PID_Fwd.C:1370
 pA_PID_Fwd.C:1371
 pA_PID_Fwd.C:1372
 pA_PID_Fwd.C:1373
 pA_PID_Fwd.C:1374
 pA_PID_Fwd.C:1375
 pA_PID_Fwd.C:1376
 pA_PID_Fwd.C:1377
 pA_PID_Fwd.C:1378
 pA_PID_Fwd.C:1379
 pA_PID_Fwd.C:1380
 pA_PID_Fwd.C:1381
 pA_PID_Fwd.C:1382
 pA_PID_Fwd.C:1383
 pA_PID_Fwd.C:1384
 pA_PID_Fwd.C:1385
 pA_PID_Fwd.C:1386
 pA_PID_Fwd.C:1387
 pA_PID_Fwd.C:1388
 pA_PID_Fwd.C:1389
 pA_PID_Fwd.C:1390
 pA_PID_Fwd.C:1391
 pA_PID_Fwd.C:1392
 pA_PID_Fwd.C:1393
 pA_PID_Fwd.C:1394
 pA_PID_Fwd.C:1395
 pA_PID_Fwd.C:1396
 pA_PID_Fwd.C:1397
 pA_PID_Fwd.C:1398
 pA_PID_Fwd.C:1399
 pA_PID_Fwd.C:1400
 pA_PID_Fwd.C:1401
 pA_PID_Fwd.C:1402
 pA_PID_Fwd.C:1403
 pA_PID_Fwd.C:1404
 pA_PID_Fwd.C:1405
 pA_PID_Fwd.C:1406
 pA_PID_Fwd.C:1407
 pA_PID_Fwd.C:1408
 pA_PID_Fwd.C:1409
 pA_PID_Fwd.C:1410
 pA_PID_Fwd.C:1411
 pA_PID_Fwd.C:1412
 pA_PID_Fwd.C:1413
 pA_PID_Fwd.C:1414
 pA_PID_Fwd.C:1415
 pA_PID_Fwd.C:1416
 pA_PID_Fwd.C:1417
 pA_PID_Fwd.C:1418
 pA_PID_Fwd.C:1419
 pA_PID_Fwd.C:1420
 pA_PID_Fwd.C:1421
 pA_PID_Fwd.C:1422
 pA_PID_Fwd.C:1423
 pA_PID_Fwd.C:1424
 pA_PID_Fwd.C:1425
 pA_PID_Fwd.C:1426
 pA_PID_Fwd.C:1427
 pA_PID_Fwd.C:1428
 pA_PID_Fwd.C:1429
 pA_PID_Fwd.C:1430
 pA_PID_Fwd.C:1431
 pA_PID_Fwd.C:1432
 pA_PID_Fwd.C:1433
 pA_PID_Fwd.C:1434
 pA_PID_Fwd.C:1435
 pA_PID_Fwd.C:1436
 pA_PID_Fwd.C:1437
 pA_PID_Fwd.C:1438
 pA_PID_Fwd.C:1439
 pA_PID_Fwd.C:1440
 pA_PID_Fwd.C:1441
 pA_PID_Fwd.C:1442
 pA_PID_Fwd.C:1443
 pA_PID_Fwd.C:1444
 pA_PID_Fwd.C:1445
 pA_PID_Fwd.C:1446
 pA_PID_Fwd.C:1447
 pA_PID_Fwd.C:1448
 pA_PID_Fwd.C:1449
 pA_PID_Fwd.C:1450
 pA_PID_Fwd.C:1451
 pA_PID_Fwd.C:1452
 pA_PID_Fwd.C:1453
 pA_PID_Fwd.C:1454
 pA_PID_Fwd.C:1455
 pA_PID_Fwd.C:1456
 pA_PID_Fwd.C:1457
 pA_PID_Fwd.C:1458
 pA_PID_Fwd.C:1459
 pA_PID_Fwd.C:1460
 pA_PID_Fwd.C:1461
 pA_PID_Fwd.C:1462
 pA_PID_Fwd.C:1463
 pA_PID_Fwd.C:1464
 pA_PID_Fwd.C:1465
 pA_PID_Fwd.C:1466
 pA_PID_Fwd.C:1467
 pA_PID_Fwd.C:1468
 pA_PID_Fwd.C:1469
 pA_PID_Fwd.C:1470
 pA_PID_Fwd.C:1471
 pA_PID_Fwd.C:1472
 pA_PID_Fwd.C:1473
 pA_PID_Fwd.C:1474
 pA_PID_Fwd.C:1475
 pA_PID_Fwd.C:1476
 pA_PID_Fwd.C:1477
 pA_PID_Fwd.C:1478
 pA_PID_Fwd.C:1479
 pA_PID_Fwd.C:1480
 pA_PID_Fwd.C:1481
 pA_PID_Fwd.C:1482
 pA_PID_Fwd.C:1483
 pA_PID_Fwd.C:1484
 pA_PID_Fwd.C:1485
 pA_PID_Fwd.C:1486
 pA_PID_Fwd.C:1487
 pA_PID_Fwd.C:1488
 pA_PID_Fwd.C:1489
 pA_PID_Fwd.C:1490
 pA_PID_Fwd.C:1491
 pA_PID_Fwd.C:1492
 pA_PID_Fwd.C:1493
 pA_PID_Fwd.C:1494
 pA_PID_Fwd.C:1495
 pA_PID_Fwd.C:1496
 pA_PID_Fwd.C:1497
 pA_PID_Fwd.C:1498
 pA_PID_Fwd.C:1499
 pA_PID_Fwd.C:1500
 pA_PID_Fwd.C:1501
 pA_PID_Fwd.C:1502
 pA_PID_Fwd.C:1503
 pA_PID_Fwd.C:1504
 pA_PID_Fwd.C:1505
 pA_PID_Fwd.C:1506
 pA_PID_Fwd.C:1507
 pA_PID_Fwd.C:1508
 pA_PID_Fwd.C:1509
 pA_PID_Fwd.C:1510
 pA_PID_Fwd.C:1511
 pA_PID_Fwd.C:1512
 pA_PID_Fwd.C:1513
 pA_PID_Fwd.C:1514
 pA_PID_Fwd.C:1515
 pA_PID_Fwd.C:1516
 pA_PID_Fwd.C:1517
 pA_PID_Fwd.C:1518
 pA_PID_Fwd.C:1519
 pA_PID_Fwd.C:1520
 pA_PID_Fwd.C:1521
 pA_PID_Fwd.C:1522
 pA_PID_Fwd.C:1523
 pA_PID_Fwd.C:1524
 pA_PID_Fwd.C:1525
 pA_PID_Fwd.C:1526
 pA_PID_Fwd.C:1527
 pA_PID_Fwd.C:1528
 pA_PID_Fwd.C:1529
 pA_PID_Fwd.C:1530
 pA_PID_Fwd.C:1531
 pA_PID_Fwd.C:1532
 pA_PID_Fwd.C:1533
 pA_PID_Fwd.C:1534
 pA_PID_Fwd.C:1535
 pA_PID_Fwd.C:1536
 pA_PID_Fwd.C:1537
 pA_PID_Fwd.C:1538
 pA_PID_Fwd.C:1539
 pA_PID_Fwd.C:1540
 pA_PID_Fwd.C:1541
 pA_PID_Fwd.C:1542
 pA_PID_Fwd.C:1543
 pA_PID_Fwd.C:1544
 pA_PID_Fwd.C:1545
 pA_PID_Fwd.C:1546
 pA_PID_Fwd.C:1547
 pA_PID_Fwd.C:1548
 pA_PID_Fwd.C:1549
 pA_PID_Fwd.C:1550
 pA_PID_Fwd.C:1551
 pA_PID_Fwd.C:1552
 pA_PID_Fwd.C:1553
 pA_PID_Fwd.C:1554
 pA_PID_Fwd.C:1555
 pA_PID_Fwd.C:1556
 pA_PID_Fwd.C:1557
 pA_PID_Fwd.C:1558
 pA_PID_Fwd.C:1559
 pA_PID_Fwd.C:1560
 pA_PID_Fwd.C:1561
 pA_PID_Fwd.C:1562
 pA_PID_Fwd.C:1563
 pA_PID_Fwd.C:1564
 pA_PID_Fwd.C:1565
 pA_PID_Fwd.C:1566
 pA_PID_Fwd.C:1567
 pA_PID_Fwd.C:1568
 pA_PID_Fwd.C:1569
 pA_PID_Fwd.C:1570
 pA_PID_Fwd.C:1571
 pA_PID_Fwd.C:1572
 pA_PID_Fwd.C:1573
 pA_PID_Fwd.C:1574
 pA_PID_Fwd.C:1575
 pA_PID_Fwd.C:1576
 pA_PID_Fwd.C:1577
 pA_PID_Fwd.C:1578
 pA_PID_Fwd.C:1579
 pA_PID_Fwd.C:1580
 pA_PID_Fwd.C:1581
 pA_PID_Fwd.C:1582
 pA_PID_Fwd.C:1583
 pA_PID_Fwd.C:1584
 pA_PID_Fwd.C:1585
 pA_PID_Fwd.C:1586
 pA_PID_Fwd.C:1587
 pA_PID_Fwd.C:1588
 pA_PID_Fwd.C:1589
 pA_PID_Fwd.C:1590
 pA_PID_Fwd.C:1591
 pA_PID_Fwd.C:1592
 pA_PID_Fwd.C:1593
 pA_PID_Fwd.C:1594
 pA_PID_Fwd.C:1595
 pA_PID_Fwd.C:1596
 pA_PID_Fwd.C:1597
 pA_PID_Fwd.C:1598
 pA_PID_Fwd.C:1599
 pA_PID_Fwd.C:1600
 pA_PID_Fwd.C:1601
 pA_PID_Fwd.C:1602
 pA_PID_Fwd.C:1603
 pA_PID_Fwd.C:1604
 pA_PID_Fwd.C:1605
 pA_PID_Fwd.C:1606
 pA_PID_Fwd.C:1607
 pA_PID_Fwd.C:1608
 pA_PID_Fwd.C:1609
 pA_PID_Fwd.C:1610
 pA_PID_Fwd.C:1611
 pA_PID_Fwd.C:1612
 pA_PID_Fwd.C:1613
 pA_PID_Fwd.C:1614
 pA_PID_Fwd.C:1615
 pA_PID_Fwd.C:1616
 pA_PID_Fwd.C:1617
 pA_PID_Fwd.C:1618
 pA_PID_Fwd.C:1619
 pA_PID_Fwd.C:1620
 pA_PID_Fwd.C:1621
 pA_PID_Fwd.C:1622
 pA_PID_Fwd.C:1623
 pA_PID_Fwd.C:1624
 pA_PID_Fwd.C:1625
 pA_PID_Fwd.C:1626
 pA_PID_Fwd.C:1627
 pA_PID_Fwd.C:1628
 pA_PID_Fwd.C:1629
 pA_PID_Fwd.C:1630
 pA_PID_Fwd.C:1631
 pA_PID_Fwd.C:1632
 pA_PID_Fwd.C:1633
 pA_PID_Fwd.C:1634
 pA_PID_Fwd.C:1635
 pA_PID_Fwd.C:1636
 pA_PID_Fwd.C:1637
 pA_PID_Fwd.C:1638
 pA_PID_Fwd.C:1639
 pA_PID_Fwd.C:1640
 pA_PID_Fwd.C:1641
 pA_PID_Fwd.C:1642
 pA_PID_Fwd.C:1643
 pA_PID_Fwd.C:1644
 pA_PID_Fwd.C:1645
 pA_PID_Fwd.C:1646
 pA_PID_Fwd.C:1647
 pA_PID_Fwd.C:1648
 pA_PID_Fwd.C:1649
 pA_PID_Fwd.C:1650
 pA_PID_Fwd.C:1651
 pA_PID_Fwd.C:1652
 pA_PID_Fwd.C:1653
 pA_PID_Fwd.C:1654
 pA_PID_Fwd.C:1655
 pA_PID_Fwd.C:1656
 pA_PID_Fwd.C:1657
 pA_PID_Fwd.C:1658
 pA_PID_Fwd.C:1659
 pA_PID_Fwd.C:1660
 pA_PID_Fwd.C:1661
 pA_PID_Fwd.C:1662
 pA_PID_Fwd.C:1663
 pA_PID_Fwd.C:1664
 pA_PID_Fwd.C:1665
 pA_PID_Fwd.C:1666
 pA_PID_Fwd.C:1667
 pA_PID_Fwd.C:1668
 pA_PID_Fwd.C:1669
 pA_PID_Fwd.C:1670
 pA_PID_Fwd.C:1671
 pA_PID_Fwd.C:1672
 pA_PID_Fwd.C:1673
 pA_PID_Fwd.C:1674
 pA_PID_Fwd.C:1675
 pA_PID_Fwd.C:1676
 pA_PID_Fwd.C:1677
 pA_PID_Fwd.C:1678
 pA_PID_Fwd.C:1679
 pA_PID_Fwd.C:1680
 pA_PID_Fwd.C:1681
 pA_PID_Fwd.C:1682
 pA_PID_Fwd.C:1683
 pA_PID_Fwd.C:1684
 pA_PID_Fwd.C:1685
 pA_PID_Fwd.C:1686
 pA_PID_Fwd.C:1687
 pA_PID_Fwd.C:1688
 pA_PID_Fwd.C:1689
 pA_PID_Fwd.C:1690
 pA_PID_Fwd.C:1691
 pA_PID_Fwd.C:1692
 pA_PID_Fwd.C:1693
 pA_PID_Fwd.C:1694
 pA_PID_Fwd.C:1695
 pA_PID_Fwd.C:1696
 pA_PID_Fwd.C:1697
 pA_PID_Fwd.C:1698
 pA_PID_Fwd.C:1699
 pA_PID_Fwd.C:1700
 pA_PID_Fwd.C:1701
 pA_PID_Fwd.C:1702
 pA_PID_Fwd.C:1703
 pA_PID_Fwd.C:1704
 pA_PID_Fwd.C:1705
 pA_PID_Fwd.C:1706
 pA_PID_Fwd.C:1707
 pA_PID_Fwd.C:1708
 pA_PID_Fwd.C:1709
 pA_PID_Fwd.C:1710
 pA_PID_Fwd.C:1711
 pA_PID_Fwd.C:1712
 pA_PID_Fwd.C:1713
 pA_PID_Fwd.C:1714
 pA_PID_Fwd.C:1715
 pA_PID_Fwd.C:1716
 pA_PID_Fwd.C:1717
 pA_PID_Fwd.C:1718
 pA_PID_Fwd.C:1719
 pA_PID_Fwd.C:1720
 pA_PID_Fwd.C:1721
 pA_PID_Fwd.C:1722
 pA_PID_Fwd.C:1723
 pA_PID_Fwd.C:1724
 pA_PID_Fwd.C:1725
 pA_PID_Fwd.C:1726
 pA_PID_Fwd.C:1727
 pA_PID_Fwd.C:1728
 pA_PID_Fwd.C:1729
 pA_PID_Fwd.C:1730
 pA_PID_Fwd.C:1731
 pA_PID_Fwd.C:1732
 pA_PID_Fwd.C:1733
 pA_PID_Fwd.C:1734
 pA_PID_Fwd.C:1735
 pA_PID_Fwd.C:1736
 pA_PID_Fwd.C:1737
 pA_PID_Fwd.C:1738
 pA_PID_Fwd.C:1739
 pA_PID_Fwd.C:1740
 pA_PID_Fwd.C:1741
 pA_PID_Fwd.C:1742
 pA_PID_Fwd.C:1743
 pA_PID_Fwd.C:1744
 pA_PID_Fwd.C:1745
 pA_PID_Fwd.C:1746
 pA_PID_Fwd.C:1747
 pA_PID_Fwd.C:1748
 pA_PID_Fwd.C:1749
 pA_PID_Fwd.C:1750
 pA_PID_Fwd.C:1751
 pA_PID_Fwd.C:1752
 pA_PID_Fwd.C:1753
 pA_PID_Fwd.C:1754
 pA_PID_Fwd.C:1755
 pA_PID_Fwd.C:1756
 pA_PID_Fwd.C:1757
 pA_PID_Fwd.C:1758
 pA_PID_Fwd.C:1759
 pA_PID_Fwd.C:1760
 pA_PID_Fwd.C:1761
 pA_PID_Fwd.C:1762
 pA_PID_Fwd.C:1763
 pA_PID_Fwd.C:1764
 pA_PID_Fwd.C:1765
 pA_PID_Fwd.C:1766
 pA_PID_Fwd.C:1767
 pA_PID_Fwd.C:1768
 pA_PID_Fwd.C:1769
 pA_PID_Fwd.C:1770
 pA_PID_Fwd.C:1771
 pA_PID_Fwd.C:1772
 pA_PID_Fwd.C:1773
 pA_PID_Fwd.C:1774
 pA_PID_Fwd.C:1775
 pA_PID_Fwd.C:1776
 pA_PID_Fwd.C:1777
 pA_PID_Fwd.C:1778
 pA_PID_Fwd.C:1779
 pA_PID_Fwd.C:1780
 pA_PID_Fwd.C:1781
 pA_PID_Fwd.C:1782
 pA_PID_Fwd.C:1783
 pA_PID_Fwd.C:1784
 pA_PID_Fwd.C:1785
 pA_PID_Fwd.C:1786
 pA_PID_Fwd.C:1787
 pA_PID_Fwd.C:1788
 pA_PID_Fwd.C:1789
 pA_PID_Fwd.C:1790
 pA_PID_Fwd.C:1791
 pA_PID_Fwd.C:1792
 pA_PID_Fwd.C:1793
 pA_PID_Fwd.C:1794
 pA_PID_Fwd.C:1795
 pA_PID_Fwd.C:1796
 pA_PID_Fwd.C:1797
 pA_PID_Fwd.C:1798
 pA_PID_Fwd.C:1799
 pA_PID_Fwd.C:1800
 pA_PID_Fwd.C:1801
 pA_PID_Fwd.C:1802
 pA_PID_Fwd.C:1803
 pA_PID_Fwd.C:1804
 pA_PID_Fwd.C:1805
 pA_PID_Fwd.C:1806
 pA_PID_Fwd.C:1807
 pA_PID_Fwd.C:1808
 pA_PID_Fwd.C:1809
 pA_PID_Fwd.C:1810
 pA_PID_Fwd.C:1811
 pA_PID_Fwd.C:1812
 pA_PID_Fwd.C:1813
 pA_PID_Fwd.C:1814
 pA_PID_Fwd.C:1815
 pA_PID_Fwd.C:1816
 pA_PID_Fwd.C:1817
 pA_PID_Fwd.C:1818
 pA_PID_Fwd.C:1819
 pA_PID_Fwd.C:1820
 pA_PID_Fwd.C:1821
 pA_PID_Fwd.C:1822
 pA_PID_Fwd.C:1823
 pA_PID_Fwd.C:1824
 pA_PID_Fwd.C:1825
 pA_PID_Fwd.C:1826
 pA_PID_Fwd.C:1827
 pA_PID_Fwd.C:1828
 pA_PID_Fwd.C:1829
 pA_PID_Fwd.C:1830
 pA_PID_Fwd.C:1831
 pA_PID_Fwd.C:1832
 pA_PID_Fwd.C:1833
 pA_PID_Fwd.C:1834
 pA_PID_Fwd.C:1835
 pA_PID_Fwd.C:1836
 pA_PID_Fwd.C:1837
 pA_PID_Fwd.C:1838
 pA_PID_Fwd.C:1839
 pA_PID_Fwd.C:1840
 pA_PID_Fwd.C:1841
 pA_PID_Fwd.C:1842
 pA_PID_Fwd.C:1843
 pA_PID_Fwd.C:1844
 pA_PID_Fwd.C:1845
 pA_PID_Fwd.C:1846
 pA_PID_Fwd.C:1847
 pA_PID_Fwd.C:1848
 pA_PID_Fwd.C:1849
 pA_PID_Fwd.C:1850
 pA_PID_Fwd.C:1851
 pA_PID_Fwd.C:1852
 pA_PID_Fwd.C:1853
 pA_PID_Fwd.C:1854
 pA_PID_Fwd.C:1855
 pA_PID_Fwd.C:1856
 pA_PID_Fwd.C:1857
 pA_PID_Fwd.C:1858
 pA_PID_Fwd.C:1859
 pA_PID_Fwd.C:1860
 pA_PID_Fwd.C:1861
 pA_PID_Fwd.C:1862
 pA_PID_Fwd.C:1863
 pA_PID_Fwd.C:1864
 pA_PID_Fwd.C:1865
 pA_PID_Fwd.C:1866
 pA_PID_Fwd.C:1867
 pA_PID_Fwd.C:1868
 pA_PID_Fwd.C:1869
 pA_PID_Fwd.C:1870
 pA_PID_Fwd.C:1871
 pA_PID_Fwd.C:1872
 pA_PID_Fwd.C:1873
 pA_PID_Fwd.C:1874
 pA_PID_Fwd.C:1875
 pA_PID_Fwd.C:1876
 pA_PID_Fwd.C:1877
 pA_PID_Fwd.C:1878
 pA_PID_Fwd.C:1879
 pA_PID_Fwd.C:1880
 pA_PID_Fwd.C:1881
 pA_PID_Fwd.C:1882
 pA_PID_Fwd.C:1883
 pA_PID_Fwd.C:1884
 pA_PID_Fwd.C:1885
 pA_PID_Fwd.C:1886
 pA_PID_Fwd.C:1887
 pA_PID_Fwd.C:1888
 pA_PID_Fwd.C:1889
 pA_PID_Fwd.C:1890
 pA_PID_Fwd.C:1891
 pA_PID_Fwd.C:1892
 pA_PID_Fwd.C:1893
 pA_PID_Fwd.C:1894
 pA_PID_Fwd.C:1895
 pA_PID_Fwd.C:1896
 pA_PID_Fwd.C:1897
 pA_PID_Fwd.C:1898
 pA_PID_Fwd.C:1899
 pA_PID_Fwd.C:1900
 pA_PID_Fwd.C:1901
 pA_PID_Fwd.C:1902
 pA_PID_Fwd.C:1903
 pA_PID_Fwd.C:1904
 pA_PID_Fwd.C:1905
 pA_PID_Fwd.C:1906
 pA_PID_Fwd.C:1907
 pA_PID_Fwd.C:1908
 pA_PID_Fwd.C:1909
 pA_PID_Fwd.C:1910
 pA_PID_Fwd.C:1911
 pA_PID_Fwd.C:1912
 pA_PID_Fwd.C:1913
 pA_PID_Fwd.C:1914
 pA_PID_Fwd.C:1915
 pA_PID_Fwd.C:1916
 pA_PID_Fwd.C:1917
 pA_PID_Fwd.C:1918
 pA_PID_Fwd.C:1919
 pA_PID_Fwd.C:1920
 pA_PID_Fwd.C:1921
 pA_PID_Fwd.C:1922
 pA_PID_Fwd.C:1923
 pA_PID_Fwd.C:1924
 pA_PID_Fwd.C:1925
 pA_PID_Fwd.C:1926
 pA_PID_Fwd.C:1927
 pA_PID_Fwd.C:1928
 pA_PID_Fwd.C:1929
 pA_PID_Fwd.C:1930
 pA_PID_Fwd.C:1931
 pA_PID_Fwd.C:1932
 pA_PID_Fwd.C:1933
 pA_PID_Fwd.C:1934
 pA_PID_Fwd.C:1935
 pA_PID_Fwd.C:1936
 pA_PID_Fwd.C:1937
 pA_PID_Fwd.C:1938
 pA_PID_Fwd.C:1939
 pA_PID_Fwd.C:1940
 pA_PID_Fwd.C:1941
 pA_PID_Fwd.C:1942
 pA_PID_Fwd.C:1943
 pA_PID_Fwd.C:1944
 pA_PID_Fwd.C:1945
 pA_PID_Fwd.C:1946
 pA_PID_Fwd.C:1947
 pA_PID_Fwd.C:1948
 pA_PID_Fwd.C:1949
 pA_PID_Fwd.C:1950
 pA_PID_Fwd.C:1951
 pA_PID_Fwd.C:1952
 pA_PID_Fwd.C:1953
 pA_PID_Fwd.C:1954
 pA_PID_Fwd.C:1955
 pA_PID_Fwd.C:1956
 pA_PID_Fwd.C:1957
 pA_PID_Fwd.C:1958
 pA_PID_Fwd.C:1959
 pA_PID_Fwd.C:1960
 pA_PID_Fwd.C:1961
 pA_PID_Fwd.C:1962
 pA_PID_Fwd.C:1963
 pA_PID_Fwd.C:1964
 pA_PID_Fwd.C:1965
 pA_PID_Fwd.C:1966
 pA_PID_Fwd.C:1967
 pA_PID_Fwd.C:1968
 pA_PID_Fwd.C:1969
 pA_PID_Fwd.C:1970
 pA_PID_Fwd.C:1971
 pA_PID_Fwd.C:1972
 pA_PID_Fwd.C:1973
 pA_PID_Fwd.C:1974
 pA_PID_Fwd.C:1975
 pA_PID_Fwd.C:1976
 pA_PID_Fwd.C:1977
 pA_PID_Fwd.C:1978
 pA_PID_Fwd.C:1979
 pA_PID_Fwd.C:1980
 pA_PID_Fwd.C:1981
 pA_PID_Fwd.C:1982
 pA_PID_Fwd.C:1983
 pA_PID_Fwd.C:1984
 pA_PID_Fwd.C:1985
 pA_PID_Fwd.C:1986
 pA_PID_Fwd.C:1987
 pA_PID_Fwd.C:1988
 pA_PID_Fwd.C:1989
 pA_PID_Fwd.C:1990
 pA_PID_Fwd.C:1991
 pA_PID_Fwd.C:1992
 pA_PID_Fwd.C:1993
 pA_PID_Fwd.C:1994
 pA_PID_Fwd.C:1995
 pA_PID_Fwd.C:1996
 pA_PID_Fwd.C:1997
 pA_PID_Fwd.C:1998
 pA_PID_Fwd.C:1999
 pA_PID_Fwd.C:2000
 pA_PID_Fwd.C:2001
 pA_PID_Fwd.C:2002
 pA_PID_Fwd.C:2003
 pA_PID_Fwd.C:2004
 pA_PID_Fwd.C:2005
 pA_PID_Fwd.C:2006
 pA_PID_Fwd.C:2007
 pA_PID_Fwd.C:2008
 pA_PID_Fwd.C:2009
 pA_PID_Fwd.C:2010
 pA_PID_Fwd.C:2011
 pA_PID_Fwd.C:2012
 pA_PID_Fwd.C:2013
 pA_PID_Fwd.C:2014
 pA_PID_Fwd.C:2015
 pA_PID_Fwd.C:2016
 pA_PID_Fwd.C:2017
 pA_PID_Fwd.C:2018
 pA_PID_Fwd.C:2019
 pA_PID_Fwd.C:2020
 pA_PID_Fwd.C:2021
 pA_PID_Fwd.C:2022
 pA_PID_Fwd.C:2023
 pA_PID_Fwd.C:2024
 pA_PID_Fwd.C:2025
 pA_PID_Fwd.C:2026
 pA_PID_Fwd.C:2027
 pA_PID_Fwd.C:2028
 pA_PID_Fwd.C:2029
 pA_PID_Fwd.C:2030
 pA_PID_Fwd.C:2031
 pA_PID_Fwd.C:2032
 pA_PID_Fwd.C:2033
 pA_PID_Fwd.C:2034
 pA_PID_Fwd.C:2035
 pA_PID_Fwd.C:2036
 pA_PID_Fwd.C:2037
 pA_PID_Fwd.C:2038
 pA_PID_Fwd.C:2039
 pA_PID_Fwd.C:2040
 pA_PID_Fwd.C:2041
 pA_PID_Fwd.C:2042
 pA_PID_Fwd.C:2043
 pA_PID_Fwd.C:2044
 pA_PID_Fwd.C:2045
 pA_PID_Fwd.C:2046
 pA_PID_Fwd.C:2047
 pA_PID_Fwd.C:2048
 pA_PID_Fwd.C:2049
 pA_PID_Fwd.C:2050
 pA_PID_Fwd.C:2051
 pA_PID_Fwd.C:2052
 pA_PID_Fwd.C:2053
 pA_PID_Fwd.C:2054
 pA_PID_Fwd.C:2055
 pA_PID_Fwd.C:2056
 pA_PID_Fwd.C:2057
 pA_PID_Fwd.C:2058
 pA_PID_Fwd.C:2059
 pA_PID_Fwd.C:2060
 pA_PID_Fwd.C:2061
 pA_PID_Fwd.C:2062
 pA_PID_Fwd.C:2063
 pA_PID_Fwd.C:2064
 pA_PID_Fwd.C:2065
 pA_PID_Fwd.C:2066
 pA_PID_Fwd.C:2067
 pA_PID_Fwd.C:2068
 pA_PID_Fwd.C:2069
 pA_PID_Fwd.C:2070
 pA_PID_Fwd.C:2071
 pA_PID_Fwd.C:2072
 pA_PID_Fwd.C:2073
 pA_PID_Fwd.C:2074
 pA_PID_Fwd.C:2075
 pA_PID_Fwd.C:2076
 pA_PID_Fwd.C:2077
 pA_PID_Fwd.C:2078
 pA_PID_Fwd.C:2079
 pA_PID_Fwd.C:2080
 pA_PID_Fwd.C:2081
 pA_PID_Fwd.C:2082
 pA_PID_Fwd.C:2083
 pA_PID_Fwd.C:2084
 pA_PID_Fwd.C:2085
 pA_PID_Fwd.C:2086
 pA_PID_Fwd.C:2087
 pA_PID_Fwd.C:2088
 pA_PID_Fwd.C:2089
 pA_PID_Fwd.C:2090
 pA_PID_Fwd.C:2091
 pA_PID_Fwd.C:2092
 pA_PID_Fwd.C:2093
 pA_PID_Fwd.C:2094
 pA_PID_Fwd.C:2095
 pA_PID_Fwd.C:2096
 pA_PID_Fwd.C:2097
 pA_PID_Fwd.C:2098
 pA_PID_Fwd.C:2099
 pA_PID_Fwd.C:2100
 pA_PID_Fwd.C:2101
 pA_PID_Fwd.C:2102
 pA_PID_Fwd.C:2103
 pA_PID_Fwd.C:2104
 pA_PID_Fwd.C:2105
 pA_PID_Fwd.C:2106
 pA_PID_Fwd.C:2107
 pA_PID_Fwd.C:2108
 pA_PID_Fwd.C:2109
 pA_PID_Fwd.C:2110
 pA_PID_Fwd.C:2111
 pA_PID_Fwd.C:2112
 pA_PID_Fwd.C:2113
 pA_PID_Fwd.C:2114
 pA_PID_Fwd.C:2115
 pA_PID_Fwd.C:2116
 pA_PID_Fwd.C:2117
 pA_PID_Fwd.C:2118
 pA_PID_Fwd.C:2119
 pA_PID_Fwd.C:2120
 pA_PID_Fwd.C:2121
 pA_PID_Fwd.C:2122
 pA_PID_Fwd.C:2123
 pA_PID_Fwd.C:2124
 pA_PID_Fwd.C:2125
 pA_PID_Fwd.C:2126
 pA_PID_Fwd.C:2127
 pA_PID_Fwd.C:2128
 pA_PID_Fwd.C:2129
 pA_PID_Fwd.C:2130
 pA_PID_Fwd.C:2131
 pA_PID_Fwd.C:2132
 pA_PID_Fwd.C:2133
 pA_PID_Fwd.C:2134
 pA_PID_Fwd.C:2135
 pA_PID_Fwd.C:2136
 pA_PID_Fwd.C:2137
 pA_PID_Fwd.C:2138
 pA_PID_Fwd.C:2139
 pA_PID_Fwd.C:2140
 pA_PID_Fwd.C:2141
 pA_PID_Fwd.C:2142
 pA_PID_Fwd.C:2143
 pA_PID_Fwd.C:2144
 pA_PID_Fwd.C:2145
 pA_PID_Fwd.C:2146
 pA_PID_Fwd.C:2147
 pA_PID_Fwd.C:2148
 pA_PID_Fwd.C:2149
 pA_PID_Fwd.C:2150
 pA_PID_Fwd.C:2151
 pA_PID_Fwd.C:2152
 pA_PID_Fwd.C:2153
 pA_PID_Fwd.C:2154
 pA_PID_Fwd.C:2155
 pA_PID_Fwd.C:2156
 pA_PID_Fwd.C:2157
 pA_PID_Fwd.C:2158
 pA_PID_Fwd.C:2159
 pA_PID_Fwd.C:2160
 pA_PID_Fwd.C:2161
 pA_PID_Fwd.C:2162
 pA_PID_Fwd.C:2163
 pA_PID_Fwd.C:2164
 pA_PID_Fwd.C:2165
 pA_PID_Fwd.C:2166
 pA_PID_Fwd.C:2167
 pA_PID_Fwd.C:2168
 pA_PID_Fwd.C:2169
 pA_PID_Fwd.C:2170
 pA_PID_Fwd.C:2171
 pA_PID_Fwd.C:2172
 pA_PID_Fwd.C:2173
 pA_PID_Fwd.C:2174
 pA_PID_Fwd.C:2175
 pA_PID_Fwd.C:2176
 pA_PID_Fwd.C:2177
 pA_PID_Fwd.C:2178
 pA_PID_Fwd.C:2179
 pA_PID_Fwd.C:2180
 pA_PID_Fwd.C:2181
 pA_PID_Fwd.C:2182
 pA_PID_Fwd.C:2183
 pA_PID_Fwd.C:2184
 pA_PID_Fwd.C:2185
 pA_PID_Fwd.C:2186
 pA_PID_Fwd.C:2187
 pA_PID_Fwd.C:2188
 pA_PID_Fwd.C:2189
 pA_PID_Fwd.C:2190
 pA_PID_Fwd.C:2191
 pA_PID_Fwd.C:2192
 pA_PID_Fwd.C:2193
 pA_PID_Fwd.C:2194
 pA_PID_Fwd.C:2195
 pA_PID_Fwd.C:2196
 pA_PID_Fwd.C:2197
 pA_PID_Fwd.C:2198
 pA_PID_Fwd.C:2199
 pA_PID_Fwd.C:2200
 pA_PID_Fwd.C:2201
 pA_PID_Fwd.C:2202
 pA_PID_Fwd.C:2203
 pA_PID_Fwd.C:2204
 pA_PID_Fwd.C:2205
 pA_PID_Fwd.C:2206
 pA_PID_Fwd.C:2207
 pA_PID_Fwd.C:2208
 pA_PID_Fwd.C:2209
 pA_PID_Fwd.C:2210
 pA_PID_Fwd.C:2211
 pA_PID_Fwd.C:2212
 pA_PID_Fwd.C:2213
 pA_PID_Fwd.C:2214
 pA_PID_Fwd.C:2215
 pA_PID_Fwd.C:2216
 pA_PID_Fwd.C:2217
 pA_PID_Fwd.C:2218
 pA_PID_Fwd.C:2219
 pA_PID_Fwd.C:2220
 pA_PID_Fwd.C:2221
 pA_PID_Fwd.C:2222
 pA_PID_Fwd.C:2223
 pA_PID_Fwd.C:2224
 pA_PID_Fwd.C:2225
 pA_PID_Fwd.C:2226
 pA_PID_Fwd.C:2227
 pA_PID_Fwd.C:2228
 pA_PID_Fwd.C:2229
 pA_PID_Fwd.C:2230
 pA_PID_Fwd.C:2231
 pA_PID_Fwd.C:2232
 pA_PID_Fwd.C:2233
 pA_PID_Fwd.C:2234
 pA_PID_Fwd.C:2235
 pA_PID_Fwd.C:2236
 pA_PID_Fwd.C:2237
 pA_PID_Fwd.C:2238
 pA_PID_Fwd.C:2239
 pA_PID_Fwd.C:2240
 pA_PID_Fwd.C:2241
 pA_PID_Fwd.C:2242
 pA_PID_Fwd.C:2243
 pA_PID_Fwd.C:2244
 pA_PID_Fwd.C:2245
 pA_PID_Fwd.C:2246
 pA_PID_Fwd.C:2247
 pA_PID_Fwd.C:2248
 pA_PID_Fwd.C:2249
 pA_PID_Fwd.C:2250
 pA_PID_Fwd.C:2251
 pA_PID_Fwd.C:2252
 pA_PID_Fwd.C:2253
 pA_PID_Fwd.C:2254
 pA_PID_Fwd.C:2255
 pA_PID_Fwd.C:2256
 pA_PID_Fwd.C:2257
 pA_PID_Fwd.C:2258
 pA_PID_Fwd.C:2259
 pA_PID_Fwd.C:2260
 pA_PID_Fwd.C:2261
 pA_PID_Fwd.C:2262
 pA_PID_Fwd.C:2263
 pA_PID_Fwd.C:2264
 pA_PID_Fwd.C:2265
 pA_PID_Fwd.C:2266
 pA_PID_Fwd.C:2267
 pA_PID_Fwd.C:2268
 pA_PID_Fwd.C:2269
 pA_PID_Fwd.C:2270
 pA_PID_Fwd.C:2271
 pA_PID_Fwd.C:2272
 pA_PID_Fwd.C:2273
 pA_PID_Fwd.C:2274
 pA_PID_Fwd.C:2275
 pA_PID_Fwd.C:2276
 pA_PID_Fwd.C:2277
 pA_PID_Fwd.C:2278
 pA_PID_Fwd.C:2279
 pA_PID_Fwd.C:2280
 pA_PID_Fwd.C:2281
 pA_PID_Fwd.C:2282
 pA_PID_Fwd.C:2283
 pA_PID_Fwd.C:2284
 pA_PID_Fwd.C:2285
 pA_PID_Fwd.C:2286
 pA_PID_Fwd.C:2287
 pA_PID_Fwd.C:2288
 pA_PID_Fwd.C:2289
 pA_PID_Fwd.C:2290
 pA_PID_Fwd.C:2291
 pA_PID_Fwd.C:2292
 pA_PID_Fwd.C:2293
 pA_PID_Fwd.C:2294
 pA_PID_Fwd.C:2295
 pA_PID_Fwd.C:2296
 pA_PID_Fwd.C:2297
 pA_PID_Fwd.C:2298
 pA_PID_Fwd.C:2299
 pA_PID_Fwd.C:2300
 pA_PID_Fwd.C:2301
 pA_PID_Fwd.C:2302
 pA_PID_Fwd.C:2303
 pA_PID_Fwd.C:2304
 pA_PID_Fwd.C:2305
 pA_PID_Fwd.C:2306
 pA_PID_Fwd.C:2307
 pA_PID_Fwd.C:2308
 pA_PID_Fwd.C:2309
 pA_PID_Fwd.C:2310
 pA_PID_Fwd.C:2311
 pA_PID_Fwd.C:2312
 pA_PID_Fwd.C:2313
 pA_PID_Fwd.C:2314
 pA_PID_Fwd.C:2315
 pA_PID_Fwd.C:2316
 pA_PID_Fwd.C:2317
 pA_PID_Fwd.C:2318
 pA_PID_Fwd.C:2319
 pA_PID_Fwd.C:2320
 pA_PID_Fwd.C:2321
 pA_PID_Fwd.C:2322
 pA_PID_Fwd.C:2323
 pA_PID_Fwd.C:2324
 pA_PID_Fwd.C:2325
 pA_PID_Fwd.C:2326
 pA_PID_Fwd.C:2327
 pA_PID_Fwd.C:2328
 pA_PID_Fwd.C:2329
 pA_PID_Fwd.C:2330
 pA_PID_Fwd.C:2331
 pA_PID_Fwd.C:2332
 pA_PID_Fwd.C:2333
 pA_PID_Fwd.C:2334
 pA_PID_Fwd.C:2335
 pA_PID_Fwd.C:2336
 pA_PID_Fwd.C:2337
 pA_PID_Fwd.C:2338
 pA_PID_Fwd.C:2339
 pA_PID_Fwd.C:2340
 pA_PID_Fwd.C:2341
 pA_PID_Fwd.C:2342
 pA_PID_Fwd.C:2343
 pA_PID_Fwd.C:2344
 pA_PID_Fwd.C:2345
 pA_PID_Fwd.C:2346
 pA_PID_Fwd.C:2347
 pA_PID_Fwd.C:2348
 pA_PID_Fwd.C:2349
 pA_PID_Fwd.C:2350
 pA_PID_Fwd.C:2351
 pA_PID_Fwd.C:2352
 pA_PID_Fwd.C:2353
 pA_PID_Fwd.C:2354
 pA_PID_Fwd.C:2355
 pA_PID_Fwd.C:2356
 pA_PID_Fwd.C:2357
 pA_PID_Fwd.C:2358
 pA_PID_Fwd.C:2359
 pA_PID_Fwd.C:2360
 pA_PID_Fwd.C:2361
 pA_PID_Fwd.C:2362
 pA_PID_Fwd.C:2363
 pA_PID_Fwd.C:2364
 pA_PID_Fwd.C:2365
 pA_PID_Fwd.C:2366
 pA_PID_Fwd.C:2367
 pA_PID_Fwd.C:2368
 pA_PID_Fwd.C:2369
 pA_PID_Fwd.C:2370
 pA_PID_Fwd.C:2371
 pA_PID_Fwd.C:2372
 pA_PID_Fwd.C:2373
 pA_PID_Fwd.C:2374
 pA_PID_Fwd.C:2375
 pA_PID_Fwd.C:2376
 pA_PID_Fwd.C:2377
 pA_PID_Fwd.C:2378
 pA_PID_Fwd.C:2379
 pA_PID_Fwd.C:2380
 pA_PID_Fwd.C:2381
 pA_PID_Fwd.C:2382
 pA_PID_Fwd.C:2383
 pA_PID_Fwd.C:2384
 pA_PID_Fwd.C:2385
 pA_PID_Fwd.C:2386
 pA_PID_Fwd.C:2387
 pA_PID_Fwd.C:2388
 pA_PID_Fwd.C:2389
 pA_PID_Fwd.C:2390
 pA_PID_Fwd.C:2391
 pA_PID_Fwd.C:2392
 pA_PID_Fwd.C:2393
 pA_PID_Fwd.C:2394
 pA_PID_Fwd.C:2395
 pA_PID_Fwd.C:2396
 pA_PID_Fwd.C:2397
 pA_PID_Fwd.C:2398
 pA_PID_Fwd.C:2399
 pA_PID_Fwd.C:2400
 pA_PID_Fwd.C:2401
 pA_PID_Fwd.C:2402
 pA_PID_Fwd.C:2403
 pA_PID_Fwd.C:2404
 pA_PID_Fwd.C:2405
 pA_PID_Fwd.C:2406
 pA_PID_Fwd.C:2407
 pA_PID_Fwd.C:2408
 pA_PID_Fwd.C:2409
 pA_PID_Fwd.C:2410
 pA_PID_Fwd.C:2411
 pA_PID_Fwd.C:2412
 pA_PID_Fwd.C:2413
 pA_PID_Fwd.C:2414
 pA_PID_Fwd.C:2415
 pA_PID_Fwd.C:2416
 pA_PID_Fwd.C:2417
 pA_PID_Fwd.C:2418
 pA_PID_Fwd.C:2419
 pA_PID_Fwd.C:2420
 pA_PID_Fwd.C:2421
 pA_PID_Fwd.C:2422
 pA_PID_Fwd.C:2423
 pA_PID_Fwd.C:2424
 pA_PID_Fwd.C:2425
 pA_PID_Fwd.C:2426
 pA_PID_Fwd.C:2427
 pA_PID_Fwd.C:2428
 pA_PID_Fwd.C:2429
 pA_PID_Fwd.C:2430
 pA_PID_Fwd.C:2431
 pA_PID_Fwd.C:2432
 pA_PID_Fwd.C:2433
 pA_PID_Fwd.C:2434
 pA_PID_Fwd.C:2435
 pA_PID_Fwd.C:2436
 pA_PID_Fwd.C:2437
 pA_PID_Fwd.C:2438
 pA_PID_Fwd.C:2439
 pA_PID_Fwd.C:2440
 pA_PID_Fwd.C:2441
 pA_PID_Fwd.C:2442
 pA_PID_Fwd.C:2443
 pA_PID_Fwd.C:2444
 pA_PID_Fwd.C:2445
 pA_PID_Fwd.C:2446
 pA_PID_Fwd.C:2447
 pA_PID_Fwd.C:2448
 pA_PID_Fwd.C:2449
 pA_PID_Fwd.C:2450
 pA_PID_Fwd.C:2451
 pA_PID_Fwd.C:2452
 pA_PID_Fwd.C:2453
 pA_PID_Fwd.C:2454
 pA_PID_Fwd.C:2455
 pA_PID_Fwd.C:2456
 pA_PID_Fwd.C:2457
 pA_PID_Fwd.C:2458
 pA_PID_Fwd.C:2459
 pA_PID_Fwd.C:2460
 pA_PID_Fwd.C:2461
 pA_PID_Fwd.C:2462
 pA_PID_Fwd.C:2463
 pA_PID_Fwd.C:2464
 pA_PID_Fwd.C:2465
 pA_PID_Fwd.C:2466
 pA_PID_Fwd.C:2467
 pA_PID_Fwd.C:2468
 pA_PID_Fwd.C:2469
 pA_PID_Fwd.C:2470
 pA_PID_Fwd.C:2471
 pA_PID_Fwd.C:2472
 pA_PID_Fwd.C:2473
 pA_PID_Fwd.C:2474
 pA_PID_Fwd.C:2475
 pA_PID_Fwd.C:2476
 pA_PID_Fwd.C:2477
 pA_PID_Fwd.C:2478
 pA_PID_Fwd.C:2479
 pA_PID_Fwd.C:2480
 pA_PID_Fwd.C:2481
 pA_PID_Fwd.C:2482
 pA_PID_Fwd.C:2483
 pA_PID_Fwd.C:2484
 pA_PID_Fwd.C:2485
 pA_PID_Fwd.C:2486
 pA_PID_Fwd.C:2487
 pA_PID_Fwd.C:2488
 pA_PID_Fwd.C:2489
 pA_PID_Fwd.C:2490
 pA_PID_Fwd.C:2491
 pA_PID_Fwd.C:2492
 pA_PID_Fwd.C:2493
 pA_PID_Fwd.C:2494
 pA_PID_Fwd.C:2495
 pA_PID_Fwd.C:2496
 pA_PID_Fwd.C:2497
 pA_PID_Fwd.C:2498
 pA_PID_Fwd.C:2499
 pA_PID_Fwd.C:2500
 pA_PID_Fwd.C:2501
 pA_PID_Fwd.C:2502
 pA_PID_Fwd.C:2503
 pA_PID_Fwd.C:2504
 pA_PID_Fwd.C:2505
 pA_PID_Fwd.C:2506
 pA_PID_Fwd.C:2507
 pA_PID_Fwd.C:2508
 pA_PID_Fwd.C:2509
 pA_PID_Fwd.C:2510
 pA_PID_Fwd.C:2511
 pA_PID_Fwd.C:2512
 pA_PID_Fwd.C:2513
 pA_PID_Fwd.C:2514
 pA_PID_Fwd.C:2515
 pA_PID_Fwd.C:2516
 pA_PID_Fwd.C:2517
 pA_PID_Fwd.C:2518
 pA_PID_Fwd.C:2519
 pA_PID_Fwd.C:2520
 pA_PID_Fwd.C:2521
 pA_PID_Fwd.C:2522
 pA_PID_Fwd.C:2523
 pA_PID_Fwd.C:2524
 pA_PID_Fwd.C:2525
 pA_PID_Fwd.C:2526
 pA_PID_Fwd.C:2527
 pA_PID_Fwd.C:2528
 pA_PID_Fwd.C:2529
 pA_PID_Fwd.C:2530
 pA_PID_Fwd.C:2531
 pA_PID_Fwd.C:2532
 pA_PID_Fwd.C:2533
 pA_PID_Fwd.C:2534
 pA_PID_Fwd.C:2535
 pA_PID_Fwd.C:2536
 pA_PID_Fwd.C:2537
 pA_PID_Fwd.C:2538
 pA_PID_Fwd.C:2539
 pA_PID_Fwd.C:2540
 pA_PID_Fwd.C:2541
 pA_PID_Fwd.C:2542
 pA_PID_Fwd.C:2543
 pA_PID_Fwd.C:2544
 pA_PID_Fwd.C:2545
 pA_PID_Fwd.C:2546
 pA_PID_Fwd.C:2547
 pA_PID_Fwd.C:2548
 pA_PID_Fwd.C:2549
 pA_PID_Fwd.C:2550
 pA_PID_Fwd.C:2551
 pA_PID_Fwd.C:2552
 pA_PID_Fwd.C:2553
 pA_PID_Fwd.C:2554
 pA_PID_Fwd.C:2555
 pA_PID_Fwd.C:2556
 pA_PID_Fwd.C:2557
 pA_PID_Fwd.C:2558
 pA_PID_Fwd.C:2559
 pA_PID_Fwd.C:2560
 pA_PID_Fwd.C:2561
 pA_PID_Fwd.C:2562
 pA_PID_Fwd.C:2563
 pA_PID_Fwd.C:2564
 pA_PID_Fwd.C:2565
 pA_PID_Fwd.C:2566
 pA_PID_Fwd.C:2567
 pA_PID_Fwd.C:2568
 pA_PID_Fwd.C:2569
 pA_PID_Fwd.C:2570
 pA_PID_Fwd.C:2571
 pA_PID_Fwd.C:2572
 pA_PID_Fwd.C:2573
 pA_PID_Fwd.C:2574
 pA_PID_Fwd.C:2575
 pA_PID_Fwd.C:2576
 pA_PID_Fwd.C:2577
 pA_PID_Fwd.C:2578
 pA_PID_Fwd.C:2579
 pA_PID_Fwd.C:2580
 pA_PID_Fwd.C:2581
 pA_PID_Fwd.C:2582
 pA_PID_Fwd.C:2583
 pA_PID_Fwd.C:2584
 pA_PID_Fwd.C:2585
 pA_PID_Fwd.C:2586
 pA_PID_Fwd.C:2587
 pA_PID_Fwd.C:2588
 pA_PID_Fwd.C:2589
 pA_PID_Fwd.C:2590
 pA_PID_Fwd.C:2591
 pA_PID_Fwd.C:2592
 pA_PID_Fwd.C:2593
 pA_PID_Fwd.C:2594
 pA_PID_Fwd.C:2595
 pA_PID_Fwd.C:2596
 pA_PID_Fwd.C:2597
 pA_PID_Fwd.C:2598
 pA_PID_Fwd.C:2599
 pA_PID_Fwd.C:2600
 pA_PID_Fwd.C:2601
 pA_PID_Fwd.C:2602
 pA_PID_Fwd.C:2603
 pA_PID_Fwd.C:2604
 pA_PID_Fwd.C:2605
 pA_PID_Fwd.C:2606
 pA_PID_Fwd.C:2607
 pA_PID_Fwd.C:2608
 pA_PID_Fwd.C:2609
 pA_PID_Fwd.C:2610
 pA_PID_Fwd.C:2611
 pA_PID_Fwd.C:2612
 pA_PID_Fwd.C:2613
 pA_PID_Fwd.C:2614
 pA_PID_Fwd.C:2615
 pA_PID_Fwd.C:2616
 pA_PID_Fwd.C:2617
 pA_PID_Fwd.C:2618
 pA_PID_Fwd.C:2619
 pA_PID_Fwd.C:2620
 pA_PID_Fwd.C:2621
 pA_PID_Fwd.C:2622
 pA_PID_Fwd.C:2623
 pA_PID_Fwd.C:2624
 pA_PID_Fwd.C:2625
 pA_PID_Fwd.C:2626
 pA_PID_Fwd.C:2627
 pA_PID_Fwd.C:2628
 pA_PID_Fwd.C:2629
 pA_PID_Fwd.C:2630
 pA_PID_Fwd.C:2631
 pA_PID_Fwd.C:2632
 pA_PID_Fwd.C:2633
 pA_PID_Fwd.C:2634
 pA_PID_Fwd.C:2635
 pA_PID_Fwd.C:2636
 pA_PID_Fwd.C:2637
 pA_PID_Fwd.C:2638
 pA_PID_Fwd.C:2639
 pA_PID_Fwd.C:2640
 pA_PID_Fwd.C:2641
 pA_PID_Fwd.C:2642
 pA_PID_Fwd.C:2643
 pA_PID_Fwd.C:2644
 pA_PID_Fwd.C:2645
 pA_PID_Fwd.C:2646
 pA_PID_Fwd.C:2647
 pA_PID_Fwd.C:2648
 pA_PID_Fwd.C:2649
 pA_PID_Fwd.C:2650
 pA_PID_Fwd.C:2651
 pA_PID_Fwd.C:2652
 pA_PID_Fwd.C:2653
 pA_PID_Fwd.C:2654
 pA_PID_Fwd.C:2655
 pA_PID_Fwd.C:2656
 pA_PID_Fwd.C:2657
 pA_PID_Fwd.C:2658
 pA_PID_Fwd.C:2659
 pA_PID_Fwd.C:2660
 pA_PID_Fwd.C:2661
 pA_PID_Fwd.C:2662
 pA_PID_Fwd.C:2663
 pA_PID_Fwd.C:2664
 pA_PID_Fwd.C:2665
 pA_PID_Fwd.C:2666
 pA_PID_Fwd.C:2667
 pA_PID_Fwd.C:2668
 pA_PID_Fwd.C:2669
 pA_PID_Fwd.C:2670
 pA_PID_Fwd.C:2671
 pA_PID_Fwd.C:2672
 pA_PID_Fwd.C:2673
 pA_PID_Fwd.C:2674
 pA_PID_Fwd.C:2675
 pA_PID_Fwd.C:2676
 pA_PID_Fwd.C:2677
 pA_PID_Fwd.C:2678
 pA_PID_Fwd.C:2679
 pA_PID_Fwd.C:2680
 pA_PID_Fwd.C:2681
 pA_PID_Fwd.C:2682
 pA_PID_Fwd.C:2683
 pA_PID_Fwd.C:2684
 pA_PID_Fwd.C:2685
 pA_PID_Fwd.C:2686
 pA_PID_Fwd.C:2687
 pA_PID_Fwd.C:2688
 pA_PID_Fwd.C:2689
 pA_PID_Fwd.C:2690
 pA_PID_Fwd.C:2691
 pA_PID_Fwd.C:2692
 pA_PID_Fwd.C:2693
 pA_PID_Fwd.C:2694
 pA_PID_Fwd.C:2695
 pA_PID_Fwd.C:2696
 pA_PID_Fwd.C:2697
 pA_PID_Fwd.C:2698
 pA_PID_Fwd.C:2699
 pA_PID_Fwd.C:2700
 pA_PID_Fwd.C:2701
 pA_PID_Fwd.C:2702
 pA_PID_Fwd.C:2703
 pA_PID_Fwd.C:2704
 pA_PID_Fwd.C:2705
 pA_PID_Fwd.C:2706
 pA_PID_Fwd.C:2707
 pA_PID_Fwd.C:2708
 pA_PID_Fwd.C:2709
 pA_PID_Fwd.C:2710
 pA_PID_Fwd.C:2711
 pA_PID_Fwd.C:2712
 pA_PID_Fwd.C:2713
 pA_PID_Fwd.C:2714
 pA_PID_Fwd.C:2715
 pA_PID_Fwd.C:2716
 pA_PID_Fwd.C:2717
 pA_PID_Fwd.C:2718
 pA_PID_Fwd.C:2719
 pA_PID_Fwd.C:2720
 pA_PID_Fwd.C:2721
 pA_PID_Fwd.C:2722
 pA_PID_Fwd.C:2723
 pA_PID_Fwd.C:2724
 pA_PID_Fwd.C:2725
 pA_PID_Fwd.C:2726
 pA_PID_Fwd.C:2727
 pA_PID_Fwd.C:2728
 pA_PID_Fwd.C:2729
 pA_PID_Fwd.C:2730
 pA_PID_Fwd.C:2731
 pA_PID_Fwd.C:2732
 pA_PID_Fwd.C:2733
 pA_PID_Fwd.C:2734
 pA_PID_Fwd.C:2735
 pA_PID_Fwd.C:2736
 pA_PID_Fwd.C:2737
 pA_PID_Fwd.C:2738
 pA_PID_Fwd.C:2739
 pA_PID_Fwd.C:2740
 pA_PID_Fwd.C:2741
 pA_PID_Fwd.C:2742
 pA_PID_Fwd.C:2743
 pA_PID_Fwd.C:2744
 pA_PID_Fwd.C:2745
 pA_PID_Fwd.C:2746
 pA_PID_Fwd.C:2747
 pA_PID_Fwd.C:2748
 pA_PID_Fwd.C:2749
 pA_PID_Fwd.C:2750
 pA_PID_Fwd.C:2751
 pA_PID_Fwd.C:2752
 pA_PID_Fwd.C:2753
 pA_PID_Fwd.C:2754
 pA_PID_Fwd.C:2755
 pA_PID_Fwd.C:2756
 pA_PID_Fwd.C:2757
 pA_PID_Fwd.C:2758
 pA_PID_Fwd.C:2759
 pA_PID_Fwd.C:2760
 pA_PID_Fwd.C:2761
 pA_PID_Fwd.C:2762
 pA_PID_Fwd.C:2763
 pA_PID_Fwd.C:2764
 pA_PID_Fwd.C:2765
 pA_PID_Fwd.C:2766
 pA_PID_Fwd.C:2767
 pA_PID_Fwd.C:2768
 pA_PID_Fwd.C:2769
 pA_PID_Fwd.C:2770
 pA_PID_Fwd.C:2771
 pA_PID_Fwd.C:2772
 pA_PID_Fwd.C:2773
 pA_PID_Fwd.C:2774
 pA_PID_Fwd.C:2775
 pA_PID_Fwd.C:2776
 pA_PID_Fwd.C:2777
 pA_PID_Fwd.C:2778
 pA_PID_Fwd.C:2779
 pA_PID_Fwd.C:2780
 pA_PID_Fwd.C:2781
 pA_PID_Fwd.C:2782
 pA_PID_Fwd.C:2783
 pA_PID_Fwd.C:2784
 pA_PID_Fwd.C:2785
 pA_PID_Fwd.C:2786
 pA_PID_Fwd.C:2787
 pA_PID_Fwd.C:2788
 pA_PID_Fwd.C:2789
 pA_PID_Fwd.C:2790
 pA_PID_Fwd.C:2791
 pA_PID_Fwd.C:2792
 pA_PID_Fwd.C:2793
 pA_PID_Fwd.C:2794
 pA_PID_Fwd.C:2795
 pA_PID_Fwd.C:2796
 pA_PID_Fwd.C:2797
 pA_PID_Fwd.C:2798
 pA_PID_Fwd.C:2799
 pA_PID_Fwd.C:2800
 pA_PID_Fwd.C:2801
 pA_PID_Fwd.C:2802
 pA_PID_Fwd.C:2803
 pA_PID_Fwd.C:2804
 pA_PID_Fwd.C:2805
 pA_PID_Fwd.C:2806
 pA_PID_Fwd.C:2807
 pA_PID_Fwd.C:2808
 pA_PID_Fwd.C:2809
 pA_PID_Fwd.C:2810
 pA_PID_Fwd.C:2811
 pA_PID_Fwd.C:2812
 pA_PID_Fwd.C:2813
 pA_PID_Fwd.C:2814
 pA_PID_Fwd.C:2815
 pA_PID_Fwd.C:2816
 pA_PID_Fwd.C:2817
 pA_PID_Fwd.C:2818
 pA_PID_Fwd.C:2819
 pA_PID_Fwd.C:2820
 pA_PID_Fwd.C:2821
 pA_PID_Fwd.C:2822
 pA_PID_Fwd.C:2823
 pA_PID_Fwd.C:2824
 pA_PID_Fwd.C:2825
 pA_PID_Fwd.C:2826
 pA_PID_Fwd.C:2827
 pA_PID_Fwd.C:2828
 pA_PID_Fwd.C:2829
 pA_PID_Fwd.C:2830
 pA_PID_Fwd.C:2831
 pA_PID_Fwd.C:2832
 pA_PID_Fwd.C:2833
 pA_PID_Fwd.C:2834
 pA_PID_Fwd.C:2835
 pA_PID_Fwd.C:2836
 pA_PID_Fwd.C:2837
 pA_PID_Fwd.C:2838
 pA_PID_Fwd.C:2839
 pA_PID_Fwd.C:2840
 pA_PID_Fwd.C:2841
 pA_PID_Fwd.C:2842
 pA_PID_Fwd.C:2843
 pA_PID_Fwd.C:2844
 pA_PID_Fwd.C:2845
 pA_PID_Fwd.C:2846
 pA_PID_Fwd.C:2847
 pA_PID_Fwd.C:2848
 pA_PID_Fwd.C:2849
 pA_PID_Fwd.C:2850
 pA_PID_Fwd.C:2851
 pA_PID_Fwd.C:2852
 pA_PID_Fwd.C:2853
 pA_PID_Fwd.C:2854
 pA_PID_Fwd.C:2855
 pA_PID_Fwd.C:2856
 pA_PID_Fwd.C:2857
 pA_PID_Fwd.C:2858
 pA_PID_Fwd.C:2859
 pA_PID_Fwd.C:2860
 pA_PID_Fwd.C:2861
 pA_PID_Fwd.C:2862
 pA_PID_Fwd.C:2863
 pA_PID_Fwd.C:2864
 pA_PID_Fwd.C:2865
 pA_PID_Fwd.C:2866
 pA_PID_Fwd.C:2867
 pA_PID_Fwd.C:2868
 pA_PID_Fwd.C:2869
 pA_PID_Fwd.C:2870
 pA_PID_Fwd.C:2871
 pA_PID_Fwd.C:2872
 pA_PID_Fwd.C:2873
 pA_PID_Fwd.C:2874
 pA_PID_Fwd.C:2875
 pA_PID_Fwd.C:2876
 pA_PID_Fwd.C:2877
 pA_PID_Fwd.C:2878
 pA_PID_Fwd.C:2879
 pA_PID_Fwd.C:2880
 pA_PID_Fwd.C:2881
 pA_PID_Fwd.C:2882
 pA_PID_Fwd.C:2883
 pA_PID_Fwd.C:2884
 pA_PID_Fwd.C:2885
 pA_PID_Fwd.C:2886
 pA_PID_Fwd.C:2887
 pA_PID_Fwd.C:2888
 pA_PID_Fwd.C:2889
 pA_PID_Fwd.C:2890
 pA_PID_Fwd.C:2891
 pA_PID_Fwd.C:2892
 pA_PID_Fwd.C:2893
 pA_PID_Fwd.C:2894
 pA_PID_Fwd.C:2895
 pA_PID_Fwd.C:2896
 pA_PID_Fwd.C:2897
 pA_PID_Fwd.C:2898
 pA_PID_Fwd.C:2899
 pA_PID_Fwd.C:2900
 pA_PID_Fwd.C:2901
 pA_PID_Fwd.C:2902
 pA_PID_Fwd.C:2903
 pA_PID_Fwd.C:2904
 pA_PID_Fwd.C:2905
 pA_PID_Fwd.C:2906
 pA_PID_Fwd.C:2907
 pA_PID_Fwd.C:2908
 pA_PID_Fwd.C:2909
 pA_PID_Fwd.C:2910
 pA_PID_Fwd.C:2911
 pA_PID_Fwd.C:2912
 pA_PID_Fwd.C:2913
 pA_PID_Fwd.C:2914
 pA_PID_Fwd.C:2915
 pA_PID_Fwd.C:2916
 pA_PID_Fwd.C:2917
 pA_PID_Fwd.C:2918
 pA_PID_Fwd.C:2919
 pA_PID_Fwd.C:2920
 pA_PID_Fwd.C:2921
 pA_PID_Fwd.C:2922
 pA_PID_Fwd.C:2923
 pA_PID_Fwd.C:2924
 pA_PID_Fwd.C:2925
 pA_PID_Fwd.C:2926
 pA_PID_Fwd.C:2927
 pA_PID_Fwd.C:2928
 pA_PID_Fwd.C:2929
 pA_PID_Fwd.C:2930
 pA_PID_Fwd.C:2931
 pA_PID_Fwd.C:2932
 pA_PID_Fwd.C:2933
 pA_PID_Fwd.C:2934
 pA_PID_Fwd.C:2935
 pA_PID_Fwd.C:2936
 pA_PID_Fwd.C:2937
 pA_PID_Fwd.C:2938
 pA_PID_Fwd.C:2939
 pA_PID_Fwd.C:2940
 pA_PID_Fwd.C:2941
 pA_PID_Fwd.C:2942
 pA_PID_Fwd.C:2943
 pA_PID_Fwd.C:2944
 pA_PID_Fwd.C:2945
 pA_PID_Fwd.C:2946
 pA_PID_Fwd.C:2947
 pA_PID_Fwd.C:2948
 pA_PID_Fwd.C:2949
 pA_PID_Fwd.C:2950
 pA_PID_Fwd.C:2951
 pA_PID_Fwd.C:2952
 pA_PID_Fwd.C:2953
 pA_PID_Fwd.C:2954
 pA_PID_Fwd.C:2955
 pA_PID_Fwd.C:2956
 pA_PID_Fwd.C:2957
 pA_PID_Fwd.C:2958
 pA_PID_Fwd.C:2959
 pA_PID_Fwd.C:2960
 pA_PID_Fwd.C:2961
 pA_PID_Fwd.C:2962
 pA_PID_Fwd.C:2963
 pA_PID_Fwd.C:2964
 pA_PID_Fwd.C:2965
 pA_PID_Fwd.C:2966
 pA_PID_Fwd.C:2967
 pA_PID_Fwd.C:2968
 pA_PID_Fwd.C:2969
 pA_PID_Fwd.C:2970
 pA_PID_Fwd.C:2971
 pA_PID_Fwd.C:2972
 pA_PID_Fwd.C:2973
 pA_PID_Fwd.C:2974
 pA_PID_Fwd.C:2975
 pA_PID_Fwd.C:2976
 pA_PID_Fwd.C:2977
 pA_PID_Fwd.C:2978
 pA_PID_Fwd.C:2979
 pA_PID_Fwd.C:2980
 pA_PID_Fwd.C:2981
 pA_PID_Fwd.C:2982
 pA_PID_Fwd.C:2983
 pA_PID_Fwd.C:2984
 pA_PID_Fwd.C:2985
 pA_PID_Fwd.C:2986
 pA_PID_Fwd.C:2987
 pA_PID_Fwd.C:2988
 pA_PID_Fwd.C:2989
 pA_PID_Fwd.C:2990
 pA_PID_Fwd.C:2991
 pA_PID_Fwd.C:2992
 pA_PID_Fwd.C:2993
 pA_PID_Fwd.C:2994
 pA_PID_Fwd.C:2995
 pA_PID_Fwd.C:2996
 pA_PID_Fwd.C:2997
 pA_PID_Fwd.C:2998
 pA_PID_Fwd.C:2999
 pA_PID_Fwd.C:3000
 pA_PID_Fwd.C:3001
 pA_PID_Fwd.C:3002
 pA_PID_Fwd.C:3003
 pA_PID_Fwd.C:3004
 pA_PID_Fwd.C:3005
 pA_PID_Fwd.C:3006
 pA_PID_Fwd.C:3007