//--------------------------------------------------- //function to make plot of signal loss for given lumi void he_plot(bool do_tower_eta=false){ gStyle->SetPalette(1); //rainbow TH2F* hist = new TH2F("he_plot","",18,-0.5,17.5,14,-29.5,-15.5); //formatting hist->SetTitle(""); hist->GetXaxis()->SetTitle("Layer"); hist->GetYaxis()->SetTitle("Tower"); //drawing TCanvas* can = new TCanvas("he_plot","he_plot",900,600); TPad* pad1 = new TPad("graph","",0,0,1,1); pad1->SetMargin(0.1,0.175,0.125,0.05); pad1->SetTicks(1,1); pad1->Draw(); pad1->cd(); //more formatting hist->GetYaxis()->SetTitleOffset(0.75); hist->GetZaxis()->SetTitleOffset(0.85); hist->GetXaxis()->SetTitleOffset(0.85); hist->GetZaxis()->SetTitleSize(38/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetZaxis()->SetLabelSize(32/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetYaxis()->SetTitleSize(38/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetYaxis()->SetLabelSize(32/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetXaxis()->SetTitleSize(38/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetXaxis()->SetLabelSize(32/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetYaxis()->SetTickLength(12/(pad1->GetWh()*pad1->GetAbsHNDC())); hist->GetXaxis()->SetTickLength(12/(pad1->GetWh()*pad1->GetAbsHNDC())); if(do_tower_eta) { Double_t tower_etas[] = {1.305,1.392,1.479,1.566,1.653,1.740,1.830,1.930,2.043,2.172,2.322,2.500,2.650,2.868,3.000}; for(int j = 0; j < 14; j++){ if(j%2) continue; stringstream binname; binname.precision(1); binname << fixed << (tower_etas[j]+tower_etas[j+1])/2; //cout << "bin " << j << ": " << binname.str() << endl; int ybin = hist->GetYaxis()->FindBin(-(j+16)); hist->GetYaxis()->SetBinLabel(ybin,(binname.str()).c_str()); } } //gStyle->SetPaintTextFormat(".2g"); //g is 'adaptive', uses shorter of e or f gStyle->SetPaintTextFormat(".2f"); //g is 'adaptive', uses shorter of e or f hist->Draw("COLZ TEXT"); }