ROOT logo

Int_t markers[] = {20,21,22,23,28,29};
Int_t colors[]  = {1,2,3,4,6,8,102};

void loadlibs()
{
  gSystem->Load("libTree");
  gSystem->Load("libVMC");

  gSystem->Load("libSTEERBase");
  gSystem->Load("libANALYSIS");
  gSystem->Load("libPWG0base");
}

void InitPad()
{
  if (!gPad)
    return;

  gPad->Range(0, 0, 1, 1);
  gPad->SetLeftMargin(0.15);
  //gPad->SetRightMargin(0.05);
  //gPad->SetTopMargin(0.13);
  //gPad->SetBottomMargin(0.1);

  gPad->SetGridx();
  gPad->SetGridy();
}

void DrawpiKpAndCombinedZOnly(Float_t upperPtLimit=0.99)
{
  //gROOT->ProcessLine(".L drawPlots.C");
  gSystem->Load("libPWG0base");

  const char* fileNames[] = { "systematics.root", "systematics.root", "systematics.root", "correction_map.root" };
  const char* folderNames[] = { "correction_0", "correction_1", "correction_2", "dndeta_correction" };
  const char* legendNames[] = { "#pi", "K", "p", "standard" };
  Int_t folderCount = 3;

  TH2F* h2DCorrections[4];
  TH1F* h1DCorrections[4];
  for (Int_t i=0; i<4; i++) {
    TFile::Open(fileNames[i]);
    AlidNdEtaCorrection* correctionTmp = new AlidNdEtaCorrection(folderNames[i],folderNames[i]);
    correctionTmp->LoadHistograms();
    
    //    h2DCorrections[i] = correctionTmp->GetTrack2ParticleCorrection()->GetTrackCorrection()->Get2DCorrectionHistogram("yz",-1,1);

    h1DCorrections[i] = correctionTmp->GetTrack2ParticleCorrection()->GetTrackCorrection()->Get1DCorrectionHistogram("z",-10,10,0.8,0.8);
  }

  TH2F* null = new TH2F("","",100,0.1,10,100,0.5,9.99);
  null->SetXTitle("p_{T} (GeV/c)");
  null->SetXTitle("Correction");

  null->Draw();

  //h1DCorrections[0]->SetMaximum(5);
  //h1DCorrections[0]->Draw();
  //  h2DCorrections[0]->Draw("colz");
  for (Int_t i=1; i<4; i++) {
    h1DCorrections[i]->Draw("same");
  }
  
}

TPad* DrawChange(Bool_t spd, const char* basename, const char** changes, Int_t nChanges, Int_t nDraw, Int_t* colors, const char** names = 0, Float_t scale = 0.10)
{  
  Float_t etaMax = 1.05;
  if (spd)
    etaMax = 1.49;

  TH1F* hRatios[100];
  for(Int_t i=0; i<nChanges; i++) {
    Printf("%d", i);
    hRatios[i] = (TH1F*)gFile->Get(Form("%s%s",basename,changes[i]));
    hRatios[i]->SetLineWidth(1);
    hRatios[i]->SetMarkerStyle(22);
    hRatios[i]->SetMarkerSize(0.8);

    Float_t average = hRatios[i]->Integral(hRatios[i]->FindBin(-1), hRatios[i]->FindBin(1)) / (hRatios[i]->FindBin(1) - hRatios[i]->FindBin(-1) + 1);
    Printf("%s %s: %.2f %%" , changes[i], hRatios[i]->GetTitle(), (average - 1) * 100);
  }
  
  TPad* p = DrawCanvasAndPad("syst_changeInXsection",700,400);
  p->SetRightMargin(0.2);
  p->SetLeftMargin(0.13);
  
  TH2F* null = new TH2F("","",100,-etaMax, etaMax,100,1. - scale,1. + scale);
  null->GetXaxis()->SetTitle("#eta");
  null->GetYaxis()->SetTitle(hRatios[0]->GetYaxis()->GetTitle());
  null->Draw();
  
  line = new TLine(-etaMax, 1, etaMax, 1);
  line->Draw();

  TLatex* text[100];

  for(Int_t i=1; i<nDraw; i++) {
    hRatios[i]->SetLineColor(colors[i]);
    hRatios[i]->SetMarkerColor(colors[i]);
    hRatios[i]->Draw("HISTPL SAME");
    
    TString str(hRatios[i]->GetTitle());
    
    if (names)
      str = names[i];
    
    text[i] = new TLatex(etaMax + 0.03,hRatios[i]->GetBinContent(hRatios[i]->FindBin(etaMax-0.1))-0.002,str.Data());
    text[i]->SetTextAlign(11);
    text[i]->SetTextColor(colors[i]);
    text[i]->Draw();
  }
  
  return p;
}

TPad* DrawChangeRatios(Bool_t spd, TFile* file1, TFile* file2, const char* basename, const char** changes, Int_t nChanges, Int_t nDraw, Int_t* colors, const char** names = 0, Float_t scale = 0.10)
{  
  Float_t etaMax = 1.05;
  if (spd)
    etaMax = 1.79;

  TH1F* hRatios[100];
  for(Int_t i=0; i<nChanges; i++) {
    hRatios[i] = (TH1F*)file1->Get(Form("%s%s",basename,changes[i]));
    hRatios[i]->SetLineWidth(1);
    hRatios[i]->SetMarkerStyle(22);
    hRatios[i]->SetMarkerSize(0.8);
    
    hRatio2 = (TH1F*)file2->Get(Form("%s%s",basename,changes[i]));
    hRatios[i]->Divide(hRatio2);

    Float_t average = hRatios[i]->Integral(hRatios[i]->FindBin(-1), hRatios[i]->FindBin(1)) / (hRatios[i]->FindBin(1) - hRatios[i]->FindBin(-1) + 1);
    Printf("%s: %.2f %%" , hRatios[i]->GetTitle(), (average - 1) * 100);
  }
  
  TPad* p = DrawCanvasAndPad("syst_changeInXsection",700,400);
  p->SetRightMargin(0.2);
  p->SetLeftMargin(0.13);
  
  TH2F* null = new TH2F("","",100,-etaMax, etaMax,100,1. - scale,1. + scale);
  null->GetXaxis()->SetTitle("#eta");
  null->GetYaxis()->SetTitle(hRatios[0]->GetYaxis()->GetTitle());
  null->Draw();
  
  line = new TLine(-etaMax, 1, etaMax, 1);
  line->Draw();

  TLatex* text[100];

  for(Int_t i=1; i<nDraw; i++) {
    hRatios[i]->SetLineColor(colors[i]);
    hRatios[i]->SetMarkerColor(colors[i]);
    hRatios[i]->Draw("HISTPL SAME");
    
    TString str(hRatios[i]->GetTitle());
    
    if (names)
      str = names[i];
    
    text[i] = new TLatex(etaMax + 0.03,hRatios[i]->GetBinContent(hRatios[i]->FindBin(etaMax-0.1))-0.002,str.Data());
    text[i]->SetTextAlign(11);
    text[i]->SetTextColor(colors[i]);
    text[i]->Draw();
  }
  
  return p;
}

void DrawEffectOfChangeInCrossSection(Bool_t spd = kFALSE, const char* fileName = "systematics_vtxtrigger_compositions.root") 
{
  TFile::Open(fileName);

//  const Char_t* changes[]  = {"pythia","ddmore","ddless","sdmore","sdless", "dmore", "dless", "sdmoreddless", "sdlessddmore", "ddmore25","ddless25","sdmore25","sdless25", "dmore25", "dless25", "sdmoreddless25", "sdlessddmore25" };
  const Char_t* changes[]  = { "default","ddmore","ddless","sdmore","sdless", "dmore", "dless", "sdlessddmore", "sdmoreddless" };
  //const Char_t* changes[]  = { "pythia", "qgsm", "phojet" };
  //const Int_t nChanges = 3;
  Int_t colors[] = {1,1,4,1,2,2,4,2,1};

  c = DrawChange(spd, "ratio_vertexReco_triggerBias_", changes, 9, 9, colors, 0);
  c->SaveAs("cross_sections.eps");
}

