3 rdTree(
int neve=100, TString Tname0=
"mc_eveID1",
int flag=0,
float Emax=40.){
4 gROOT->LoadMacro(
"bfc.C");
5 bfc(0,
"fzin sim_T gen_T",
"mc_eveID6.fzd");
7 gSystem->Load(
"EEmc.so");
9 gStyle->SetOptStat(111111);
18 printf(
"read upto %d events from file=%s.root\n",neve,Tname.Data());
19 TFile *f =
new TFile(Tname+
".root");
21 TTree *t4 = (TTree*)f->Get(
"t4");
25 EEevent *
event =
new EEevent();
30 TClonesArray *secA=
new TClonesArray(
"EEsectorDst",1000);
33 TBranch *BRsec = t4->GetBranch(
"Sec");
35 BRsec->SetAddress(&secA);
37 Int_t nevent = (Int_t)t4->GetEntries();
38 printf(
"Total events in TTree=%d\n",nevent);
42 h[0]=
new TH2F(
"pr1",
"EE Pre-1 #eta-Bin vs #phi-sector",60,1.,13.,12,0.5,12.5);
43 h[1]=
new TH2F(
"pr2",
"EE Pre-2 #eta-Bin vs #phi-sector",60,1.,13.,12,0.5,12.5);
44 h[2]=
new TH2F(
"tw",
"EE towers #eta-Bin vs #phi-sector",60,1.,13.,12,0.5,12.5);
45 h[3]=
new TH2F(
"Post",
"EE Post #eta-Bin vs #phi-sector",60,1.,13.,12,0.5,12.5);
50 hde[0]=
new TH2F(
"deD1",
"EE energy loss : Pre-1 vs. Tower (GeV)",50,.0,20.,50,0.,1.);
51 hde[1]=
new TH2F(
"deD2",
"EE energy loss : Post vs. Tower (GeV)",50,.0,20.,50,0.,.5);
52 hde[2]=
new TH2F(
"deD3",
"EE energy loss : Pre-1 vs. Post (GeV)",50,.0,1.,50,0.,.5);
59 hde1[0]=
new TH1F(
"dePr1",
"EE energy deposit : Pre-1 (GeV)",500,.0,Emax/150.);
60 hde1[1]=
new TH1F(
"dePr2",
"EE energy deposit : Pre-2 (GeV)",500,.0,Emax/150.);
61 hde1[2]=
new TH1F(
"deTw",
"EE energy deposit : Tower (GeV)",500,.0,Emax/7.);
62 hde1[3]=
new TH1F(
"dePo",
"EE energy deposit : Post (GeV)",200,.0,Emax/150.);
63 hde1[4]=
new TH1F(
"deU",
"EE energy deposit : smdU (GeV)",300,.0,Emax/70.);
64 hde1[5]=
new TH1F(
"deV",
"EE energy deposit : smdV (GeV)",300,.0,Emax/70.);
65 TH1F *hdeSum=
new TH1F(
"deT+S",
"EE energy deposit : Tower+smdU+V (GeV)",600,.0,Emax/7.);
69 h[i]->GetXaxis()->SetTitle(
"#phi sectors [1-12]");
70 h[i]->GetYaxis()->SetTitle(
"#eta bins (bin1 #rightarrow #eta=2.0)");
71 h[i]->GetZaxis()->SetTitle(
"Energy deposit (GeV)");
76 for (Int_t ie=0;ie<nevent;ie++) {
85 if(ie%20==0) printf(
"\n\iEve=%d nSec=%d with data \n",ie,secA->GetEntries());
89 {
int i;
for(i=0;i<nz;i++) enerS[i]=0;}
92 for(is=0;is<secA->GetEntries();is++) {
94 if(ie<1) sec->print();
99 TClonesArray *hitAA[]={sec->getPre1Hits(),sec->getPre2Hits(),sec->getTwHits(),sec->getPostHits(),sec->getSmdUHits(),sec->getSmdVHits()};
101 for(iz=0;iz<4;iz++) {
103 if(ie<1) printf(
" sectorID=%d iz=%d nHit=%d :\n",sec->getID(),iz,hitA->GetEntries());
104 for(ih=0;ih<hitA->GetEntries();ih++) {
109 hit->get(sub,eta,ener);
110 if(ie<1) printf(
" ih=%d sec=%d sub=%c etaBin=%d ener=%f\n",ih, sec->getID(), sub, eta,ener);
111 float x=sec->getID()+0.1+0.2*(sub-
'A');
112 h[iz]->Fill(x,eta,ener);
119 for(iz=4;iz<6;iz++) {
121 if(ie<1) printf(
" sectorID=%d iz=%d nHit=%d :\n",sec->getID(),iz,hitA->GetEntries());
122 for(ih=0;ih<hitA->GetEntries();ih++) {
126 hit2->get(strip,ener);
127 if(ie<1) printf(
" ih=%d strip=%d etaBin=%d ener=%f\n",ih, sec->getID(), strip,ener);
137 hde[0]->Fill(enerS[2],enerS[0]);
138 hde[1]->Fill(enerS[2],enerS[3]);
139 hde[2]->Fill(enerS[3],enerS[0]);
141 for(i=0;i<nz;i++) hde1[i]->Fill(enerS[i]);
143 hdeSum->Fill(enerS[2]+enerS[4]+enerS[5]);
145 if(ie<1)
for(i=0;i<nz;i++) printf(
"enerS[%d]=%f\n",i,enerS[i]);
150 printf(
"Total events in B TTree=%d\n",nevent);
152 TFile fh(Tname0+
".hist.root",
"recreate");
154 hde1[2]->Fit(
"gaus");
155 hde1[2]->GetFunction(
"gaus")->SetLineColor(kRed);
158 hdeSum->GetFunction(
"gaus")->SetLineColor(kRed);
168 TCanvas *can =
new TCanvas(
"cx",
"main plot",600,800);
171 TPad *pad0 =
new TPad(
"pad0",
"apd0",0.0,0.90,1.,1.);
174 pad0->Range(0,0,1,1);
176 TLatex *tlx=
new TLatex(0.12,0.5,strstr(Tname0.Data(),
"/mc_"));
177 tlx->SetTextSize(0.4);
181 TPad *c1 =
new TPad(
"pad1",
"apd1",0.0,0.0,1.,.90);
197 TString psFile=Tname0+
".ps";
198 can->Print(psFile.Data());
199 printf(
"## cp %s target ",psFile.Data());
210 if(flag)c1->Print(
"fig2.ps");
215 printf(
"Content of all used event DISPLAY\n");
221 if(flag) c1->Print(
"fig3.ps");