void emc(void) { // Hole preparation TCutG *hole = new TCutG("hole",5); hole->SetPoint(0,18,26); hole->SetPoint(1,18,27); hole->SetPoint(2,34,27); hole->SetPoint(3,34,26); hole->SetPoint(4,18,26); TF2 *fhole = new TF2("fhole","x-x+y-y",18.0,34.0,26.0,27.0); fhole->SetFillColor(3); fhole->SetNpx(80); fhole->SetNpy(80); // Create 2D histogram TH2F *hcal = new TH2F("hcal","EMC",52,0.5,52.5,52,0.5,52.5); hcal->GetXaxis()->SetTitle("X"); hcal->GetXaxis()->SetLabelSize(0.03); hcal->GetXaxis()->SetTickLength(0.02); hcal->GetXaxis()->SetTitleOffset(1.2); hcal->GetYaxis()->SetTitle("Y"); hcal->GetYaxis()->SetLabelSize(0.03); hcal->GetYaxis()->SetTickLength(0.02); hcal->GetYaxis()->SetTitleOffset(1.2); hcal->GetZaxis()->SetTitle("E, [MeV]"); hcal->GetZaxis()->SetLabelSize(0.03); hcal->GetZaxis()->SetTickLength(0.02); hcal->Fill(10.0,20.0,250.0); hcal->Fill(20.0,30.0, 50.0); hcal->Fill(30.0,40.0,450.0); hcal->Draw("lego2 fb bb"); fhole->Draw("surf1 fb bb same [hole]"); }