-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from JeffersonLab/CcalMonitoring
Ccal monitoring
- Loading branch information
Showing
6 changed files
with
227 additions
and
1 deletion.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
src/plugins/monitoring/lowlevel_online/HistMacro_CCAL_lowlevel.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// hnamepath: /lowlevel_online/CCAL/ccal_adc_multi | ||
// hnamepath: /lowlevel_online/CCAL/ccal_adc_pedestal | ||
// hnamepath: /lowlevel_online/CCAL/ccal_adc_time | ||
// hnamepath: /lowlevel_online/CCAL/ccal_adc_integral | ||
|
||
{ | ||
TDirectory *locInitDirectory = gDirectory; | ||
TDirectory *locDirectory = (TDirectory*)locInitDirectory->FindObjectAny("lowlevel_online"); | ||
if(locDirectory == NULL) | ||
return; | ||
|
||
//Get/Make Canvas | ||
TCanvas *locCanvas = NULL; | ||
if(TVirtualPad::Pad() == NULL) | ||
locCanvas = new TCanvas("CCAL", "CCAL", 1200, 800); //for testing | ||
else | ||
locCanvas = gPad->GetCanvas(); | ||
locCanvas->Divide(2, 2); | ||
|
||
|
||
TH1I* locHist_ADCmulti = (TH1I*)locDirectory->Get("CCAL/ccal_adc_multi"); | ||
TH1I* locHist_ADCpedestal = (TH1I*)locDirectory->Get("CCAL/ccal_adc_pedestal"); | ||
TH1I* locHist_ADCtime = (TH1I*)locDirectory->Get("CCAL/ccal_adc_time"); | ||
TH1I* locHist_ADCintegral = (TH1I*)locDirectory->Get("CCAL/ccal_adc_integral"); | ||
|
||
//# ADC hits | ||
locCanvas->cd(1); | ||
gPad->SetTicks(); | ||
//gPad->SetGrid(); | ||
if(locHist_ADCmulti != NULL) | ||
{ | ||
locHist_ADCmulti->SetTitle("CCAL ADC Multiplicity"); | ||
//locHist_ADCmulti->Rebin(2); | ||
//locHist_ADCmulti->GetYaxis()->SetRangeUser(0.0, 1.05*locHist_ADCmulti->GetBinContent(locHist_ADCmulti->GetMaximumBin())); | ||
locHist_ADCmulti->GetXaxis()->SetTitleSize(0.05); | ||
locHist_ADCmulti->GetXaxis()->SetTitle("# ADC Hits"); | ||
//locHist_ADCmulti->GetYaxis()->SetTitle(""); | ||
locHist_ADCmulti->GetXaxis()->SetLabelSize(0.05); | ||
locHist_ADCmulti->GetYaxis()->SetLabelSize(0.05); | ||
locHist_ADCmulti->SetFillColor(kYellow); | ||
locHist_ADCmulti->Draw(""); | ||
} | ||
|
||
//# ADC hits | ||
locCanvas->cd(2); | ||
gPad->SetTicks(); | ||
//gPad->SetGrid(); | ||
if(locHist_ADCpedestal != NULL) | ||
{ | ||
locHist_ADCpedestal->SetTitle("CCAL ADC Pedestal"); | ||
//locHist_ADCpedestal->Rebin(2); | ||
//locHist_ADCpedestal->GetYaxis()->SetRangeUser(0.0, 1.05*locHist_ADCpedestal->GetBinContent(locHist_ADCpedestal->GetMaximumBin())); | ||
locHist_ADCpedestal->GetXaxis()->SetRangeUser(0.0, 1000.); | ||
locHist_ADCpedestal->GetXaxis()->SetTitleSize(0.05); | ||
locHist_ADCpedestal->GetXaxis()->SetTitle("# ADC Hits"); | ||
//locHist_ADCpedestal->GetYaxis()->SetTitle(""); | ||
locHist_ADCpedestal->GetXaxis()->SetLabelSize(0.05); | ||
locHist_ADCpedestal->GetYaxis()->SetLabelSize(0.05); | ||
locHist_ADCpedestal->SetFillColor(kYellow); | ||
locHist_ADCpedestal->Draw(""); | ||
} | ||
|
||
//ADC integral | ||
locCanvas->cd(3); | ||
gPad->SetTicks(); | ||
//gPad->SetLogy(); | ||
//gPad->SetGrid(); | ||
if(locHist_ADCintegral != NULL) | ||
{ | ||
locHist_ADCintegral->SetTitle("CCAL ADC Integral"); | ||
//locHist_ADCintegral->Rebin(2); | ||
locHist_ADCintegral->GetXaxis()->SetRangeUser(0.0, 10000.); | ||
locHist_ADCintegral->GetXaxis()->SetTitleSize(0.05); | ||
//locHist_ADCintegral->GetYaxis()->SetTitle(""); | ||
locHist_ADCintegral->GetXaxis()->SetLabelSize(0.05); | ||
locHist_ADCintegral->GetYaxis()->SetLabelSize(0.05); | ||
locHist_ADCintegral->SetFillColor(kYellow); | ||
locHist_ADCintegral->Draw(""); | ||
} | ||
|
||
//ADC time | ||
locCanvas->cd(4); | ||
gPad->SetTicks(); | ||
//gPad->SetGrid(); | ||
if(locHist_ADCtime != NULL) | ||
{ | ||
locHist_ADCtime->SetTitle("CCAL ADC Time"); | ||
//locHist_ADCtime->Rebin(5); | ||
//locHist_ADCtime->GetXaxis()->SetRangeUser(0, 1500); | ||
locHist_ADCtime->GetXaxis()->SetTitleSize(0.05); | ||
//locHist_ADCtime->GetYaxis()->SetTitle(""); | ||
locHist_ADCtime->GetXaxis()->SetLabelSize(0.05); | ||
locHist_ADCtime->GetYaxis()->SetLabelSize(0.05); | ||
locHist_ADCtime->SetFillColor(kYellow); | ||
locHist_ADCtime->Draw(""); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// | ||
// Guidance: -------------------------------------------- | ||
// | ||
// End Guidance: ---------------------------------------- | ||
// | ||
// | ||
// | ||
// The following are special comments used by RootSpy to know | ||
// which histograms to fetch for the macro. | ||
// | ||
// hnamepath: /occupancy/fcal_occ | ||
// hnamepath: /occupancy/fcal_num_events | ||
// | ||
// e-mail: davidl@jlab.org | ||
// e-mail: staylor@jlab.org | ||
// e-mail: somov@jlab.org | ||
// e-mail: tbritton@jlab.org | ||
// | ||
|
||
{ | ||
// RootSpy saves the current directory and style before | ||
// calling the macro and restores it after so it is OK to | ||
// change them and not change them back. | ||
TDirectory *savedir = gDirectory; | ||
TDirectory *dir = (TDirectory*)gDirectory->FindObjectAny("occupancy"); | ||
if(dir) dir->cd(); | ||
|
||
TH2I *ccal_occ = (TH2I*)gDirectory->FindObjectAny("ccal_occ"); | ||
TH1I *ccal_num_events = (TH1I*)gDirectory->FindObjectAny("ccal_num_events"); | ||
|
||
double Nevents = 1.0; | ||
if(ccal_num_events) Nevents = (double)ccal_num_events->GetBinContent(1); | ||
|
||
TLegend *legend_sa = new TLegend(0.1,0.85,0.3,0.9); | ||
if(ccal_occ)legend_sa->AddEntry(ccal_occ, "fADC","f"); | ||
|
||
// 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->Clear(); | ||
|
||
gPad->SetTicks(); | ||
gPad->SetGrid(); | ||
gPad->SetRightMargin(2.0); | ||
gPad->SetLeftMargin(2.0); | ||
if(ccal_occ){ | ||
ccal_occ->SetStats(0); | ||
TH1* h = ccal_occ->DrawCopy("colz"); | ||
h->Scale(1./Nevents); | ||
h->GetZaxis()->SetRangeUser(0.0001, 0.25); | ||
|
||
char str[256]; | ||
sprintf(str,"%0.0f events", Nevents); | ||
TLatex lat(30.0, 61.75, str); | ||
lat.SetTextAlign(22); | ||
lat.SetTextSize(0.035); | ||
lat.Draw(); | ||
} | ||
|
||
legend_sa->Draw(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters