Skip to content

Commit

Permalink
Setup new BSMD histograms for QA (Saskia M.) (star-bnl#708)
Browse files Browse the repository at this point in the history
This PR provides additional QA histograms with more detailed QA of the
BSMD.

Code updates provided by Saskia Mioduszewski. I have also compiled and
tested that it all works.

Additional tweaks may come later as accumulated statistics from
FastOffline provide feedback on the efficacy of these plots.
  • Loading branch information
genevb committed Aug 29, 2024
1 parent 2fa4c61 commit 50de453
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 16 deletions.
11 changes: 11 additions & 0 deletions StRoot/StAnalysisUtilities/StHistUtil.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -960,25 +960,36 @@ Int_t StHistUtil::DrawHists(const Char_t *dirName) {
} else graphPad->cd(m_QAShiftMode ? 0 : curPad);

// set x & y grid off by default
TRegexp bsmdPerModule("bsmd.*PerModule");
gPad->SetGridy(0);
if (oName.Contains("H_matchCand")) {
gPad->SetGridx(1);
gStyle->SetGridStyle(6);
gStyle->SetGridColor(kOrange);
} else if (oName.Contains(bsmdPerModule)) {
hobj->GetXaxis()->SetNdivisions(15);
hobj->GetXaxis()->SetLabelSize(0.03);
hobj->GetXaxis()->SetTitle("Module Number");
gPad->SetGridx();
} else {
gPad->SetGridx(0);
gStyle->SetGridStyle(3);
gStyle->SetGridColor(kGray);
}

// set stats to draw
TRegexp bsmd2DPerModule("bsmd.*Strip.*PerModule");
if (oName.Contains("TpcSector") ||
oName.Contains("PointRPTpc") ||
oName.Contains("PointXYTpc") ||
oName.Contains("TrigBits")) {
gStyle->SetOptStat(11);
} else if (oName.Contains("NullPrim")) {
gStyle->SetOptStat(1111);
} else if (oName.Contains(bsmd2DPerModule)) {
gStyle->SetOptStat(0);
hobj->GetYaxis()->SetTitle("Strip Within Module");
hobj->GetYaxis()->SetTitleOffset(1.4);
} else {
gStyle->SetOptStat(111111);
}
Expand Down
2 changes: 2 additions & 0 deletions StRoot/St_QA_Maker/QAhlist_logy.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@
"bemcAdc",
"bsmdeAdc",
"bsmdpAdc",
"bsmdeEnergy",
"bsmdpEnergy",
"bemcClNum",
"bemcClEnergy",
"EmcCat4_Point_Energy",
Expand Down
30 changes: 16 additions & 14 deletions StRoot/St_QA_Maker/QAhlist_subsystems.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,26 @@
":emc:bprsEnergy2D",
":emc:bprsAdc",
":emc:bprsEnergy",
":bsmd:bsmdeWest1HitsPerModule",
":bsmd:bsmdeWest1StripHitsPerModule",
":bsmd:bsmdeWest2HitsPerModule",
":bsmd:bsmdeWest2StripHitsPerModule",
":bsmd:bsmdeEast1HitsPerModule",
":bsmd:bsmdeEast1StripHitsPerModule",
":bsmd:bsmdeEast2HitsPerModule",
":bsmd:bsmdeEast2StripHitsPerModule",
":bsmd:bsmdpWest1HitsPerModule",
":bsmd:bsmdpWest1StripHitsPerModule",
":bsmd:bsmdpWest2HitsPerModule",
":bsmd:bsmdpWest2StripHitsPerModule",
":bsmd:bsmdpEast1HitsPerModule",
":bsmd:bsmdpEast1StripHitsPerModule",
":bsmd:bsmdpEast2HitsPerModule",
":bsmd:bsmdpEast2StripHitsPerModule",
":bsmd:bsmdeHits",
":bsmd:bsmdeEnergy2D",
":bsmd:bsmdeAdc",
":bsmd:bsmdeEnergy",
":bsmd:bsmdpHits",
":bsmd:bsmdpEnergy2D",
":bsmd:bsmdpAdc",
":bsmd:bsmdpEnergy",
":emc:EmcNcluster",
Expand All @@ -99,18 +113,6 @@
":emc:bprsClEnergy",
":emc:bprsEta",
":emc:bprsPhi",
":bsmd:bsmde_cluster",
":bsmd:bsmde_cluster_energy",
":bsmd:bsmdeClNum",
":bsmd:bsmdeClEnergy",
":bsmd:bsmdeEta",
":bsmd:bsmdePhi",
":bsmd:bsmdp_cluster",
":bsmd:bsmdp_cluster_energy",
":bsmd:bsmdpClNum",
":bsmd:bsmdpClEnergy",
":bsmd:bsmdpEta",
":bsmd:bsmdpPhi",
":emc:EmcCat1_Point_Energy",
":emc:EmcCat1_Point_Eta",
":emc:EmcCat1_Point_Phi",
Expand Down
21 changes: 20 additions & 1 deletion StRoot/St_QA_Maker/StEventQAMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2059,13 +2059,17 @@ void StEventQAMaker::MakeHistEMC() {
if(module) {
StSPtrVecEmcRawHit& rawHit=module->hits();

Int_t m,e,s,adc;
Int_t m,e,s,adc,sId,stripInMod;
Float_t eta(0),phi(0),E(0);
nh += rawHit.size();
for(UInt_t k=0;k<rawHit.size();k++){
m = rawHit[k]->module();
e = rawHit[k]->eta();
s = rawHit[k]->sub();
emcGeom[i]->getId(m, e, s, sId);
stripInMod = sId % 150; // only used for BSMD
if (stripInMod==0) stripInMod=150;
// cout << "strip Id = " << sId << ", strip in Module = " << stripInMod << endl;
if (s == -1) s = 1; // case of smde
adc = rawHit[k]->adc();
E = rawHit[k]->energy();
Expand All @@ -2075,6 +2079,21 @@ void StEventQAMaker::MakeHistEMC() {
hists->m_emc_energy2D[i]->Fill(eta,phi,E);
hists->m_emc_adc[i]->Fill(float(adc));
hists->m_emc_energy[i]->Fill(E);

if (i>1) { // BSMD module hists

Int_t modIndex = (m-1)/30;
Int_t histIndex = modIndex;
if (i>2) histIndex = modIndex + 4;

hists->m_emc_hits_per_module[histIndex]->Fill(m);
hists->m_emc_energy_per_module[histIndex]->Fill(m,E);
hists->m_emc_strip_hits_per_module[histIndex]->Fill(m,stripInMod);
hists->m_emc_strip_energy_per_module[histIndex]->Fill(m,stripInMod,E);

}


energy += E;
}
}
Expand Down
40 changes: 39 additions & 1 deletion StRoot/St_QA_Maker/StQABookHist.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,14 @@ StQABookHist::StQABookHist(const char* type) : QAHistType(type) {
m_emc_energy[i]=0; //!
}

// for EMC-BSMD hits
for (i=0; i<8; i++) {
m_emc_hits_per_module[i]=0; //!
m_emc_energy_per_module[i]=0; //!
m_emc_strip_hits_per_module[i]=0; //!
m_emc_strip_energy_per_module[i]=0; //!
}

// for EMC cluster finder
m_emc_ncl=0; //!
m_emc_etotCl=0; //!
Expand Down Expand Up @@ -2014,6 +2022,12 @@ void StQABookHist::BookHistEMC(){
const Char_t* tit={"Barrel"};
const Int_t nx[4] = {40,40,300,20};
const Int_t ny[4] = {120, 120, 60, 900};

// for BSMD per-module histos
Axis_t ModNumLo[4] = {1.,31.,61.,91.};
Axis_t ModNumHi[4] = {31.,61.,91.,121.};
const TString PerModuleHistName[4] = {"West1","West2","East1","East2"};

Float_t rpi = M_PI + 0.00001;
TString name, title;
TArrayD *xb = StEmcMath::binForSmde();
Expand All @@ -2025,7 +2039,7 @@ void StQABookHist::BookHistEMC(){
else m_emc_hits[i] = QAH::H2F(name,title, nx[i],-1.,+1., ny[i],-rpi, rpi);

name = detname[i] + "Energy2D";
title = tit + detname[i] + " energy dist. in eta&phi";
title = tit + detname[i] + " energy dist. in eta-phi";
if(i==2) m_emc_energy2D[i] = QAH::H2F(name,title, xb->GetSize()-1,xb->GetArray(), ny[i],-rpi,rpi);
else m_emc_energy2D[i] = QAH::H2F(name,title, nx[i],-1.,+1., ny[i],-rpi, rpi);

Expand All @@ -2039,6 +2053,30 @@ void StQABookHist::BookHistEMC(){
}
delete xb;

for(Int_t i=2; i<4; i++){ // Detector ID for BSMDE and BSMDP (BSMD eta and phi)
for (Int_t j=0; j<4; j++){ // split 120 modules into 4 histos

Int_t k = j;
if (i>2) k = j + 4;

name = detname[i] + PerModuleHistName[j] + "HitsPerModule";
title = tit + detname[i] + " " + PerModuleHistName[j] + " - hits per module";
m_emc_hits_per_module[k] = QAH::H1F(name,title, 30, ModNumLo[j], ModNumHi[j]);

name = detname[i] + PerModuleHistName[j] + "EnergyPerModule";
title = tit + detname[i] + " " + PerModuleHistName[j] + " - energy-weighted hits per module";
m_emc_energy_per_module[k] = QAH::H1F(name,title, 30, ModNumLo[j], ModNumHi[j]);

name = detname[i] + PerModuleHistName[j] + "StripHitsPerModule";
title = tit + detname[i] + " " + PerModuleHistName[j] + " - hits in strip (within mod) vs. mod";
m_emc_strip_hits_per_module[k] = QAH::H2F(name,title, 30, ModNumLo[j], ModNumHi[j], 150, 1., 151.);

name = detname[i] + PerModuleHistName[j] + "StripEnergyPerModule";
title = tit + detname[i] + " " + PerModuleHistName[j] + " - energy in strip (within mod) vs. mod";
m_emc_strip_energy_per_module[k] = QAH::H2F(name,title, 30, ModNumLo[j], ModNumHi[j], 150, 1., 151.);
}
}

// Book the hists for cluster finder
Int_t greta[4]={40,40,300,20}; // eta bins
Int_t grphi[4]={120,120,60,900}; // phi bins => 16-apr by PAI
Expand Down
4 changes: 4 additions & 0 deletions StRoot/St_QA_Maker/StQABookHist.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,10 @@ class StQABookHist : public TObject {
TH2F *m_emc_energy2D[4]; //!
TH1F *m_emc_adc[4]; //!
TH1F *m_emc_energy[4]; //!
TH1F *m_emc_hits_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each
TH1F *m_emc_energy_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each
TH2F *m_emc_strip_hits_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each
TH2F *m_emc_strip_energy_per_module[8]; // SM added for BSMD eta and phi, West and East Barrels, split into 30 modules each

// Hists for EMC cluster finder
TH2F *m_emc_ncl; //!
Expand Down

0 comments on commit 50de453

Please sign in to comment.