forked from JeffersonLab/hallc_replay
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temp fixes to LAD GEM online gui monitoring.
- Loading branch information
cdaq
committed
Mar 8, 2025
1 parent
02cd386
commit 4b94355
Showing
4 changed files
with
138 additions
and
3 deletions.
There are no files selected for viewing
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,68 @@ | ||
#include <algorithm> | ||
|
||
void occupancy( int module, double Lx, double Ly, int axis=0, double dt_ns = 150.0, const char* spectrometer = "bb", const char* db_append = "gem" ){ | ||
//TTree *T = (TTree*) gFile->Get("T"); | ||
|
||
//gStyle->SetPalette(kRainBow); | ||
//gStyle->SetPalette(53); | ||
|
||
gStyle->SetOptStat(0); | ||
|
||
gPad->cd(); | ||
|
||
//TH1D *hnstripskeep = new TH1D("hnstripskeep", | ||
|
||
double area_cm2 = Lx*Ly; | ||
|
||
TString histname; | ||
if( axis == 0 ){ | ||
histname.Form("hClusterMultiplicity_%s_%s_m%d_U", spectrometer, db_append, module); | ||
} else { | ||
histname.Form("hClusterMultiplicity_%s_%s_m%d_V", spectrometer, db_append, module); | ||
} | ||
|
||
TH1D *htemp; | ||
gFile->GetObject( histname.Data(), htemp ); | ||
|
||
double mean = htemp->GetMean(); | ||
double rms = htemp->GetRMS(); | ||
|
||
|
||
double xmin = (mean - 10.0*rms > -0.5 ) ? mean - 10.0*rms : -0.5; | ||
double xmax = mean + 10.0*rms; | ||
|
||
htemp->GetXaxis()->SetRangeUser( xmin, xmax ); | ||
|
||
htemp->Draw(); | ||
|
||
double ymax = htemp->GetBinContent(htemp->GetMaximumBin()); | ||
|
||
htemp->GetYaxis()->SetRangeUser(0, 1.5*ymax ); | ||
|
||
// double xmin = std::max( -0.5,mean-10.0*rms); | ||
//double xmax = mean+10.0*rms; | ||
|
||
TPaveText *p = new TPaveText( xmin, 1.01*ymax, xmax, 1.5*ymax, "br" ); | ||
|
||
p->SetFillStyle(0); | ||
p->SetBorderSize(0); | ||
|
||
TString text; | ||
|
||
text.Form("Module: %i", module); | ||
|
||
p->AddText( text.Data() ); | ||
|
||
double rate = mean / area_cm2 / dt_ns * 1.e6; | ||
|
||
text.Form( "Average clusters/event = %6.2f", mean ); | ||
|
||
p->AddText( text.Data() ); | ||
|
||
text.Form( "Hit rate = %6.2f (kHz/cm^{2})", rate ); | ||
|
||
p->AddText( text.Data() ); | ||
|
||
p->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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include <algorithm> | ||
|
||
//Plot raw strip multiplicity and occupancy: | ||
void stripmult( int layer=0, int axis=0, int nstrips=3840) { | ||
//gStyle->SetPalette(kRainBow); | ||
//gStyle->SetPalette(53); | ||
|
||
gStyle->SetOptStat(0); | ||
gPad->cd(); | ||
|
||
TH2D *htemp; | ||
if( axis == 0 ){ | ||
gFile->GetObject( "h2_gem_NstripsU_layer", htemp ); | ||
} else { | ||
gFile->GetObject( "h2_gem_NstripsV_layer", htemp ); | ||
} | ||
|
||
TString hnametemp; | ||
TH1D *htemp_yproj = htemp->ProjectionY( hnametemp.Format( "htemp_yproj_layer%d_axis%d", layer, axis ), layer+1, layer+1 ); | ||
|
||
TString htitle; | ||
if( axis == 0 ){ | ||
htemp_yproj->SetTitle( htitle.Format( "Layer %d U strips; Number of strips fired;", layer ) ); | ||
} else { | ||
htemp_yproj->SetTitle( htitle.Format( "Layer %d V strips; Number of strips fired;", layer ) ); | ||
} | ||
|
||
double mean = htemp_yproj->GetMean(); | ||
double rms = htemp_yproj->GetRMS(); | ||
|
||
double xmin = (mean - 10.0*rms > -0.5 ) ? mean - 10.0*rms : -0.5; | ||
double xmax = mean + 10.0*rms; | ||
|
||
htemp_yproj->GetXaxis()->SetRangeUser( xmin, xmax ); | ||
|
||
htemp_yproj->Draw(); | ||
|
||
double ymax = htemp_yproj->GetBinContent(htemp_yproj->GetMaximumBin()); | ||
|
||
htemp_yproj->GetYaxis()->SetRangeUser(0, 1.5*ymax ); | ||
|
||
//double xmin = std::max( -0.5,mean-10.0*rms); | ||
//double xmax = mean+10.0*rms; | ||
|
||
TPaveText *p = new TPaveText( xmin, 1.01*ymax, xmax, 1.5*ymax, "br" ); | ||
|
||
p->SetFillStyle(0); | ||
p->SetBorderSize(0); | ||
|
||
TString text; | ||
|
||
//double rate = mean / area_cm2 / dt_ns * 1.e6; | ||
//double nstripmean = mean; | ||
double occupancy = mean/double(nstrips); | ||
|
||
text.Form( "Raw strip multiplicity = %6.1f", mean ); | ||
|
||
p->AddText( text.Data() ); | ||
|
||
text.Form( "Raw occupancy = %6.2f%%", occupancy * 100.0); | ||
|
||
p->AddText( text.Data() ); | ||
|
||
p->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