Skip to content

Commit

Permalink
Add BCAL occupancy plot for calibrated hits
Browse files Browse the repository at this point in the history
The other occupancy plots use digihits.  We need to monitor the
calibrated hits to check the BCAL bad channel map
  • Loading branch information
sdobbs committed Jul 9, 2024
1 parent 1a9c2dc commit 4e48a28
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/plugins/monitoring/BCAL_online/bcal_hit_occupancy.C
Original file line number Diff line number Diff line change
@@ -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");
}

}


0 comments on commit 4e48a28

Please sign in to comment.