void DrawEffectOfChangeInCrossSection2Files(Bool_t spd = kFALSE, const char* fileName1 = "systematics_vtxtrigger_compositions.root", const char* fileName2) 
{
  file1 = TFile::Open(fileName1);
  file2 = TFile::Open(fileName2);

  const Char_t* changes[]  = {"pythia","ddmore","ddless","sdmore","sdless", "dmore", "dless", "sdmoreddless", "sdlessddmore", "ddmore25","ddless25","sdmore25","sdless25", "dmore25", "dless25", "sdmoreddless25", "sdlessddmore25" };
  //const Char_t* changes[]  = { "pythia", "qgsm", "phojet" };
  //const Int_t nChanges = 3;
  Int_t colors[] = {1,1,4,1,2,2,4,2,1};

  c = DrawChangeRatios(spd, file1, file2, "ratio_vertexReco_triggerBias_", changes, 17, 9, colors, 0);
  c->SaveAs("cross_sections.eps");
}

void DrawEffectOfChangeInComposition(Bool_t spd = kFALSE, const char* fileName = "new_compositions_analysis.root") 
{
  TFile::Open(fileName);

  const Char_t* changes[]  = { "KBoosted", "KReduced", "pBoosted", "pReduced", "KBoostedpBoosted", "KReducedpReduced", "KBoostedpReduced", "KReducedpBoosted", "othersBoosted", "othersReduced" };
  const char*   names[]    = { "K #times 1.3", "K #times 0.7", "p #times 1.3", "p #times 0.7", "K #times 1.3, p #times 1.3", "K #times 0.7, p #times 0.7", "K #times 1.3, p #times 0.7", "K #times 0.7, p #times 1.3", "O #times 1.3", "O #times 0.7" };
  //const Char_t* changes[]  = { "PythiaRatios", "PiBoosted",      "PiReduced", "KBoosted", "KReduced", "pBoosted", "pReduced", "othersBoosted", "othersReduced" };
  //const char*   names[]    = { "",             "#pi #times 1.5", "#pi #times 0.5", "K #times 1.5", "K #times 0.5", "p #times 1.5", "p #times 0.5",  "others #times 1.5", "others #times 0.5" };
  Int_t colors[] = {1,1,2,2,1,2,1,4,4,1,1};

  c = DrawChange(spd, "", changes, 10, 10, colors, names, 0.03);
  //c->SaveAs("compositions.eps");
}

TPad* DrawCanvasAndPad(const Char_t* name, Int_t sizeX=600, Int_t sizeY=500) {

  gStyle->SetOptStat(0);
  gStyle->SetOptTitle(0);
  gStyle->SetOptFit(0);

  gStyle->SetTextSize(0.04);
  gStyle->SetTitleSize(0.05,"xyz");
  //gStyle->SetTitleFont(133, "xyz");
  //gStyle->SetLabelFont(133, "xyz");
  //gStyle->SetLabelSize(17, "xyz");
  gStyle->SetLabelOffset(0.01, "xyz");

  gStyle->SetTitleOffset(1.1, "y");
  gStyle->SetTitleOffset(1.1, "x");
  gStyle->SetEndErrorSize(0.0);

  //##############################################

  //making canvas and pads
  TCanvas *c = new TCanvas(name,name,sizeX,sizeY);

  TPad* p1 = new TPad("pad1","", 0, 0.0, 1.0, 1.0, 0, 0, 0);

  p1->SetBottomMargin(0.15);
  p1->SetTopMargin(0.03);
  p1->SetLeftMargin(0.15);
  p1->SetRightMargin(0.03);
  
  p1->SetGridx();
  p1->SetGridy();

  p1->Draw();
  p1->cd();

  return p1;
}

void MisalignmentShowRawTrackPlots(const char* dirName = "fdNdEtaAnalysisESD")
{
  loadlibs();

  TFile* file = TFile::Open("fullA-simrec/MB2/analysis_esd_raw.root");
  dNdEtaAnalysis* fdNdEtaAnalysis = new dNdEtaAnalysis(dirName, dirName);
  fdNdEtaAnalysis->LoadHistograms();

  TFile* file2 = TFile::Open("fullA-sim/analysis_esd_raw.root");
  dNdEtaAnalysis* fdNdEtaAnalysis2 = new dNdEtaAnalysis(dirName, dirName);
  fdNdEtaAnalysis2->LoadHistograms();

  TH3* track1 = fdNdEtaAnalysis->GetData()->GetTrackCorrection()->GetMeasuredHistogram()->Clone("track1");
  TH3* track2 = fdNdEtaAnalysis2->GetData()->GetTrackCorrection()->GetMeasuredHistogram()->Clone("track2");

  // normalize to number of events;
  TH2* event1 = fdNdEtaAnalysis->GetData()->GetEventCorrection()->GetMeasuredHistogram();
  TH2* event2 = fdNdEtaAnalysis2->GetData()->GetEventCorrection()->GetMeasuredHistogram();
  Int_t event1Count = event1->Integral();
  Int_t event2Count = event2->Integral();
  track1->Scale(1.0 / event1Count);
  track2->Scale(1.0 / event2Count);

  const Float_t innerLimit = 0.49;
  const Float_t outerLimit = 0.99;

  track1->GetYaxis()->SetRangeUser(-outerLimit, outerLimit);
  track2->GetYaxis()->SetRangeUser(-outerLimit, outerLimit);
  AliPWG0Helper::CreateDividedProjections(track1, track2, "ze1");
  TH1* fullRange = gROOT->FindObject("track1_ze1_div_track2_ze1");

  track1->GetYaxis()->SetRangeUser(-innerLimit, innerLimit);
  track2->GetYaxis()->SetRangeUser(-innerLimit, innerLimit);
  AliPWG0Helper::CreateDividedProjections(track1, track2, "ze2");
  TH1* central = gROOT->FindObject("track1_ze2_div_track2_ze2");
  central->SetLineColor(1);
  central->SetMarkerStyle(21);

  for (Int_t x=1; x<track1->GetXaxis()->GetNbins(); ++x)
    for (Int_t y=track1->GetYaxis()->FindBin(-innerLimit); y<track1->GetYaxis()->FindBin(innerLimit); ++y)
      for (Int_t z=1; z<track1->GetZaxis()->GetNbins(); ++z)
      {
        track1->SetBinContent(x, y, z, 0);
        track1->SetBinError(x, y, z, 0);
        track2->SetBinContent(x, y, z, 0);
        track2->SetBinError(x, y, z, 0);
      }

  track1->GetYaxis()->SetRangeUser(-outerLimit, outerLimit);
  track2->GetYaxis()->SetRangeUser(-outerLimit, outerLimit);
  AliPWG0Helper::CreateDividedProjections(track1, track2, "ze3");
  TH1* peripheral = gROOT->FindObject("track1_ze3_div_track2_ze3");
  peripheral->SetLineColor(2);
  peripheral->SetMarkerStyle(22);
  peripheral->SetMarkerColor(2);

  TH2* tmp = new TH2F("tmp", ";p_{T} [GeV/c]      ;#frac{tracks full misalignment during rec.}{tracks ideal misalignment during rec.}", 1, 0.1, 10, 1, 0.9, 1.3);

  tmp->SetStats(kFALSE);
  //tmp->GetXaxis()->SetNoExponent();

  Float_t ptStart = 0.1;

  fullRange->GetXaxis()->SetRangeUser(ptStart, 9.9);
  central->GetXaxis()->SetRangeUser(ptStart, 9.9);
  peripheral->GetXaxis()->SetRangeUser(ptStart, 9.9);

  TCanvas* canvas = new TCanvas("MisalignmentShowRawTrackPlots", "MisalignmentShowRawTrackPlots", 700, 400);
  gPad->SetLogx();
  gPad->SetGridx();
  gPad->SetGridy();

  TLegend* legend = new TLegend(0.2, 0.7, 0.4, 0.8);

  legend->AddEntry(central, "|#eta| < 0.5");
  legend->AddEntry(peripheral, "0.5 < |#eta| < 1.0");

  legend->SetFillColor(0);

  tmp->Draw();
  //fullRange->Draw("SAME");
  central->Draw("SAME");
  peripheral->Draw("SAME");

  legend->Draw();

  canvas->SaveAs("syst_mis_ntracks.eps");
}


