Dear experts,
in a TH1 frame, I want to draw a TGraph by category (or bin the histogram bin), so:
- I defined the TH1 [1].
- I set the TH1 bin label [2].
- I defined the TVectorD to be parse to the TGraph [3].
- I defined the TGraph[4].
then I got this plot: calpas.web.cern.ch/calpas/h2taus/limit.png
But that is not exactly what I want. Indeed, it make a continues line btw the categories, while it should be discontinues. I want to fill each category with a value. For example, for the comb bin, we should have a vertical line which should correspond to the 1st element that I put in the graph vector parameter. Do you see how I can do that?
Regards
[1]
TH1D *dummy = new TH1D(“dummy”,“dummy”, 4, 120, 135);
dummy->GetXaxis()->SetTitle(“Channel”);
dummy->GetYaxis()->SetTitle("#sigma/#sigma_{SM}");
[2]
vector vlabel{“comb.”, “#mu#tau”, “e#tau”, “e#mu”};
for (int i=0; iGetNbinsX(); i++) dummy->GetXaxis()->SetBinLabel(i+1, vlabel[i].c_str());
[3]
array amass=(120, 125, 130, 135);
array azero=(0, 0, 0, 0);
int ndir=amass.size();
TVectorD v_dir (ndir, amass);
TVectorD v_zeros (ndir, azero);
TVectorD v_exp_p2(ndir, aexp_p2);
TVectorD v_exp (ndir, aexp);
TVectorD v_exp_m2(ndir, aexp_m2);
[4]
TGraphAsymmErrors *gr_exp2 = new TGraphAsymmErrors(v_dir, v_exp, v_zeros, v_zeros, v_exp_m2, v_exp_p2);
gr_exp2->SetLineColor(kYellow);
gr_exp2->SetFillColor(kYellow);
gr_exp2->Draw(“e3same”);