From 4e48a28006575312160b20c2195de5d23702896b Mon Sep 17 00:00:00 2001 From: Sean Dobbs Date: Tue, 9 Jul 2024 16:18:24 -0400 Subject: [PATCH] Add BCAL occupancy plot for calibrated hits The other occupancy plots use digihits. We need to monitor the calibrated hits to check the BCAL bad channel map --- .../BCAL_online/bcal_hit_occupancy.C | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/plugins/monitoring/BCAL_online/bcal_hit_occupancy.C diff --git a/src/plugins/monitoring/BCAL_online/bcal_hit_occupancy.C b/src/plugins/monitoring/BCAL_online/bcal_hit_occupancy.C new file mode 100644 index 0000000000..c198a1e7a5 --- /dev/null +++ b/src/plugins/monitoring/BCAL_online/bcal_hit_occupancy.C @@ -0,0 +1,48 @@ + +// hnamepath: /bcal/bcal_fadc_occ +// hnamepath: /bcal/bcal_tdc_occ +// + +{ + TDirectory *savedir = gDirectory; + TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("bcal"); + if(dir) dir->cd(); + + TH2I *bcal_adc_occ = (TH2I*)gDirectory->FindObjectAny("bcal_fadc_occ"); + TH2I *bcal_tdc_occ = (TH2I*)gDirectory->FindObjectAny("bcal_tdc_occ"); + + // Just for testing + if(gPad == NULL){ + TCanvas *c1 = new TCanvas("c1"); + c1->cd(0); + c1->Draw(); + c1->Update(); + } + if(!gPad) {savedir->cd(); return;} + + TCanvas *c1 = gPad->GetCanvas(); + c1->cd(0); + + c1->Divide(2,1); + + TVirtualPad *pad1 = c1->cd(1); + pad1->SetTicks(); + pad1->SetLeftMargin(0.15); + pad1->SetRightMargin(0.15); + if(bcal_adc_occ){ + bcal_adc_occ->SetStats(0); + bcal_adc_occ->Draw("colz"); + } + + TVirtualPad *pad2 = c1->cd(2); + pad2->SetTicks(); + pad2->SetLeftMargin(0.15); + pad2->SetRightMargin(0.15); + if(bcal_tdc_occ){ + bcal_tdc_occ->SetStats(0); + bcal_tdc_occ->Draw("colz"); + } + +} + +