void drawdNdEtaRatios(const char* canvasName, Int_t n, const char** files, const char** dirs, const char** names, Int_t* histID)
{
  loadlibs();
  gROOT->ProcessLine(".L $ALICE_ROOT/PWG0/dNdEta/drawPlots.C");

  TCanvas* canvas = new TCanvas(canvasName, canvasName, 1000, 500);
  canvas->Divide(2, 1);
  canvas->cd(2)->SetGridx();
  canvas->cd(2)->SetGridy();

  TLegend* legend = new TLegend(0.63, 0.73, 0.98, 0.98);
  legend->SetFillColor(0);

  TH1* base = 0;

  for (Int_t i = 0; i < n; ++i)
  {
    TFile::Open(files[i]);

    dNdEtaAnalysis* tmp = new dNdEtaAnalysis(dirs[i], dirs[i]);
    tmp->LoadHistograms();

    TH1* hist = tmp->GetdNdEtaPtCutOffCorrectedHistogram(histID[i]);

    if (i == 0)
      base = hist;

    legend->AddEntry(hist, names[i]);

    hist->SetMarkerColor(colors[i]);
    hist->SetMarkerStyle(markers[i]);

    canvas->cd(1);
    hist->DrawCopy((i == 0) ? "" : "SAME");

    if (i != 0)
    {
      PrintIntegratedDeviation(hist, base, names[i]);

      canvas->cd(2);
      hist->Divide(hist, base, 1, 1);
      hist->GetYaxis()->SetRangeUser(0.9, 1.1);
      hist->DrawCopy((i == 1) ? "" : "SAME");
    }
  }

  legend->Draw();

  canvas->SaveAs(Form("%s.eps", canvas->GetName()));
}

void drawdNdEtaRatios(const char* canvasName, Int_t n, const char** files1, const char** files2, const char** dirs1, const char** dirs2, const char** names, Int_t* histID)
{
  gSystem->Load("libPWG0base");

  TCanvas* canvas = new TCanvas(canvasName, canvasName, 700, 400);
  canvas->SetLeftMargin(0.12);

  TLegend* legend = new TLegend(0.35, 0.7, 0.65, 0.85);
  legend->SetFillColor(0);

  for (Int_t i = 0; i < n; ++i)
  {
    TFile::Open(files1[i]);

    dNdEtaAnalysis* tmp1 = new dNdEtaAnalysis(dirs1[i], dirs1[i]);
    tmp1->LoadHistograms();

    TFile::Open(files2[i]);

    dNdEtaAnalysis* tmp2 = new dNdEtaAnalysis(dirs2[i], dirs2[i]);
    tmp2->LoadHistograms();

    TH1* hist1 = tmp1->GetdNdEtaPtCutOffCorrectedHistogram(histID[i]);
    TH1* hist2 = tmp2->GetdNdEtaPtCutOffCorrectedHistogram(histID[i]);

    TH1* division = hist1->Clone();

    division->Divide(hist1, hist2, 1, 1, "B");

    division->SetMarkerColor(colors[i]);
    division->SetMarkerStyle(markers[i]);

    legend->AddEntry(division, names[i]);

    division->SetTitle("");
    division->GetYaxis()->SetTitle("#frac{dN_{ch}/d#eta using MC vtx}{dN_{ch}/d#eta using ESD vtx}");
    division->SetStats(kFALSE);
    division->GetYaxis()->SetTitleOffset(1.3);
    division->GetXaxis()->SetRangeUser(-0.99, 0.99);
    division->GetYaxis()->SetRangeUser(0.981, 1.02);
    division->DrawCopy((i == 0) ? "" : "SAME");
  }

  gPad->SetGridx();
  gPad->SetGridy();

  legend->Draw();

  canvas->SaveAs(Form("%s.eps", canvas->GetName()));
}

void MaterialBudgetChange()
{
  const char* files[] =
    { "Material-normal-mcvtx/analysis_esd.root",
      "Material-increased-mcvtx/analysis_esd.root",
      "Material-decreased-mcvtx/analysis_esd.root" };

  const char* dirs[] = { "dndeta", "dndeta", "dndeta"};
  const char* names[] = { "no change", "+ 10 % material", "- 10 % material" };
  Int_t hist[] = { 0, 0, 0 };

  drawdNdEtaRatios("MaterialBudgetChange", 3, files, dirs, names, hist);
}

void MisalignmentChange()
{
  const char* files[] =
    { "maps/v4-09-Release/tpc-only/fullC-simrec--fullA-sim-mcvtx/analysis_esd.root",
      "maps/v4-09-Release/tpc-only/fullC-simrec--fullA-simrec-mcvtx/analysis_esd.root" };

  const char* dirs[] = { "dndeta", "dndeta", "dndeta"};
  const char* names[] = { "no change", "increased in sim/rec", "increased in sim" };
  Int_t hist[] = { 0, 0, 0 };

  drawdNdEtaRatios("MisalignmentChange", 2, files, dirs, names, hist);
}

void dNdEtaVertexRanges()
{
  const char* files[] =
    { "analysis_esd.root",
      "analysis_esd.root",
      "analysis_esd.root" };

  const char* dirs[] = { "dndeta", "dndeta", "dndeta"};
  const char* names[] = { "|vtx-z| < 10 cm", "-10 cm < vtx-z < 0 cm", "0 cm < vtx-z < 10 cm" };
  Int_t hist[] = { 0, 1, 2 };

  drawdNdEtaRatios("dNdEtaVertexRanges", 3, files, dirs, names, hist);
}

void vertexShiftStudy(Int_t histID)
{
  const char* files[] = { "maps/idealA/mc-vertex/analysis_esd.root", "results/idealC-idealA/analysis_esd.root", "maps/idealA/mc-vertex-shift-0.05/analysis_esd.root", "maps/idealA/mc-vertex-shift-0.1/analysis_esd.root", "maps/idealA/mc-vertex-shift-dep/analysis_esd.root" };
  const char* dirs[] = { "dndeta", "dndeta", "dndeta", "dndeta", "dndeta" };
  const char* names[] = { "mc vtx", "esd vtx", "+ 0.05 cm", "+ 0.1 cm", "old vtx shift" };
  Int_t hist[] = { histID, histID, histID, histID, histID };

  drawdNdEtaRatios("syst_vertex_shift1", 5, files, dirs, names, hist);

  const char* files1[] = { "maps/idealA/mc-vertex/analysis_esd.root", "maps/idealA/mc-vertex/analysis_esd.root", "maps/idealA/mc-vertex/analysis_esd.root" };
  const char* files2[] = { "results/idealC-idealA/analysis_esd.root", "results/idealC-idealA/analysis_esd.root", "results/idealC-idealA/analysis_esd.root" };
  const char* dirs1[] = { "dndeta", "dndeta", "dndeta"};
  const char* names[] = { "|vtx-z| < 10 cm", "-10 cm < vtx-z < 0 cm", "0 cm < vtx-z < 10 cm" };
  Int_t hist[] = { 0, 1, 2 };

  drawdNdEtaRatios("syst_vertex_shift2", 3, files1, files2, dirs, dirs, names, hist);
}

void vertexShift()
{
  TFile::Open("vertex.root");

  TH2* hist = gFile->Get("fVertexCorr");
  TProfile* prof = hist->ProfileX();

  prof->SetStats(kFALSE);
  prof->SetTitle(";MC vtx-z [cm];mean (ESD vtx-z - MC vtx-z) [cm]");
  prof->GetYaxis()->SetTitleOffset(1.2);

  prof->SetLineWidth(2);

  TCanvas* canvas = new TCanvas("syst_vertex_shift", "syst_vertex_shift", 700, 400);

  gPad->SetGridx();
  gPad->SetGridy();

  prof->Draw();

  canvas->SaveAs(Form("%s.eps", canvas->GetName()));
}

