How to plot std::vector<int> and std::vector<float>

Dear developers,

I want to plot std::vector and std::vector (i.e mu_isTight, mu_ismuon, mu_iso) from my macro. Kindly assist me in plotting.

std::vector VetoMu_ch, el_charge, el_iso1, el_iso2, mu_isTight, mu_ismuon, el_isTight;
std::vector mu_iso, el_iso;

Thanks
Nab

Hi Nab, from what I understand you have two vectors, V1 and V2, and you want to plot one versus the other one.
To do so you can use a TGraph

TGraph *g = new TGraph("g","g",V1.size(), &(V1[0]), &(V2[0])); g->Draw();
If it is not what you want to do, could be give us more details.

hi pamputt,
I have many std vectors and I want to plot them separately as a tree branch.
I am attaching my script below.

new_macro.cc (10.5 KB)

Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.