auto legend = new TLegend(0.6,0.7,0.9,0.9);
legend->AddEntry(hqc2,"TLC","l");
legend->AddEntry(hqc1,"LaBr3","l");
legend->AddEntry(hqc21,"511 keV TLC","f");
legend->AddEntry(hqc11,"511 keV LaBr3","f");
legend->Draw();
auto legend = new TLegend(0.1,0.7,0.48,0.9); 
legend->SetHeader("The Legend Title","C"); // option "C" allows to center the header
legend->AddEntry(h1,"Histogram filled with random numbers","f");
legend->AddEntry("f1","Function abs(#frac{sin(x)}{x})","l");
legend->AddEntry("gr","Graph with error bars","lep");
legend->Draw();