3 rdEEeventMipSolo(
int neve=1000, TString Tname0=
"/star/u/eemcdb/dataFeb11/run00006.eeTree",
int flag=0,
float Emax=40.){
4 Tname0=
"../4piotr/dAu1K.eeTree";
6 gSystem->Load(
"StRoot/StEEmcUtil/EEevent/libEEevent.so");
8 gStyle->SetPalette(1,0);
9 gStyle->SetOptStat(111111);
11 TString fname=
"out.hist.root";
12 TFile *fd=
new TFile(fname,
"recreate");
17 TH2F *heve=
new TH2F(
"tw2D",
"eta vs. phi , EEMC towers",60,-0.5,59.5,12,0.5,12.5);
21 int valA[mxEta*mxPhi];
26 printf(
"read upto %d events from file=%s.root\n",neve,Tname.Data());
27 TFile *f =
new TFile(Tname+
".root");
29 TTree *t4 = (TTree*)f->Get(
"EEtree");
36 TBranch *br = t4->GetBranch(
"EEdst");
37 br->SetAddress(&event);
38 Int_t nevent = (Int_t)t4->GetEntries();
39 for (Int_t ie=0;ie<nevent;ie++) {
42 printf(
"\niEve=%d ---------- \n",ie);
47 if(ie<5)
event->print();
49 int nSec=
event->Sec->GetEntries();
50 if(ie<5) printf(
"%d sectors with data\n",nSec);
53 memset(valA,0,
sizeof(valA));
55 for(is=0;is<nSec;is++) {
58 TClonesArray *hitA=sec->getTwHits();
61 for(ih=0;ih<hitA->GetEntries();ih++) {
66 hit->get(sub,eta,ener);
67 h2[0]->Fill(ener,eta);
69 int iphi=5*(sec->getID()-1) +(sub-
'A');
70 int jj=mxPhi*(eta-1)+iphi;
71 heve->Fill(iphi,eta,ener);
72 if(ener<256) valA[jj]=ener+0.5;
73 if(ie<5) printf(
" ih=%d sec=%d sub=%c etaBin=%d ener=%f\n",ih, sec->getID(), sub, eta,ener);
81 for(k0=0;k0<mxEta*mxPhi;k0++) {
82 if(valA[k0]==0)
continue;
86 int sumS=sumSurr(ieta,iphi,valA,mxPhi,mxEta);
89 h2[1]->Fill(valA[k0],ieta+1);
90 h1[1]->Fill(valA[k0]);
92 h2[2]->Fill(valA[k0],ieta+1);
93 h1[2]->Fill(valA[k0]);
95 sumS=sumSurr2(ieta,iphi,valA,mxPhi,mxEta);
97 h2[3]->Fill(valA[k0],ieta+1);
98 h1[3]->Fill(valA[k0]);
100 h2[4]->Fill(valA[k0],ieta+1);
101 h1[4]->Fill(valA[k0]);
106 printf(
"\n\nTotal events in B TTree=%d\n",nevent);
108 heve->SetMaximum(20);
113 TCanvas * c=
new TCanvas(
"aa",
"bb",500,600);
121 TCanvas * c=
new TCanvas(
"aa1",
"bb1",500,600);
133 c=
new TCanvas(
"aa2",
"bb2",600,400);
136 TH2F *hx=(TH2F *hx)h2[0]->Clone();
137 hx->Divide(h2[1],h2[2]); hx->Draw(
"colz");
139 hx=(TH2F *hx)h2[0]->Clone();
140 hx->Divide(h2[3],h2[2]); hx->Draw(
"colz");
143 TH1F *hy=(TH1F*) h1[0]->Clone();
144 hy->Divide(h1[1],h1[2]); hy->Draw();
146 hy=(TH1F*) h1[0]->Clone();
147 hy->Divide(h1[3],h1[2]); hy->Draw();
154 int sumSurr(
int ieta,
int iphi,
int *valA,
int nPhi,
int nEta){
162 sum+=valA[ nPhi*jeta + iphi-1 ];
163 sum+=valA[ nPhi*jeta + iphi ];
164 sum+=valA[ nPhi*jeta + iphi+1 ];
170 sum+=valA[ nPhi*jeta + iphi-1 ];
171 sum+=valA[ nPhi*jeta + iphi ];
172 sum+=valA[ nPhi*jeta + iphi+1 ];
176 sum+=valA[ nPhi*ieta + iphi-1 ];
177 sum+=valA[ nPhi*ieta + iphi+1 ];
184 int sumSurr2(
int ieta,
int iphi,
int *valA,
int nPhi,
int nEta){
191 sum=-valA[ nPhi*ieta + iphi];
193 for(i=ieta-2; i<=ieta+2;i++){
194 if(i>=nEta || i<0)
continue;
195 for(j=iphi-2;j<=iphi+2;j++){
197 sum+=valA[ nPhi*i + j ];
206 void initHisto(TH2F **h2, TH1F **h1, TFile *fd) {
210 char tt1[100], tt2[100];
211 sprintf(tt1,
"etaC%d",i);
212 sprintf(tt2,
"eta-bin vs. raw ADC , condition=%d",i);
213 TH2F *h =
new TH2F(tt1,tt2, 25,-0.,50.,12,.5,12.5);
218 sprintf(tt1,
"C%d",i);
219 sprintf(tt2,
" raw ADC , condition=%d",i);
220 TH1F *hx =
new TH1F(tt1,tt2, 50,-0.5,49.5);
221 hx->SetDirectory(fd);