1 #include "StClusterDisplay.h"
2 #include "StEventTypes.h"
8 #include "StEmcUtil/geometry/StEmcGeom.h"
9 #include "StEmcUtil/others/emcDetectorName.h"
17 StClusterDisplay::~StClusterDisplay()
20 Int_t StClusterDisplay::Init()
23 for(Int_t i = 0; i<MAXDETBARREL; i++)
25 mGeo[i]=StEmcGeom::getEmcGeom(detname[i].Data());
31 title =
"Number of clusters for detector ";
33 mHist1D[0][i] =
new TH1F(name.Data(),title.Data(),500,0,500);
37 title =
"Number of hits/cluster for detector ";
39 mHist1D[1][i] =
new TH1F(name.Data(),title.Data(),20,0,20);
43 title =
"Cluster energy for detector ";
45 mHist1D[2][i] =
new TH1F(name.Data(),title.Data(),500,0,50);
49 title =
"Cluster RMS/eta for detector ";
51 mHist1D[3][i] =
new TH1F(name.Data(),title.Data(),20,0,0.1);
55 title =
"Cluster RMS/phi for detector ";
57 mHist1D[4][i] =
new TH1F(name.Data(),title.Data(),20,0,0.1);
61 title =
"Cluster (eta,phi) for detector ";
63 mHist2D[0][i] =
new TH2F(name.Data(),title.Data(),40,-1,1,120,-3.1415,3.1415);
66 Int_t nEta=mGeo[i]->NEta();
67 Int_t nSub=mGeo[i]->NSub();
69 TArrayF EtaB(nEta+1,mGeo[i]->EtaB());
70 TArrayF PhiB(nSub+1,mGeo[i]->PhiB());
72 TArrayF EtaBins(2*nEta+2);
73 for(Int_t j=0;j<2*nEta+2;j++)
76 EtaBins[j]=-EtaB[nEta-j];
78 EtaBins[j]=EtaB[j-nEta-1];
81 TArrayF PhiBins1(60*(nSub+1));
82 TArrayF PhiBins(60*(nSub+1));
84 for(Int_t m=1;m<=60;m++)
85 for(Int_t s=1;s<=nSub+1;s++)
88 mGeo[i]->getPhiModule(m,center);
89 PhiBins1[j]=center+PhiB[s-1];
100 for(Int_t k=0;k<60*(nSub+1);k++)
102 if(PhiBins1[k]<phitmp)
119 name +=
"_HitDisplay";
120 title =
"Hits distribution for detector ";
122 mHist2D[1][i] =
new TH2F(name.Data(),title.Data(),2*nEta+2-1,EtaBins.GetArray(),60*(nSub+1)-1,PhiBins.GetArray());
125 name +=
"_ClusterDisplay";
126 title =
"Cluster distribution for detector ";
129 mHist2D[2][i] =
new TH2F(name.Data(),title.Data(),BF*2*nEta,-1,1,BF*60*nSub,-3.1415,3.1415);
131 return StMaker::Init();
143 for(Int_t i = 0;i<MAXDETBARREL;i++)
145 mHist2D[1][i]->Reset();
146 mHist2D[2][i]->Reset();
147 StDetectorId
id =
static_cast<StDetectorId
>(i+kBarrelEmcTowerId);
151 for(UInt_t j=1;j<121;j++)
156 StSPtrVecEmcRawHit& rawHit=module->hits();
158 for(Int_t k=0;k<(Int_t)rawHit.size();k++)
161 Int_t m=rawHit[k]->module();
162 Int_t e=rawHit[k]->eta();
163 Int_t s=abs(rawHit[k]->sub());
164 Float_t energy = rawHit[k]->energy();
166 mGeo[i]->getEta(m,e,eta);
167 mGeo[i]->getPhi(m,s,phi);
169 mHist2D[1][i]->Fill(eta,phi,energy);
176 StSPtrVecEmcCluster& clusters = coll->clusters();
177 Int_t n = clusters.size();
178 mHist1D[0][i]->Fill(n);
179 for(Int_t j = 0;j<n;j++)
184 mHist1D[1][i]->Fill(c->nHits());
185 mHist1D[2][i]->Fill(c->energy());
186 mHist1D[3][i]->Fill(c->sigmaEta());
187 mHist1D[4][i]->Fill(c->sigmaPhi());
188 mHist2D[0][i]->Fill(c->eta(),c->phi());
189 mHist2D[2][i]->Fill(c->eta(),c->phi());
196 TString CN =
"Display_";
198 if(!gROOT->FindObject(CN.Data()))
201 mCanvas[i] =
new TCanvas(CN.Data(),CN.Data(),400,600);
203 mHist2D[1][i]->Draw(
"colz");
204 mHist2D[1][i]->GetXaxis()->UnZoom();
205 mHist2D[1][i]->GetYaxis()->UnZoom();
207 mHist2D[2][i]->SetMarkerStyle(24);
208 mHist2D[2][i]->SetMarkerColor(2);
209 mHist2D[2][i]->Draw(
"sameP");
222 Int_t StClusterDisplay::SaveHist()