15 Float_t raderror,phierror;
20 Float_t timepos,padpos,timesigma,padsigma;
21 Float_t peakheight, charge;
23 Int_t padlength,timelength;
36 void hits2cluster_all(TString eingabe,
int evt)
45 gStyle->SetTitleOffset(1.25);
46 gStyle->SetCanvasBorderMode(0);
47 gStyle->SetPadBorderMode(0);
48 gStyle->SetPadColor(0);
49 gStyle->SetCanvasColor(0);
50 gStyle->SetTitleColor(0);
51 gStyle->SetStatColor(0);
52 gStyle->SetPalette(1);
53 gStyle->SetOptStat(11);
56 Float_t fpad,ftime,fflag,frow, fsec;
61 TCanvas *c1 =
new TCanvas(
"c1",
"ps",200,10,700,500);
64 cout<<
"Macro cluster_hits..."<<endl;
65 TFile *f =
new TFile(eingabe+
".root");
70 TPostScript *fps=
new TPostScript(eingabe,112);
74 dtree=(TTree*) f->Get(
"cl");
75 bhit=dtree->GetBranch(
"hit");
76 bhit->SetAddress(&hit);
77 bcluster=dtree->GetBranch(
"cluster");
78 bcluster->SetAddress(&cluster);
79 bevent=dtree->GetBranch(
"event");
80 bevent->SetAddress(&event);
82 topdir=(TDirectory*) f->Get(
"histograms");
84 TString dirname=
"evt_";
90 histdir=(TDirectory*) topdir->Get(dirname);
95 int maxentries = (int)bcluster->GetEntries();
97 TIter nextkey(histdir->GetListOfKeys());
103 while (key = (TKey*) nextkey())
105 if (key->GetName()!=oldname)
107 oldname=key->GetName();
108 if (i==1) fps->NewPage();
110 TH2F *hist=(TH2F*) histdir->Get(key->GetName());
111 hist->DrawCopy(
"colz");
113 TH2F *flag0=
new TH2F(
"flag0",
"flag0",160,0,160,255,0,255);
114 flag0->SetMarkerStyle(20);flag0->SetMarkerSize(0.5);flag0->SetMarkerColor(1);
115 TH2F *flag1=
new TH2F(
"flag1",
"flag1",160,0,160,255,0,255);
116 flag1->SetMarkerStyle(29);flag1->SetMarkerSize(0.5);flag1->SetMarkerColor(7);
117 TH2F *flag2=
new TH2F(
"flag2",
"flag2",160,0,160,255,0,255);
118 flag2->SetMarkerStyle(21);flag2->SetMarkerSize(0.5);flag2->SetMarkerColor(3);
119 TH2F *flag3=
new TH2F(
"flag3",
"flag3",160,0,160,255,0,255);
120 flag3->SetMarkerStyle(23);flag3->SetMarkerSize(0.5);flag3->SetMarkerColor(5);
121 TH2F *flag4=
new TH2F(
"flag4",
"flag4",160,0,160,255,0,255);
122 flag4->SetMarkerStyle(29);flag4->SetMarkerSize(0.5);flag4->SetMarkerColor(3);
123 TH2F *flag5=
new TH2F(
"flag5",
"flag5",160,0,160,255,0,255);
124 flag5->SetMarkerStyle(22);flag5->SetMarkerSize(0.5);flag5->SetMarkerColor(6);
125 TH2F *flag10=
new TH2F(
"flag10",
"flag10",160,0,160,255,0,255);
126 flag10->SetMarkerStyle(20);flag10->SetMarkerSize(0.5);flag10->SetMarkerColor(2);
127 TH2F *flag11=
new TH2F(
"flag11",
"flag11",160,0,160,255,0,255);
128 flag11->SetMarkerStyle(29);flag11->SetMarkerSize(0.5);flag11->SetMarkerColor(7);
129 TH2F *flag12=
new TH2F(
"flag12",
"flag12",160,0,160,255,0,255);
130 flag12->SetMarkerStyle(29);flag12->SetMarkerSize(0.5);flag12->SetMarkerColor(3);
131 TH2F *flag13=
new TH2F(
"flag13",
"flag13",160,0,160,255,0,255);
132 flag13->SetMarkerStyle(23);flag13->SetMarkerSize(0.5);flag13->SetMarkerColor(5);
133 TH2F *flag14=
new TH2F(
"flag14",
"flag14",160,0,160,255,0,255);
134 flag14->SetMarkerStyle(29);flag14->SetMarkerSize(0.5);flag14->SetMarkerColor(3);
135 TH2F *flag15=
new TH2F(
"flag15",
"flag15",160,0,160,255,0,255);
136 flag15->SetMarkerStyle(22);flag15->SetMarkerSize(0.5);flag15->SetMarkerColor(6);
137 TH2F *flag16=
new TH2F(
"flag16",
"flag16",160,0,160,255,0,255);
138 flag16->SetMarkerStyle(28);flag16->SetMarkerSize(0.5);flag16->SetMarkerColor(8);
145 for (
int k=0;k<=maxentries;k++)
148 bcluster->GetEntry(k);
150 if (event.nevent==evt)
154 if (cluster.sec==atoi(strchr(name,
'c')+1) && cluster.row==atoi(strchr(name,
'w')+1))
160 if (cluster.flag==0) {flag0->Fill(cluster.padpos,cluster.timepos);}
162 if (cluster.flag==1) {flag1->Fill(cluster.padpos,cluster.timepos);}
164 if (cluster.flag==2) {flag2->Fill(cluster.padpos,cluster.timepos);}
166 if (cluster.flag==3) {flag3->Fill(cluster.padpos,cluster.timepos);}
168 if (cluster.flag==4) {flag4->Fill(cluster.padpos,cluster.timepos);}
170 if (cluster.flag==5) {flag5->Fill(cluster.padpos,cluster.timepos);}
172 if (cluster.flag==10) {flag10->Fill(cluster.padpos,cluster.timepos);}
174 if (cluster.flag==11) {flag11->Fill(cluster.padpos,cluster.timepos);}
176 if (cluster.flag==12) {flag12->Fill(cluster.padpos,cluster.timepos);}
178 if (cluster.flag==13) {flag13->Fill(cluster.padpos,cluster.timepos);}
180 if (cluster.flag==14) {flag14->Fill(cluster.padpos,cluster.timepos);}
182 if (cluster.flag==15) {flag15->Fill(cluster.padpos,cluster.timepos);}
184 if (cluster.flag>=16) {flag16->Fill(cluster.padpos,cluster.timepos);}
191 flag0->DrawCopy(
"same");
192 flag1->DrawCopy(
"same");
193 flag2->DrawCopy(
"same");
194 flag3->DrawCopy(
"same");
195 flag4->DrawCopy(
"same");
196 flag5->DrawCopy(
"same");
198 flag10->DrawCopy(
"same");
199 flag11->DrawCopy(
"same");
200 flag12->DrawCopy(
"same");
201 flag13->DrawCopy(
"same");
202 flag14->DrawCopy(
"same");
203 flag15->DrawCopy(
"same");
204 flag16->DrawCopy(
"same");
205 TLegend *leg =
new TLegend(0.46,0.72,0.80,0.86);
206 leg->SetFillColor(10);
207 leg->SetTextSize(0.03);
208 leg->AddEntry(flag0,
"flag=0",
"P");
209 leg->AddEntry(flag10,
"flag=10",
"P");
210 leg->AddEntry(flag11,
"flag=1 & flag=11",
"P");
211 leg->AddEntry(flag2,
"flag=2 & flag=12",
"P");
212 leg->AddEntry(flag3,
"flag=3 & flag=13",
"P");
213 leg->AddEntry(flag4,
"flag=4 & flag=14",
"P");
214 leg->AddEntry(flag15,
"flag=5 & flag=15",
"P");
215 leg->AddEntry(flag16,
"flag=6 & flag=16",
"P");
262 cout<<
"Ps-file created !"<<endl;