|
@@ -18,7 +18,7 @@
|
|
|
struct HistWithPlottingInfo{
|
|
|
TH1* hist;
|
|
|
std::string draw_string;
|
|
|
-
|
|
|
+
|
|
|
HistWithPlottingInfo()
|
|
|
:hist(0),draw_string(""){};
|
|
|
HistWithPlottingInfo(TH1* hist, std::string draw_string)
|
|
@@ -30,15 +30,16 @@ class HistCollection{
|
|
|
private:
|
|
|
map<std::string, HistWithPlottingInfo> histograms;
|
|
|
std::string sample_name;
|
|
|
-
|
|
|
- const char* hist_id(const std::string &id){
|
|
|
- return (sample_name+id).c_str();
|
|
|
+
|
|
|
+ std::string hist_id(const std::string &id){
|
|
|
+ return sample_name+"_"+id;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TH1D* book_histogram_1d(const std::string &id, const std::string &title,
|
|
|
int nbins, double min, double max,
|
|
|
const std::string draw_string = ""){
|
|
|
- TH1D *hist = new TH1D(hist_id(id), title.c_str(), nbins, min, max);
|
|
|
+ std::string full_id = hist_id(id);
|
|
|
+ TH1D *hist = new TH1D(full_id.c_str(), title.c_str(), nbins, min, max);
|
|
|
histograms[id] = HistWithPlottingInfo(hist, draw_string);
|
|
|
return hist;
|
|
|
};
|
|
@@ -46,33 +47,33 @@ class HistCollection{
|
|
|
TH2D* book_histogram_2d(const std::string id, const std::string title,
|
|
|
int nbins_x, double min_x, double max_x,
|
|
|
int nbins_y, double min_y, double max_y){
|
|
|
- TH2D *hist = new TH2D(hist_id(id), title.c_str(), nbins_x, min_x, max_x, nbins_y, min_y, max_y);
|
|
|
+ std::string full_id = hist_id(id);
|
|
|
+ TH2D *hist = new TH2D(full_id.c_str(), title.c_str(), nbins_x, min_x, max_x, nbins_y, min_y, max_y);
|
|
|
histograms[id] = HistWithPlottingInfo(hist, "COLZ");
|
|
|
return hist;
|
|
|
};
|
|
|
public:
|
|
|
- /* List of included histogram objects
|
|
|
- */
|
|
|
+ // List of included histogram objects
|
|
|
TH1D *lepton_count;
|
|
|
TH1D *lepton_count_pass_miniiso;
|
|
|
TH1D *delta_pt;
|
|
|
TH2D *lepton_count_vs_delta_pt;
|
|
|
TH1D *top_quark_count;
|
|
|
-
|
|
|
+
|
|
|
TH1D *jet_count_trilepton;
|
|
|
TH1D *jet_count_ss_dilepton;
|
|
|
TH1D *jet_count_os_dilepton;
|
|
|
TH1D *jet_count;
|
|
|
-
|
|
|
+
|
|
|
TH1D *b_jet_discriminator;
|
|
|
TH1D *b_jet_count;
|
|
|
TH1D *b_jet_pt_all;
|
|
|
TH1D *b_jet_pt_3_or_more;
|
|
|
-
|
|
|
+
|
|
|
TH1D *trilepton_iso_1;
|
|
|
TH1D *trilepton_iso_2;
|
|
|
TH1D *trilepton_iso_3;
|
|
|
-
|
|
|
+
|
|
|
HistCollection(const std::string &sample_name)
|
|
|
: sample_name(sample_name)
|
|
|
{
|
|
@@ -120,23 +121,23 @@ class HistCollection{
|
|
|
50, 0, 2000);
|
|
|
// ---------------------------------------------
|
|
|
trilepton_iso_1 = book_histogram_1d("trilepton_iso_1", "Trilepton Isolation - First",
|
|
|
- 50, 0, PI);
|
|
|
+ 50, 0, 2*PI);
|
|
|
// ---------------------------------------------
|
|
|
trilepton_iso_2 = book_histogram_1d("trilepton_iso_2", "Trilepton Isolation - Second",
|
|
|
- 50, 0, PI);
|
|
|
+ 50, 0, 2*PI);
|
|
|
// ---------------------------------------------
|
|
|
trilepton_iso_3 = book_histogram_1d("trilepton_iso_3", "Trilepton Isolation - Third",
|
|
|
- 50, 0, PI);
|
|
|
+ 50, 0, 2*PI);
|
|
|
// ---------------------------------------------
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
HistCollection(): HistCollection("") {};
|
|
|
-
|
|
|
+
|
|
|
~HistCollection(){
|
|
|
for(auto& p: histograms)
|
|
|
delete p.second.hist;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
void draw(TCanvas* canvas,
|
|
|
std::pair<int, int> shape = {0,0}){
|
|
|
std::pair<int, int> null_shape(0,0);
|
|
@@ -154,18 +155,18 @@ class HistCollection{
|
|
|
p.second.hist->Draw(p.second.draw_string.c_str());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
std::string get_sample_name(){
|
|
|
return sample_name;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
vector<std::string> get_ids(){
|
|
|
vector<std::string> vec;
|
|
|
for(auto& p: histograms)
|
|
|
vec.push_back(p.first);
|
|
|
return vec;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
TH1* get_by_id(const std::string &id){
|
|
|
TH1* hist = histograms[id].hist;
|
|
|
return hist;
|
|
@@ -173,4 +174,4 @@ class HistCollection{
|
|
|
};
|
|
|
|
|
|
|
|
|
-#endif // histcollection_h
|
|
|
+#endif // histcollection_h
|