ROOT logo
void DrawMNN()
{
  gROOT->LoadMacro("MakeRawProduction.C+g");
  
  RawProduction::Output output;

  const char* example1 = "kMB/pt003_hPi0M11";
  TCanvas* canv = new TCanvas(example1, example1);
  gStyle->SetOptFit(1);
  TH1* hist = output.GetHistogram(example1);
  hist->SetAxisRange(0.05, 0.3);
  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
  hist->Draw();
  canv->SaveAs("imgs/kMB_pt003_hPi0M11.pdf");

  const char* example2 = "kMB/pt003_hPi0M12";
  TCanvas* canv = new TCanvas(example2, example2);
  gStyle->SetOptFit(1);
  TH1* hist = output.GetHistogram(example2);
  hist->SetAxisRange(0.05, 0.3);
  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
  hist->Draw();
  canv->SaveAs(Form("imgs/kMB_pt003_hPi0M12.pdf", example2));



  const char* badM11 = "kCentral/pt003_hPi0M11";
  TCanvas* canv = new TCanvas(badM11, badM11);
  gStyle->SetOptFit(1);
  TH1* hist = output.GetHistogram(badM11);
  hist->SetAxisRange(0.05, 0.3);
  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
  hist->Draw();
  canv->SaveAs(Form("imgs/kCentral_pt003_hPi0M11.pdf", badM11));


  const char* badM22 = "kCentral/pt003_hPi0M22";
  TCanvas* canv = new TCanvas(badM22, badM22);
  gStyle->SetOptFit(1);
  TH1* hist = output.GetHistogram(badM22);
  hist->SetAxisRange(0.05, 0.3);
  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
  hist->Draw();
  canv->SaveAs(Form("imgs/kCentral_pt003_hPi0M22.pdf", badM22));


  const char* badM33 = "kCentral/pt003_hPi0M33";
  TCanvas* canv = new TCanvas(badM33, badM33);
  gStyle->SetOptFit(1);
  TH1* hist = output.GetHistogram(badM33);
  hist->SetAxisRange(0.05, 0.3);
  hist->GetXaxis()->SetTitle("M_{#gamma#gamma}");
  hist->Draw();
  canv->SaveAs(Form("imgs/kCentral_pt003_hPi0M33.pdf", badM33));
  
 
  
  TStringToken triggers("kMB kCentral kSemiCentral kPHOSPb", " ");
  while(triggers.NextToken()) {
    canv = new TCanvas(Form("cMean_%s", triggers.Data()), Form("cMean_%s", triggers.Data()));

    RawProduction::TriggerBin triggerBin(triggers);
    TH1* hM11 = output.GetHistogram("M_M11", triggerBin);
    TH1* hM12 = output.GetHistogram("M_M12", triggerBin);
    TH1* hM13 = output.GetHistogram("M_M13", triggerBin);
    TH1* hM22 = output.GetHistogram("M_M22", triggerBin);
    TH1* hM23 = output.GetHistogram("M_M23", triggerBin);
    TH1* hM33 = output.GetHistogram("M_M33", triggerBin);


    hM12->SetMarkerStyle(24);
    hM12->SetMarkerColor(kCyan+1);
    hM12->SetLineColor(kCyan+1);
    hM12->GetYaxis()->SetRangeUser(0.12, 0.15);
    hM12->SetTitle(Form("#pi^{0} Peak Mean, %s", triggers.Data()));
    hM12->GetYaxis()->SetTitle("Peak #mu");
    hM12->GetYaxis()->SetTitleOffset(1.3);
    hM12->GetXaxis()->SetTitle("p_{T}");
    gStyle->SetOptStat(0);
    hM12->Draw();

    hM13->SetMarkerStyle(25);
    hM13->SetMarkerColor(kMagenta);
    hM13->SetLineColor(kMagenta);
    hM13->Draw("same");

    hM23->SetMarkerStyle(26);
    hM23->SetMarkerColor(kYellow+1);
    hM23->SetLineColor(kYellow+1);
    hM23->Draw("same");
    

    hM11->SetMarkerStyle(21);
    hM11->SetMarkerColor(1);
    hM11->SetLineColor(1);
    hM11->GetYaxis()->SetRangeUser(0.12, 0.15);
    hM11->Draw("same");

    hM22->SetMarkerStyle(22);
    hM22->SetMarkerColor(kRed);
    hM22->SetLineColor(kRed);
    hM22->Draw("same");

    hM33->SetMarkerStyle(23);
    hM33->SetMarkerColor(kGreen);
    hM33->SetLineColor(kGreen);
    hM33->Draw("same");

    TLegend* leg = new TLegend(0.8,0.6,0.95,0.95);
    leg->AddEntry(hM11, "M11", "lep");
    leg->AddEntry(hM22, "M22", "lep");
    leg->AddEntry(hM33, "M33", "lep");
    leg->AddEntry(hM12, "M12", "lep");
    leg->AddEntry(hM13, "M13", "lep");
    leg->AddEntry(hM23, "M23", "lep");
    leg->Draw();
    
    canv->SaveAs(Form("imgs/MNN_Mean_%s.pdf", triggers.Data()));
    canv->SaveAs(Form("imgs/MNN_Mean_%s.png", triggers.Data()));

    
    
    canv = new TCanvas(Form("cWidth_%s", triggers.Data()), Form("cWidth_%s", triggers.Data()));

    TH1* hW11 = output.GetHistogram("W_M11", triggerBin);
    TH1* hW12 = output.GetHistogram("W_M12", triggerBin);
    TH1* hW13 = output.GetHistogram("W_M13", triggerBin);
    TH1* hW22 = output.GetHistogram("W_M22", triggerBin);
    TH1* hW23 = output.GetHistogram("W_M23", triggerBin);
    TH1* hW33 = output.GetHistogram("W_M33", triggerBin);


    hW12->SetMarkerStyle(24);
    hW12->SetMarkerColor(kCyan+1);
    hW12->SetLineColor(kCyan+1);
    hW12->GetYaxis()->SetRangeUser(0., 0.012);
    hW12->SetTitle(Form("#pi^{0} Peak Width, %s", triggers.Data()));
    hW12->GetYaxis()->SetTitle("Peak #sigma");
    hW12->GetYaxis()->SetTitleOffset(1.3);
    hW12->GetXaxis()->SetTitle("p_{T}");
    gStyle->SetOptStat(0);
    hW12->Draw();

    hW13->SetMarkerStyle(25);
    hW13->SetMarkerColor(kMagenta);
    hW13->SetLineColor(kMagenta);
    hW13->Draw("same");

    hW23->SetMarkerStyle(26);
    hW23->SetMarkerColor(kYellow+1);
    hW23->SetLineColor(kYellow+1);
    hW23->Draw("same");
    

    hW11->SetMarkerStyle(21);
    hW11->SetMarkerColor(1);
    hW11->SetLineColor(1);
    hW11->GetYaxis()->SetRangeUser(0.12, 0.15);
    hW11->Draw("same");

    hW22->SetMarkerStyle(22);
    hW22->SetMarkerColor(kRed);
    hW22->SetLineColor(kRed);
    hW22->Draw("same");

    hW33->SetMarkerStyle(23);
    hW33->SetMarkerColor(kGreen);
    hW33->SetLineColor(kGreen);
    hW33->Draw("same");

    leg = new TLegend(0.8,0.6,0.95,0.95);
    leg->AddEntry(hW11, "M11", "lep");
    leg->AddEntry(hW22, "M22", "lep");
    leg->AddEntry(hW33, "M33", "lep");
    leg->AddEntry(hW12, "M12", "lep");
    leg->AddEntry(hW13, "M13", "lep");
    leg->AddEntry(hW23, "M23", "lep");
    leg->Draw();
    
    canv->SaveAs(Form("imgs/MNN_Width_%s.pdf", triggers.Data()));
  }
}
 DrawMNN.C:1
 DrawMNN.C:2
 DrawMNN.C:3
 DrawMNN.C:4
 DrawMNN.C:5
 DrawMNN.C:6
 DrawMNN.C:7
 DrawMNN.C:8
 DrawMNN.C:9
 DrawMNN.C:10
 DrawMNN.C:11
 DrawMNN.C:12
 DrawMNN.C:13
 DrawMNN.C:14
 DrawMNN.C:15
 DrawMNN.C:16
 DrawMNN.C:17
 DrawMNN.C:18
 DrawMNN.C:19
 DrawMNN.C:20
 DrawMNN.C:21
 DrawMNN.C:22
 DrawMNN.C:23
 DrawMNN.C:24
 DrawMNN.C:25
 DrawMNN.C:26
 DrawMNN.C:27
 DrawMNN.C:28
 DrawMNN.C:29
 DrawMNN.C:30
 DrawMNN.C:31
 DrawMNN.C:32
 DrawMNN.C:33
 DrawMNN.C:34
 DrawMNN.C:35
 DrawMNN.C:36
 DrawMNN.C:37
 DrawMNN.C:38
 DrawMNN.C:39
 DrawMNN.C:40
 DrawMNN.C:41
 DrawMNN.C:42
 DrawMNN.C:43
 DrawMNN.C:44
 DrawMNN.C:45
 DrawMNN.C:46
 DrawMNN.C:47
 DrawMNN.C:48
 DrawMNN.C:49
 DrawMNN.C:50
 DrawMNN.C:51
 DrawMNN.C:52
 DrawMNN.C:53
 DrawMNN.C:54
 DrawMNN.C:55
 DrawMNN.C:56
 DrawMNN.C:57
 DrawMNN.C:58
 DrawMNN.C:59
 DrawMNN.C:60
 DrawMNN.C:61
 DrawMNN.C:62
 DrawMNN.C:63
 DrawMNN.C:64
 DrawMNN.C:65
 DrawMNN.C:66
 DrawMNN.C:67
 DrawMNN.C:68
 DrawMNN.C:69
 DrawMNN.C:70
 DrawMNN.C:71
 DrawMNN.C:72
 DrawMNN.C:73
 DrawMNN.C:74
 DrawMNN.C:75
 DrawMNN.C:76
 DrawMNN.C:77
 DrawMNN.C:78
 DrawMNN.C:79
 DrawMNN.C:80
 DrawMNN.C:81
 DrawMNN.C:82
 DrawMNN.C:83
 DrawMNN.C:84
 DrawMNN.C:85
 DrawMNN.C:86
 DrawMNN.C:87
 DrawMNN.C:88
 DrawMNN.C:89
 DrawMNN.C:90
 DrawMNN.C:91
 DrawMNN.C:92
 DrawMNN.C:93
 DrawMNN.C:94
 DrawMNN.C:95
 DrawMNN.C:96
 DrawMNN.C:97
 DrawMNN.C:98
 DrawMNN.C:99
 DrawMNN.C:100
 DrawMNN.C:101
 DrawMNN.C:102
 DrawMNN.C:103
 DrawMNN.C:104
 DrawMNN.C:105
 DrawMNN.C:106
 DrawMNN.C:107
 DrawMNN.C:108
 DrawMNN.C:109
 DrawMNN.C:110
 DrawMNN.C:111
 DrawMNN.C:112
 DrawMNN.C:113
 DrawMNN.C:114
 DrawMNN.C:115
 DrawMNN.C:116
 DrawMNN.C:117
 DrawMNN.C:118
 DrawMNN.C:119
 DrawMNN.C:120
 DrawMNN.C:121
 DrawMNN.C:122
 DrawMNN.C:123
 DrawMNN.C:124
 DrawMNN.C:125
 DrawMNN.C:126
 DrawMNN.C:127
 DrawMNN.C:128
 DrawMNN.C:129
 DrawMNN.C:130
 DrawMNN.C:131
 DrawMNN.C:132
 DrawMNN.C:133
 DrawMNN.C:134
 DrawMNN.C:135
 DrawMNN.C:136
 DrawMNN.C:137
 DrawMNN.C:138
 DrawMNN.C:139
 DrawMNN.C:140
 DrawMNN.C:141
 DrawMNN.C:142
 DrawMNN.C:143
 DrawMNN.C:144
 DrawMNN.C:145
 DrawMNN.C:146
 DrawMNN.C:147
 DrawMNN.C:148
 DrawMNN.C:149
 DrawMNN.C:150
 DrawMNN.C:151
 DrawMNN.C:152
 DrawMNN.C:153
 DrawMNN.C:154
 DrawMNN.C:155
 DrawMNN.C:156
 DrawMNN.C:157
 DrawMNN.C:158
 DrawMNN.C:159
 DrawMNN.C:160
 DrawMNN.C:161
 DrawMNN.C:162
 DrawMNN.C:163
 DrawMNN.C:164
 DrawMNN.C:165
 DrawMNN.C:166
 DrawMNN.C:167
 DrawMNN.C:168
 DrawMNN.C:169
 DrawMNN.C:170
 DrawMNN.C:171
 DrawMNN.C:172
 DrawMNN.C:173
 DrawMNN.C:174
 DrawMNN.C:175
 DrawMNN.C:176
 DrawMNN.C:177
 DrawMNN.C:178
 DrawMNN.C:179
 DrawMNN.C:180
 DrawMNN.C:181
 DrawMNN.C:182
 DrawMNN.C:183