void CompareRawTrackPlots(const char* fileName1, const char* fileName2, Float_t ptCut = 0.0, Int_t multCut = 1)
{
  loadlibs();

  const char* dirName = "fdNdEtaAnalysisESD";

  TFile* file = TFile::Open(fileName1);
  dNdEtaAnalysis* fdNdEtaAnalysis = new dNdEtaAnalysis(dirName, dirName);
  fdNdEtaAnalysis->LoadHistograms();

  TFile* file2 = TFile::Open(fileName2);
  dNdEtaAnalysis* fdNdEtaAnalysis2 = new dNdEtaAnalysis(dirName, dirName);
  fdNdEtaAnalysis2->LoadHistograms();

  TH3* track1 = fdNdEtaAnalysis->GetData()->GetTrackCorrection()->GetMeasuredHistogram()->Clone("track1");
  TH3* track2 = fdNdEtaAnalysis2->GetData()->GetTrackCorrection()->GetMeasuredHistogram()->Clone("track2");

  TH2* event1 = fdNdEtaAnalysis->GetData()->GetEventCorrection()->GetMeasuredHistogram();
  TH2* event2 = fdNdEtaAnalysis2->GetData()->GetEventCorrection()->GetMeasuredHistogram();
  Int_t event1Count = event1->Integral(event1->GetXaxis()->FindBin(-9.9), event1->GetXaxis()->FindBin(9.9), multCut, event1->GetNbinsY() + 1);
  Int_t event2Count = event2->Integral(event2->GetXaxis()->FindBin(-9.9), event2->GetXaxis()->FindBin(9.9), multCut, event1->GetNbinsY() + 1);

  Float_t nTrack1 = track1->Integral(track1->GetXaxis()->FindBin(-9.9), track1->GetXaxis()->FindBin(9.9), track1->GetYaxis()->FindBin(-0.79), track1->GetYaxis()->FindBin(0.79), track1->GetZaxis()->FindBin(ptCut), track1->GetZaxis()->GetNbins());
  Float_t nTrack2 = track2->Integral(track2->GetXaxis()->FindBin(-9.9), track2->GetXaxis()->FindBin(9.9), track2->GetYaxis()->FindBin(-0.79), track2->GetYaxis()->FindBin(0.79), track2->GetZaxis()->FindBin(ptCut), track2->GetZaxis()->GetNbins());

  Printf("%d tracks in %d events in first sample; %d tracks in %d events in second sample", (Int_t) nTrack1, event1Count, (Int_t) nTrack2, event2Count);

  // normalize to number of events;
  nTrack1 /= event1Count;
  nTrack2 /= event2Count;

  Printf("There are %.2f tracks/event in the first sample and %.2f tracks/event in the second sample. %.2f %% difference (with pt cut at %.2f GeV/c)", nTrack1, nTrack2, 100.0 * (nTrack1 - nTrack2) / nTrack1, ptCut);

  gROOT->cd();

  AliPWG0Helper::CreateDividedProjections(track1, track2);

  new TCanvas; gROOT->FindObject("track1_yx_div_track2_yx")->Draw("COLZ");
  new TCanvas; gROOT->FindObject("track1_zx_div_track2_zx")->Draw("COLZ");
  new TCanvas; gROOT->FindObject("track1_zy_div_track2_zy")->Draw("COLZ");

  for (Int_t i=0; i<3; i++)
  {
    char c = 'x' + (char) i;

    /*proj1 = track1->Project3D(Form("%ce2", c));
    proj2 = track2->Project3D(Form("%ce2", c));
    AliPWG0Helper::NormalizeToBinWidth(proj1);
    AliPWG0Helper::NormalizeToBinWidth(proj2);

    new TCanvas;
    proj1->DrawCopy();
    proj2->SetLineColor(2);
    proj2->SetMarkerColor(2);
    proj2->DrawCopy("SAME");*/

    AliPWG0Helper::CreateDividedProjections(track1, track2, Form("%ce2", c));
    TH1* pt = gROOT->FindObject(Form("track1_%ce2_div_track2_%ce2", c, c));
    new TCanvas; pt->DrawCopy();
    gPad->SetGridx(); gPad->SetGridy();
  }

  event1_x = event1->ProjectionX("event1_x");
  event1_y = event1->ProjectionY("event1_y");
  event2_x = event2->ProjectionX("event2_x");
  event2_y = event2->ProjectionY("event2_y");

  new TCanvas; event1_x->DrawCopy(); event2_x->SetLineColor(2); event2_x->DrawCopy("SAME"); 

  event1_x->Divide(event2_x);
  event1_y->Divide(event2_y);

  new TCanvas; event1_x->DrawCopy();
  new TCanvas; event1_y->DrawCopy();

  event1->Divide(event2);
  new TCanvas;
  event1->Draw("COLZ");
  event1->SetMinimum(0.5);
  event1->SetMaximum(2);


}

void MagnitudeOfCorrection(const char* fileName, const char* dirName = "dndeta", Float_t ptCut = 0.3)
{
  loadlibs();

  TFile* file = TFile::Open(fileName);
  dNdEtaAnalysis* fdNdEtaAnalysis = new dNdEtaAnalysis(dirName, dirName);
  fdNdEtaAnalysis->LoadHistograms();
  fdNdEtaAnalysis->GetData()->PrintInfo(ptCut);
}

Double_t ConvSigma1To2D(Double_t sigma)
{
  return TMath::Sqrt( - TMath::Log( 1 - TMath::Erf(sigma / TMath::Sqrt(2)) ) * 2);
}

Double_t ConvDistance1DTo2D(Double_t distance)
{
  return TMath::ErfInverse(1 - TMath::Exp(-distance * distance / 2)) * TMath::Sqrt(2);
}

Double_t Sigma2VertexCount(TH2F* tracks, Double_t nSigma)
{
  Double_t count = 0;

  //nSigma = ConvSigma1To2D(nSigma);

  for (Int_t x=1; x<=tracks->GetNbinsX(); ++x)
    for (Int_t y=1; y<=tracks->GetNbinsY(); ++y)
    {
      Double_t impactX = tracks->GetXaxis()->GetBinCenter(x);
      Double_t impactY = tracks->GetYaxis()->GetBinCenter(y);

      Float_t d = TMath::Sqrt(impactX*impactX + impactY*impactY);

      d = ConvDistance1DTo2D(d);

      if (d < nSigma)
        count += tracks->GetBinContent(x, y);
    }

  return count;
}

TH2F* Sigma2VertexGaussianTracksHist()
{
  TH2F* tracks = new TH2F("Sigma2Vertex_tracks", "Sigma2Vertex_tracks", 200, -5, 5, 200, -5, 5);

  TF2* gaussian2D = new TF2("gaussian2D", "xgausn(0) * ygausn(3)", -5, 5, -5, 5);
  gaussian2D->SetParameters(1, 0, 1, 1, 0, 1);

  for (Int_t x=1; x<=tracks->GetNbinsX(); ++x)
    for (Int_t y=1; y<=tracks->GetNbinsY(); ++y)
      tracks->SetBinContent(x, y, gaussian2D->Eval(tracks->GetXaxis()->GetBinCenter(x), tracks->GetYaxis()->GetBinCenter(y)));

  //normalize
  tracks->Scale(1.0 / tracks->Integral());

  return tracks;
}

TH1F* Sigma2VertexGaussian()
{
  TH2F* tracks = Sigma2VertexGaussianTracksHist();

  TCanvas* canvas = new TCanvas("Sigma2VertexGaussian", "Sigma2VertexGaussian", 1000, 1000);
  canvas->Divide(2, 2);

  canvas->cd(1);
  tracks->Draw("COLZ");

  TH1F* ratio = new TH1F("Sigma2Vertex_ratio", "Sigma2Vertex_ratio;n sigma;included", 50, 0.05, 5.05);
  for (Double_t nSigma = 0.1; nSigma < 5.05; nSigma += 0.1)
    ratio->Fill(nSigma, Sigma2VertexCount(tracks, nSigma));
  ratio->SetMarkerStyle(21);

  canvas->cd(2);
  ratio->DrawCopy("P");

  TH1F* ratio2 = new TH1F("Sigma2Vertex_ratio2", "Sigma2Vertex_ratio2;nSigma;% included 4 sigma / % included n sigma", 50, 0.05, 5.05);
  Double_t sigma3 = Sigma2VertexCount(tracks, 4);
  for (Double_t nSigma = 0.1; nSigma < 5.05; nSigma += 0.1)
    ratio2->Fill(nSigma, sigma3 / ratio->GetBinContent(ratio->FindBin(nSigma)));
  ratio2->SetMarkerStyle(21);

  canvas->cd(3);
  ratio2->DrawCopy("P");

  canvas->SaveAs("Sigma2Vertex.eps");

  return ratio2;
}

