]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RICH/RICHpadtest.C
Implements all the new classes (JB, AM)
[u/mrichter/AliRoot.git] / RICH / RICHpadtest.C
CommitLineData
d2269328 1Int_t diaglevel=3; // 1->Hits, 2->Spectra, 3->Statistics
2
3
ddae0931 4void RICHpadtest (Int_t evNumber1=0,Int_t evNumber2=0)
5{
6/////////////////////////////////////////////////////////////////////////
7// This macro is a small example of a ROOT macro
8// illustrating how to read the output of GALICE
9// and do some analysis.
10//
11/////////////////////////////////////////////////////////////////////////
12
13
d2269328 14 Int_t NpadX = 162; // number of pads on X
15 Int_t NpadY = 162; // number of pads on Y
ddae0931 16
d2269328 17 Int_t Pad[162][162];
ddae0931 18 for (Int_t i=0;i<NpadX;i++) {
19 for (Int_t j=0;j<NpadY;j++) {
20 Pad[i][j]=0;
21 }
22 }
d2269328 23 gClassTable->GetID("AliRun");
ddae0931 24
25
26// Dynamically link some shared libs
27
28 if (gClassTable->GetID("AliRun") < 0) {
d2269328 29 gROOT->LoadMacro("loadlibs.C");
30 loadlibs();
31 }
32 else {
33 //delete gAlice;
34 gAlice = 0;
ddae0931 35 }
ddae0931 36
d2269328 37 gAlice=0;
38
39// Connect the Root Galice file containing Geometry, Kine and Hits
40
41 TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root");
42 if (!file) file = new TFile("galice.root");
43
ddae0931 44// Get AliRun object from file or create it if not on file
d2269328 45
46 if (!gAlice) {
ddae0931 47 gAlice = (AliRun*)file->Get("gAlice");
48 if (gAlice) printf("AliRun object found on file\n");
49 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
d2269328 50 }
51 else {
52 delete gAlice;
53 gAlice = (AliRun*)file->Get("gAlice");
54 if (gAlice) printf("AliRun object found on file\n");
55 if (!gAlice) gAlice = new AliRun("gAlice","Alice test program");
56 }
ddae0931 57
58// Create some histograms
59
d2269328 60 Int_t xmin= -NpadX/2;
61 Int_t xmax= NpadX/2;
62 Int_t ymin= -NpadY/2;
63 Int_t ymax= NpadY/2;
ddae0931 64
d2269328 65 TH2F *hc1 = new TH2F("hc1","Chamber 1 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
66 TH2F *hc2 = new TH2F("hc2","Chamber 2 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
67 TH2F *hc3 = new TH2F("hc3","Chamber 3 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
68 TH2F *hc4 = new TH2F("hc4","Chamber 4 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
69 TH2F *hc5 = new TH2F("hc5","Chamber 5 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
70 TH2F *hc6 = new TH2F("hc6","Chamber 6 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
71 TH2F *hc7 = new TH2F("hc7","Chamber 7 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
72 TH2F *h = new TH2F("h","Detector hit distribution",150,-300,300,150,-300,300);
73 TH1F *Clcharge = new TH1F("Clcharge","Cluster Charge Distribution",500,0.,500.);
74 TH2F *cerenkov = new TH2F("cerenkov","Cerenkov hit distribution",150,-300,300,150,-300,300);
75 TH1F *ckovangle = new TH1F("ckovangle","Cerenkov angle per photon",200,.5,1);
76 TH1F *hckphi = new TH1F("hckphi","Cerenkov phi angle per photon",620,-3.1,3.1);
77 TH2F *feedback = new TH2F("feedback","Feedback hit distribution",150,-300,300,150,-300,300);
78 TH2F *mip = new TH2F("mip","Mip hit distribution",150,-300,300,150,-300,300);
79 TH1F *mother = new TH1F("mother","Cerenkovs per Mip",75,0.,75.);
80 TH1F *radius = new TH1F("radius","Mean distance to Mip",100,0.,20.);
81 TH1F *phspectra1 = new TH1F("phspectra","Photon Spectra",200,5.,10.);
82 TH1F *phspectra2 = new TH1F("phspectra","Photon Spectra",200,5.,10.);
83 TH1F *totalphotons = new TH1F("totalphotons","Produced Photons per Mip",100,200,700.);
84 TH1F *feedbacks = new TH1F("feedbacks","Produced Feedbacks per Mip",50,0.5,50.);
85 TH1F *padnumber = new TH1F("padnumber","Number of pads per cluster",50,-0.5,50.);
86 TH1F *padsev = new TH1F("padsev","Number of pads hit per event",50,0.5,100.);
87 TH1F *clusev = new TH1F("clusev","Number of clusters per event",50,0.5,50.);
88 TH1F *photev = new TH1F("photev","Number of photons per event",50,0.5,50.);
89 TH1F *feedev = new TH1F("feedev","Number of feedbacks per event",50,0.5,50.);
90 TH1F *padsmip = new TH1F("padsmip","Number of pads per event inside MIP region",50,0.5,50.);
91 TH1F *padscl = new TH1F("padscl","Number of pads per event from cluster count",50,0.5,100.);
92 TH1F *pionspectra = new TH1F("pionspectra","Pion Spectra",200,.5,10.);
93 TH1F *protonspectra = new TH1F("protonspectra","Proton Spectra",200,.5,10.);
94 TH1F *kaonspectra = new TH1F("kaonspectra","Kaon Spectra",100,.5,10.);
95 TH1F *kaonspectra = new TH1F("kaonspectra","Kaon Spectra",100,.5,10.);
96 TH1F *chargedspectra = new TH1F("chargedspectra","Charged particles above 1 GeV Spectra",100,.5,10.);
97 TH1F *hitsX = new TH1F("digitsX","Distribution of hits along x-axis",200,-300,300);
98 TH1F *hitsY = new TH1F("digitsY","Distribution of hits along z-axis",200,-300,300);
99 TH1F *hitsPhi = new TH1F("hitsPhi","Distribution of phi angle of incidence",100,-180,180);
100 TH1F *hitsTheta = new TH1F("hitsTheta","Distribution of Theta angle of incidence",100,0,15);
101 TH1F *Omega = new TH1F("omega","Reconstructed Cerenkov angle per track",200,.5,1);
102 TH1F *Theta = new TH1F("theta","Reconstructed theta incidence angle per track",200,0,15);
103 TH1F *Phi = new TH1F("phi","Reconstructed phi incidence per track",200,-180,180);
104
105
106
ddae0931 107
108// Start loop over events
109
110 Int_t Nh=0;
d2269328 111 Int_t pads=0;
ddae0931 112 Int_t Nh1=0;
d2269328 113 Int_t mothers[80000];
114 Int_t mothers2[80000];
115 Float_t mom[3];
116 Int_t nraw=0;
117 Int_t phot=0;
118 Int_t feed=0;
119 Int_t padmip=0;
120 for (Int_t i=0;i<100;i++) mothers[i]=0;
ddae0931 121 for (int nev=0; nev<= evNumber2; nev++) {
d2269328 122 Int_t nparticles = gAlice->GetEvent(nev);
123
124
125 //cout<<"nev "<<nev<<endl;
126 printf ("\nProcessing event:%d\n",nev);
127 //cout<<"nparticles "<<nparticles<<endl;
128 printf ("Particles : %d\n",nparticles);
129 if (nev < evNumber1) continue;
130 if (nparticles <= 0) return;
131
ddae0931 132// Get pointers to RICH detector and Hits containers
d2269328 133
134 AliRICH *RICH = (AliRICH*)gAlice->GetDetector("RICH");
135 Int_t nent=(Int_t)gAlice->TreeR()->GetEntries();
136 gAlice->TreeR()->GetEvent(nent-1);
137 TClonesArray *Rawclusters = RICH->RawClustAddress(2); // Raw clusters branch
138 //printf ("Rawclusters:%p",Rawclusters);
139 Int_t nrawclusters = Rawclusters->GetEntriesFast();
140 //printf (" nrawclusters:%d\n",nrawclusters);
141 gAlice->TreeR()->GetEvent(nent-1);
142 TClonesArray *RecHits = RICH->RecHitsAddress(2);
143 Int_t nrechits = RecHits->GetEntriesFast();
144 //printf (" nrechits:%d\n",nrechits);
145 TTree *TH = gAlice->TreeH();
146 Int_t ntracks = TH->GetEntries();
ddae0931 147
ddae0931 148
d2269328 149
150 Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
151 gAlice->TreeD()->GetEvent(nent-1);
152
153
154 TClonesArray *Digits = RICH->DigitsAddress(2); // Raw clusters branch
155 Int_t ndigits = Digits->GetEntriesFast();
156 //printf("Digits:%d\n",ndigits);
157 padsev->Fill(ndigits,(float) 1);
158
159 for (Int_t ich=0;ich<7;ich++)
160 {
161 TClonesArray *Digits = RICH->DigitsAddress(ich); // Raw clusters branch
162 Int_t ndigits = Digits->GetEntriesFast();
163 //printf("Digits:%d\n",ndigits);
164 padsev->Fill(ndigits,(float) 1);
165 if (ndigits) {
166 for (Int_t hit=0;hit<ndigits;hit++) {
167 dHit = (AliRICHDigit*) Digits->UncheckedAt(hit);
168 //Int_t nchamber = padHit->fChamber; // chamber number
169 //Int_t nhit = dHit->fHitNumber; // hit number
170 Int_t qtot = dHit->fSignal; // charge
171 Int_t ipx = dHit->fPadX; // pad number on X
172 Int_t ipy = dHit->fPadY; // pad number on Y
173 //Int_t iqpad = dHit->fQpad; // charge per pad
174 //Int_t rpad = dHit->fRSec; // R-position of pad
175 //printf ("Pad hit, PadX:%d, PadY:%d\n",ipx,ipy);
176 if( ipx<=162 && ipy <=162 && ich==0) hc1->Fill(ipx,ipy,(float) qtot);
177 if( ipx<=162 && ipy <=162 && ich==1) hc2->Fill(ipx,ipy,(float) qtot);
178 if( ipx<=162 && ipy <=162 && ich==2) hc3->Fill(ipx,ipy,(float) qtot);
179 if( ipx<=162 && ipy <=162 && ich==3) hc4->Fill(ipx,ipy,(float) qtot);
180 if( ipx<=162 && ipy <=162 && ich==4) hc5->Fill(ipx,ipy,(float) qtot);
181 if( ipx<=162 && ipy <=162 && ich==5) hc6->Fill(ipx,ipy,(float) qtot);
182 if( ipx<=162 && ipy <=162 && ich==6) hc7->Fill(ipx,ipy,(float) qtot);
183 }
184 }
185 }
186
ddae0931 187// Start loop on tracks in the hits containers
d2269328 188 Int_t Nc=0;
189 for (Int_t track=0; track<ntracks;track++) {
190 printf ("Processing Track: %d\n",track);
191 gAlice->ResetHits();
192 Int_t nbytes += TH->GetEvent(track);
193 if (RICH) {
194 //RICH->ResetRawClusters();
195 TClonesArray *PadHits = RICH->PadHits(); // Cluster branch
196 TClonesArray *Hits = RICH->Hits(); // Hits branch
197 TClonesArray *Cerenkovs = RICH->Cerenkovs(); // Cerenkovs branch
198 }
199 //see hits distribution
200
ddae0931 201
d2269328 202 Int_t nhits = Hits->GetEntriesFast();
203 if (nhits) Nh+=nhits;
204 //printf("nhits %d\n",nhits);
205 for (Int_t hit=0;hit<nhits;hit++) {
206 mHit = (AliRICHHit*) Hits->UncheckedAt(hit);
ddae0931 207 Int_t nch = mHit->fChamber; // chamber number
208 Float_t x = mHit->fX; // x-pos of hit
d2269328 209 Float_t y = mHit->fZ; // y-pos
210 Float_t phi = mHit->fPhi; //Phi angle of incidence
211 Float_t theta = mHit->fTheta; //Theta angle of incidence
212 Int_t index = mHit->fTrack;
213 Int_t particle = mHit->fParticle;
214 Int_t freon = mHit->fLoss;
215
216 hitsX->Fill(x,(float) 1);
217 hitsY->Fill(y,(float) 1);
218
219 //printf("Particle:%d\n",particle);
220
221 TParticle *current = (TParticle*)(*gAlice->Particles())[index];
222 //printf("Particle type: %d\n",current->GetPdgCode());
223 if (TMath::Abs(particle) < 50000000)
224 {
225 mip->Fill(x,y,(float) 1);
226 if (current->Energy() - current->GetCalcMass()>1 && freon==1)
227 {
228 hitsPhi->Fill(phi,(float) 1);
229 hitsTheta->Fill(theta,(float) 1);
230 //printf("Theta:%f, Phi:%f\n",theta,phi);
231 }
232 }
233
234 if (TMath::Abs(particle)==211 || TMath::Abs(particle)==111)
235 {
236 pionspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
237 }
238 if (TMath::Abs(particle)==2212)
239 {
240 protonspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
241 }
242 if (TMath::Abs(particle)==321 || TMath::Abs(particle)==130 || TMath::Abs(particle)==310
243 || TMath::Abs(particle)==311)
244 {
245 kaonspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
246 }
247 if(TMath::Abs(particle)==211 || TMath::Abs(particle)==2212 || TMath::Abs(particle)==321)
248 {
249 if (current->Energy() - current->GetCalcMass()>1)
250 chargedspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
251 }
252 //printf("Hits:%d\n",hit);
253 //printf ("Chamber number:%d x:%f y:%f\n",nch,x,y);
ddae0931 254 // Fill the histograms
d2269328 255 Nh1+=nhits;
256 h->Fill(x,y,(float) 1);
257 //}
258 //}
ddae0931 259 }
d2269328 260
261 Int_t ncerenkovs = Cerenkovs->GetEntriesFast();
262
263 if (ncerenkovs) {
264 for (Int_t hit=0;hit<ncerenkovs;hit++) {
265 cHit = (AliRICHCerenkov*) Cerenkovs->UncheckedAt(hit);
266 Int_t nchamber = cHit->fChamber; // chamber number
267 Int_t index = cHit->fTrack;
268 Int_t pindex = cHit->fIndex;
269 Int_t cx = cHit->fX; // x-position
270 Int_t cy = cHit->fZ; // y-position
271 Int_t cmother = cHit->fCMother; // Index of mother particle
272 Int_t closs = cHit->fLoss; // How did the particle get lost?
273 //printf ("Cerenkov hit, X:%d, Y:%d\n",cx,cy);
274
275
276
277 TParticle *current = (TParticle*)(*gAlice->Particles())[index];
278
279 if (current->GetPdgCode() == 50000051)
280 {
281 if (closs==4)
282 {
283 feedback->Fill(cx,cy,(float) 1);
284 feed++;
285 }
286 }
287 if (current->GetPdgCode() == 50000050)
288 {
289 if (closs==4)
290 {
291 cerenkov->Fill(cx,cy,(float) 1);
292
293
294
295 TParticle *MIP = (TParticle*)(*gAlice->Particles())[cmother];
296 mipHit = (AliRICHHit*) Hits->UncheckedAt(0);
297 mom[0] = current->Px();
298 mom[1] = current->Py();
299 mom[2] = current->Pz();
300 Float_t energyckov = current->Energy();
301 /*mom[0] = cHit->fMomX;
302 mom[1] = cHit->fMomZ;
303 mom[2] = cHit->fMomY;*/
304 Float_t energymip = MIP->Energy();
305 Float_t Mip_px = mipHit->fMomX;
306 Float_t Mip_py = mipHit->fMomY;
307 Float_t Mip_pz = mipHit->fMomZ;
308 /*Float_t Mip_px = MIP->Px();
309 Float_t Mip_py = MIP->Py();
310 Float_t Mip_pz = MIP->Pz();*/
311
312
313
314 Float_t r = mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2];
315 Float_t rt = TMath::Sqrt(r);
316 Float_t Mip_r = Mip_px*Mip_px + Mip_py*Mip_py + Mip_pz*Mip_pz;
317 Float_t Mip_rt = TMath::Sqrt(Mip_r);
318 Float_t coscerenkov = (mom[0]*Mip_px + mom[1]*Mip_py + mom[2]*Mip_pz)/(rt*Mip_rt);
319 Float_t cherenkov = TMath::ACos(coscerenkov);
320 ckovangle->Fill(cherenkov,(float) 1); //Cerenkov angle calculus
321 //printf("Cherenkov: %f\n",cherenkov);
322 Float_t ckphi=TMath::ATan2(mom[0], mom[2]);
323 hckphi->Fill(ckphi,(float) 1);
324
325
326 Float_t mix = MIP->Vx();
327 Float_t miy = MIP->Vy();
328 Float_t mx = mipHit->fX;
329 Float_t my = mipHit->fZ;
330 //printf("FX %e, FY %e, VX %e, VY %e\n",cx,cy,mx,my);
331 Float_t dx = cx - mx;
332 Float_t dy = cy - my;
333 //printf("Dx:%f, Dy:%f\n",dx,dy);
334 Float_t final_radius = TMath::Sqrt(dx*dx+dy*dy);
335 //printf("Final radius:%f\n",final_radius);
336 radius->Fill(final_radius,(float) 1);
337
338 phspectra1->Fill(energyckov*1e9,(float) 1);
339 phot++;
340 }
341 else
342 phspectra2->Fill(energyckov*1e9,(float) 1);
343 for (Int_t nmothers=0;nmothers<=ntracks;nmothers++){
344 if (cmother == nmothers){
345 if (closs == 4)
346 mothers2[cmother]++;
347 mothers[cmother]++;
348 }
349 }
350 }
351 }
352 }
353
354 if (nrawclusters) {
355 for (Int_t hit=0;hit<nrawclusters;hit++) {
356 rcHit = (AliRICHRawCluster*) Rawclusters->UncheckedAt(hit);
357 //Int_t nchamber = rcHit->fChamber; // chamber number
358 //Int_t nhit = cHit->fHitNumber; // hit number
359 Int_t qtot = rcHit->fQ; // charge
360 Int_t fx = rcHit->fX; // x-position
361 Int_t fy = rcHit->fY; // y-position
362 Int_t type = rcHit->fCtype; // cluster type ?
363 Int_t mult = rcHit->fMultiplicity; // How many pads form the cluster
364 pads += mult;
365 if (qtot > 0) {
366 if (fx>-4 && fx<4 && fy>-4 && fy<4) {
367 padmip+=mult;
368 } else {
369 padnumber->Fill(mult,(float) 1);
370 nraw++;
371 if (mult<4) Clcharge->Fill(qtot,(float) 1);
372 }
373 }
374 }
375 }
376
377 if(nrechits)
378 {
379 for (Int_t hit=0;hit<nrechits;hit++) {
380 recHit = (AliRICHRecHit*) RecHits->UncheckedAt(hit);
381 Float_t r_omega = recHit->Omega; // Cerenkov angle
382 Float_t r_theta = recHit->Theta; // Theta angle of incidence
383 Float_t r_phi = recHit->Phi; // Phi angle if incidence
384
385 Omega->Fill(r_omega,(float) 1);
386 Theta->Fill(r_theta*180/TMath::Pi(),(float) 1);
387 Phi->Fill(r_phi*180/TMath::Pi(),(float) 1);
388
389 //printf("Omega: %f, Theta: %f, Phi: %f\n",r_omega,r_theta,r_phi);
390 }
391 }
ddae0931 392 }
d2269328 393
394 for (Int_t nmothers=0;nmothers<ntracks;nmothers++){
395 totalphotons->Fill(mothers[nmothers],(float) 1);
396 mother->Fill(mothers2[nmothers],(float) 1);
397 //printf ("Entries in %d : %d\n",nmothers, mothers[nmothers]);
398 }
399
400 clusev->Fill(nraw,(float) 1);
401 photev->Fill(phot,(float) 1);
402 feedev->Fill(feed,(float) 1);
403 padsmip->Fill(padmip,(float) 1);
404 padscl->Fill(pads,(float) 1);
405 //printf("Photons:%d\n",phot);
406 phot = 0;
407 feed = 0;
408 pads = 0;
409 nraw=0;
410 padmip=0;
ddae0931 411
d2269328 412 }
ddae0931 413
d2269328 414 //Create canvases, set the view range, show histograms
ddae0931 415
d2269328 416 switch(diaglevel)
417 {
418 case 1:
ddae0931 419
d2269328 420 if (ndigits)
421 {
422 TCanvas *c1 = new TCanvas("c1","Alice RICH pad hits",50,10,1200,700);
423 c1->Divide(4,2);
424 c1->cd(1);
425 hc1->SetXTitle("ix (npads)");
426 hc1->Draw();
427 c1->cd(2);
428 hc2->SetXTitle("ix (npads)");
429 hc2->Draw();
430 c1->cd(3);
431 hc3->SetXTitle("ix (npads)");
432 hc3->Draw();
433 c1->cd(4);
434 hc4->SetXTitle("ix (npads)");
435 hc4->Draw();
436 c1->cd(5);
437 hc5->SetXTitle("ix (npads)");
438 hc5->Draw();
439 c1->cd(6);
440 hc6->SetXTitle("ix (npads)");
441 hc6->Draw();
442 c1->cd(7);
443 hc7->SetXTitle("ix (npads)");
444 hc7->Draw();
445 }
446//
447 TCanvas *c4 = new TCanvas("c4","Hits per type",400,10,600,700);
448 c4->Divide(2,2);
449
450 c4->cd(1);
451 feedback->SetFillColor(42);
452 feedback->SetXTitle("x (pads)");
453 feedback->SetYTitle("y (pads)");
454 feedback->Draw();
455
456 c4->cd(2);
457 mip->SetFillColor(42);
458 mip->SetXTitle("x (pads)");
459 mip->SetYTitle("y (pads)");
460 mip->Draw();
461
462 c4->cd(3);
463 cerenkov->SetFillColor(42);
464 cerenkov->SetXTitle("x (pads)");
465 cerenkov->SetYTitle("y (pads)");
466 cerenkov->Draw();
467
468 c4->cd(4);
469 h->SetFillColor(42);
470 h->SetXTitle("x (cm)");
471 h->SetYTitle("y (cm)");
472 h->Draw();
473
474 TCanvas *c10 = new TCanvas("c10","Hits distribution",400,10,600,350);
475 c10->Divide(2,1);
476
477 c10->cd(1);
478 hitsX->SetFillColor(42);
479 hitsX->SetXTitle("(GeV)");
480 hitsX->Draw();
481
482 c10->cd(2);
483 hitsY->SetFillColor(42);
484 hitsY->SetXTitle("(GeV)");
485 hitsY->Draw();
486
487
488 break;
489//
490 case 2:
491
492 TCanvas *c6 = new TCanvas("c6","Photon Spectra",50,10,600,350);
493 c6->Divide(2,1);
494
495 c6->cd(1);
496 phspectra2->SetFillColor(42);
497 phspectra2->SetXTitle("energy (eV)");
498 phspectra2->Draw();
499 c6->cd(2);
500 phspectra1->SetFillColor(42);
501 phspectra1->SetXTitle("energy (eV)");
502 phspectra1->Draw();
503
504 TCanvas *c9 = new TCanvas("c9","Particles Spectra",400,10,600,700);
505 c9->Divide(2,2);
506
507 c9->cd(1);
508 pionspectra->SetFillColor(42);
509 pionspectra->SetXTitle("(GeV)");
510 pionspectra->Draw();
511
512 c9->cd(2);
513 protonspectra->SetFillColor(42);
514 protonspectra->SetXTitle("(GeV)");
515 protonspectra->Draw();
516
517 c9->cd(3);
518 kaonspectra->SetFillColor(42);
519 kaonspectra->SetXTitle("(GeV)");
520 kaonspectra->Draw();
521
522 c9->cd(4);
523 chargedspectra->SetFillColor(42);
524 chargedspectra->SetXTitle("(GeV)");
525 chargedspectra->Draw();
ddae0931 526
d2269328 527 break;
528
529 case 3:
530
531 if (nrawclusters) {
532 TCanvas *c3=new TCanvas("c3","Clusters Statistics",400,10,600,700);
533 c3->Divide(2,2);
534
535 c3->cd(1);
536 Clcharge->SetFillColor(42);
537 Clcharge->SetXTitle("ADC units");
538 Clcharge->Draw();
539
540 c3->cd(2);
541 padnumber->SetFillColor(42);
542 padnumber->SetXTitle("(counts)");
543 padnumber->Draw();
544
545 c3->cd(3);
546 clusev->SetFillColor(42);
547 clusev->SetXTitle("(counts)");
548 clusev->Draw();
ddae0931 549
d2269328 550 c3->cd(4);
551 padsmip->SetFillColor(42);
552 padsmip->SetXTitle("(counts)");
553 padsmip->Draw();
554 }
555
556 if (nev<1)
557 {
558 TCanvas *c11 = new TCanvas("c11","Cherenkov per Mip",400,10,600,700);
559 mother->SetFillColor(42);
560 mother->SetXTitle("counts");
561 mother->Draw();
562 }
563
564 TCanvas *c2 = new TCanvas("c2","Angles of incidence",50,10,600,700);
565 c2->Divide(2,2);
566
567 c2->cd(1);
568 hitsPhi->SetFillColor(42);
569 hitsPhi->Draw();
570 c2->cd(2);
571 hitsTheta->SetFillColor(42);
572 hitsTheta->Draw();
573 c2->cd(3);
574 Phi->SetFillColor(42);
575 Phi->Draw();
576 c2->cd(4);
577 Theta->SetFillColor(42);
578 Theta->Draw();
579
580
581 TCanvas *c5 = new TCanvas("c5","Ring Statistics",50,10,600,700);
582 c5->Divide(2,2);
583
584 c5->cd(1);
585 ckovangle->SetFillColor(42);
586 ckovangle->SetXTitle("angle (radians)");
587 ckovangle->Draw();
588
589 c5->cd(2);
590 radius->SetFillColor(42);
591 radius->SetXTitle("radius (cm)");
592 radius->Draw();
593
594 c5->cd(3);
595 Omega->SetFillColor(42);
596 Omega->SetXTitle("angle (radians)");
597 Omega->Draw();
598
599 TCanvas *c7 = new TCanvas("c7","Production Statistics",400,10,600,700);
600 c7->Divide(2,2);
601
602 c7->cd(1);
603 totalphotons->SetFillColor(42);
604 totalphotons->SetXTitle("Photons (counts)");
605 totalphotons->Draw();
606
607 c7->cd(2);
608 photev->SetFillColor(42);
609 photev->SetXTitle("(counts)");
610 photev->Draw();
611
612 c7->cd(3);
613 feedev->SetFillColor(42);
614 feedev->SetXTitle("(counts)");
615 feedev->Draw();
616
617 c7->cd(4);
618 padsev->SetFillColor(42);
619 padsev->SetXTitle("(counts)");
620 padsev->Draw();
621
622 break;
623
624 }
625
626
627 // calculate the number of pads which give a signal
628
629
630 Int_t Np=0;
631 for (Int_t i=0;i< NpadX;i++) {
632 for (Int_t j=0;j< NpadY;j++) {
633 if (Pad[i][j]>=6){
634 Np+=1;
635 }
636 }
637 }
638 //printf("The total number of pads which give a signal: %d %d\n",Nh,Nh1);
639 printf("End of macro\n");
ddae0931 640}
d2269328 641
642