18 Float_t raderror,phierror;
23 Float_t timepos,padpos,timesigma,padsigma;
24 Float_t peakheight, charge;
26 Int_t padlength,timelength;
39 void hits2cluster_laser(TString eingabe,
int evt,
int laser_sec)
48 gStyle->SetTitleOffset(1.25);
49 gStyle->SetCanvasBorderMode(0);
50 gStyle->SetPadBorderMode(0);
51 gStyle->SetPadColor(0);
52 gStyle->SetCanvasColor(0);
53 gStyle->SetTitleColor(0);
54 gStyle->SetStatColor(0);
55 gStyle->SetPalette(1);
56 gStyle->SetOptStat(11);
59 Float_t fpad,ftime,fflag,frow, fsec;
64 TCanvas *c1 =
new TCanvas(
"c1",
"ps",200,10,700,500);
67 cout<<
"Macro cluster_hits..."<<endl;
68 TFile *f =
new TFile(eingabe+
".root");
77 TPostScript *fps=
new TPostScript(eingabe,112);
81 dtree=(TTree*) f->Get(
"cl");
82 bhit=dtree->GetBranch(
"hit");
83 bhit->SetAddress(&hit);
84 bcluster=dtree->GetBranch(
"cluster");
85 bcluster->SetAddress(&cluster);
86 bevent=dtree->GetBranch(
"event");
87 bevent->SetAddress(&event);
89 topdir=(TDirectory*) f->Get(
"histograms");
91 TString dirname=
"evt_";
98 histdir=(TDirectory*) topdir->Get(dirname);
103 int maxentries = (int) bcluster->GetEntries();
105 for (
int i=1;i<=60;i++)
107 if (laser_sector(1,laser_sec,i))
110 for(
int j=1;j<=2;j++)
117 TH1F *histo=(TH1F*) histdir->Get(histoname);
121 histo->DrawCopy(
"colz");
122 TH2F *flag0=
new TH2F(
"flag0",
"flag0",160,0,160,255,0,255);
123 flag0->SetMarkerStyle(20);flag0->SetMarkerSize(0.5);flag0->SetMarkerColor(1);
124 TH2F *flag1=
new TH2F(
"flag1",
"flag1",160,0,160,255,0,255);
125 flag1->SetMarkerStyle(29);flag1->SetMarkerSize(0.5);flag1->SetMarkerColor(7);
126 TH2F *flag2=
new TH2F(
"flag2",
"flag2",160,0,160,255,0,255);
127 flag2->SetMarkerStyle(21);flag2->SetMarkerSize(0.5);flag2->SetMarkerColor(3);
128 TH2F *flag3=
new TH2F(
"flag3",
"flag3",160,0,160,255,0,255);
129 flag3->SetMarkerStyle(23);flag3->SetMarkerSize(0.5);flag3->SetMarkerColor(5);
130 TH2F *flag4=
new TH2F(
"flag4",
"flag4",160,0,160,255,0,255);
131 flag4->SetMarkerStyle(29);flag4->SetMarkerSize(0.5);flag4->SetMarkerColor(3);
132 TH2F *flag5=
new TH2F(
"flag5",
"flag5",160,0,160,255,0,255);
133 flag5->SetMarkerStyle(22);flag5->SetMarkerSize(0.5);flag5->SetMarkerColor(6);
134 TH2F *flag10=
new TH2F(
"flag10",
"flag10",160,0,160,255,0,255);
135 flag10->SetMarkerStyle(20);flag10->SetMarkerSize(0.5);flag10->SetMarkerColor(2);
136 TH2F *flag11=
new TH2F(
"flag11",
"flag11",160,0,160,255,0,255);
137 flag11->SetMarkerStyle(29);flag11->SetMarkerSize(0.5);flag11->SetMarkerColor(7);
138 TH2F *flag12=
new TH2F(
"flag12",
"flag12",160,0,160,255,0,255);
139 flag12->SetMarkerStyle(29);flag12->SetMarkerSize(0.5);flag12->SetMarkerColor(3);
140 TH2F *flag13=
new TH2F(
"flag13",
"flag13",160,0,160,255,0,255);
141 flag13->SetMarkerStyle(23);flag13->SetMarkerSize(0.5);flag13->SetMarkerColor(5);
142 TH2F *flag14=
new TH2F(
"flag14",
"flag14",160,0,160,255,0,255);
143 flag14->SetMarkerStyle(29);flag14->SetMarkerSize(0.5);flag14->SetMarkerColor(3);
144 TH2F *flag15=
new TH2F(
"flag15",
"flag15",160,0,160,255,0,255);
145 flag15->SetMarkerStyle(22);flag15->SetMarkerSize(0.5);flag15->SetMarkerColor(6);
146 TH2F *flag16=
new TH2F(
"flag16",
"flag16",160,0,160,255,0,255);
147 flag16->SetMarkerStyle(28);flag16->SetMarkerSize(0.5);flag16->SetMarkerColor(8);
149 for (
int k=0;k<=maxentries;k++)
152 bcluster->GetEntry(k);
154 if (event.nevent==evt)
158 if (cluster.sec==i && cluster.row==j)
164 if (cluster.flag==0) {flag0->Fill(cluster.padpos,cluster.timepos);}
166 if (cluster.flag==1) {flag1->Fill(cluster.padpos,cluster.timepos);}
168 if (cluster.flag==2) {flag2->Fill(cluster.padpos,cluster.timepos);}
170 if (cluster.flag==3) {flag3->Fill(cluster.padpos,cluster.timepos);}
172 if (cluster.flag==4) {flag4->Fill(cluster.padpos,cluster.timepos);}
174 if (cluster.flag==5) {flag5->Fill(cluster.padpos,cluster.timepos);}
176 if (cluster.flag==10) {flag10->Fill(cluster.padpos,cluster.timepos);}
178 if (cluster.flag==11) {flag11->Fill(cluster.padpos,cluster.timepos);}
180 if (cluster.flag==12) {flag12->Fill(cluster.padpos,cluster.timepos);}
182 if (cluster.flag==13) {flag13->Fill(cluster.padpos,cluster.timepos);}
184 if (cluster.flag==14) {flag14->Fill(cluster.padpos,cluster.timepos);}
186 if (cluster.flag==15) {flag15->Fill(cluster.padpos,cluster.timepos);}
188 if (cluster.flag>=16) {flag16->Fill(cluster.padpos,cluster.timepos);}
195 flag0->DrawCopy(
"same");
196 flag1->DrawCopy(
"same");
197 flag2->DrawCopy(
"same");
198 flag3->DrawCopy(
"same");
199 flag4->DrawCopy(
"same");
200 flag5->DrawCopy(
"same");
202 flag10->DrawCopy(
"same");
203 flag11->DrawCopy(
"same");
204 flag12->DrawCopy(
"same");
205 flag13->DrawCopy(
"same");
206 flag14->DrawCopy(
"same");
207 flag15->DrawCopy(
"same");
208 flag16->DrawCopy(
"same");
209 TLegend *leg =
new TLegend(0.46,0.72,0.80,0.86);
210 leg->SetFillColor(10);
211 leg->SetTextSize(0.03);
212 leg->AddEntry(flag0,
"flag=0",
"P");
213 leg->AddEntry(flag10,
"flag=10",
"P");
214 leg->AddEntry(flag11,
"flag=1 & flag=11",
"P");
215 leg->AddEntry(flag3,
"flag=3 & flag=13",
"P");
216 leg->AddEntry(flag4,
"flag=4 & flag=14",
"P");
217 leg->AddEntry(flag15,
"flag=5 & flag=15",
"P");
218 leg->AddEntry(flag16,
"flag=6 & flag=16",
"P");
246 cout<<
"Ps-file created !"<<endl;
257 bool laser_sector(
int whichftpc,
int whichsec,
int sec)
270 if (sec==32 || sec==38 || sec==44 || sec==50 || sec==56)
276 if (sec==34 || sec==40 || sec==46 || sec==52 || sec==58)
282 if (sec==36 || sec==42 || sec==48 || sec==54 || sec==60)
289 cout<<
"ERROR : Kein gueltiger Lasersector !"<<endl;
294 else if (whichftpc==1)
304 if (sec==2 || sec==8 || sec==14 || sec==20 || sec==26)
310 if (sec==4 || sec==10 || sec==16 || sec==22 || sec==28)
316 if (sec==6 || sec==12 || sec==18 || sec==24 || sec==30)
323 cout<<
"ERROR : Kein gueltiger Lasersector !"<<endl;
329 cout<<
"ERROR : Keine FTPC gewaehlt !"<<endl;