TH1F** Sigma2VertexSimulation(const char* fileName = "systematics.root")
{
  TFile* file = TFile::Open(fileName);

  TH1F* sigmavertex = dynamic_cast<TH1F*> (file->Get("fSigmaVertexTracks"));
  TH1F* sigmavertexPrim = dynamic_cast<TH1F*> (file->Get("fSigmaVertexPrim"));
  if (!sigmavertex || !sigmavertexPrim)
  {
    printf("Could not read histogram(s)\n");
    return;
  }

  // calculate ratio
  TH1F* ratio = new TH1F("sigmavertexsimulation_ratio", "sigmavertexsimulation_ratio;N#sigma;% included in 4 #sigma / % included in N#sigma", sigmavertex->GetNbinsX(), sigmavertex->GetXaxis()->GetXmin(), sigmavertex->GetXaxis()->GetXmax());

  // calculate contamination
  TH1F* contamination = ratio->Clone("sigmavertexsimulation_contamination");
  contamination->SetTitle("sigmavertexsimulation_contamination;N#sigma;1 + N_{secondaries} / N_{all}");

  for (Int_t i=1; i<=sigmavertex->GetNbinsX(); ++i)
  {
    ratio->SetBinContent(i, sigmavertex->GetBinContent(sigmavertex->GetXaxis()->FindBin(4)) / sigmavertex->GetBinContent(i));
    contamination->SetBinContent(i, 1 + (sigmavertex->GetBinContent(i) - sigmavertexPrim->GetBinContent(i)) / sigmavertex->GetBinContent(i));
  }

  // print stats
  for (Float_t sigma = 2.0; sigma < 5.25; sigma += 0.5)
  {
    Float_t error1 = 1 - ratio->GetBinContent(sigmavertex->GetXaxis()->FindBin(sigma)) / ratio->GetBinContent(sigmavertex->GetXaxis()->FindBin(sigma - 0.5));
    Float_t error2 = -1 + ratio->GetBinContent(sigmavertex->GetXaxis()->FindBin(sigma)) / ratio->GetBinContent(sigmavertex->GetXaxis()->FindBin(sigma + 0.5));
    Float_t cont = -1 + contamination->GetBinContent(sigmavertex->GetXaxis()->FindBin(sigma));
    Printf("%.2f sigma --> syst. error = - %.2f %% + %.2f %%, cont. = %.2f %%", sigma, error1 * 100, error2 * 100, cont * 100);
  }

  TCanvas* canvas = new TCanvas("Sigma2VertexSimulation", "Sigma2VertexSimulation", 1000, 500);
  canvas->Divide(2, 1);

  canvas->cd(1);
  sigmavertex->SetMarkerStyle(21);
  sigmavertex->Draw("P");

  canvas->cd(2);
  ratio->SetMarkerStyle(21);
  ratio->DrawCopy("P");

  contamination->DrawCopy("SAME");

  TH1F** returnContainer = new TH1F*[2];
  returnContainer[0] = ratio;
  returnContainer[1] = contamination;

  return returnContainer;
}

