Example #1
0
void proc_pileup(const AliVdMMetaData& vdmMetaData,
                 AliVdMScanData& allData,
                 const char* classAC,
                 const char* classAnotC,
                 const char* classCnotA,
                 const std::vector<Double_t>& par0)
{
  typedef std::map<Short_t, TGraphErrors> map_t; // BCID -> TGraphErrors
  map_t gAnotC, gCnotA;  // one-arm/two-arm ratios

  // (1) fill one-arm/two-arm ratio graphs for all BCIDs
  for (Int_t iScan=0; iScan<4; ++iScan) {
    AliVdMTree& vtAND   = allData.GetMap(iScan)[classAC];
    AliVdMTree& vtAnotC = allData.GetMap(iScan)[classAnotC];
    AliVdMTree& vtCnotA = allData.GetMap(iScan)[classCnotA];
    vtAND.Zip3([&gAnotC,&gCnotA](const AliVdMTree::DefaultBranchData& d,
                                 AliVdMTree::branchMap_t& mapAC,
                                 AliVdMTree::branchMap_t& mapAnotC,
                                 AliVdMTree::branchMap_t& mapCnotA)
               {
                 AliVdMTree::ValErr v1 = mapAnotC["rate"];
                 v1 /= mapAC["rate"];
                 // v1 /= mapAC["relBkgd"];
                 v1 *= mapAnotC["relBkgd"];
                 if (!v1.isInf() && v1.val()) {
                   const Int_t m1 = gAnotC[d.BCID()].GetN();
                   gAnotC[d.BCID()].SetPoint     (m1, mapAC["mu"].val(), v1.val());
                   gAnotC[d.BCID()].SetPointError(m1, mapAC["mu"].err(), v1.err());
                 }
                 AliVdMTree::ValErr v2 = mapCnotA["rate"];
                 v2 /= mapAC["rate"];
                 // v2 /= mapAC["relBkgd"];
                 v2 *= mapCnotA["relBkgd"];
                 if (!v2.isInf() && v2.val()) {
                   const Int_t m2 = gCnotA[d.BCID()].GetN();
                   gCnotA[d.BCID()].SetPoint     (m2, mapAC["mu"].val(), v2.val());
                   gCnotA[d.BCID()].SetPointError(m2, mapAC["mu"].err(), v2.err());
                 }
               },
               vtAnotC, vtCnotA);
  }

  // (2) fit model
  AliVdMPileup pileupModel;

  TString pn = TString::Format("pileup_%s.pdf", classAC);
  TCanvas *c1 = new TCanvas;
  c1->SaveAs(pn+"[");

  const AliTriggerBCMask& bcMask = vdmMetaData.GetTriggerBCMask();
  const Int_t             nBCs   = bcMask.GetNUnmaskedBCs();

  TH1 *hPar[5] = {
    SetAttr(new TH1D("hrA",      ";BCID;r_{A}",           nBCs,0,nBCs), kRed),
    SetAttr(new TH1D("hrC",      ";BCID;r_{C}",           nBCs,0,nBCs), kBlue),
    SetAttr(new TH1D("hbkgdA",   ";BCID;bkgd_{A}",        nBCs,0,nBCs), kRed),
    SetAttr(new TH1D("hbkgdC",   ";BCID;bkgd_{C}",        nBCs,0,nBCs), kBlue),
    SetAttr(new TH1D("hChi2NDF", ";BCID;#chi^{2}/n.d.f.", nBCs,0,nBCs), kBlue)
  };

  for (Int_t bc=0, counter=0; bc<3564; ++bc) {
    if (bcMask.GetMask(bc))
      continue;

    const TString binLabel = TString::Format("%d", bc);
    for (Int_t i=0; i<5; ++i)
      hPar[i]->GetXaxis()->SetBinLabel(1+counter, binLabel);

    c1->Clear();
    c1->SetLogx();
    c1->SetLogy();
    TH1 *hf = c1->DrawFrame(1e-6, 0.01, 0.5, 20);
    hf->SetTitle(TString::Format("BCID=%d %s;two-arm #mu;one-arm/two-arm", bc, classAC));
    pileupModel.DoFit(&gAnotC[bc], &gCnotA[bc], &par0[0]);

    SetAttr(&gAnotC[bc], kBlue);
    SetAttr(&gCnotA[bc], kRed);
    gAnotC[bc].Draw("PE");
    gCnotA[bc].Draw("PE");

    TF1 *fAnotC = SetAttr(new TF1("fAnotC", &pileupModel, &AliVdMPileup::fcnAnotC, 1e-6, 0.5, 5), kBlue);
    fAnotC->SetParameters(pileupModel.GetPar());
    fAnotC->SetNpx(1000);
    fAnotC->Draw("same");

    TF1 *fCnotA = SetAttr(new TF1("fCnotA", &pileupModel, &AliVdMPileup::fcnCnotA, 1e-6, 0.5, 5), kRed);
    fCnotA->SetParameters(pileupModel.GetPar());
    fCnotA->SetNpx(1000);
    fCnotA->Draw("same");

    TLegend *leg = new TLegend(0.6, 0.75, 0.9, 0.9);
    leg->AddEntry(&gCnotA[bc], "AnotC/AandC", "PEL");
    leg->AddEntry(&gAnotC[bc], "CnotA/AandC", "PEL");
    leg->Draw();

    TPaveText *pt = new TPaveText(0.6, 0.4, 0.9, 0.7, "NDC NB");
    pt->SetFillStyle(0);
    pt->AddText(TString::Format("#chi^{2}/n.d.f = %.0f/%.0f = %.2f", pileupModel.GetChi2(), pileupModel.GetNDF(), pileupModel.GetChi2()/pileupModel.GetNDF()));
    {
      double curval,err, lowlim, uplim;
      int iuint;
      TString name;
      for (Int_t ivar=0; ivar<4; ++ivar) {
        gMinuit->mnpout(ivar, name, curval, err, lowlim, uplim,iuint);
        hPar[ivar]->SetBinContent(1+counter, curval);
        hPar[ivar]->SetBinError(1+counter, err);
        if (ivar==0) {
          hf->SetMinimum(0.5*curval);
        }
        if (ivar==1) {
          hf->SetMinimum(TMath::Min(hf->GetMinimum(), 0.5*curval));
        }
        if (ivar < 2)
          pt->AddText(TString::Format("%s = %.4f#pm%.4f", name.Data(), curval, err));
        else
          pt->AddText(TString::Format("%s = %.1e#pm%.1e", name.Data(), curval, err));
        pt->GetLine(1+ivar)->SetTextColor(ivar%2 ? kRed : kBlue);
      }
      hPar[4]->SetBinContent(1+counter, pileupModel.GetChi2()/pileupModel.GetNDF());
    }
    pt->Draw();
    c1->SaveAs(pn);
    Printf("%f / %f", pileupModel.GetChi2(), pileupModel.GetNDF());
    ++counter;
  }
  gStyle->SetOptStat("n");
  gStyle->SetOptFit(111);
  TCanvas *c2 = new TCanvas;
  for (Int_t i=0; i<4; ++i) {
    FitPol0(hPar[i])->Draw();
    c2->SaveAs(pn);
  }
  hPar[4]->SetMinimum(0);
  hPar[4]->Draw();
  c2->SaveAs(pn+")");
}
void makeV2_DataOnly_Cen(const int flag=0)
{
  gROOT->Reset();
  const Double_t MassD = 1.865;
  const Double_t MassKs = 0.498;
  const Double_t MassPhi = 1.019;
  const Double_t MassLa = 1.1156;
  const Double_t MassXi = 1.3217;
  const Double_t MassOmega = 1.672;

  ifstream inData;
  // new data
  TFile *fin = new TFile("Systematics_D0vn_SL16d_2016-10-14.ME.root");
  TGraphErrors *gr_data_0_80 = (TGraphErrors *)(fin->Get("vnStat_0_80"));
  gr_data_0_80->RemovePoint(0);
  TGraphErrors *gr_data_0_80_sys = (TGraphErrors *)(fin->Get("vnSyst_0_80"));
  gr_data_0_80_sys->RemovePoint(0);

  cout << gr_data_0_80->GetN() << endl;
  cout << gr_data_0_80_sys->GetN() << endl;
  
  const Double_t scale_w_Ks = 1.0;
  const Int_t n_data_new = 8;
  //////////////////////////////////////////////
  // Read-in data points for 0-80% centrality
  //////////////////////////////////////////////
  Double_t nonflow[n_data_new] = { 0.032629 , 0.0336555 , 0.0336555 , 0.033947 , 0.0346236 , 0.0353009 , 0.0361988 , 0.0382869};  // full range 0-80%
  Double_t x_data_new[n_data_new], y_data_new[n_data_new], ye_data_new[n_data_new], yes_data_new[n_data_new], yesL_data_new[n_data_new];
  Double_t yeL_data_new[n_data_new], yeU_data_new[n_data_new];
  Double_t x_mTScaled_data_new[n_data_new], yScaled_data_new[n_data_new], yeScaled_data_new[n_data_new], yesScaled_data_new[n_data_new], yesLScaled_data_new[n_data_new];
  Double_t yeLScaled_data_new[n_data_new], yeUScaled_data_new[n_data_new];
  for(int i=0;i<gr_data_0_80->GetN();i++) {
    cout << i << endl;
    x_data_new[i] = gr_data_0_80->GetX()[i];
    y_data_new[i] = gr_data_0_80->GetY()[i];
    ye_data_new[i] = gr_data_0_80->GetEY()[i];
    yes_data_new[i] = gr_data_0_80_sys->GetEY()[i];
    yesL_data_new[i] = nonflow[i];

    x_mTScaled_data_new[i] = (sqrt(x_data_new[i]*x_data_new[i] + MassD*MassD) - MassD)/2;
    yScaled_data_new[i] = y_data_new[i]/2 * scale_w_Ks;
    yeScaled_data_new[i] = ye_data_new[i]/2 * scale_w_Ks;
    yesScaled_data_new[i] = yes_data_new[i]/2 * scale_w_Ks;
    yesLScaled_data_new[i] = yesL_data_new[i]/2 * scale_w_Ks;
  
    yeL_data_new[i] = sqrt(ye_data_new[i]**2+yes_data_new[i]**2+yesL_data_new[i]**2) * scale_w_Ks;
    yeU_data_new[i] = sqrt(ye_data_new[i]**2+yes_data_new[i]**2) * scale_w_Ks;

    yeLScaled_data_new[i] = yeL_data_new[i]/2 * scale_w_Ks;
    yeUScaled_data_new[i] = yeU_data_new[i]/2 * scale_w_Ks;
  }

  //////////////////////////////
  // different centrality bins
  //////////////////////////////
  const Int_t NCen = 3;
  TGraphErrors *gr_data_cen[NCen];
  TGraphErrors *gr_data_cen_sys[NCen];
  TGraphErrors *gr_data_mT_cen[NCen];
  const Char_t *CenName[NCen] = {"40_80","10_40","0_10"};
  for(int i=0;i<NCen;i++) {
    gr_data_cen[i] = (TGraphErrors *)(fin->Get(Form("vnStat_%s",CenName[i])));
    gr_data_cen[i]->RemovePoint(0);
    gr_data_cen_sys[i] = (TGraphErrors *)(fin->Get(Form("vnSyst_%s",CenName[i])));
    gr_data_cen_sys[i]->RemovePoint(0);
  }

  const Int_t n_data_cen = 8;
  Double_t nonflow_cen[NCen][n_data_cen] = {{ 0.115456 , 0.118967 , 0.118967 , 0.120065 , 0.122454 , 0.124808 , 0.128025 , 0.135539},
					    { 0.0210766 , 0.0217398 , 0.0217398 , 0.0219309 , 0.0223667 , 0.0228055 , 0.0233849 , 0.0247439},
					    { 0.0202398 , 0.0208774 , 0.0208774 , 0.0210541 , 0.0214741 , 0.021893 , 0.0224473 , 0.0237127}};

  Double_t x_data_cen[NCen][n_data_cen], y_data_cen[NCen][n_data_cen], ye_data_cen[NCen][n_data_cen], yes_data_cen[NCen][n_data_cen], yesL_data_cen[NCen][n_data_cen];
  Double_t yeL_data_cen[NCen][n_data_cen], yeU_data_cen[NCen][n_data_cen];
  Double_t x_mTScaled_data_cen[NCen][n_data_cen], yScaled_data_cen[NCen][n_data_cen], yeScaled_data_cen[NCen][n_data_cen], yesScaled_data_cen[NCen][n_data_cen], yesLScaled_data_cen[NCen][n_data_cen];
  Double_t yeLScaled_data_cen[NCen][n_data_cen], yeUScaled_data_cen[NCen][n_data_cen];
  for(int ic=0;ic<NCen;ic++) {
    for(int i=0;i<gr_data_cen[ic]->GetN();i++) {
      x_data_cen[ic][i] = gr_data_cen[ic]->GetX()[i];
      y_data_cen[ic][i] = gr_data_cen[ic]->GetY()[i];
      ye_data_cen[ic][i] = gr_data_cen[ic]->GetEY()[i];
      yes_data_cen[ic][i] = gr_data_cen_sys[ic]->GetEY()[i];
      yesL_data_cen[ic][i] = nonflow_cen[ic][i];
      
      x_mTScaled_data_cen[ic][i] = (sqrt(x_data_cen[ic][i]*x_data_cen[ic][i] + MassD*MassD) - MassD)/2;
      yScaled_data_cen[ic][i] = y_data_cen[ic][i]/2 * scale_w_Ks;
      yeScaled_data_cen[ic][i] = ye_data_cen[ic][i]/2 * scale_w_Ks;
      yesScaled_data_cen[ic][i] = yes_data_cen[ic][i]/2 * scale_w_Ks;
      yesLScaled_data_cen[ic][i] = yesL_data_cen[ic][i]/2 * scale_w_Ks;
      
      yeL_data_cen[ic][i] = sqrt(ye_data_cen[ic][i]**2+yes_data_cen[ic][i]**2+yesL_data_cen[ic][i]**2) * scale_w_Ks;
      yeU_data_cen[ic][i] = sqrt(ye_data_cen[ic][i]**2+yes_data_cen[ic][i]**2) * scale_w_Ks;
      
      yeLScaled_data_cen[ic][i] = yeL_data_cen[ic][i]/2 * scale_w_Ks;
      yeUScaled_data_cen[ic][i] = yeU_data_cen[ic][i]/2 * scale_w_Ks;      
    }
    gr_data_mT_cen[ic] = new TGraphErrors(n_data_cen, x_mTScaled_data_cen[ic], yScaled_data_cen[ic], 0, yeScaled_data_cen[ic]);
  }

  cout << " Read-in D0 data done ..." << endl;
  
 /* const Int_t n_ks_cen = 19;
  const Int_t n_la_cen = 18;

  Double_t x_ks_cen[n_ks_cen], y_ks_cen[NCen][n_ks_cen], ye_ks_cen[NCen][n_ks_cen], yes_ks_cen[NCen][n_ks_cen];
  Double_t x_la_cen[n_la_cen], y_la_cen[NCen][n_la_cen], ye_la_cen[NCen][n_la_cen], yes_la_cen[NCen][n_la_cen];

  Double_t x_mTScaled_ks_cen[n_ks_cen], yScaled_ks_cen[NCen][n_ks_cen], yeScaled_ks_cen[NCen][n_ks_cen], yesScaled_ks_cen[NCen][n_ks_cen];
  Double_t x_mTScaled_la_cen[n_la_cen], yScaled_la_cen[NCen][n_la_cen], yeScaled_la_cen[NCen][n_la_cen], yesScaled_la_cen[NCen][n_la_cen];


  inData.open("Run14/ks_v2_cen_PRC77.txt");
  for(int i=0;i<n_ks_cen;i++) {
    double a, b, c;
    inData >> x_ks_cen[i] >> a >> b >> c >> y_ks_cen[0][i] >> ye_ks_cen[0][i] >> yes_ks_cen[0][i] >> y_ks_cen[1][i] >> ye_ks_cen[1][i] >> yes_ks_cen[1][i] >> y_ks_cen[2][i] >> ye_ks_cen[2][i] >> yes_ks_cen[2][i];

    x_mTScaled_ks_cen[i] = (sqrt(x_ks_cen[i]*x_ks_cen[i]+MassKs*MassKs)-MassKs)/2;
    for(int ic=0;ic<NCen;ic++) {
      yScaled_ks_cen[ic][i] = y_ks_cen[ic][i]/2.;
      yeScaled_ks_cen[ic][i] = ye_ks_cen[ic][i]/2.;
      yesScaled_ks_cen[ic][i] = yes_ks_cen[ic][i]/2.;
    }

  }
  inData.close();

  TGraphErrors *gr_ks_cen[NCen], *gr_ks_mT_cen[NCen];
  for(int ic=0;ic<NCen;ic++) {
    gr_ks_cen[ic] = new TGraphErrors(n_ks_cen, x_ks_cen, y_ks_cen[ic], 0, ye_ks_cen[ic]);
    gr_ks_mT_cen[ic] = new TGraphErrors(n_ks_cen, x_mTScaled_ks_cen, yScaled_ks_cen[ic], 0, yeScaled_ks_cen[ic]);
    //    gr_ks_mT_cen[ic]->Print();
  }
  cout << " Read-in Ks data points done ... " << endl;
  
  inData.open("Run14/lambda_v2_cen_PRC77.txt");
  for(int i=0;i<n_la_cen;i++) {
    double a, b, c;
    inData >> x_la_cen[i] >> a >> b >> c >> y_la_cen[0][i] >> ye_la_cen[0][i] >> yes_la_cen[0][i] >> y_la_cen[1][i] >> ye_la_cen[1][i] >> yes_la_cen[1][i] >> y_la_cen[2][i] >> ye_la_cen[2][i] >> yes_la_cen[2][i];

    x_mTScaled_la_cen[i] = (sqrt(x_la_cen[i]*x_la_cen[i]+MassLa*MassLa)-MassLa)/3;
    for(int ic=0;ic<NCen;ic++) {
      yScaled_la_cen[ic][i] = y_la_cen[ic][i]/3.;
      yeScaled_la_cen[ic][i] = ye_la_cen[ic][i]/3.;
      yesScaled_la_cen[ic][i] = yes_la_cen[ic][i]/3.;
    }

  }
  inData.close();
  TGraphErrors *gr_la_cen[NCen], *gr_la_mT_cen[NCen];
  for(int ic=0;ic<NCen;ic++) {
    gr_la_cen[ic] = new TGraphErrors(n_la_cen, x_la_cen, y_la_cen[ic], 0, ye_la_cen[ic]);
    gr_la_mT_cen[ic] = new TGraphErrors(n_la_cen, x_mTScaled_la_cen, yScaled_la_cen[ic], 0, yeScaled_la_cen[ic]);
  }
  cout << " Read-in Lambda data points done ... " << endl;
  
  // Xi data points, format is a bit different
  const Int_t n_xi_cenMax = 9;
  Int_t n_xi_cen[NCen];
  Double_t x_xi_cen[NCen][n_xi_cenMax], y_xi_cen[NCen][n_xi_cenMax], ye_xi_cen[NCen][n_xi_cenMax];
  Double_t x_mTScaled_xi_cen[NCen][n_xi_cenMax], yScaled_xi_cen[NCen][n_xi_cenMax], yeScaled_xi_cen[NCen][n_xi_cenMax];
  TGraphErrors *gr_xi_cen[NCen];
  TGraphErrors *gr_xi_mT_cen[NCen];
  for(int ic=0;ic<NCen;ic++) {
    gr_xi_cen[ic] = new TGraphErrors(Form("Run14/xi_v2_%s.txt",CenName[ic]),"%lg %lg %lg");

    n_xi_cen[ic] = gr_xi_cen[ic]->GetN();
    for(int i=0;i<gr_xi_cen[ic]->GetN();i++) {
      x_xi_cen[ic][i] = gr_xi_cen[ic]->GetX()[i];
      y_xi_cen[ic][i] = gr_xi_cen[ic]->GetY()[i];
      ye_xi_cen[ic][i] = gr_xi_cen[ic]->GetEY()[i];

      x_mTScaled_xi_cen[ic][i] = (sqrt(x_xi_cen[ic][i]*x_xi_cen[ic][i]+MassXi*MassXi)-MassXi)/3;
      yScaled_xi_cen[ic][i] = y_xi_cen[ic][i]/3.;
      yeScaled_xi_cen[ic][i] = ye_xi_cen[ic][i]/3.;      
    }
    
    gr_xi_mT_cen[ic] = new TGraphErrors(n_xi_cen[ic], x_mTScaled_xi_cen[ic], yScaled_xi_cen[ic], 0, yeScaled_xi_cen[ic]);
  }
  cout << " Read-in Xi data points done ... " << endl;

  const Int_t n_phi_cenMax = 7;
  Int_t n_phi_cen[NCen];
  Double_t x_phi_cen[NCen][n_phi_cenMax], y_phi_cen[NCen][n_phi_cenMax], ye_phi_cen[NCen][n_phi_cenMax], yes_phi_cen[NCen][n_phi_cenMax];
  Double_t x_mTScaled_phi_cen[NCen][n_phi_cenMax], yScaled_phi_cen[NCen][n_phi_cenMax], yeScaled_phi_cen[NCen][n_phi_cenMax], yesScaled_phi_cen[NCen][n_phi_cenMax];
  TGraphErrors *gr_phi_cen[NCen];
  TGraphErrors *gr_phi_mT_cen[NCen];
  const Char_t *CenName_Phi[NCen] = {"40_80","10_40","0_5"};
  for(int ic=0;ic<NCen;ic++) {
    gr_phi_cen[ic] = new TGraphErrors(Form("Run14/phi_v2_%s_PRC.txt",CenName_Phi[ic]),"%lg %lg %lg");

    n_phi_cen[ic] = gr_phi_cen[ic]->GetN();
    inData.open(Form("Run14/phi_v2_%s_PRC.txt",CenName_Phi[ic]));
    for(int i=0;i<gr_phi_cen[ic]->GetN();i++) {
      x_phi_cen[ic][i] = gr_phi_cen[ic]->GetX()[i];
      y_phi_cen[ic][i] = gr_phi_cen[ic]->GetY()[i];
      ye_phi_cen[ic][i] = gr_phi_cen[ic]->GetEY()[i];

      double a, b, c, d;
      inData >> a >> b >> c >> d;
      yes_phi_cen[ic][i] = d;

      x_mTScaled_phi_cen[ic][i] = (sqrt(x_phi_cen[ic][i]*x_phi_cen[ic][i]+MassPhi*MassPhi)-MassPhi)/2.;
      yScaled_phi_cen[ic][i] = y_phi_cen[ic][i]/2.;
      yeScaled_phi_cen[ic][i] = ye_phi_cen[ic][i]/2.;
      yesScaled_phi_cen[ic][i] = yes_phi_cen[ic][i]/2.;
    }
    
    gr_phi_mT_cen[ic] = new TGraphErrors(n_phi_cen[ic], x_mTScaled_phi_cen[ic], yScaled_phi_cen[ic], 0, yeScaled_phi_cen[ic]);
  }
  cout << " Read-in Phi data points done ... " << endl;*/
  
  

  TCanvas *c1 = new TCanvas("c1", "c1",0,0,1600,900);
  gStyle->SetOptFit(0);
  gStyle->SetOptStat(0);
  gStyle->SetEndErrorSize(0);
  gStyle->SetTitleBorderSize(0);
  c1->SetFillColor(10);
  c1->SetFillStyle(0);
  c1->SetBorderMode(0);
  c1->SetBorderSize(0);
  c1->SetFrameFillColor(10);
  c1->SetFrameFillStyle(0);
  c1->SetFrameBorderMode(0);
  
  /*TPad* p1 = new TPad("p1","p1",0.,0.5,1.0,1.0);
  p1->SetFillColor(10);
  p1->SetFillStyle(0);
  p1->SetBorderMode(0);
  p1->SetBorderSize(0);
  p1->SetFrameFillColor(10);
  p1->SetFrameFillStyle(0);
  p1->SetFrameBorderMode(0);
  //p1->SetLogy();
  p1->SetGridx(0);
  p1->SetGridy(0);
  p1->SetLeftMargin(0.16);
  p1->SetBottomMargin(0.15);
  p1->SetTopMargin(0.02);
  p1->SetRightMargin(0.02);
  p1->Draw();
  //p1->cd();*/
  
  double x1 = 0.0;
  double x2 = 6.8;
  double y1 = -0.05;
  double y2 = 0.38;
  TH1 *h0 = new TH1D("h0","",1,x1, x2);
  h0->SetMinimum(y1);
  h0->SetMaximum(y2);
  h0->GetXaxis()->SetNdivisions(208);
  h0->GetXaxis()->CenterTitle();
  h0->GetXaxis()->SetTitle("p_{T} (GeV/c)");
  h0->GetXaxis()->SetTitleOffset(.9);
  h0->GetXaxis()->SetTitleSize(0.05);
  h0->GetXaxis()->SetLabelOffset(0.005);
  h0->GetXaxis()->SetLabelSize(0.04);
  h0->GetXaxis()->SetLabelFont(42);
  h0->GetXaxis()->SetTitleFont(42);
  h0->GetYaxis()->SetNdivisions(505);
  h0->GetYaxis()->CenterTitle();
  h0->GetYaxis()->SetTitle("Anisotropy Parameter, v_{2}");
  h0->GetYaxis()->SetTitleOffset(.9);
  h0->GetYaxis()->SetTitleSize(0.05);
  h0->GetYaxis()->SetLabelOffset(0.005);
  h0->GetYaxis()->SetLabelSize(0.04);
  h0->GetYaxis()->SetLabelFont(42);
  h0->GetYaxis()->SetTitleFont(42);
  h0->Draw("c");

  
  double pt[2] = {1.766, 4.459};
  double pt1Bin[1] = {1.866};
  double v2[2] = {0.08329931, 0.126231279};
  double eptLow[2] = {.766, .459};
  double eptHigh[2] = {2.234, 2.341};
  double eptSyst[2] = { 0.0, 0.0};
  double eptSyst1Bin[1] = { 0.0};
  double ev2Low[2] = { 0.00736501, 0.012241649};
  double ev2High[2] = { 0.00736501, 0.012241649};
  double ev2Syst[2] = {.0124948965, .02145931743 };
  
  
  TGraphAsymmErrors *AlexData = new TGraphAsymmErrors(2, pt, v2, eptLow, eptHigh, ev2Low, ev2High);
  
  AlexData->SetMarkerColor(2);
  AlexData->SetMarkerStyle(21);
  AlexData->SetMarkerSize(2);
  AlexData->SetLineColor(2);
  AlexData->SetLineWidth(3);
  
  TGraphErrors *AlexDataSyst = new TGraphErrors(2, pt, v2, eptSyst, ev2Syst);
  
  AlexDataSyst->SetMarkerColor(2);
  AlexDataSyst->SetMarkerStyle(21);
  AlexDataSyst->SetMarkerSize(1.1);
  AlexDataSyst->SetLineColor(2);
  AlexDataSyst->SetLineWidth(33);
  
  
  
  // 8 data points
   
 
  
  double weights[6] = {0.4034, .3058, .1696, .0778, .0316, .0119};

  double avgV2[1] = {0};
  double avgV2StatErrorSquared[1] = {0};
  double avgV2SystErrorSquared[1] = {0};
  double avgV2StatError[1] = {0};
  double avgV2SystError[1] = {0};
  
  for(int i = 0; i < 6; i++){

    cout << "V2: " << y_data_cen[1][i] << endl;
    
    avgV2[0] = avgV2[0] + (weights[i]*y_data_cen[1][i]);
    
    avgV2StatErrorSquared[0] = avgV2StatErrorSquared[0] + (weights[i]*weights[i])*(ye_data_cen[1][i]*ye_data_cen[1][i]);
    avgV2SystErrorSquared[0] = avgV2SystErrorSquared[0] + (weights[i]*weights[i])*(yes_data_cen[1][i]*yes_data_cen[1][i]);
    
  }
    
  avgV2StatError[0] = TMath::Sqrt(avgV2StatErrorSquared[0]);
  avgV2SystError[0] = TMath::Sqrt(avgV2SystErrorSquared[0]);
    
  TGraphErrors *AvgV2Data = new TGraphErrors(1, pt1Bin, avgV2, eptSyst1Bin, avgV2StatError);
  
  AvgV2Data->SetMarkerColor(4);
  AvgV2Data->SetMarkerStyle(22);
  AvgV2Data->SetMarkerSize(2.5);
  AvgV2Data->SetLineColor(4);
  //AvgV2Data->SetLineWidth(15);
  
  TGraphErrors *AvgV2DataSyst = new TGraphErrors(1, pt1Bin, avgV2, eptSyst1Bin, avgV2SystError);
  
  AvgV2DataSyst->SetMarkerColor(4);
  AvgV2DataSyst->SetMarkerStyle(22);
  AvgV2DataSyst->SetMarkerSize(2.5);
  AvgV2DataSyst->SetLineColor(4);
  AvgV2DataSyst->SetLineWidth(29);
  
  
  
  /*TH1 *hAlex1 = new TH1D("","", 7, 0, 6.8);
  hAlex1->SetMarkerStyle(20);
  hAlex1->SetMarkerColor(2);
  hAlex1->SetMarkerSize(1.5);
  //hAlex->SetBinContent(3, 0.0801251);
  //hAlex->SetBinError(3, 0.00244519);
  
  hAlex1->SetBinContent(1, 0.122872);
  hAlex1->SetBinError(1, 0.0149516);
  
 // hAlex1->SetBinContent(5, 0.0789727);
  //hAlex1->SetBinError(5, 0.00444987);
  
  TH1 *hAlex2 = new TH1D("","", 1, 1, 4);
  hAlex2->SetMarkerStyle(20);
  hAlex2->SetMarkerColor(2);
  hAlex2->SetMarkerSize(1.5);
  hAlex2->SetBinContent(1, 0.0801251);
  hAlex2->SetBinError(1, 0.00244519);
  
  TH1 *hAlex3 = new TH1D("","", 1, 4, 6.8);
  hAlex3->SetMarkerStyle(20);
  hAlex3->SetMarkerColor(2);
  hAlex3->SetMarkerSize(1.5);
  hAlex3->SetBinContent(1, 0.0789727);
  hAlex3->SetBinError(1, 0.00444987);
  //////////////////////////////////////////////////////////////////
  TH1 *hAlex1Syst = new TH1D("","", 7, 0, 6.8);
  hAlex1Syst->SetMarkerStyle(20);
  hAlex1Syst->SetMarkerColor(2);
  hAlex1Syst->SetMarkerSize(1.5);
  //hAlex1Syst->SetEndErrorSize(2);
  hAlex1Syst->SetBinContent(1, 0.122872);
  hAlex1Syst->SetBinError(1, 0.02);
  
 
  TH1 *hAlex2Syst = new TH1D("","", 1, 1, 4);
  hAlex2Syst->SetMarkerStyle(20);
  hAlex2Syst->SetMarkerColor(2);
  hAlex2Syst->SetMarkerSize(1.5);
  hAlex2Syst->SetBinContent(1, 0.0801251);
  hAlex2Syst->SetBinError(1, 0.006172166);
  
  TH1 *hAlex3Syst = new TH1D("","", 1, 4, 6.8);
  hAlex3Syst->SetMarkerStyle(20);
  hAlex3Syst->SetMarkerColor(2);
  hAlex3Syst->SetMarkerSize(1.5);
  hAlex3Syst->SetBinContent(1, 0.0789727);
  hAlex3Syst->SetBinError(1, 0.004869332);*/
  
 
  
  /*TLine *l1 = new TLine(x1,y1,x2,y1);
  l1->SetLineWidth(2);
  l1->Draw("same");
  TLine *l2 = new TLine(x1,y2,x2,y2);
  l2->SetLineWidth(2);
  l2->Draw("same");
  TLine *l3 = new TLine(x1,y1,x1,y2);
  l3->SetLineWidth(2);
  l3->Draw("same");
  TLine *l4 = new TLine(x2,y1,x2,y2);
  l4->SetLineWidth(2);
  l4->Draw("same");

  TLine *l0 = new TLine(x1, 0, x2, 0);
  l0->SetLineWidth(2);
  l0->SetLineStyle(2);
  l0->Draw("same");*/

  /*for(int i=0;i<n_ks_cen;i++) {
    double x1 = x_ks_cen[i]-0.08;
    double x2 = x_ks_cen[i]+0.08;
    double y1 = y_ks_cen[1][i]-yes_ks_cen[1][i];
    double y2 = y_ks_cen[1][i]+yes_ks_cen[1][i];
    
    TLine *la = new TLine(x1, y1, x1, y1+0.003);
    la->Draw("same");
    TLine *lb = new TLine(x2, y1, x2, y1+0.003);
    lb->Draw("same");
    TLine *lc = new TLine(x1, y2, x1, y2-0.003);
    lc->Draw("same");
    TLine *ld = new TLine(x2, y2, x2, y2-0.003);
    ld->Draw("same");
    TLine *le = new TLine(x1, y1, x2, y1);
    le->SetLineWidth(2);
    le->Draw("same");
    TLine *lf = new TLine(x1, y2, x2, y2);
    lf->SetLineWidth(2);
    lf->Draw("same");
  }*/
  
  /*gr_ks_cen[1]->Print();
  gr_ks_cen[1]->SetMarkerStyle(25);
  gr_ks_cen[1]->SetMarkerColor(1);
  gr_ks_cen[1]->SetMarkerSize(1.2);
  gr_ks_cen[1]->SetLineColor(1);
  gr_ks_cen[1]->SetLineWidth(2);
  gr_ks_cen[1]->Draw("p");*/

  
 /* for(int i=0;i<n_la_cen;i++) {
    double x1 = x_la_cen[i]-0.08;
    double x2 = x_la_cen[i]+0.08;
    double y1 = y_la_cen[1][i]-yes_la_cen[1][i];
    double y2 = y_la_cen[1][i]+yes_la_cen[1][i];
    
    TLine *la = new TLine(x1, y1, x1, y1+0.003);
    la->Draw("same");
    TLine *lb = new TLine(x2, y1, x2, y1+0.003);
    lb->Draw("same");
    TLine *lc = new TLine(x1, y2, x1, y2-0.003);
    lc->Draw("same");
    TLine *ld = new TLine(x2, y2, x2, y2-0.003);
    ld->Draw("same");
    TLine *le = new TLine(x1, y1, x2, y1);
    le->SetLineWidth(2);
    le->Draw("same");
    TLine *lf = new TLine(x1, y2, x2, y2);
    lf->SetLineWidth(2);
    lf->Draw("same");
  }
  
  gr_la_cen[1]->Print();
  gr_la_cen[1]->SetMarkerStyle(24);
  gr_la_cen[1]->SetMarkerColor(1);
  gr_la_cen[1]->SetMarkerSize(1.2);
  gr_la_cen[1]->SetLineColor(1);
  gr_la_cen[1]->SetLineWidth(2);
  gr_la_cen[1]->Draw("p");


  gr_xi_cen[1]->Print();
  gr_xi_cen[1]->SetMarkerStyle(26);
  gr_xi_cen[1]->SetMarkerColor(1);
  gr_xi_cen[1]->SetMarkerSize(1.2);
  gr_xi_cen[1]->SetLineColor(1);
  gr_xi_cen[1]->SetLineWidth(2);
  gr_xi_cen[1]->Draw("p");
  
  gr_phi_cen[1]->Print();
  gr_phi_cen[1]->SetMarkerStyle(25);
  gr_phi_cen[1]->SetMarkerColor(1);
  gr_phi_cen[1]->SetMarkerSize(1.2);
  gr_phi_cen[1]->SetLineColor(1);
  gr_phi_cen[1]->SetLineWidth(2);
  //  gr_phi_cen[1]->Draw("p");*/

    for(int i=0;i<n_data_cen[1];i++) {
    double x1 = x_data_cen[1][i]-0.08;
    double x2 = x_data_cen[1][i]+0.08;
    double y1 = y_data_cen[1][i]-yes_data_cen[1][i];
    double y2 = y_data_cen[1][i]+yes_data_cen[1][i];

    double y3 = y_data_cen[1][i] - yesL_data_cen[1][i];
    double y4 = y_data_cen[1][i];
    TBox *box = new TBox(x1, y3, x2, y4);
    box->SetLineColor(16);
    box->SetFillColor(16);
    box->Draw("same");
    
    TLine *la = new TLine(x1, y1, x1, y1+0.003);
    la->SetLineColor(4);
    la->Draw("same");
    TLine *lb = new TLine(x2, y1, x2, y1+0.003);
    lb->SetLineColor(4);
    lb->Draw("same");
    TLine *lc = new TLine(x1, y2, x1, y2-0.003);
    lc->SetLineColor(4);
    lc->Draw("same");
    TLine *ld = new TLine(x2, y2, x2, y2-0.003);
    ld->SetLineColor(4);
    ld->Draw("same");
    TLine *le = new TLine(x1, y1, x2, y1);
    le->SetLineWidth(2);
    le->SetLineColor(4);
    le->Draw("same");
    TLine *lf = new TLine(x1, y2, x2, y2);
    lf->SetLineWidth(2);
    lf->SetLineColor(4);
    lf->Draw("same");
  }
   
   gr_data_cen[1]->SetMarkerStyle(20);
   //gr_data_cen[1]->SetMarkerColorAlpha(4, 0.35);
   gr_data_cen[1]->SetMarkerColor(4);
   
   gr_data_cen[1]->SetMarkerSize(1.5);
   gr_data_cen[1]->SetLineWidth(2);
   gr_data_cen[1]->SetLineColor(4);
   gr_data_cen[1]->Draw("p");
  
  /////MY DATA HERE////////////////////////
    for(int i = 0; i < 2; i++) {
        double x1 = pt[i]-0.08;
        double x2 = pt[i]+0.08;
        double y1 = v2[i]-ev2Syst[i];
        double y2 = v2[i]+ev2Syst[i];

   
    
        TLine *la = new TLine(x1, y1, x1, y1+0.003);
        la->SetLineColor(2);
        la->Draw("same");
        TLine *lb = new TLine(x2, y1, x2, y1+0.003);
        lb->SetLineColor(2);
        lb->Draw("same");
        TLine *lc = new TLine(x1, y2, x1, y2-0.003);
        lc->SetLineColor(2);
        lc->Draw("same");
        TLine *ld = new TLine(x2, y2, x2, y2-0.003);
        ld->SetLineColor(2);
        ld->Draw("same");
        TLine *le = new TLine(x1, y1, x2, y1);
        le->SetLineWidth(2);
        le->SetLineColor(2);
        le->Draw("same");
        TLine *lf = new TLine(x1, y2, x2, y2);
        lf->SetLineWidth(2);
        lf->SetLineColor(2);
        lf->Draw("same");
    }
  

  //TLatex *tex = new TLatex(5.5, 0.28, "10-40%");
  //tex->SetTextFont(42);
  //tex->SetTextSize(0.055);
  //tex->Draw();
  
  TLegend *leg = new TLegend(0.1, 0.72, 0.55, 0.9);
  leg->SetFillStyle(0);
  leg->SetLineStyle(4000);
  leg->SetLineColor(10);
  //leg->SetLineWidth(1.0);
  leg->SetBorderSize(0.0);
  leg->SetTextSize(0.045);
  leg->AddEntry(gr_data_cen[1], "D^{0} Event Plane, 10-40% ", "p");
  leg->AddEntry(AlexData, "D^{0}-Hadron Angular Corr, 20-50%", "p");
  //leg->AddEntry(AvgV2Data, "D^{0} Event Plane Avg. of 1 GeV/c < p_{t} < 4 GeV/c", "p");
  //leg->AddEntry(gr_xi_cen[1], "#Xi^{-}", "p");
  //leg->AddEntry(gr_la_cen[1], "#Lambda", "p");
  //leg->AddEntry(gr_ks_cen[1], "K_{S}", "p");
  //  leg->AddEntry(gr_phi_cen[1], "#phi", "p");
  leg->Draw();
  
  AlexData->Draw("SAME P");
  //AlexDataSyst->Draw("SAME []");
  //AvgV2Data->Draw("SAME P");
  //AvgV2DataSyst->Draw("SAME []");
  
  TString starPrelim = "STAR Preliminary";
  
  TPaveText *starPrelimTextBox = new TPaveText(0.7, 0.7, .8, .77, "NB NDC");
  starPrelimTextBox->SetFillColor(0);
  starPrelimTextBox->AddText(starPrelim);
  starPrelimTextBox->GetLine(0)->SetTextSize(.055);
  starPrelimTextBox->GetLine(0)->SetTextColor(2);
  starPrelimTextBox->Draw("SAME");

  TLatex *tex = new TLatex(4.2, 0.345, "STAR  Au+Au @ 200 GeV");
  tex->SetTextFont(42);
  tex->SetTextSize(0.05);
  tex->Draw();
  //hAlex2->Draw("SAME");
  //hAlex3->Draw("SAME");
  //hAlex1Syst->Draw("SAME E1");
  //hAlex2Syst->Draw("SAME E1");
  //hAlex3Syst->Draw("SAME E1");
  
 // tex = new TLatex(0.2, 0.34, "a)");
  //tex->SetTextFont(42);
  //tex->SetTextSize(0.065);
  //tex->Draw();

  //p1->Modified();
  //c1->Update();
  //c1->cd();

  /*TPad* p2 = new TPad("p2","",0.,0.,1.0,0.5);
  p2->SetFillColor(10);
  p2->SetFillStyle(0);
  p2->SetBorderMode(0);
  p2->SetBorderSize(0);
  p2->SetFrameFillColor(10);
  p2->SetFrameFillStyle(0);
  p2->SetFrameBorderMode(0);
  //p2->SetLogy();
  p2->SetGridx(0);
  p2->SetGridy(0);
  p2->SetLeftMargin(0.16);
  p2->SetBottomMargin(0.18);
  p2->SetTopMargin(0.01);
  p2->SetRightMargin(0.02);
  p2->Draw();
  p2->cd();*/

 /* double x1 = 0.;
  double x2 = 2.8;
  double y1 = -0.025;
  double y2 = 0.18;
  TH1 *h0 = new TH1D("h0","",1,x1, x2);
  h0->SetMinimum(y1);
  h0->SetMaximum(y2);
  h0->GetXaxis()->SetNdivisions(208);
  h0->GetXaxis()->CenterTitle();
  h0->GetXaxis()->SetTitle("(m_{T} - m_{0}) / n_{q} (GeV/c^{ 2})");
  h0->GetXaxis()->SetTitleOffset(1.1);
  h0->GetXaxis()->SetTitleSize(0.065);
  h0->GetXaxis()->SetLabelOffset(0.01);
  h0->GetXaxis()->SetLabelSize(0.055);
  h0->GetXaxis()->SetLabelFont(42);
  h0->GetXaxis()->SetTitleFont(42);
  h0->GetYaxis()->SetNdivisions(505);
  h0->GetYaxis()->CenterTitle();
  h0->GetYaxis()->SetTitle("Anisotropy Parameter, v_{2} / n_{q}");
  h0->GetYaxis()->SetTitleOffset(1.1);
  h0->GetYaxis()->SetTitleSize(0.065);
  h0->GetYaxis()->SetLabelOffset(0.015);
  h0->GetYaxis()->SetLabelSize(0.055);
  h0->GetYaxis()->SetLabelFont(42);
  h0->GetYaxis()->SetTitleFont(42);
  h0->Draw("c");

  TLine *l1 = new TLine(x1,y1,x2,y1);
  l1->SetLineWidth(2);
  l1->Draw("same");
  TLine *l2 = new TLine(x1,y2,x2,y2);
  l2->SetLineWidth(2);
  l2->Draw("same");
  TLine *l3 = new TLine(x1,y1,x1,y2);
  l3->SetLineWidth(2);
  l3->Draw("same");
  TLine *l4 = new TLine(x2,y1,x2,y2);
  l4->SetLineWidth(2);
  l4->Draw("same");

  TLine *l0 = new TLine(x1, 0, x2, 0);
  l0->SetLineWidth(2);
  l0->SetLineStyle(2);
  l0->Draw("same");*/

  /*for(int i=0;i<n_ks_cen;i++) {
    double x1 = x_mTScaled_ks_cen[i]-0.04;
    double x2 = x_mTScaled_ks_cen[i]+0.04;
    double y1 = yScaled_ks_cen[1][i]-yesScaled_ks_cen[1][i];
    double y2 = yScaled_ks_cen[1][i]+yesScaled_ks_cen[1][i];
    
    TLine *la = new TLine(x1, y1, x1, y1+0.0015);
    la->Draw("same");
    TLine *lb = new TLine(x2, y1, x2, y1+0.0015);
    lb->Draw("same");
    TLine *lc = new TLine(x1, y2, x1, y2-0.0015);
    lc->Draw("same");
    TLine *ld = new TLine(x2, y2, x2, y2-0.0015);
    ld->Draw("same");
    TLine *le = new TLine(x1, y1, x2, y1);
    le->SetLineWidth(2);
    le->Draw("same");
    TLine *lf = new TLine(x1, y2, x2, y2);
    lf->SetLineWidth(2);
    lf->Draw("same");
  }
  
  gr_ks_mT_cen[1]->Print();
  gr_ks_mT_cen[1]->SetMarkerStyle(25);
  gr_ks_mT_cen[1]->SetMarkerColor(1);
  gr_ks_mT_cen[1]->SetMarkerSize(1.2);
  gr_ks_mT_cen[1]->SetLineColor(1);
  gr_ks_mT_cen[1]->SetLineWidth(2);
  gr_ks_mT_cen[1]->Draw("p");

  
  for(int i=0;i<n_la_cen;i++) {
    double x1 = x_mTScaled_la_cen[i]-0.04;
    double x2 = x_mTScaled_la_cen[i]+0.04;
    double y1 = yScaled_la_cen[1][i]-yesScaled_la_cen[1][i];
    double y2 = yScaled_la_cen[1][i]+yesScaled_la_cen[1][i];
    
    TLine *la = new TLine(x1, y1, x1, y1+0.0015);
    la->Draw("same");
    TLine *lb = new TLine(x2, y1, x2, y1+0.0015);
    lb->Draw("same");
    TLine *lc = new TLine(x1, y2, x1, y2-0.0015);
    lc->Draw("same");
    TLine *ld = new TLine(x2, y2, x2, y2-0.0015);
    ld->Draw("same");
    TLine *le = new TLine(x1, y1, x2, y1);
    le->SetLineWidth(2);
    le->Draw("same");
    TLine *lf = new TLine(x1, y2, x2, y2);
    lf->SetLineWidth(2);
    lf->Draw("same");
  }
  
  gr_la_mT_cen[1]->Print();
  gr_la_mT_cen[1]->SetMarkerStyle(24);
  gr_la_mT_cen[1]->SetMarkerColor(1);
  gr_la_mT_cen[1]->SetMarkerSize(1.2);
  gr_la_mT_cen[1]->SetLineColor(1);
  gr_la_mT_cen[1]->SetLineWidth(2);
  gr_la_mT_cen[1]->Draw("p");


  gr_xi_mT_cen[1]->Print();
  gr_xi_mT_cen[1]->SetMarkerStyle(26);
  gr_xi_mT_cen[1]->SetMarkerColor(1);
  gr_xi_mT_cen[1]->SetMarkerSize(1.2);
  gr_xi_mT_cen[1]->SetLineColor(1);
  gr_xi_mT_cen[1]->SetLineWidth(2);
  gr_xi_mT_cen[1]->Draw("p");
  
  gr_phi_mT_cen[1]->Print();
  gr_phi_mT_cen[1]->SetMarkerStyle(25);
  gr_phi_mT_cen[1]->SetMarkerColor(1);
  gr_phi_mT_cen[1]->SetMarkerSize(1.2);
  gr_phi_mT_cen[1]->SetLineColor(1);
  gr_phi_mT_cen[1]->SetLineWidth(2);
  //  gr_phi_mT_cen[1]->Draw("p");*/

/*  for(int i=0;i<n_data_cen[1];i++) {
    double x1 = x_mTScaled_data_cen[1][i]-0.04;
    double x2 = x_mTScaled_data_cen[1][i]+0.04;
    double y1 = yScaled_data_cen[1][i]-yesScaled_data_cen[1][i];
    double y2 = yScaled_data_cen[1][i]+yesScaled_data_cen[1][i];

    double y3 = yScaled_data_cen[1][i] - yesLScaled_data_cen[1][i];
    double y4 = yScaled_data_cen[1][i];
    TBox *box = new TBox(x1, y3, x2, y4);
    box->SetLineColor(16);
    box->SetFillColor(16);
    box->Draw("same");
    
    TLine *la = new TLine(x1, y1, x1, y1+0.0015);
    la->SetLineColor(4);
    la->Draw("same");
    TLine *lb = new TLine(x2, y1, x2, y1+0.0015);
    lb->SetLineColor(4);
    lb->Draw("same");
    TLine *lc = new TLine(x1, y2, x1, y2-0.0015);
    lc->SetLineColor(4);
    lc->Draw("same");
    TLine *ld = new TLine(x2, y2, x2, y2-0.0015);
    ld->SetLineColor(4);
    ld->Draw("same");
    TLine *le = new TLine(x1, y1, x2, y1);
    le->SetLineColor(4);
    le->SetLineWidth(2);
    le->Draw("same");
    TLine *lf = new TLine(x1, y2, x2, y2);
    lf->SetLineColor(4);
    lf->SetLineWidth(2);
    lf->Draw("same");
  }*/
   
   //gr_data_mT_cen[1]->SetMarkerStyle(20);
   //gr_data_mT_cen[1]->SetMarkerColor(4);
   //gr_data_mT_cen[1]->SetMarkerSize(1.5);
   //gr_data_mT_cen[1]->SetLineWidth(2);
   //gr_data_mT_cen[1]->SetLineColor(4);
   //gr_data_mT_cen[1]->Draw("p");
  
  
  //TLegend *leg = new TLegend(0.22, 0.66, 0.5, 0.96);
  //leg->SetFillStyle(0);
  //leg->SetLineStyle(4000);
  //leg->SetLineColor(-1);
  //leg->SetLineWidth(0);
  //leg->SetTextSize(0.06);
  //leg->AddEntry(gr_data_mT_cen[1], "D^{0}", "p");
  //leg->AddEntry(gr_xi_mT_cen[1], "#Xi^{-}", "p");
  //leg->AddEntry(gr_la_mT_cen[1], "#Lambda", "p");
  //leg->AddEntry(gr_ks_mT_cen[1], "K_{S}", "p");  
  //  leg->AddEntry(gr_phi_mT_cen[1], "#phi", "p");  
  //leg->Draw();

  //TLatex *tex = new TLatex(1.2, 0.155, "STAR  Au+Au @ 200 GeV");
 // tex->SetTextFont(42);
  //tex->SetTextSize(0.065);
  //tex->Draw();

  //TLatex *tex = new TLatex(2.27, 0.13, "10-40%");
  //tex->SetTextFont(42);
  //tex->SetTextSize(0.065);
  //tex->Draw();


  //tex = new TLatex(0.08, 0.155, "b)");
  //tex->SetTextFont(42);
  //tex->SetTextSize(0.065);
  //tex->Draw();

  //p2->Modified();
  //c1->Update();
  //c1->cd();

  //c1->SaveAs("v2CompareWithData.eps");
  c1->SaveAs("v2_plot.png");

}
Example #3
0
void ptPlots(){
    TFile *file1 = new TFile("20170527_Kstar0bar_recon_masswidth_pf100_wide_scaled.root");
    TH1D* single1 = file1->Get("ptbin21particle5");
    single1->SetLineColor(1);
    single1->SetMarkerStyle(21);
    single1->SetMarkerSize(0.3);
    single1->SetLineWidth(3);
    TH1D* othersingle1 = file1->Get("ptbin05particle5");
    othersingle1->SetLineColor(1);
    othersingle1->SetMarkerStyle(21);
    othersingle1->SetMarkerSize(0.3);
    othersingle1->SetLineWidth(3);
    TF1* fit1 = single1->GetFunction("fitPTbin2100particle5");
    TF1* otherfit1 = othersingle1->GetFunction("fitPTbin500particle5");
    fit1->SetBit(TF1::kNotDraw);
    fit1->SetLineColor(kGray+3);
    fit1->SetLineWidth(4);
    otherfit1->SetBit(TF1::kNotDraw);
    otherfit1->SetLineColor(kGray+3);
    otherfit1->SetLineWidth(4);

    TFile *file2 = new TFile("20170527_Kstar0bar_recon_masswidth_pf100_wide_scaled_error05.root");
    TH1D* single2 = file2->Get("ptbin21particle5");
    single2->SetLineColor(17);
    single2->SetFillColor(17);
    single2->SetLineWidth(3);
    TH1D* othersingle2 = file2->Get("ptbin05particle5");
    othersingle2->SetLineColor(17);
    othersingle2->SetFillColor(17);
    othersingle2->SetLineWidth(3);
    TF1* fit2 = single2->GetFunction("fitPTbin2100particle5");
    TF1* otherfit2 = othersingle2->GetFunction("fitPTbin500particle5");
    fit2->SetLineColor(kGreen-2);
    fit2->SetLineStyle(5);
    fit2->SetLineWidth(6);
    otherfit2->SetLineColor(kGreen-2);
    otherfit2->SetLineWidth(6);
    otherfit2->SetLineStyle(5);

    TFile *file3 = new TFile("20170527_Kstar0bar_recon_simplewidth_pf100_wide_scaled_error05.root");
    TF1* fit3 = file3->Get("fitPTbin2100particle5");
    fit3->SetLineColor(4);
    fit3->SetLineStyle(7);
    fit3->SetLineWidth(6);
    TF1* otherfit3 = file3->Get("fitPTbin500particle5");
    otherfit3->SetLineColor(4);
    otherfit3->SetLineStyle(7);
    otherfit3->SetLineWidth(6);

    TFile *file5 = new TFile("20170527_Kstar0bar_recon_fixedwidth_pf100_wide_scaled_error05.root");
    TF1* fit5 = file5->Get("fitPTbin2100particle5");
    fit5->SetLineColor(2);
    fit5->SetLineStyle(3);
    fit5->SetLineWidth(6);
    TF1* otherfit5 = file5->Get("fitPTbin500particle5");
    otherfit5->SetLineColor(2);
    otherfit5->SetLineStyle(3);
    otherfit5->SetLineWidth(6);

    //KStar0 AT DECAY //
    TFile *decayfile1 = new TFile("20170527_Kstar0bar_masswidth_pf160_scaled.root");
    TH1D* decaysingle1 = decayfile1->Get("ptbin21particle5");
    decaysingle1->SetLineColor(1);
    decaysingle1->SetMarkerStyle(21);
    decaysingle1->SetMarkerSize(0.3);
    decaysingle1->SetLineWidth(3);
    TH1D* otherdecaysingle1 = decayfile1->Get("ptbin05particle5");
    otherdecaysingle1->SetLineColor(1);
    otherdecaysingle1->SetMarkerStyle(21);
    otherdecaysingle1->SetMarkerSize(0.3);
    otherdecaysingle1->SetLineWidth(3);
    TF1* decayfit1 = decaysingle1->GetFunction("fitPTbin2100particle5");
    TF1* otherdecayfit1 = otherdecaysingle1->GetFunction("fitPTbin500particle5");
    decayfit1->SetBit(TF1::kNotDraw);
    decayfit1->SetLineColor(kGray+3);
    decayfit1->SetLineWidth(4);
    otherdecayfit1->SetBit(TF1::kNotDraw);
    otherdecayfit1->SetLineColor(kGray+3);
    otherdecayfit1->SetLineWidth(4);

    TFile *decayfile2 = new TFile("20170527_Kstar0bar_masswidth_pf160_scaled_error05.root");
    TH1D* decaysingle2 = decayfile2->Get("ptbin21particle5");
    decaysingle2->SetLineColor(17);
    decaysingle2->SetFillColor(17);
    decaysingle2->SetLineWidth(3);
    TH1D* otherdecaysingle2 = decayfile2->Get("ptbin05particle5");
    otherdecaysingle2->SetLineColor(17);
    otherdecaysingle2->SetFillColor(17);
    otherdecaysingle2->SetLineWidth(3);
    TF1* decayfit2 = decaysingle2->GetFunction("fitPTbin2100particle5");
    TF1* otherdecayfit2 = otherdecaysingle2->GetFunction("fitPTbin500particle5");
    decayfit2->SetLineColor(kGreen-2);
    decayfit2->SetLineStyle(5);
    decayfit2->SetLineWidth(6);
    otherdecayfit2->SetLineColor(kGreen-2);
    otherdecayfit2->SetLineWidth(4);
    otherdecayfit2->SetLineStyle(6);

    TFile *decayfile3 = new TFile("20170527_Kstar0bar_simplewidth_pf160_scaled_error05.root");
    TF1* decayfit3 = decayfile3->Get("fitPTbin2100particle5");
    decayfit3->SetLineColor(4);
    decayfit3->SetLineStyle(7);
    decayfit3->SetLineWidth(6);
    TF1* otherdecayfit3 = decayfile3->Get("fitPTbin500particle5");
    otherdecayfit3->SetLineColor(4);
    otherdecayfit3->SetLineStyle(7);
    otherdecayfit3->SetLineWidth(6);

    TFile *decayfile5 = new TFile("20170527_Kstar0bar_fixedwidth_pf160_scaled_error05.root");
    TF1* decayfit5 = decayfile5->Get("fitPTbin2100particle5");
    decayfit5->SetLineColor(2);
    decayfit5->SetLineStyle(3);
    decayfit5->SetLineWidth(6);
    TF1* otherdecayfit5 = decayfile5->Get("fitPTbin500particle5");
    otherdecayfit5->SetLineColor(2);
    otherdecayfit5->SetLineStyle(3);
    otherdecayfit5->SetLineWidth(6);


    //Do plots for decay and recon side by side, for high PT////////////////////////////////////////////////
    TExec *exec1 = new TExec("exec1", "gStyle->SetErrorX(0)");
    TExec *exec2 = new TExec("exec2", "gStyle->SetErrorX(0.5)");

    TCanvas *cSingle = new TCanvas("single", "single", 70, 70, 1000, 600);
    cSingle->SetMargin(0.0, 0.0, 0.0, 0.0);
    cSingle->Divide(2,1,0.0);
    cSingle->cd(2)->SetMargin(0.0, 0.1867, 0.1326, 0.0977);
    cSingle->cd(2)->SetTicks(0,1);

    single1->SetStats(kFALSE);
    single1->SetTitle("");
    single1->GetYaxis()->SetTitleOffset(1.50);
    single1->GetYaxis()->SetLabelSize(0.05);
    single1->GetYaxis()->SetTitleSize(0.06);
    single1->GetYaxis()->SetTitleFont(42);
    single1->GetYaxis()->SetLabelFont(42);
    single1->GetYaxis()->SetTitle("Counts / 8 MeV/c^{2}");
    single1->GetXaxis()->SetRangeUser(0.61, 1.09);
    single1->GetXaxis()->SetLabelSize(0.05);
    single1->GetXaxis()->SetTitleSize(0.06);
    single1->GetXaxis()->SetLabelFont(42);
    single1->GetXaxis()->SetTitleFont(42);
    single1->GetXaxis()->SetTitle("K^{-}#pi^{+} invariant mass (GeV/c^{2})");
    single1->Draw("E Y+");
    single2->SetStats(kFALSE);
    single2->GetXaxis()->SetRangeUser(0.61, 1.09);
    single2->Draw("SAME E2");
    fit1->Draw("SAME");
    fit2->Draw("SAME");
    fit3->Draw("SAME");
    fit5->Draw("SAME");
    exec1->Draw();
    single1->Draw("E SAME");
    exec2->Draw();
    //fit7->Draw("SAME");

    TPaveText *text = new TPaveText(0.3715, 0.7592, 0.6586, 0.8901, "NDC");
    text->AddText("Reconstructed #bar{K}*^{0}");
    text->AddText("2.0 < p_{T} < 2.2 GeV/c");
    text->SetBorderSize(0);
    text->SetFillStyle(0);
    text->GetLine(1)->SetTextSizePixels(28);
    text->GetLine(0)->SetTextSizePixels(32);
  
    text->Draw();

    //Do DECAY part
    cSingle->cd(1)->SetMargin(0.1727, 0.0, 0.1326, 0.0977);
    cSingle->cd(1)->SetTicks(0,1);
    TLegend *singleLegend = new TLegend(0.2048, 0.4223, 0.5884, 0.7400);
    singleLegend->AddEntry(fit1, "Mass Dep. Width", "l");
    singleLegend->AddEntry(fit2, "#splitline{Mass Dep. Width}{+5% Error}", "l");
    singleLegend->AddEntry(fit3, "#splitline{Simple Width}{+5% Error}", "l");
    singleLegend->AddEntry(fit5, "#splitline{Fixed #Gamma = 50 MeV/c^{2}}{+5% Error}", "l");
    singleLegend->SetTextSizePixels(20);

    TLegend *singleLegend2 = new TLegend(0.2430, 0.3351, 0.4940, 0.3892);
    singleLegend2->AddEntry(single2, "#splitline{Added Error}{(5% of peak bin)}", "f");
    singleLegend2->SetFillStyle(0);
    singleLegend2->SetBorderSize(0);
    singleLegend2->SetTextSizePixels(20); 

    decaysingle1->SetStats(kFALSE);
    decaysingle1->SetTitle("");
    decaysingle1->GetYaxis()->SetTitleOffset(1.50);
    decaysingle1->GetYaxis()->SetLabelSize(0.05);
    decaysingle1->GetYaxis()->SetTitleSize(0.06);
    decaysingle1->GetYaxis()->SetTitleFont(42);
    decaysingle1->GetYaxis()->SetLabelFont(42);
    decaysingle1->GetYaxis()->SetTitle("Counts / 8 MeV/c^{2}");
    decaysingle1->GetXaxis()->SetRangeUser(0.61, 1.09);
    decaysingle1->GetXaxis()->SetLabelSize(0.05);
    decaysingle1->GetXaxis()->SetTitleSize(0.06);
    decaysingle1->GetXaxis()->SetTitleFont(42);
    decaysingle1->GetXaxis()->SetLabelFont(42);
    decaysingle1->GetXaxis()->SetTitle("K^{-}#pi^{+} invariant mass (GeV/c^{2})");
    decaysingle1->Draw("E");
    decaysingle2->SetStats(kFALSE);
    decaysingle2->GetXaxis()->SetRangeUser(0.61, 1.09);
    decaysingle2->Draw("SAME E2");
    decayfit1->Draw("SAME");
    decayfit2->Draw("SAME");
    decayfit3->Draw("SAME");
    decayfit5->Draw("SAME");
    exec1->Draw();
    decaysingle1->Draw("E SAME");
    exec2->Draw();
    //fit7->Draw("SAME");

    TPaveText *text = new TPaveText(0.5964, 0.7539, 0.8835, 0.8848, "NDC");
    text->AddText("#bar{K}*^{0} at Decay Point");
    text->AddText("2.0 < p_{T} < 2.2 GeV/c");
    text->SetBorderSize(0);
    text->SetFillStyle(0);
    text->GetLine(1)->SetTextSizePixels(28);
    text->GetLine(0)->SetTextSizePixels(32);
  
    singleLegend->Draw();
    singleLegend2->Draw();
    text->Draw();


    //DO LOW MOMENTUM/////////////////////////////////////////////////////////////

    TCanvas *cotherSingle = new TCanvas("othersingle", "othersingle", 70, 70, 1000, 600);
    cotherSingle->SetMargin(0.0, 0.0, 0.0, 0.0);
    cotherSingle->Divide(2,1,0.0);
    cotherSingle->cd(2)->SetMargin(0.0, 0.1867, 0.1326, 0.0977);
    cotherSingle->cd(2)->SetTicks(0,1);

    othersingle1->SetStats(kFALSE);
    othersingle1->SetTitle("");
    othersingle1->GetYaxis()->SetTitleOffset(1.50);
    othersingle1->GetYaxis()->SetLabelSize(0.05);
    othersingle1->GetYaxis()->SetTitleSize(0.06);
    othersingle1->GetYaxis()->SetTitleFont(42);
    othersingle1->GetYaxis()->SetLabelFont(42);
    othersingle1->GetYaxis()->SetTitle("Counts / 8 MeV/c^{2}");
    othersingle1->GetXaxis()->SetRangeUser(0.61, 1.09);
    othersingle1->GetXaxis()->SetLabelSize(0.05);
    othersingle1->GetXaxis()->SetTitleSize(0.06);
    othersingle1->GetXaxis()->SetLabelFont(42);
    othersingle1->GetXaxis()->SetTitleFont(42);
    othersingle1->GetXaxis()->SetTitle("K^{-}#pi^{+} invariant mass (GeV/c^{2})");
    othersingle1->Draw("E Y+");
    othersingle2->SetStats(kFALSE);
    othersingle2->GetXaxis()->SetRangeUser(0.61, 1.09);
    othersingle2->Draw("SAME E2");
    otherfit1->Draw("SAME");
    otherfit2->Draw("SAME");
    otherfit3->Draw("SAME");
    otherfit5->Draw("SAME");
    exec1->Draw();
    othersingle1->Draw("E SAME");
    exec2->Draw();
    //fit7->Draw("SAME");

    TPaveText *othertext = new TPaveText(0.3715, 0.7592, 0.6586, 0.8901, "NDC");
    othertext->AddText("Reconstructed #bar{K}*^{0}");
    othertext->AddText("0.4 < p_{T} < 0.6 GeV/c");
    othertext->SetBorderSize(0);
    othertext->SetFillStyle(0);
    othertext->GetLine(1)->SetTextSizePixels(28);
    othertext->GetLine(0)->SetTextSizePixels(32);
  
    othertext->Draw();

    //Do DECAY part
    cotherSingle->cd(1)->SetMargin(0.1727, 0.0, 0.1326, 0.0977);
    cotherSingle->cd(1)->SetTicks(0,1);
    TLegend *othersingleLegend = new TLegend(0.2048, 0.4223, 0.5884, 0.7400);
    othersingleLegend->AddEntry(fit1, "Mass Dep. Width", "l");
    othersingleLegend->AddEntry(fit2, "#splitline{Mass Dep. Width}{+5% Error}", "l");
    othersingleLegend->AddEntry(fit3, "#splitline{Simple Width}{+5% Error}", "l");
    othersingleLegend->AddEntry(fit5, "#splitline{Fixed #Gamma = 50 MeV/c^{2}}{+5% Error}", "l");
    othersingleLegend->SetTextSizePixels(20);

    TLegend *othersingleLegend2 = new TLegend(0.2430, 0.3351, 0.4940, 0.3892);
    othersingleLegend2->AddEntry(othersingle2, "#splitline{Added Error}{(5% of peak bin)}", "f");
    othersingleLegend2->SetFillStyle(0);
    othersingleLegend2->SetBorderSize(0);
    othersingleLegend2->SetTextSizePixels(20); 

    otherdecaysingle1->SetStats(kFALSE);
    otherdecaysingle1->SetTitle("");
    otherdecaysingle1->GetYaxis()->SetTitleOffset(1.50);
    otherdecaysingle1->GetYaxis()->SetLabelSize(0.05);
    otherdecaysingle1->GetYaxis()->SetTitleSize(0.06);
    otherdecaysingle1->GetYaxis()->SetTitleFont(42);
    otherdecaysingle1->GetYaxis()->SetLabelFont(42);
    otherdecaysingle1->GetYaxis()->SetTitle("Counts / 8 MeV/c^{2}");
    otherdecaysingle1->GetXaxis()->SetRangeUser(0.61, 1.09);
    otherdecaysingle1->GetXaxis()->SetLabelSize(0.05);
    otherdecaysingle1->GetXaxis()->SetTitleSize(0.06);
    otherdecaysingle1->GetXaxis()->SetTitleFont(42);
    otherdecaysingle1->GetXaxis()->SetLabelFont(42);
    otherdecaysingle1->GetXaxis()->SetTitle("K^{-}#pi^{+} invariant mass (GeV/c^{2})");
    otherdecaysingle1->Draw("E");
    otherdecaysingle2->SetStats(kFALSE);
    otherdecaysingle2->GetXaxis()->SetRangeUser(0.61, 1.09);
    otherdecaysingle2->Draw("SAME E2");
    otherdecayfit1->Draw("SAME");
    otherdecayfit2->Draw("SAME");
    otherdecayfit3->Draw("SAME");
    otherdecayfit5->Draw("SAME");
    exec1->Draw();
    otherdecaysingle1->Draw("E SAME");
    exec2->Draw();
    //fit7->Draw("SAME");

    TPaveText *othertext = new TPaveText(0.5964, 0.7539, 0.8835, 0.8848, "NDC");
    othertext->AddText("#bar{K}*^{0} at Decay Point");
    othertext->AddText("0.4 < p_{T} < 0.6 GeV/c");
    othertext->SetBorderSize(0);
    othertext->SetFillStyle(0);
    othertext->GetLine(1)->SetTextSizePixels(24);
    othertext->GetLine(0)->SetTextSizePixels(28);
  
    othersingleLegend->Draw();
    othersingleLegend2->Draw();
    othertext->Draw();

}
Example #4
0
void alicePlots(){
    
    TFile* alice = new TFile("~/Downloads/HEPData-ins1288320-v1-root.root");
    alice->cd("Table 16");
    TGraph* aliceData = Graph1D_y1;
    TH1F* hist = Hist1D_y1;
    TH1F* stat = Hist1D_y1_e1;
    TH1F* syst = Hist1D_y1_e2;
    TGraphAsymmErrors* graph2 = (TGraphAsymmErrors*)aliceData->Clone("graph2");

    Int_t numPts = aliceData->GetN();
    Double_t x, y;
    for(int i = 0; i<numPts; i++){
        aliceData->GetPoint(i, x, y);
        aliceData->SetPoint(i, x, (y - 0.89581));
        graph2->SetPoint(i, x, (y- 0.89581));
        hist->SetBinContent(i+1, hist->GetBinContent(i+1) - 0.89581);
        hist->SetBinError(i+1, stat->GetBinContent(i+1));
        graph2->SetPointEXhigh(i, 0.1);
        graph2->SetPointEXlow(i, 0.1);
    }

    graph2->SetLineColor(kBlue-10);
    graph2->SetLineWidth(2);
    graph2->SetMarkerColor(kBlue-10);
    graph2->SetFillColor(kBlue-10);
    hist->SetLineColor(kBlue-2);
    hist->SetLineWidth(2);

    aliceData->SetTitle("");
    aliceData->GetYaxis()->SetTitle("Mass - Vacuum Mass (GeV/c^{2})");
    aliceData->GetYaxis()->SetTitleSize(0.06);
    aliceData->GetYaxis()->SetLabelSize(0.04);
    aliceData->GetYaxis()->SetTitleOffset(1.65);
    aliceData->GetYaxis()->SetTitleFont(42);
    aliceData->GetYaxis()->SetLabelFont(42);
    aliceData->GetXaxis()->SetTitle("p_{T} (GeV/c)");
    aliceData->GetXaxis()->SetTitleSize(0.06);
    aliceData->GetXaxis()->SetLabelSize(0.05);
    aliceData->GetXaxis()->SetTitleFont(42);
    aliceData->GetXaxis()->SetLabelFont(42);
    aliceData->SetMarkerStyle(29);
    aliceData->SetMarkerSize(2.5);
    aliceData->SetMarkerColor(kBlue-2);
    aliceData->SetLineColor(kBlue-2);

    aliceData->GetYaxis()->SetRangeUser(-0.02, 0.015);
    aliceData->GetXaxis()->SetRangeUser(0, 5);

    TFile* phsd = new TFile("~/utaustin/resonancefits/finalplotting/20170721_KKbarAdded2_fixedwidth42_recon_pf100_scaled_error05.root");
    TH1D* mass = phsd->Get("kstar0mass");
    mass->SetName("mass");
    mass->SetMarkerStyle(26);
    mass->SetMarkerSize(2.5);
    mass->SetMarkerColor(2);
    mass->SetLineColor(2);

    TF1* line = new TF1("line", "[0]", 0.0, 5.0);
    line->SetParameter(0, 0.0);
    line->SetLineColor(1);
    line->SetLineStyle(7);
    line->SetLineWidth(3);

    for(int j = 0; j<mass->GetNbinsX(); j++){
        mass->SetBinContent(j+1, (mass->GetBinContent(j+1) - 0.892));
    }


    TFile* phsd2 = new TFile("~/utaustin/resonancefits/finalplotting/20170616_KKbarAdded2_fixedwidth_recon_pf100_scaled_error05.root");
    TH1D* mass2 = phsd2->Get("kstar0mass");
    mass2->SetName("mass2");
    mass2->SetMarkerStyle(22);
    mass2->SetMarkerSize(2.5);
    mass2->SetMarkerColor(2);
    mass2->SetLineColor(2);
    for(int j = 0; j<mass2->GetNbinsX(); j++){
        mass2->SetBinContent(j+1, (mass2->GetBinContent(j+1) - 0.892));
    }



    TExec *exec1 = new TExec("exec1", "gStyle->SetErrorX(0.1)");
    TExec *exec2 = new TExec("exec2", "gStyle->SetErrorX(0.5)");
    
    TCanvas *c = new TCanvas ("c", "c", 50, 50, 650, 600);
    c->cd()->SetMargin(0.1997, 0.0369, 0.1396, 0.0681);
    aliceData->Draw("APX");
    //exec1->Draw();
    graph2->Draw("SAME P2");
    //exec2->Draw();
    hist->Draw("SAME E1");
    line->Draw("SAME");
    mass2->Draw("SAME P E1");
    mass->Draw("SAME P E1");
    aliceData->Draw("SAME PX");
    

    TLegend* legend = new TLegend(0.5836, 0.1815, 0.9489, 0.3438);
    legend->SetMargin(0.2);
    legend->SetTextSizePixels(20);
    legend->AddEntry(aliceData, "ALICE data, 0-20%", "p");
    legend->AddEntry(mass2, "Fit IV to PHSD: w in-med", "p");
    legend->AddEntry(mass, "Fit IV to PHSD: w/o in-med", "p");
    legend->Draw("SAME"); 
  
    TPaveText* text = new TPaveText(0.2554, 0.7243, 0.6006, 0.9162, "NDC");
    text->AddText("(K*^{0} + #bar{K}*^{0})");
    text->AddText("Pb-Pb #sqrt{s_{NN}} = 2.76 TeV");
    text->GetLine(0)->SetTextSizePixels(36);
    text->GetLine(1)->SetTextSizePixels(24);
    text->SetTextFont(42);
    text->SetBorderSize(0);
    text->SetFillStyle(0);
    text->Draw();
}
Example #5
0
void massPlotsbar(){

    TFile *file1 = new TFile("20170721_Kstar0bar_masswidth_pf160_scaled.root");
    TH1D* mass1 = file1->Get("kstar0mass");
    mass1->SetName("mwScaled");
    mass1->SetTitle("Fit Mass Peak for K*^{0}");
    mass1->SetMarkerStyle(20);
    mass1->SetMarkerSize(1.5);
    mass1->SetMarkerColor(1);
    TH1D* width1 = file1->Get("kstar0width");
    width1->SetName("mwWidthScaled");
    width1->SetTitle("Fit Width for K*^{0}");
    width1->SetMarkerStyle(20);
    width1->SetMarkerSize(1.5);
    width1->SetMarkerColor(1);
    TH1D* single1 = file1->Get("ptbin21particle5");
    single1->SetLineColor(1);
    single1->SetMarkerStyle(21);
    single1->SetMarkerSize(0.3);
    single1->SetLineWidth(3);
    TH1D* othersingle1 = file1->Get("ptbin05particle5");
    othersingle1->SetLineColor(1);
    othersingle1->SetMarkerStyle(21);
    othersingle1->SetMarkerSize(0.3);
    othersingle1->SetLineWidth(3);
    TF1* fit1 = single1->GetFunction("fitPTbin2100particle5");
    TF1* otherfit1 = othersingle1->GetFunction("fitPTbin500particle5");
    fit1->SetBit(TF1::kNotDraw);
    fit1->SetLineColor(kGray+3);
    fit1->SetLineWidth(4);
    otherfit1->SetBit(TF1::kNotDraw);
    otherfit1->SetLineColor(kGray+3);
    otherfit1->SetLineWidth(4);

    TFile *file2 = new TFile("20170721_Kstar0bar_masswidth_pf160_scaled_error05.root");
    TH1D* mass2 = file2->Get("kstar0mass");
    mass2->SetName("mwError05");
    mass2->SetTitle("Fit Mass Peak for K*^{-}");
    mass2->SetMarkerStyle(33);
    mass2->SetMarkerSize(1.5);
    mass2->SetLineColor(kGreen-2);
    mass2->SetMarkerColor(kGreen-2);
    TH1D* width2 = file2->Get("kstar0width");
    width2->SetName("mwWidth05");
    width2->SetTitle("Fit Width for K*^{0}");
    width2->SetMarkerStyle(33);
    width2->SetMarkerSize(1.5);
    width2->SetMarkerColor(kGreen-2);
    width2->SetLineColor(kGreen-2);
    TH1D* single2 = file2->Get("ptbin21particle5");
    single2->SetLineColor(17);
    single2->SetFillColor(17);
    single2->SetLineWidth(3);
    TH1D* othersingle2 = file2->Get("ptbin05particle5");
    othersingle2->SetLineColor(17);
    othersingle2->SetFillColor(17);
    othersingle2->SetLineWidth(3);
    TF1* fit2 = single2->GetFunction("fitPTbin2100particle5");
    TF1* otherfit2 = othersingle2->GetFunction("fitPTbin500particle5");
    fit2->SetLineColor(kGreen-2);
    fit2->SetLineStyle(5);
    fit2->SetLineWidth(4);
    otherfit2->SetLineColor(kGreen-2);
    otherfit2->SetLineWidth(4);
    otherfit2->SetLineStyle(5);



    TFile *file3 = new TFile("20170721_Kstar0bar_simplewidth_pf160_scaled_error05.root");
    TH1D* mass3 = file3->Get("kstar0mass");
    mass3->SetName("swError05");
    mass3->SetTitle("simple width, error: 5%");
    mass3->SetMarkerStyle(21);
    mass3->SetMarkerSize(1.5);
    mass3->SetMarkerColor(4);
    mass3->SetLineColor(4);
    TH1D* width3 = file3->Get("kstar0collWidth");
    width3->SetName("swWidth05");
    width3->SetTitle("Fit Width for (K*^{0} + K*^{0})");
    width3->SetMarkerStyle(21);
    width3->SetMarkerSize(1.5);
    width3->SetMarkerColor(4);
    width3->SetLineColor(4);
    TF1* fit3 = file3->Get("fitPTbin2100particle5");
    fit3->SetLineColor(4);
    fit3->SetLineStyle(7);
    fit3->SetLineWidth(4);
    TF1* otherfit3 = file3->Get("fitPTbin500particle5");
    otherfit3->SetLineColor(4);
    otherfit3->SetLineStyle(7);
    otherfit3->SetLineWidth(4);

/*
    TFile *file4 = new TFile("20170522_Kstar0_reconsimplewidth_pf160_error01.root");
    TH1D* mass4 = file4->Get("kstar0mass");
    mass4->SetName("swError10");
    mass4->SetTitle("simple width, error: 10%");
    mass4->SetMarkerStyle(25);
    mass4->SetMarkerSize(1.5);
    mass4->SetMarkerColor(3);
*/
    TFile *file5 = new TFile("20170721_Kstar0bar_fixedwidth42_pf160_scaled_error05.root");
    TH1D* mass5 = file5->Get("kstar0mass");
    mass5->SetName("fwError05");
    mass5->SetTitle("fixed width, error: 5%");
    mass5->SetMarkerStyle(22);
    mass5->SetMarkerSize(1.5);
    mass5->SetMarkerColor(2);
    mass5->SetLineColor(2);
    TH1D* width5 = file5->Get("kstar0collWidth");
    width5->SetName("fwWidth05");
    width5->SetTitle("Fit Width for K*^0");
    width5->SetMarkerStyle(22);
    width5->SetMarkerSize(1.5);
    width5->SetMarkerColor(2);
    width5->SetLineColor(2);
    TF1* fit5 = file5->Get("fitPTbin2100particle5");
    fit5->SetLineColor(2);
    fit5->SetLineStyle(3);
    fit5->SetLineWidth(4);
    TF1* otherfit5 = file5->Get("fitPTbin500particle5");
    otherfit5->SetLineColor(2);
    otherfit5->SetLineStyle(3);
    otherfit5->SetLineWidth(4);
    /*
    TFile *file6 = new TFile("20170522_Kstar0_reconfixedwidth_pf160_error10.root");
    TH1D* mass6 = file6->Get("kstar0mass");
    mass6->SetName("fwError05");
    mass6->SetTitle("fixed width, error: 10%");
    mass6->SetMarkerStyle(26);
    mass6->SetMarkerSize(1.5);
    mass6->SetMarkerColor(3);

    TFile *file7 = new TFile("20170522_Kstar0_reconfixedwidth70_pf160_scaled.root");
    TH1D* mass7 = file7->Get("kstar0mass");
    mass7->SetName("fw70Error05");
    mass7->SetMarkerStyle(22);
    mass7->SetMarkerSize(1.5);
    mass7->SetMarkerColor(kRed+3);
    TH1D* width7 = file7->Get("kstar0collWidth");
    width7->SetName("fw70Width05");
    width7->SetTitle("Fit Width for K*^{0}");
    width7->SetMarkerStyle(22);
    width7->SetMarkerSize(1.5);
    width7->SetMarkerColor(kRed+3);
    width7->SetLineColor(2);
    TF1* fit7 = file7->Get("fitPTbin2100particle5");
    fit7->SetLineColor(kRed+3);
    fit7->SetLineStyle(3);
    fit7->SetLineWidth(3);
*/
   


    TCanvas *cMass = new TCanvas("cMass", "cMass", 50, 50, 600, 600);

    TF1 *pdg = new TF1("pdg", "[0]", 0.0, 4.0);
    pdg->SetParameter(0, 0.892);
    pdg->SetLineStyle(7);
    pdg->SetLineColor(1);
    pdg->SetLineWidth(4);

    TPaveText *pdgtext = new TPaveText(0.5520, 0.5637, 0.8322, 0.6946, "NDC");
    pdgtext->AddText("PHSD vacuum mass");
    pdgtext->SetTextSizePixels(32);
    pdgtext->SetBorderSize(0);
    pdgtext->SetTextFont(42);
    pdgtext->SetFillStyle(0);

    cMass->cd();
    TLegend* legend = new TLegend(0.1611,0.6370,0.4832,0.8935);
    legend->AddEntry(mass1, "Mass Dep. Width", "lpe");
    legend->AddEntry(mass2, "Mass Dep. Width (+5% Error)", "lpe");
    legend->AddEntry(mass3, "Simple Width (+5% Error)", "lpe");
    legend->AddEntry(mass5, "Fixed Vacuum Width (+5% Error)", "lpe");
    legend->SetMargin(0.1);
    legend->SetTextSizePixels(28);
    //legend->AddEntry(mass7, "Fixed Width (70 MeV/c^{2}), 5% Error", "lpe");

    mass1->GetYaxis()->SetRangeUser(0.87, 0.91);
    mass1->GetYaxis()->SetLabelSize(0.06);
    mass1->GetYaxis()->SetTitleOffset(1.3);
    mass1->GetYaxis()->SetTitleSize(0.07);
    mass1->GetYaxis()->SetTitleFont(42);
    mass1->GetYaxis()->SetLabelFont(42);
    mass1->GetXaxis()->SetLabelSize(0.06);
    mass1->GetXaxis()->SetTitleSize(0.07);
    mass1->GetXaxis()->SetLabelFont(42);
    mass1->GetXaxis()->SetTitleFont(42);
    mass1->SetTitle("");
    mass1->Draw("P E1");
    mass3->Draw("SAME P E1");
    //mass4->Draw("SAME");
    mass5->Draw("SAME P E1");
    mass2->Draw("SAME P E1");
    pdg->Draw("SAME");
    pdgtext->Draw("SAME");
    //mass6->Draw("SAME");
    //mass7->Draw("SAME P E1");
    TPaveText *masstext = new TPaveText(0.5520, 0.7208, 0.8389, 0.8517, "NDC");
    masstext->AddText("#bar{K}*^{0} Mass");
    masstext->AddText("At Decay Point");
    //masstext->AddText("Reconstructed");
    masstext->SetBorderSize(0);
    masstext->SetFillStyle(0);
    masstext->SetTextSizePixels(36);
    masstext->SetTextFont(42);
    masstext->Draw();

    legend->Draw();

    TLegend *widthLegend = new TLegend(0.1913,0.6108,0.5134,0.8656);
    widthLegend->AddEntry(width1, "Mass Dep. Width", "lpe");
    widthLegend->AddEntry(width2, "Mass Dep. Width (+5% Error)", "lpe");
    widthLegend->AddEntry(width3, "Simple Width (+5% Error)", "lpe");
    widthLegend->AddEntry(width5, "Fixed Vacuum Width (+5% Error)", "lpe");
    widthLegend->SetTextSizePixels(20);
    //widthLegend->AddEntry(width7, "Fixed Width (70 MeV/c^{2}), 5% Error", "lpw");
    
    TCanvas *cWidth = new TCanvas("cWidth", "cWidth", 60, 60, 600, 600);
    cWidth->cd();
    width1->GetYaxis()->SetLabelSize(0.06);
    width1->GetYaxis()->SetTitleOffset(1.4);
    width1->GetYaxis()->SetRangeUser(0.02, 0.12);
    width1->GetYaxis()->SetTitleSize(0.07);
    width1->GetYaxis()->SetTitleFont(42);
    width1->GetYaxis()->SetLabelFont(42);
    width1->GetXaxis()->SetTitleSize(0.07);
    width1->GetXaxis()->SetLabelSize(0.06);
    width1->GetXaxis()->SetTitleFont(42);
    width1->GetXaxis()->SetLabelFont(42);
    width1->GetYaxis()->SetTitle("Width (GeV/c^{2})");
    width1->SetTitle("");
    width1->Draw("P E1");
    width3->Draw("SAME P E1");
    width1->Draw("SAME P E1");
    width5->Draw("SAME P E1");
    width2->Draw("SAME P E1");
   //width7->Draw("SAME P E1");
    widthLegend->Draw();

    TPaveText *widthtext = new TPaveText(0.5822, 0.7024, 0.8675, 0.8333, "NDC");
    widthtext->AddText("#bar{K}*^{0} Width");
    widthtext->AddText("At Decay Point");
    //widthtext->AddText("Reconstructed");
    widthtext->SetBorderSize(0);
    widthtext->SetFillStyle(0);
    widthtext->SetTextSizePixels(36);
    widthtext->SetTextFont(42);
    widthtext->Draw();

    TExec *exec1 = new TExec("exec1", "gStyle->SetErrorX(0)");
    TExec *exec2 = new TExec("exec2", "gStyle->SetErrorX(0.5)");

    TLegend *singleLegend = new TLegend(0.1376, 0.5585, 0.5201, 0.8778);
    singleLegend->AddEntry(fit1, "Mass Dep. Width", "l");
    singleLegend->AddEntry(fit2, "#splitline{Mass Dep. Width}{+5% Error}", "l");
    singleLegend->AddEntry(fit3, "#splitline{Simple Width}{+5% Error}", "l");
    singleLegend->AddEntry(fit5, "#splitline{Fixed #Gamma = 50 MeV/c^{2}}{+5% Error}", "l");
    singleLegend->SetTextSizePixels(20);
    //singleLegend->AddEntry(fit7, "Fixed Width (70 MeV/c^{2})", "l");
    TCanvas *cSingle = new TCanvas("single", "single", 70, 70, 600, 600);
    cSingle->cd();
    single1->SetStats(kFALSE);
    single1->SetTitle("");
    single1->GetYaxis()->SetTitleOffset(1.50);
    single1->GetYaxis()->SetLabelSize(0.03);
    single1->GetYaxis()->SetTitleSize(0.04);
    single1->GetYaxis()->SetTitle("Counts / 8 MeV/c^{2}");
    single1->GetXaxis()->SetRangeUser(0.61, 1.09);
    single1->GetXaxis()->SetLabelSize(0.03);
    single1->GetXaxis()->SetTitleSize(0.04);
    single1->GetXaxis()->SetTitle("K^{+}#pi^{-} invariant mass (GeV/c^{2})");
    single1->Draw("E");
    single2->SetStats(kFALSE);
    single2->GetXaxis()->SetRangeUser(0.61, 1.09);
    single2->Draw("SAME E2");
    fit1->Draw("SAME");
    fit2->Draw("SAME");
    fit3->Draw("SAME");
    fit5->Draw("SAME");
    exec1->Draw();
    single1->Draw("E SAME");
    exec2->Draw();
    //fit7->Draw("SAME");
    TLegend *singleLegend2 = new TLegend(0.1695, 0.4738, 0.4211, 0.5279);
    singleLegend2->AddEntry(single2, "#splitline{Added Error}{(5% of peak bin)}", "f");
    singleLegend2->SetFillStyle(0);
    singleLegend2->SetBorderSize(0);
    singleLegend2->SetTextSizePixels(20);
 
    TPaveText *text = new TPaveText(0.5822, 0.7024, 0.8675, 0.8333, "NDC");
    text->AddText("Reconstructed #bar{K}*^{0}");
    text->AddText("2.0 < p_{T} < 2.2 GeV/c");
    text->SetBorderSize(0);
    text->SetFillStyle(0);
    text->GetLine(1)->SetTextSizePixels(20);
    text->GetLine(0)->SetTextSizePixels(22);
  
    singleLegend->Draw();
    singleLegend2->Draw();
    text->Draw();

    TLegend *othersingleLegend = new TLegend(0.1376, 0.5585, 0.5201, 0.8778);
    othersingleLegend->AddEntry(otherfit1, "Mass Dep. Width", "l");
    othersingleLegend->AddEntry(otherfit2, "#splitline{Mass Dep. Width}{+5% Error}", "l");
    othersingleLegend->AddEntry(otherfit3, "#splitline{Simple Width}{+5% Error}", "l");
    othersingleLegend->AddEntry(otherfit5, "#splitline{Fixed #Gamma = 50 MeV/c^{2}}{+5% Error}", "l");
    //othersingleLegend->SetBorderSize(0);
    //othersingleLegend->SetFillStyle(0);
    othersingleLegend->SetTextSizePixels(20);
    TCanvas *cotherSingle = new TCanvas("othersingle", "othersingle", 70, 70, 600, 600);
    cotherSingle->cd();
    othersingle1->SetStats(kFALSE);
    othersingle1->SetTitle("");
    othersingle1->GetYaxis()->SetTitleOffset(1.50);
    othersingle1->GetYaxis()->SetTitleSize(0.06);
    othersingle1->GetYaxis()->SetLabelSize(0.07);
    othersingle1->GetYaxis()->SetTitleFont(42);
    othersingle1->GetYaxis()->SetLabelFont(42);
    othersingle1->GetYaxis()->SetTitle("Counts / 8 MeV/c^{2}");
    othersingle1->GetXaxis()->SetRangeUser(0.61, 1.09);
    othersingle1->GetXaxis()->SetLabelSize(0.06);
    othersingle1->GetXaxis()->SetTitleSize(0.07);
    othersingle1->GetXaxis()->SetLabelFont(42);
    othersingle1->GetXaxis()->SetTitleFont(42);
    othersingle1->GetXaxis()->SetTitle("K^{+}#pi^{-} invariant mass (GeV/c^{2})");
    othersingle1->Draw("E");
    othersingle2->SetStats(kFALSE);
    othersingle2->GetXaxis()->SetRangeUser(0.61, 1.09);
    othersingle2->Draw("SAME E2");
    otherfit1->Draw("SAME");
    otherfit2->Draw("SAME");
    otherfit3->Draw("SAME");
    otherfit5->Draw("SAME");
    exec1->Draw();
    othersingle1->Draw("E SAME");
    exec2->Draw();
    othersingle1->GetXaxis()->Draw();
    //fit7->Draw("SAME");
    TLegend *othersingleLegend2 = new TLegend(0.1695, 0.4738, 0.4211, 0.5279);
   //othersingleLegend2->AddEntry(othersingle1, "Invariant Mass at Decay Point", "l");
    othersingleLegend2->AddEntry(othersingle2, "#splitline{Added Error}{(5% of peak bin)}", "f");
    othersingleLegend2->SetTextSizePixels(20);
    othersingleLegend2->SetBorderSize(0);
    othersingleLegend2->SetFillStyle(0);
   
    TPaveText *othertext = new TPaveText(0.5882, 0.7024, 0.8675, 0.8333, "NDC");
    othertext->AddText("Reconstructed K*^{0}");
    othertext->AddText("0.4 < p_{T} < 0.6 GeV/c");
    othertext->GetLine(0)->SetTextSizePixels(22);
    othertext->GetLine(1)->SetTextSizePixels(20);
    othertext->SetBorderSize(0);
    othertext->SetFillStyle(0);

    othersingleLegend->Draw();
    othersingleLegend2->Draw();
    othertext->Draw();  

    //testing drawing mass and width on same plot
    TCanvas* cMassWidth = new TCanvas("cmasswidth", "cmasswidth", 50, 50, 1000, 500);
    cMassWidth->SetMargin(0.0, 0.0, 0.0, 0.0);

    cMassWidth->Divide(2, 1, 0.0);
    
    cMassWidth->cd(1)->SetMargin(0.1827, 0.0, 0.1543, 0.0994);
    cMassWidth->cd(1)->SetTicks(0,1);
   
    mass1->Draw("P E1");
    mass3->Draw("SAME P E1");
    //mass4->Draw("SAME");
    mass5->Draw("SAME P E1");
    mass2->Draw("SAME P E1");
    pdg->Draw("SAME");
    pdgtext->Draw("SAME");
    masstext->Draw();
    legend->Draw();

    cMassWidth->cd(2)->SetMargin(0.0, 0.1968, 0.1543, 0.0994);
    cMassWidth->cd(2)->SetTicks(0,1);

    width1->Draw("P E1 Y+");
    width3->Draw("SAME P E1");
    width1->Draw("SAME P E1");
    width5->Draw("SAME P E1");
    width2->Draw("SAME P E1");
    //widthLegend->Draw("SAME");
    widthtext->Draw();


}