void Sigma2VertexCompare(const char* fileName = "systematics.root")
{
  TH1F* ratio1 = Sigma2VertexGaussian();

  TH1F** hists = Sigma2VertexSimulation(fileName);
  TH1F* ratio2 = hists[0];
  TH1F* contamination = hists[1];

  ratio1->SetStats(kFALSE);
  ratio2->SetStats(kFALSE);

  ratio1->SetMarkerStyle(0);
  ratio2->SetMarkerStyle(0);

  ratio1->SetLineWidth(2);
  ratio2->SetLineWidth(2);

  TLegend* legend = new TLegend(0.6, 0.8, 0.95, 0.95);
  legend->SetFillColor(0);
  legend->AddEntry(ratio1, "Gaussian");
  legend->AddEntry(ratio2, "Simulation");
  legend->AddEntry(contamination, "1 + Contamination");

  ratio2->SetTitle("");
  ratio2->GetYaxis()->SetTitleOffset(1.5);
  ratio2->GetXaxis()->SetRangeUser(2, 5);

  TCanvas* canvas = new TCanvas("Sigma2VertexCompare", "Sigma2VertexCompare", 500, 500);
  InitPad();

  ratio2->SetMarkerStyle(21);
  ratio1->SetMarkerStyle(22);

  ratio2->GetYaxis()->SetRangeUser(0.8, 1.2);
  ratio2->SetLineColor(kRed);
  ratio2->SetMarkerColor(kRed);
  ratio2->Draw("PL");
  ratio1->Draw("SAMEPL");

  contamination->Draw("SAME");

  legend->Draw();

  canvas->SaveAs("Sigma2VertexCompare.eps");
}
 drawSystematicsNew.C:1
 drawSystematicsNew.C:2
 drawSystematicsNew.C:3
 drawSystematicsNew.C:4
 drawSystematicsNew.C:5
 drawSystematicsNew.C:6
 drawSystematicsNew.C:7
 drawSystematicsNew.C:8
 drawSystematicsNew.C:9
 drawSystematicsNew.C:10
 drawSystematicsNew.C:11
 drawSystematicsNew.C:12
 drawSystematicsNew.C:13
 drawSystematicsNew.C:14
 drawSystematicsNew.C:15
 drawSystematicsNew.C:16
 drawSystematicsNew.C:17
 drawSystematicsNew.C:18
 drawSystematicsNew.C:19
 drawSystematicsNew.C:20
 drawSystematicsNew.C:21
 drawSystematicsNew.C:22
 drawSystematicsNew.C:23
 drawSystematicsNew.C:24
 drawSystematicsNew.C:25
 drawSystematicsNew.C:26
 drawSystematicsNew.C:27
 drawSystematicsNew.C:28
 drawSystematicsNew.C:29
 drawSystematicsNew.C:30
 drawSystematicsNew.C:31
 drawSystematicsNew.C:32
 drawSystematicsNew.C:33
 drawSystematicsNew.C:34
 drawSystematicsNew.C:35
 drawSystematicsNew.C:36
 drawSystematicsNew.C:37
 drawSystematicsNew.C:38
 drawSystematicsNew.C:39
 drawSystematicsNew.C:40
 drawSystematicsNew.C:41
 drawSystematicsNew.C:42
 drawSystematicsNew.C:43
 drawSystematicsNew.C:44
 drawSystematicsNew.C:45
 drawSystematicsNew.C:46
 drawSystematicsNew.C:47
 drawSystematicsNew.C:48
 drawSystematicsNew.C:49
 drawSystematicsNew.C:50
 drawSystematicsNew.C:51
 drawSystematicsNew.C:52
 drawSystematicsNew.C:53
 drawSystematicsNew.C:54
 drawSystematicsNew.C:55
 drawSystematicsNew.C:56
 drawSystematicsNew.C:57
 drawSystematicsNew.C:58
 drawSystematicsNew.C:59
 drawSystematicsNew.C:60
 drawSystematicsNew.C:61
 drawSystematicsNew.C:62
 drawSystematicsNew.C:63
 drawSystematicsNew.C:64
 drawSystematicsNew.C:65
 drawSystematicsNew.C:66
 drawSystematicsNew.C:67
 drawSystematicsNew.C:68
 drawSystematicsNew.C:69
 drawSystematicsNew.C:70
 drawSystematicsNew.C:71
 drawSystematicsNew.C:72
 drawSystematicsNew.C:73
 drawSystematicsNew.C:74
 drawSystematicsNew.C:75
 drawSystematicsNew.C:76
 drawSystematicsNew.C:77
 drawSystematicsNew.C:78
 drawSystematicsNew.C:79
 drawSystematicsNew.C:80
 drawSystematicsNew.C:81
 drawSystematicsNew.C:82
 drawSystematicsNew.C:83
 drawSystematicsNew.C:84
 drawSystematicsNew.C:85
 drawSystematicsNew.C:86
 drawSystematicsNew.C:87
 drawSystematicsNew.C:88
 drawSystematicsNew.C:89
 drawSystematicsNew.C:90
 drawSystematicsNew.C:91
 drawSystematicsNew.C:92
 drawSystematicsNew.C:93
 drawSystematicsNew.C:94
 drawSystematicsNew.C:95
 drawSystematicsNew.C:96
 drawSystematicsNew.C:97
 drawSystematicsNew.C:98
 drawSystematicsNew.C:99
 drawSystematicsNew.C:100
 drawSystematicsNew.C:101
 drawSystematicsNew.C:102
 drawSystematicsNew.C:103
 drawSystematicsNew.C:104
 drawSystematicsNew.C:105
 drawSystematicsNew.C:106
 drawSystematicsNew.C:107
 drawSystematicsNew.C:108
 drawSystematicsNew.C:109
 drawSystematicsNew.C:110
 drawSystematicsNew.C:111
 drawSystematicsNew.C:112
 drawSystematicsNew.C:113
 drawSystematicsNew.C:114
 drawSystematicsNew.C:115
 drawSystematicsNew.C:116
 drawSystematicsNew.C:117
 drawSystematicsNew.C:118
 drawSystematicsNew.C:119
 drawSystematicsNew.C:120
 drawSystematicsNew.C:121
 drawSystematicsNew.C:122
 drawSystematicsNew.C:123
 drawSystematicsNew.C:124
 drawSystematicsNew.C:125
 drawSystematicsNew.C:126
 drawSystematicsNew.C:127
 drawSystematicsNew.C:128
 drawSystematicsNew.C:129
 drawSystematicsNew.C:130
 drawSystematicsNew.C:131
 drawSystematicsNew.C:132
 drawSystematicsNew.C:133
 drawSystematicsNew.C:134
 drawSystematicsNew.C:135
 drawSystematicsNew.C:136
 drawSystematicsNew.C:137
 drawSystematicsNew.C:138
 drawSystematicsNew.C:139
 drawSystematicsNew.C:140
 drawSystematicsNew.C:141
 drawSystematicsNew.C:142
 drawSystematicsNew.C:143
 drawSystematicsNew.C:144
 drawSystematicsNew.C:145
 drawSystematicsNew.C:146
 drawSystematicsNew.C:147
 drawSystematicsNew.C:148
 drawSystematicsNew.C:149
 drawSystematicsNew.C:150
 drawSystematicsNew.C:151
 drawSystematicsNew.C:152
 drawSystematicsNew.C:153
 drawSystematicsNew.C:154
 drawSystematicsNew.C:155
 drawSystematicsNew.C:156
 drawSystematicsNew.C:157
 drawSystematicsNew.C:158
 drawSystematicsNew.C:159
 drawSystematicsNew.C:160
 drawSystematicsNew.C:161
 drawSystematicsNew.C:162
 drawSystematicsNew.C:163
 drawSystematicsNew.C:164
 drawSystematicsNew.C:165
 drawSystematicsNew.C:166
 drawSystematicsNew.C:167
 drawSystematicsNew.C:168
 drawSystematicsNew.C:169
 drawSystematicsNew.C:170
 drawSystematicsNew.C:171
 drawSystematicsNew.C:172
 drawSystematicsNew.C:173
 drawSystematicsNew.C:174
 drawSystematicsNew.C:175
 drawSystematicsNew.C:176
 drawSystematicsNew.C:177
 drawSystematicsNew.C:178
 drawSystematicsNew.C:179
 drawSystematicsNew.C:180
 drawSystematicsNew.C:181
 drawSystematicsNew.C:182
 drawSystematicsNew.C:183
 drawSystematicsNew.C:184
 drawSystematicsNew.C:185
 drawSystematicsNew.C:186
 drawSystematicsNew.C:187
 drawSystematicsNew.C:188
 drawSystematicsNew.C:189
 drawSystematicsNew.C:190
 drawSystematicsNew.C:191
 drawSystematicsNew.C:192
 drawSystematicsNew.C:193
 drawSystematicsNew.C:194
 drawSystematicsNew.C:195
 drawSystematicsNew.C:196
 drawSystematicsNew.C:197
 drawSystematicsNew.C:198
 drawSystematicsNew.C:199
 drawSystematicsNew.C:200
 drawSystematicsNew.C:201
 drawSystematicsNew.C:202
 drawSystematicsNew.C:203
 drawSystematicsNew.C:204
 drawSystematicsNew.C:205
 drawSystematicsNew.C:206
 drawSystematicsNew.C:207
 drawSystematicsNew.C:208
 drawSystematicsNew.C:209
 drawSystematicsNew.C:210
 drawSystematicsNew.C:211
 drawSystematicsNew.C:212
 drawSystematicsNew.C:213
 drawSystematicsNew.C:214
 drawSystematicsNew.C:215
 drawSystematicsNew.C:216
 drawSystematicsNew.C:217
 drawSystematicsNew.C:218
 drawSystematicsNew.C:219
 drawSystematicsNew.C:220
 drawSystematicsNew.C:221
 drawSystematicsNew.C:222
 drawSystematicsNew.C:223
 drawSystematicsNew.C:224
 drawSystematicsNew.C:225
 drawSystematicsNew.C:226
 drawSystematicsNew.C:227
 drawSystematicsNew.C:228
 drawSystematicsNew.C:229
 drawSystematicsNew.C:230
 drawSystematicsNew.C:231
 drawSystematicsNew.C:232
 drawSystematicsNew.C:233
 drawSystematicsNew.C:234
 drawSystematicsNew.C:235
 drawSystematicsNew.C:236
 drawSystematicsNew.C:237
 drawSystematicsNew.C:238
 drawSystematicsNew.C:239
 drawSystematicsNew.C:240
 drawSystematicsNew.C:241
 drawSystematicsNew.C:242
 drawSystematicsNew.C:243
 drawSystematicsNew.C:244
 drawSystematicsNew.C:245
 drawSystematicsNew.C:246
 drawSystematicsNew.C:247
 drawSystematicsNew.C:248
 drawSystematicsNew.C:249
 drawSystematicsNew.C:250
 drawSystematicsNew.C:251
 drawSystematicsNew.C:252
 drawSystematicsNew.C:253
 drawSystematicsNew.C:254
 drawSystematicsNew.C:255
 drawSystematicsNew.C:256
 drawSystematicsNew.C:257
 drawSystematicsNew.C:258
 drawSystematicsNew.C:259
 drawSystematicsNew.C:260
 drawSystematicsNew.C:261
 drawSystematicsNew.C:262
 drawSystematicsNew.C:263
 drawSystematicsNew.C:264
 drawSystematicsNew.C:265
 drawSystematicsNew.C:266
 drawSystematicsNew.C:267
 drawSystematicsNew.C:268
 drawSystematicsNew.C:269
 drawSystematicsNew.C:270
 drawSystematicsNew.C:271
 drawSystematicsNew.C:272
 drawSystematicsNew.C:273
 drawSystematicsNew.C:274
 drawSystematicsNew.C:275
 drawSystematicsNew.C:276
 drawSystematicsNew.C:277
 drawSystematicsNew.C:278
 drawSystematicsNew.C:279
 drawSystematicsNew.C:280
 drawSystematicsNew.C:281
 drawSystematicsNew.C:282
 drawSystematicsNew.C:283
 drawSystematicsNew.C:284
 drawSystematicsNew.C:285
 drawSystematicsNew.C:286
 drawSystematicsNew.C:287
 drawSystematicsNew.C:288
 drawSystematicsNew.C:289
 drawSystematicsNew.C:290
 drawSystematicsNew.C:291
 drawSystematicsNew.C:292
 drawSystematicsNew.C:293
 drawSystematicsNew.C:294
 drawSystematicsNew.C:295
 drawSystematicsNew.C:296
 drawSystematicsNew.C:297
 drawSystematicsNew.C:298
 drawSystematicsNew.C:299
 drawSystematicsNew.C:300
 drawSystematicsNew.C:301
 drawSystematicsNew.C:302
 drawSystematicsNew.C:303
 drawSystematicsNew.C:304
 drawSystematicsNew.C:305
 drawSystematicsNew.C:306
 drawSystematicsNew.C:307
 drawSystematicsNew.C:308
 drawSystematicsNew.C:309
 drawSystematicsNew.C:310
 drawSystematicsNew.C:311
 drawSystematicsNew.C:312
 drawSystematicsNew.C:313
 drawSystematicsNew.C:314
 drawSystematicsNew.C:315
 drawSystematicsNew.C:316
 drawSystematicsNew.C:317
 drawSystematicsNew.C:318
 drawSystematicsNew.C:319
 drawSystematicsNew.C:320
 drawSystematicsNew.C:321
 drawSystematicsNew.C:322
 drawSystematicsNew.C:323
 drawSystematicsNew.C:324
 drawSystematicsNew.C:325
 drawSystematicsNew.C:326
 drawSystematicsNew.C:327
 drawSystematicsNew.C:328
 drawSystematicsNew.C:329
 drawSystematicsNew.C:330
 drawSystematicsNew.C:331
 drawSystematicsNew.C:332
 drawSystematicsNew.C:333
 drawSystematicsNew.C:334
 drawSystematicsNew.C:335
 drawSystematicsNew.C:336
 drawSystematicsNew.C:337
 drawSystematicsNew.C:338
 drawSystematicsNew.C:339
 drawSystematicsNew.C:340
 drawSystematicsNew.C:341
 drawSystematicsNew.C:342
 drawSystematicsNew.C:343
 drawSystematicsNew.C:344
 drawSystematicsNew.C:345
 drawSystematicsNew.C:346
 drawSystematicsNew.C:347
 drawSystematicsNew.C:348
 drawSystematicsNew.C:349
 drawSystematicsNew.C:350
 drawSystematicsNew.C:351
 drawSystematicsNew.C:352
 drawSystematicsNew.C:353
 drawSystematicsNew.C:354
 drawSystematicsNew.C:355
 drawSystematicsNew.C:356
 drawSystematicsNew.C:357
 drawSystematicsNew.C:358
 drawSystematicsNew.C:359
 drawSystematicsNew.C:360
 drawSystematicsNew.C:361
 drawSystematicsNew.C:362
 drawSystematicsNew.C:363
 drawSystematicsNew.C:364
 drawSystematicsNew.C:365
 drawSystematicsNew.C:366
 drawSystematicsNew.C:367
 drawSystematicsNew.C:368
 drawSystematicsNew.C:369
 drawSystematicsNew.C:370
 drawSystematicsNew.C:371
 drawSystematicsNew.C:372
 drawSystematicsNew.C:373
 drawSystematicsNew.C:374
 drawSystematicsNew.C:375
 drawSystematicsNew.C:376
 drawSystematicsNew.C:377
 drawSystematicsNew.C:378
 drawSystematicsNew.C:379
 drawSystematicsNew.C:380
 drawSystematicsNew.C:381
 drawSystematicsNew.C:382
 drawSystematicsNew.C:383
 drawSystematicsNew.C:384
 drawSystematicsNew.C:385
 drawSystematicsNew.C:386
 drawSystematicsNew.C:387
 drawSystematicsNew.C:388
 drawSystematicsNew.C:389
 drawSystematicsNew.C:390
 drawSystematicsNew.C:391
 drawSystematicsNew.C:392
 drawSystematicsNew.C:393
 drawSystematicsNew.C:394
 drawSystematicsNew.C:395
 drawSystematicsNew.C:396
 drawSystematicsNew.C:397
 drawSystematicsNew.C:398
 drawSystematicsNew.C:399
 drawSystematicsNew.C:400
 drawSystematicsNew.C:401
 drawSystematicsNew.C:402
 drawSystematicsNew.C:403
 drawSystematicsNew.C:404
 drawSystematicsNew.C:405
 drawSystematicsNew.C:406
 drawSystematicsNew.C:407
 drawSystematicsNew.C:408
 drawSystematicsNew.C:409
 drawSystematicsNew.C:410
 drawSystematicsNew.C:411
 drawSystematicsNew.C:412
 drawSystematicsNew.C:413
 drawSystematicsNew.C:414
 drawSystematicsNew.C:415
 drawSystematicsNew.C:416
 drawSystematicsNew.C:417
 drawSystematicsNew.C:418
 drawSystematicsNew.C:419
 drawSystematicsNew.C:420
 drawSystematicsNew.C:421
 drawSystematicsNew.C:422
 drawSystematicsNew.C:423
 drawSystematicsNew.C:424
 drawSystematicsNew.C:425
 drawSystematicsNew.C:426
 drawSystematicsNew.C:427
 drawSystematicsNew.C:428
 drawSystematicsNew.C:429
 drawSystematicsNew.C:430
 drawSystematicsNew.C:431
 drawSystematicsNew.C:432
 drawSystematicsNew.C:433
 drawSystematicsNew.C:434
 drawSystematicsNew.C:435
 drawSystematicsNew.C:436
 drawSystematicsNew.C:437
 drawSystematicsNew.C:438
 drawSystematicsNew.C:439
 drawSystematicsNew.C:440
 drawSystematicsNew.C:441
 drawSystematicsNew.C:442
 drawSystematicsNew.C:443
 drawSystematicsNew.C:444
 drawSystematicsNew.C:445
 drawSystematicsNew.C:446
 drawSystematicsNew.C:447
 drawSystematicsNew.C:448
 drawSystematicsNew.C:449
 drawSystematicsNew.C:450
 drawSystematicsNew.C:451
 drawSystematicsNew.C:452
 drawSystematicsNew.C:453
 drawSystematicsNew.C:454
 drawSystematicsNew.C:455
 drawSystematicsNew.C:456
 drawSystematicsNew.C:457
 drawSystematicsNew.C:458
 drawSystematicsNew.C:459
 drawSystematicsNew.C:460
 drawSystematicsNew.C:461
 drawSystematicsNew.C:462
 drawSystematicsNew.C:463
 drawSystematicsNew.C:464
 drawSystematicsNew.C:465
 drawSystematicsNew.C:466
 drawSystematicsNew.C:467
 drawSystematicsNew.C:468
 drawSystematicsNew.C:469
 drawSystematicsNew.C:470
 drawSystematicsNew.C:471
 drawSystematicsNew.C:472
 drawSystematicsNew.C:473
 drawSystematicsNew.C:474
 drawSystematicsNew.C:475
 drawSystematicsNew.C:476
 drawSystematicsNew.C:477
 drawSystematicsNew.C:478
 drawSystematicsNew.C:479
 drawSystematicsNew.C:480
 drawSystematicsNew.C:481
 drawSystematicsNew.C:482
 drawSystematicsNew.C:483
 drawSystematicsNew.C:484
 drawSystematicsNew.C:485
 drawSystematicsNew.C:486
 drawSystematicsNew.C:487
 drawSystematicsNew.C:488
 drawSystematicsNew.C:489
 drawSystematicsNew.C:490
 drawSystematicsNew.C:491
 drawSystematicsNew.C:492
 drawSystematicsNew.C:493
 drawSystematicsNew.C:494
 drawSystematicsNew.C:495
 drawSystematicsNew.C:496
 drawSystematicsNew.C:497
 drawSystematicsNew.C:498
 drawSystematicsNew.C:499
 drawSystematicsNew.C:500
 drawSystematicsNew.C:501
 drawSystematicsNew.C:502
 drawSystematicsNew.C:503
 drawSystematicsNew.C:504
 drawSystematicsNew.C:505
 drawSystematicsNew.C:506
 drawSystematicsNew.C:507
 drawSystematicsNew.C:508
 drawSystematicsNew.C:509
 drawSystematicsNew.C:510
 drawSystematicsNew.C:511
 drawSystematicsNew.C:512
 drawSystematicsNew.C:513
 drawSystematicsNew.C:514
 drawSystematicsNew.C:515
 drawSystematicsNew.C:516
 drawSystematicsNew.C:517
 drawSystematicsNew.C:518
 drawSystematicsNew.C:519
 drawSystematicsNew.C:520
 drawSystematicsNew.C:521
 drawSystematicsNew.C:522
 drawSystematicsNew.C:523
 drawSystematicsNew.C:524
 drawSystematicsNew.C:525
 drawSystematicsNew.C:526
 drawSystematicsNew.C:527
 drawSystematicsNew.C:528
 drawSystematicsNew.C:529
 drawSystematicsNew.C:530
 drawSystematicsNew.C:531
 drawSystematicsNew.C:532
 drawSystematicsNew.C:533
 drawSystematicsNew.C:534
 drawSystematicsNew.C:535
 drawSystematicsNew.C:536
 drawSystematicsNew.C:537
 drawSystematicsNew.C:538
 drawSystematicsNew.C:539
 drawSystematicsNew.C:540
 drawSystematicsNew.C:541
 drawSystematicsNew.C:542
 drawSystematicsNew.C:543
 drawSystematicsNew.C:544
 drawSystematicsNew.C:545
 drawSystematicsNew.C:546
 drawSystematicsNew.C:547
 drawSystematicsNew.C:548
 drawSystematicsNew.C:549
 drawSystematicsNew.C:550
 drawSystematicsNew.C:551
 drawSystematicsNew.C:552
 drawSystematicsNew.C:553
 drawSystematicsNew.C:554
 drawSystematicsNew.C:555
 drawSystematicsNew.C:556
 drawSystematicsNew.C:557
 drawSystematicsNew.C:558
 drawSystematicsNew.C:559
 drawSystematicsNew.C:560
 drawSystematicsNew.C:561
 drawSystematicsNew.C:562
 drawSystematicsNew.C:563
 drawSystematicsNew.C:564
 drawSystematicsNew.C:565
 drawSystematicsNew.C:566
 drawSystematicsNew.C:567
 drawSystematicsNew.C:568
 drawSystematicsNew.C:569
 drawSystematicsNew.C:570
 drawSystematicsNew.C:571
 drawSystematicsNew.C:572
 drawSystematicsNew.C:573
 drawSystematicsNew.C:574
 drawSystematicsNew.C:575
 drawSystematicsNew.C:576
 drawSystematicsNew.C:577
 drawSystematicsNew.C:578
 drawSystematicsNew.C:579
 drawSystematicsNew.C:580
 drawSystematicsNew.C:581
 drawSystematicsNew.C:582
 drawSystematicsNew.C:583
 drawSystematicsNew.C:584
 drawSystematicsNew.C:585
 drawSystematicsNew.C:586
 drawSystematicsNew.C:587
 drawSystematicsNew.C:588
 drawSystematicsNew.C:589
 drawSystematicsNew.C:590
 drawSystematicsNew.C:591
 drawSystematicsNew.C:592
 drawSystematicsNew.C:593
 drawSystematicsNew.C:594
 drawSystematicsNew.C:595
 drawSystematicsNew.C:596
 drawSystematicsNew.C:597
 drawSystematicsNew.C:598
 drawSystematicsNew.C:599
 drawSystematicsNew.C:600
 drawSystematicsNew.C:601
 drawSystematicsNew.C:602
 drawSystematicsNew.C:603
 drawSystematicsNew.C:604
 drawSystematicsNew.C:605
 drawSystematicsNew.C:606
 drawSystematicsNew.C:607
 drawSystematicsNew.C:608
 drawSystematicsNew.C:609
 drawSystematicsNew.C:610
 drawSystematicsNew.C:611
 drawSystematicsNew.C:612
 drawSystematicsNew.C:613
 drawSystematicsNew.C:614
 drawSystematicsNew.C:615
 drawSystematicsNew.C:616
 drawSystematicsNew.C:617
 drawSystematicsNew.C:618
 drawSystematicsNew.C:619
 drawSystematicsNew.C:620
 drawSystematicsNew.C:621
 drawSystematicsNew.C:622
 drawSystematicsNew.C:623
 drawSystematicsNew.C:624
 drawSystematicsNew.C:625
 drawSystematicsNew.C:626
 drawSystematicsNew.C:627
 drawSystematicsNew.C:628
 drawSystematicsNew.C:629
 drawSystematicsNew.C:630
 drawSystematicsNew.C:631
 drawSystematicsNew.C:632
 drawSystematicsNew.C:633
 drawSystematicsNew.C:634
 drawSystematicsNew.C:635
 drawSystematicsNew.C:636
 drawSystematicsNew.C:637
 drawSystematicsNew.C:638
 drawSystematicsNew.C:639
 drawSystematicsNew.C:640
 drawSystematicsNew.C:641
 drawSystematicsNew.C:642
 drawSystematicsNew.C:643
 drawSystematicsNew.C:644
 drawSystematicsNew.C:645
 drawSystematicsNew.C:646
 drawSystematicsNew.C:647
 drawSystematicsNew.C:648
 drawSystematicsNew.C:649
 drawSystematicsNew.C:650
 drawSystematicsNew.C:651
 drawSystematicsNew.C:652
 drawSystematicsNew.C:653
 drawSystematicsNew.C:654
 drawSystematicsNew.C:655
 drawSystematicsNew.C:656
 drawSystematicsNew.C:657
 drawSystematicsNew.C:658
 drawSystematicsNew.C:659
 drawSystematicsNew.C:660
 drawSystematicsNew.C:661
 drawSystematicsNew.C:662
 drawSystematicsNew.C:663
 drawSystematicsNew.C:664
 drawSystematicsNew.C:665
 drawSystematicsNew.C:666
 drawSystematicsNew.C:667
 drawSystematicsNew.C:668
 drawSystematicsNew.C:669
 drawSystematicsNew.C:670
 drawSystematicsNew.C:671
 drawSystematicsNew.C:672
 drawSystematicsNew.C:673
 drawSystematicsNew.C:674
 drawSystematicsNew.C:675
 drawSystematicsNew.C:676
 drawSystematicsNew.C:677
 drawSystematicsNew.C:678
 drawSystematicsNew.C:679
 drawSystematicsNew.C:680
 drawSystematicsNew.C:681
 drawSystematicsNew.C:682
 drawSystematicsNew.C:683
 drawSystematicsNew.C:684
 drawSystematicsNew.C:685
 drawSystematicsNew.C:686
 drawSystematicsNew.C:687
 drawSystematicsNew.C:688
 drawSystematicsNew.C:689
 drawSystematicsNew.C:690
 drawSystematicsNew.C:691
 drawSystematicsNew.C:692
 drawSystematicsNew.C:693
 drawSystematicsNew.C:694
 drawSystematicsNew.C:695
 drawSystematicsNew.C:696
 drawSystematicsNew.C:697
 drawSystematicsNew.C:698
 drawSystematicsNew.C:699
 drawSystematicsNew.C:700
 drawSystematicsNew.C:701
 drawSystematicsNew.C:702
 drawSystematicsNew.C:703
 drawSystematicsNew.C:704
 drawSystematicsNew.C:705
 drawSystematicsNew.C:706
 drawSystematicsNew.C:707
 drawSystematicsNew.C:708
 drawSystematicsNew.C:709
 drawSystematicsNew.C:710
 drawSystematicsNew.C:711
 drawSystematicsNew.C:712
 drawSystematicsNew.C:713
 drawSystematicsNew.C:714
 drawSystematicsNew.C:715
 drawSystematicsNew.C:716
 drawSystematicsNew.C:717
 drawSystematicsNew.C:718
 drawSystematicsNew.C:719
 drawSystematicsNew.C:720
 drawSystematicsNew.C:721
 drawSystematicsNew.C:722
 drawSystematicsNew.C:723
 drawSystematicsNew.C:724
 drawSystematicsNew.C:725
 drawSystematicsNew.C:726
 drawSystematicsNew.C:727
 drawSystematicsNew.C:728
 drawSystematicsNew.C:729
 drawSystematicsNew.C:730
 drawSystematicsNew.C:731
 drawSystematicsNew.C:732
 drawSystematicsNew.C:733
 drawSystematicsNew.C:734
 drawSystematicsNew.C:735
 drawSystematicsNew.C:736
 drawSystematicsNew.C:737
 drawSystematicsNew.C:738
 drawSystematicsNew.C:739
 drawSystematicsNew.C:740
 drawSystematicsNew.C:741
 drawSystematicsNew.C:742
 drawSystematicsNew.C:743
 drawSystematicsNew.C:744
 drawSystematicsNew.C:745
 drawSystematicsNew.C:746
 drawSystematicsNew.C:747
 drawSystematicsNew.C:748
 drawSystematicsNew.C:749
 drawSystematicsNew.C:750
 drawSystematicsNew.C:751
 drawSystematicsNew.C:752
 drawSystematicsNew.C:753
 drawSystematicsNew.C:754
 drawSystematicsNew.C:755
 drawSystematicsNew.C:756
 drawSystematicsNew.C:757
 drawSystematicsNew.C:758
 drawSystematicsNew.C:759
 drawSystematicsNew.C:760
 drawSystematicsNew.C:761
 drawSystematicsNew.C:762
 drawSystematicsNew.C:763
 drawSystematicsNew.C:764
 drawSystematicsNew.C:765
 drawSystematicsNew.C:766
 drawSystematicsNew.C:767
 drawSystematicsNew.C:768
 drawSystematicsNew.C:769
 drawSystematicsNew.C:770
 drawSystematicsNew.C:771
 drawSystematicsNew.C:772
 drawSystematicsNew.C:773
 drawSystematicsNew.C:774
 drawSystematicsNew.C:775
 drawSystematicsNew.C:776
 drawSystematicsNew.C:777
 drawSystematicsNew.C:778
 drawSystematicsNew.C:779
 drawSystematicsNew.C:780
 drawSystematicsNew.C:781
 drawSystematicsNew.C:782
 drawSystematicsNew.C:783
 drawSystematicsNew.C:784
 drawSystematicsNew.C:785
 drawSystematicsNew.C:786
 drawSystematicsNew.C:787
 drawSystematicsNew.C:788
 drawSystematicsNew.C:789
 drawSystematicsNew.C:790
 drawSystematicsNew.C:791
 drawSystematicsNew.C:792
 drawSystematicsNew.C:793
 drawSystematicsNew.C:794
 drawSystematicsNew.C:795
 drawSystematicsNew.C:796
 drawSystematicsNew.C:797
 drawSystematicsNew.C:798
 drawSystematicsNew.C:799
 drawSystematicsNew.C:800