]>
Commit | Line | Data |
---|---|---|
5bd23319 | 1 | void RICHpadtest (Int_t diaglevel,Int_t evNumber1=0,Int_t evNumber2=0) |
2 | { | |
d2269328 | 3 | |
6b1de171 | 4 | // Diaglevel |
5 | // 1-> Single Ring Hits | |
6 | // 2-> Single Ring Spectra | |
7 | // 3-> Single Ring Statistics | |
8 | // 4-> Single Ring Reconstruction | |
9 | // 5-> Full Event Hits | |
d2269328 | 10 | |
ddae0931 | 11 | ///////////////////////////////////////////////////////////////////////// |
12 | // This macro is a small example of a ROOT macro | |
13 | // illustrating how to read the output of GALICE | |
14 | // and do some analysis. | |
15 | // | |
16 | ///////////////////////////////////////////////////////////////////////// | |
17 | ||
d2269328 | 18 | gClassTable->GetID("AliRun"); |
ddae0931 | 19 | |
20 | ||
21 | // Dynamically link some shared libs | |
22 | ||
23 | if (gClassTable->GetID("AliRun") < 0) { | |
d2269328 | 24 | gROOT->LoadMacro("loadlibs.C"); |
25 | loadlibs(); | |
b73bd8af | 26 | }else { |
27 | delete gAlice; | |
d2269328 | 28 | gAlice = 0; |
b73bd8af | 29 | } |
ddae0931 | 30 | |
d2269328 | 31 | gAlice=0; |
32 | ||
33 | // Connect the Root Galice file containing Geometry, Kine and Hits | |
34 | ||
35 | TFile *file = (TFile*)gROOT->GetListOfFiles()->FindObject("galice.root"); | |
6b1de171 | 36 | if (!file) file = new TFile("galice.root","UPDATE"); |
d2269328 | 37 | |
ddae0931 | 38 | // Get AliRun object from file or create it if not on file |
d2269328 | 39 | |
40 | if (!gAlice) { | |
ddae0931 | 41 | gAlice = (AliRun*)file->Get("gAlice"); |
42 | if (gAlice) printf("AliRun object found on file\n"); | |
43 | if (!gAlice) gAlice = new AliRun("gAlice","Alice test program"); | |
d2269328 | 44 | } |
45 | else { | |
46 | delete gAlice; | |
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"); | |
50 | } | |
ddae0931 | 51 | |
c128dc06 | 52 | AliRICH *RICH = (AliRICH*)gAlice->GetDetector("RICH"); |
53 | ||
54 | RICH->DiagnosticsSE(diaglevel,evNumber1,evNumber2); | |
55 | ||
de655b16 | 56 | file->Write(); |
57 | ||
c128dc06 | 58 | |
ddae0931 | 59 | // Create some histograms |
60 | ||
c128dc06 | 61 | /* AliRICH *RICH = (AliRICH*)gAlice->GetDetector("RICH"); |
b73bd8af | 62 | AliRICHSegmentationV0* segmentation; |
63 | AliRICHChamber* chamber; | |
64 | ||
65 | chamber = &(RICH->Chamber(0)); | |
66 | segmentation=(AliRICHSegmentationV0*) chamber->GetSegmentationModel(0); | |
67 | ||
68 | Int_t NpadX = segmentation->Npx(); // number of pads on X | |
69 | Int_t NpadY = segmentation->Npy(); // number of pads on Y | |
70 | ||
71 | Int_t Pad[144][160]; | |
c128dc06 | 72 | //for (Int_t i=0;i<NpadX;i++) { |
73 | //for (Int_t j=0;j<NpadY;j++) { | |
74 | //Pad[i][j]=0; | |
75 | //} | |
76 | //} | |
b73bd8af | 77 | |
78 | ||
d2269328 | 79 | Int_t xmin= -NpadX/2; |
80 | Int_t xmax= NpadX/2; | |
81 | Int_t ymin= -NpadY/2; | |
82 | Int_t ymax= NpadY/2; | |
ddae0931 | 83 | |
b73bd8af | 84 | TH2F *hc0 = new TH2F("hc0","Zoom on center of central chamber",150,-30,30,150,-50,10); |
6b1de171 | 85 | |
86 | if (diaglevel == 1) | |
87 | ||
88 | { | |
89 | printf("Single Ring Hits\n"); | |
b73bd8af | 90 | TH2F *feedback = new TH2F("feedback","Feedback hit distribution",150,-30,30,150,-50,10); |
91 | TH2F *mip = new TH2F("mip","Mip hit distribution",150,-30,30,150,-50,10); | |
92 | TH2F *cerenkov = new TH2F("cerenkov","Cerenkov hit distribution",150,-30,30,150,-50,10); | |
93 | TH2F *h = new TH2F("h","Detector hit distribution",150,-30,30,150,-50,10); | |
6b1de171 | 94 | TH1F *hitsX = new TH1F("hitsX","Distribution of hits along x-axis",150,-30,30); |
b73bd8af | 95 | TH1F *hitsY = new TH1F("hitsY","Distribution of hits along z-axis",150,-50,10); |
6b1de171 | 96 | } |
97 | else | |
98 | { | |
99 | printf("Full Event Hits\n"); | |
100 | ||
101 | TH2F *feedback = new TH2F("feedback","Feedback hit distribution",150,-300,300,150,-300,300); | |
102 | TH2F *mip = new TH2F("mip","Mip hit distribution",150,-300,300,150,-300,300); | |
103 | TH2F *cerenkov = new TH2F("cerenkov","Cerenkov hit distribution",150,-300,300,150,-300,300); | |
104 | TH2F *h = new TH2F("h","Detector hit distribution",150,-300,300,150,-300,300); | |
105 | TH1F *hitsX = new TH1F("digitsX","Distribution of hits along x-axis",200,-300,300); | |
106 | TH1F *hitsY = new TH1F("digitsY","Distribution of hits along z-axis",200,-300,300); | |
6b1de171 | 107 | } |
be7c94f7 | 108 | |
109 | ||
6b1de171 | 110 | |
d2269328 | 111 | TH2F *hc1 = new TH2F("hc1","Chamber 1 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); |
112 | TH2F *hc2 = new TH2F("hc2","Chamber 2 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); | |
113 | TH2F *hc3 = new TH2F("hc3","Chamber 3 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); | |
114 | TH2F *hc4 = new TH2F("hc4","Chamber 4 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); | |
115 | TH2F *hc5 = new TH2F("hc5","Chamber 5 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); | |
116 | TH2F *hc6 = new TH2F("hc6","Chamber 6 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); | |
117 | TH2F *hc7 = new TH2F("hc7","Chamber 7 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax); | |
6b1de171 | 118 | |
d2269328 | 119 | TH1F *Clcharge = new TH1F("Clcharge","Cluster Charge Distribution",500,0.,500.); |
d2269328 | 120 | TH1F *ckovangle = new TH1F("ckovangle","Cerenkov angle per photon",200,.5,1); |
121 | TH1F *hckphi = new TH1F("hckphi","Cerenkov phi angle per photon",620,-3.1,3.1); | |
d2269328 | 122 | TH1F *mother = new TH1F("mother","Cerenkovs per Mip",75,0.,75.); |
123 | TH1F *radius = new TH1F("radius","Mean distance to Mip",100,0.,20.); | |
6b1de171 | 124 | TH1F *phspectra1 = new TH1F("phspectra1","Detected Photon Spectra",200,5.,10.); |
125 | TH1F *phspectra2 = new TH1F("phspectra2","Produced Photon Spectra",200,5.,10.); | |
126 | TH1F *totalphotonstrack = new TH1F("totalphotonstrack","Produced Photons per Mip",100,200,700.); | |
127 | TH1F *totalphotonsevent = new TH1F("totalphotonsevent","Produced Photons per Mip",100,200,700.); | |
d2269328 | 128 | TH1F *feedbacks = new TH1F("feedbacks","Produced Feedbacks per Mip",50,0.5,50.); |
129 | TH1F *padnumber = new TH1F("padnumber","Number of pads per cluster",50,-0.5,50.); | |
6b1de171 | 130 | TH1F *padsev = new TH1F("padsev","Number of pads hit per MIP",50,0.5,100.); |
131 | TH1F *clusev = new TH1F("clusev","Number of clusters per MIP",50,0.5,50.); | |
132 | TH1F *photev = new TH1F("photev","Number of detected photons per MIP",50,0.5,50.); | |
133 | TH1F *feedev = new TH1F("feedev","Number of feedbacks per MIP",50,0.5,50.); | |
d2269328 | 134 | TH1F *padsmip = new TH1F("padsmip","Number of pads per event inside MIP region",50,0.5,50.); |
135 | TH1F *padscl = new TH1F("padscl","Number of pads per event from cluster count",50,0.5,100.); | |
136 | TH1F *pionspectra = new TH1F("pionspectra","Pion Spectra",200,.5,10.); | |
137 | TH1F *protonspectra = new TH1F("protonspectra","Proton Spectra",200,.5,10.); | |
138 | TH1F *kaonspectra = new TH1F("kaonspectra","Kaon Spectra",100,.5,10.); | |
139 | TH1F *kaonspectra = new TH1F("kaonspectra","Kaon Spectra",100,.5,10.); | |
140 | TH1F *chargedspectra = new TH1F("chargedspectra","Charged particles above 1 GeV Spectra",100,.5,10.); | |
d2269328 | 141 | TH1F *hitsPhi = new TH1F("hitsPhi","Distribution of phi angle of incidence",100,-180,180); |
142 | TH1F *hitsTheta = new TH1F("hitsTheta","Distribution of Theta angle of incidence",100,0,15); | |
b3462c7e | 143 | TH1F *Omega1D = new TH1F("omega","Reconstructed Cerenkov angle per track",200,.5,1); |
d2269328 | 144 | TH1F *Theta = new TH1F("theta","Reconstructed theta incidence angle per track",200,0,15); |
145 | TH1F *Phi = new TH1F("phi","Reconstructed phi incidence per track",200,-180,180); | |
b3462c7e | 146 | TH1F *Omega3D = new TH1F("omega","Reconstructed Cerenkov angle per track",200,.5,1); |
6b1de171 | 147 | TH1F *PhotonCer = new TH1F("photoncer","Reconstructed Cerenkov angle per photon",200,.5,1); |
148 | TH2F *PadsUsed = new TH2F("padsused","Pads Used for Reconstruction",100,-30,30,100,-30,30); | |
ddae0931 | 149 | |
150 | // Start loop over events | |
151 | ||
152 | Int_t Nh=0; | |
d2269328 | 153 | Int_t pads=0; |
ddae0931 | 154 | Int_t Nh1=0; |
d2269328 | 155 | Int_t mothers[80000]; |
156 | Int_t mothers2[80000]; | |
157 | Float_t mom[3]; | |
158 | Int_t nraw=0; | |
159 | Int_t phot=0; | |
160 | Int_t feed=0; | |
161 | Int_t padmip=0; | |
162 | for (Int_t i=0;i<100;i++) mothers[i]=0; | |
ddae0931 | 163 | for (int nev=0; nev<= evNumber2; nev++) { |
d2269328 | 164 | Int_t nparticles = gAlice->GetEvent(nev); |
165 | ||
166 | ||
167 | //cout<<"nev "<<nev<<endl; | |
a4622d0f | 168 | printf ("\n**********************************\nProcessing Event: %d\n",nev); |
d2269328 | 169 | //cout<<"nparticles "<<nparticles<<endl; |
a4622d0f | 170 | printf ("Particles : %d\n\n",nparticles); |
d2269328 | 171 | if (nev < evNumber1) continue; |
172 | if (nparticles <= 0) return; | |
173 | ||
ddae0931 | 174 | // Get pointers to RICH detector and Hits containers |
d2269328 | 175 | |
c128dc06 | 176 | |
177 | if(gAlice->TreeR()) | |
178 | { | |
179 | Int_t nent=(Int_t)gAlice->TreeR()->GetEntries(); | |
180 | gAlice->TreeR()->GetEvent(nent-1); | |
181 | TClonesArray *Rawclusters = RICH->RawClustAddress(2); // Raw clusters branch | |
182 | //printf ("Rawclusters:%p",Rawclusters); | |
183 | Int_t nrawclusters = Rawclusters->GetEntriesFast(); | |
184 | //printf (" nrawclusters:%d\n",nrawclusters); | |
185 | gAlice->TreeR()->GetEvent(nent-1); | |
186 | TClonesArray *RecHits1D = RICH->RecHitsAddress1D(2); | |
187 | Int_t nrechits1D = RecHits1D->GetEntriesFast(); | |
188 | //printf (" nrechits:%d\n",nrechits); | |
189 | TClonesArray *RecHits3D = RICH->RecHitsAddress3D(2); | |
190 | Int_t nrechits3D = RecHits3D->GetEntriesFast(); | |
191 | //printf (" nrechits:%d\n",nrechits); | |
192 | } | |
193 | else | |
194 | printf("No TreeR found on file.\n"); | |
d2269328 | 195 | TTree *TH = gAlice->TreeH(); |
196 | Int_t ntracks = TH->GetEntries(); | |
c128dc06 | 197 | |
b73bd8af | 198 | gAlice->ResetDigits(); |
d2269328 | 199 | Int_t nent=(Int_t)gAlice->TreeD()->GetEntries(); |
7da9cdef | 200 | gAlice->TreeD()->GetEvent(0); |
b73bd8af | 201 | |
202 | ||
203 | ||
204 | // Start loop on tracks in the hits containers | |
d2269328 | 205 | Int_t Nc=0; |
206 | for (Int_t track=0; track<ntracks;track++) { | |
a4622d0f | 207 | printf ("\nProcessing Track: %d\n",track); |
d2269328 | 208 | gAlice->ResetHits(); |
209 | Int_t nbytes += TH->GetEvent(track); | |
210 | if (RICH) { | |
211 | //RICH->ResetRawClusters(); | |
7da9cdef | 212 | TClonesArray *SDigits = RICH->SDigits(); // Cluster branch |
d2269328 | 213 | TClonesArray *Hits = RICH->Hits(); // Hits branch |
214 | TClonesArray *Cerenkovs = RICH->Cerenkovs(); // Cerenkovs branch | |
215 | } | |
216 | //see hits distribution | |
217 | ||
ddae0931 | 218 | |
d2269328 | 219 | Int_t nhits = Hits->GetEntriesFast(); |
220 | if (nhits) Nh+=nhits; | |
185048a3 | 221 | printf("Hits : %d\n",nhits); |
d2269328 | 222 | for (Int_t hit=0;hit<nhits;hit++) { |
223 | mHit = (AliRICHHit*) Hits->UncheckedAt(hit); | |
ddae0931 | 224 | Int_t nch = mHit->fChamber; // chamber number |
185048a3 | 225 | Float_t x = mHit->X(); // x-pos of hit |
226 | Float_t y = mHit->Z(); // y-pos | |
d2269328 | 227 | Float_t phi = mHit->fPhi; //Phi angle of incidence |
228 | Float_t theta = mHit->fTheta; //Theta angle of incidence | |
185048a3 | 229 | Int_t index = mHit->Track(); |
d2269328 | 230 | Int_t particle = mHit->fParticle; |
231 | Int_t freon = mHit->fLoss; | |
232 | ||
185048a3 | 233 | hitsX->Fill(x,(float) 1); |
234 | hitsY->Fill(y,(float) 1); | |
d2269328 | 235 | |
b73bd8af | 236 | //printf("Particle:%9d\n",particle); |
d2269328 | 237 | |
b73bd8af | 238 | TParticle *current = (TParticle*)gAlice->Particle(index); |
239 | //printf("Particle type: %d\n",sizeoff(Particles)); | |
6b1de171 | 240 | |
241 | hitsTheta->Fill(theta,(float) 1); | |
242 | if (RICH->GetDebugLevel() == -1) | |
b73bd8af | 243 | //printf("Theta:%f, Phi:%f\n",theta,phi); |
6b1de171 | 244 | |
245 | //printf("Debug Level:%d\n",RICH->GetDebugLevel()); | |
246 | ||
be7c94f7 | 247 | if (TMath::Abs(particle) < 10000000) |
d2269328 | 248 | { |
249 | mip->Fill(x,y,(float) 1); | |
be7c94f7 | 250 | //printf("adding mip\n"); |
d2269328 | 251 | if (current->Energy() - current->GetCalcMass()>1 && freon==1) |
252 | { | |
253 | hitsPhi->Fill(phi,(float) 1); | |
6b1de171 | 254 | //hitsTheta->Fill(theta,(float) 1); |
d2269328 | 255 | //printf("Theta:%f, Phi:%f\n",theta,phi); |
256 | } | |
be7c94f7 | 257 | } |
d2269328 | 258 | |
259 | if (TMath::Abs(particle)==211 || TMath::Abs(particle)==111) | |
260 | { | |
261 | pionspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1); | |
262 | } | |
263 | if (TMath::Abs(particle)==2212) | |
264 | { | |
265 | protonspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1); | |
266 | } | |
267 | if (TMath::Abs(particle)==321 || TMath::Abs(particle)==130 || TMath::Abs(particle)==310 | |
268 | || TMath::Abs(particle)==311) | |
269 | { | |
270 | kaonspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1); | |
271 | } | |
272 | if(TMath::Abs(particle)==211 || TMath::Abs(particle)==2212 || TMath::Abs(particle)==321) | |
273 | { | |
274 | if (current->Energy() - current->GetCalcMass()>1) | |
275 | chargedspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1); | |
276 | } | |
277 | //printf("Hits:%d\n",hit); | |
278 | //printf ("Chamber number:%d x:%f y:%f\n",nch,x,y); | |
ddae0931 | 279 | // Fill the histograms |
d2269328 | 280 | Nh1+=nhits; |
281 | h->Fill(x,y,(float) 1); | |
282 | //} | |
283 | //} | |
ddae0931 | 284 | } |
d2269328 | 285 | |
286 | Int_t ncerenkovs = Cerenkovs->GetEntriesFast(); | |
6dcad8f7 | 287 | //if (current->GetPdgCode() < 50000051 && current->GetPdgCode() > 50000040) |
288 | //totalphotonsevent->Fill(ncerenkovs,(float) 1); | |
d2269328 | 289 | |
185048a3 | 290 | if (ncerenkovs) { |
291 | printf("Cerenkovs : %d\n",ncerenkovs); | |
6dcad8f7 | 292 | totalphotonsevent->Fill(ncerenkovs,(float) 1); |
293 | for (Int_t hit=0;hit<ncerenkovs;hit++) { | |
d2269328 | 294 | cHit = (AliRICHCerenkov*) Cerenkovs->UncheckedAt(hit); |
295 | Int_t nchamber = cHit->fChamber; // chamber number | |
185048a3 | 296 | Int_t index = cHit->Track(); |
d2269328 | 297 | Int_t pindex = cHit->fIndex; |
185048a3 | 298 | Float_t cx = cHit->X(); // x-position |
299 | Float_t cy = cHit->Z(); // y-position | |
d2269328 | 300 | Int_t cmother = cHit->fCMother; // Index of mother particle |
301 | Int_t closs = cHit->fLoss; // How did the particle get lost? | |
c128dc06 | 302 | //printf ("Cerenkov hit number %d/%d, X:%d, Y:%d\n",hit,ncerenkovs,cx,cy); |
d2269328 | 303 | |
c128dc06 | 304 | //printf("Particle:%9d\n",current->GetPdgCode()); |
6dcad8f7 | 305 | |
b73bd8af | 306 | TParticle *current = (TParticle*)gAlice->Particle(index); |
6b1de171 | 307 | Float_t energyckov = current->Energy(); |
d2269328 | 308 | |
309 | if (current->GetPdgCode() == 50000051) | |
6dcad8f7 | 310 | { |
d2269328 | 311 | if (closs==4) |
6dcad8f7 | 312 | { |
d2269328 | 313 | feedback->Fill(cx,cy,(float) 1); |
314 | feed++; | |
6dcad8f7 | 315 | } |
316 | } | |
d2269328 | 317 | if (current->GetPdgCode() == 50000050) |
6dcad8f7 | 318 | { |
319 | ||
320 | if (closs !=4) | |
321 | { | |
322 | phspectra2->Fill(energyckov*1e9,(float) 1); | |
323 | } | |
324 | ||
325 | if (closs==4) | |
326 | { | |
327 | cerenkov->Fill(cx,cy,(float) 1); | |
328 | ||
c128dc06 | 329 | printf ("Cerenkov hit number %d/%d, X:%d, Y:%d\n",hit,ncerenkovs,cx,cy); |
330 | ||
b73bd8af | 331 | TParticle *MIP = (TParticle*)gAlice->Particle(cmother); |
d2269328 | 332 | mipHit = (AliRICHHit*) Hits->UncheckedAt(0); |
333 | mom[0] = current->Px(); | |
334 | mom[1] = current->Py(); | |
335 | mom[2] = current->Pz(); | |
185048a3 | 336 | //mom[0] = cHit->fMomX; |
337 | // mom[1] = cHit->fMomZ; | |
338 | //mom[2] = cHit->fMomY; | |
d2269328 | 339 | Float_t energymip = MIP->Energy(); |
b73bd8af | 340 | Float_t Mip_px = mipHit->fMomFreoX; |
341 | Float_t Mip_py = mipHit->fMomFreoY; | |
342 | Float_t Mip_pz = mipHit->fMomFreoZ; | |
185048a3 | 343 | //Float_t Mip_px = MIP->Px(); |
344 | //Float_t Mip_py = MIP->Py(); | |
345 | //Float_t Mip_pz = MIP->Pz(); | |
d2269328 | 346 | |
347 | ||
348 | ||
349 | Float_t r = mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2]; | |
350 | Float_t rt = TMath::Sqrt(r); | |
351 | Float_t Mip_r = Mip_px*Mip_px + Mip_py*Mip_py + Mip_pz*Mip_pz; | |
352 | Float_t Mip_rt = TMath::Sqrt(Mip_r); | |
b73bd8af | 353 | Float_t coscerenkov = (mom[0]*Mip_px + mom[1]*Mip_py + mom[2]*Mip_pz)/(rt*Mip_rt+0.0000001); |
d2269328 | 354 | Float_t cherenkov = TMath::ACos(coscerenkov); |
355 | ckovangle->Fill(cherenkov,(float) 1); //Cerenkov angle calculus | |
356 | //printf("Cherenkov: %f\n",cherenkov); | |
357 | Float_t ckphi=TMath::ATan2(mom[0], mom[2]); | |
358 | hckphi->Fill(ckphi,(float) 1); | |
359 | ||
360 | ||
361 | Float_t mix = MIP->Vx(); | |
362 | Float_t miy = MIP->Vy(); | |
185048a3 | 363 | Float_t mx = mipHit->X(); |
364 | Float_t my = mipHit->Z(); | |
d2269328 | 365 | //printf("FX %e, FY %e, VX %e, VY %e\n",cx,cy,mx,my); |
366 | Float_t dx = cx - mx; | |
367 | Float_t dy = cy - my; | |
368 | //printf("Dx:%f, Dy:%f\n",dx,dy); | |
369 | Float_t final_radius = TMath::Sqrt(dx*dx+dy*dy); | |
370 | //printf("Final radius:%f\n",final_radius); | |
371 | radius->Fill(final_radius,(float) 1); | |
372 | ||
373 | phspectra1->Fill(energyckov*1e9,(float) 1); | |
374 | phot++; | |
375 | } | |
d2269328 | 376 | for (Int_t nmothers=0;nmothers<=ntracks;nmothers++){ |
377 | if (cmother == nmothers){ | |
378 | if (closs == 4) | |
379 | mothers2[cmother]++; | |
380 | mothers[cmother]++; | |
381 | } | |
382 | } | |
383 | } | |
384 | } | |
385 | } | |
386 | ||
387 | if (nrawclusters) { | |
185048a3 | 388 | printf("Raw Clusters : %d\n",nrawclusters); |
d2269328 | 389 | for (Int_t hit=0;hit<nrawclusters;hit++) { |
390 | rcHit = (AliRICHRawCluster*) Rawclusters->UncheckedAt(hit); | |
391 | //Int_t nchamber = rcHit->fChamber; // chamber number | |
392 | //Int_t nhit = cHit->fHitNumber; // hit number | |
393 | Int_t qtot = rcHit->fQ; // charge | |
394 | Int_t fx = rcHit->fX; // x-position | |
395 | Int_t fy = rcHit->fY; // y-position | |
396 | Int_t type = rcHit->fCtype; // cluster type ? | |
397 | Int_t mult = rcHit->fMultiplicity; // How many pads form the cluster | |
398 | pads += mult; | |
399 | if (qtot > 0) { | |
6dcad8f7 | 400 | //printf ("fx: %d, fy: %d\n",fx,fy); |
b73bd8af | 401 | if (fx>(x-4) && fx<(x+4) && fy>(y-4) && fy<(y+4)) { |
6dcad8f7 | 402 | //printf("There %d \n",mult); |
403 | padmip+=mult; | |
404 | } else { | |
405 | padnumber->Fill(mult,(float) 1); | |
406 | nraw++; | |
407 | if (mult<4) Clcharge->Fill(qtot,(float) 1); | |
408 | } | |
be7c94f7 | 409 | |
d2269328 | 410 | } |
411 | } | |
412 | } | |
413 | ||
a4622d0f | 414 | if(nrechits1D) |
d2269328 | 415 | { |
a4622d0f | 416 | for (Int_t hit=0;hit<nrechits1D;hit++) { |
417 | recHit1D = (AliRICHRecHit1D*) RecHits1D->UncheckedAt(hit); | |
418 | Float_t r_omega = recHit1D->fOmega; // Cerenkov angle | |
a4622d0f | 419 | Float_t *cer_pho = recHit1D->fCerPerPhoton; // Cerenkov angle per photon |
420 | Int_t *padsx = recHit1D->fPadsUsedX; // Pads Used fo reconstruction (x) | |
421 | Int_t *padsy = recHit1D->fPadsUsedY; // Pads Used fo reconstruction (y) | |
422 | Int_t goodPhotons = recHit1D->fGoodPhotons; // Number of pads used for reconstruction | |
d2269328 | 423 | |
b3462c7e | 424 | Omega1D->Fill(r_omega,(float) 1); |
425 | ||
6b1de171 | 426 | for (Int_t i=0; i<goodPhotons; i++) |
427 | { | |
428 | PhotonCer->Fill(cer_pho[i],(float) 1); | |
429 | PadsUsed->Fill(padsx[i],padsy[i],1); | |
430 | //printf("Angle:%f, pad: %d %d\n",cer_pho[i],padsx[i],padsy[i]); | |
431 | } | |
d2269328 | 432 | |
433 | //printf("Omega: %f, Theta: %f, Phi: %f\n",r_omega,r_theta,r_phi); | |
434 | } | |
435 | } | |
b3462c7e | 436 | |
437 | if(nrechits3D) | |
438 | { | |
439 | for (Int_t hit=0;hit<nrechits3D;hit++) { | |
440 | recHit3D = (AliRICHRecHit3D*) RecHits3D->UncheckedAt(hit); | |
441 | Float_t r_omega = recHit3D->fOmega; // Cerenkov angle | |
442 | Float_t r_theta = recHit3D->fTheta; // Theta angle of incidence | |
443 | Float_t r_phi = recHit3D->fPhi; // Phi angle if incidence | |
444 | ||
445 | ||
446 | Omega3D->Fill(r_omega,(float) 1); | |
447 | Theta->Fill(r_theta*180/TMath::Pi(),(float) 1); | |
448 | Phi->Fill(r_phi*180/TMath::Pi(),(float) 1); | |
449 | ||
450 | } | |
451 | } | |
ddae0931 | 452 | } |
d2269328 | 453 | |
454 | for (Int_t nmothers=0;nmothers<ntracks;nmothers++){ | |
6b1de171 | 455 | totalphotonstrack->Fill(mothers[nmothers],(float) 1); |
d2269328 | 456 | mother->Fill(mothers2[nmothers],(float) 1); |
457 | //printf ("Entries in %d : %d\n",nmothers, mothers[nmothers]); | |
458 | } | |
459 | ||
460 | clusev->Fill(nraw,(float) 1); | |
461 | photev->Fill(phot,(float) 1); | |
462 | feedev->Fill(feed,(float) 1); | |
463 | padsmip->Fill(padmip,(float) 1); | |
464 | padscl->Fill(pads,(float) 1); | |
465 | //printf("Photons:%d\n",phot); | |
466 | phot = 0; | |
467 | feed = 0; | |
468 | pads = 0; | |
469 | nraw=0; | |
470 | padmip=0; | |
ddae0931 | 471 | |
6dcad8f7 | 472 | if (diaglevel < 4) |
6b1de171 | 473 | { |
6dcad8f7 | 474 | |
b73bd8af | 475 | |
476 | TClonesArray *Digits = RICH->DigitsAddress(2); | |
6b1de171 | 477 | Int_t ndigits = Digits->GetEntriesFast(); |
be7c94f7 | 478 | printf("Digits : %d\n",ndigits); |
6dcad8f7 | 479 | padsev->Fill(ndigits,(float) 1); |
480 | for (Int_t hit=0;hit<ndigits;hit++) { | |
481 | dHit = (AliRICHDigit*) Digits->UncheckedAt(hit); | |
482 | Int_t qtot = dHit->fSignal; // charge | |
483 | Int_t ipx = dHit->fPadX; // pad number on X | |
484 | Int_t ipy = dHit->fPadY; // pad number on Y | |
485 | //printf("%d, %d\n",ipx,ipy); | |
486 | if( ipx<=100 && ipy <=100) hc0->Fill(ipx,ipy,(float) qtot); | |
6b1de171 | 487 | } |
488 | } | |
b73bd8af | 489 | |
6dcad8f7 | 490 | if (diaglevel == 5) |
491 | { | |
492 | for (Int_t ich=0;ich<7;ich++) | |
493 | { | |
494 | TClonesArray *Digits = RICH->DigitsAddress(ich); // Raw clusters branch | |
495 | Int_t ndigits = Digits->GetEntriesFast(); | |
496 | //printf("Digits:%d\n",ndigits); | |
497 | padsev->Fill(ndigits,(float) 1); | |
498 | if (ndigits) { | |
499 | for (Int_t hit=0;hit<ndigits;hit++) { | |
500 | dHit = (AliRICHDigit*) Digits->UncheckedAt(hit); | |
be7c94f7 | 501 | //Int_t nchamber = dHit->fChamber; // chamber number |
6dcad8f7 | 502 | //Int_t nhit = dHit->fHitNumber; // hit number |
503 | Int_t qtot = dHit->fSignal; // charge | |
504 | Int_t ipx = dHit->fPadX; // pad number on X | |
505 | Int_t ipy = dHit->fPadY; // pad number on Y | |
506 | //Int_t iqpad = dHit->fQpad; // charge per pad | |
507 | //Int_t rpad = dHit->fRSec; // R-position of pad | |
508 | //printf ("Pad hit, PadX:%d, PadY:%d\n",ipx,ipy); | |
509 | if( ipx<=100 && ipy <=100 && ich==2) hc0->Fill(ipx,ipy,(float) qtot); | |
510 | if( ipx<=162 && ipy <=162 && ich==0) hc1->Fill(ipx,ipy,(float) qtot); | |
511 | if( ipx<=162 && ipy <=162 && ich==1) hc2->Fill(ipx,ipy,(float) qtot); | |
512 | if( ipx<=162 && ipy <=162 && ich==2) hc3->Fill(ipx,ipy,(float) qtot); | |
513 | if( ipx<=162 && ipy <=162 && ich==3) hc4->Fill(ipx,ipy,(float) qtot); | |
514 | if( ipx<=162 && ipy <=162 && ich==4) hc5->Fill(ipx,ipy,(float) qtot); | |
515 | if( ipx<=162 && ipy <=162 && ich==5) hc6->Fill(ipx,ipy,(float) qtot); | |
516 | if( ipx<=162 && ipy <=162 && ich==6) hc7->Fill(ipx,ipy,(float) qtot); | |
517 | } | |
518 | } | |
519 | } | |
520 | } | |
d2269328 | 521 | } |
6b1de171 | 522 | |
ddae0931 | 523 | |
d2269328 | 524 | //Create canvases, set the view range, show histograms |
ddae0931 | 525 | |
b73bd8af | 526 | switch(diaglevel) |
d2269328 | 527 | { |
528 | case 1: | |
6b1de171 | 529 | |
530 | TCanvas *c1 = new TCanvas("c1","Alice RICH digits",50,50,300,350); | |
531 | hc0->SetXTitle("ix (npads)"); | |
532 | hc0->Draw("box"); | |
533 | ||
d2269328 | 534 | // |
6b1de171 | 535 | TCanvas *c4 = new TCanvas("c4","Hits per type",100,100,600,700); |
d2269328 | 536 | c4->Divide(2,2); |
b73bd8af | 537 | //c4->SetFillColor(42); |
538 | ||
d2269328 | 539 | c4->cd(1); |
6b1de171 | 540 | feedback->SetXTitle("x (cm)"); |
541 | feedback->SetYTitle("y (cm)"); | |
d2269328 | 542 | feedback->Draw(); |
543 | ||
544 | c4->cd(2); | |
b73bd8af | 545 | //mip->SetFillColor(5); |
6b1de171 | 546 | mip->SetXTitle("x (cm)"); |
547 | mip->SetYTitle("y (cm)"); | |
d2269328 | 548 | mip->Draw(); |
549 | ||
550 | c4->cd(3); | |
b73bd8af | 551 | //cerenkov->SetFillColor(5); |
6b1de171 | 552 | cerenkov->SetXTitle("x (cm)"); |
553 | cerenkov->SetYTitle("y (cm)"); | |
d2269328 | 554 | cerenkov->Draw(); |
555 | ||
556 | c4->cd(4); | |
b73bd8af | 557 | //h->SetFillColor(5); |
d2269328 | 558 | h->SetXTitle("x (cm)"); |
559 | h->SetYTitle("y (cm)"); | |
560 | h->Draw(); | |
561 | ||
6b1de171 | 562 | TCanvas *c10 = new TCanvas("c10","Hits distribution",150,150,600,350); |
d2269328 | 563 | c10->Divide(2,1); |
b73bd8af | 564 | //c10->SetFillColor(42); |
d2269328 | 565 | |
566 | c10->cd(1); | |
b73bd8af | 567 | hitsX->SetFillColor(5); |
5bd23319 | 568 | hitsX->SetXTitle("(cm)"); |
d2269328 | 569 | hitsX->Draw(); |
570 | ||
571 | c10->cd(2); | |
b73bd8af | 572 | hitsY->SetFillColor(5); |
5bd23319 | 573 | hitsY->SetXTitle("(cm)"); |
d2269328 | 574 | hitsY->Draw(); |
575 | ||
576 | ||
577 | break; | |
578 | // | |
579 | case 2: | |
580 | ||
6b1de171 | 581 | TCanvas *c6 = new TCanvas("c6","Photon Spectra",50,50,600,350); |
d2269328 | 582 | c6->Divide(2,1); |
b73bd8af | 583 | //c6->SetFillColor(42); |
d2269328 | 584 | |
585 | c6->cd(1); | |
b73bd8af | 586 | phspectra2->SetFillColor(5); |
d2269328 | 587 | phspectra2->SetXTitle("energy (eV)"); |
588 | phspectra2->Draw(); | |
589 | c6->cd(2); | |
b73bd8af | 590 | phspectra1->SetFillColor(5); |
d2269328 | 591 | phspectra1->SetXTitle("energy (eV)"); |
592 | phspectra1->Draw(); | |
593 | ||
6b1de171 | 594 | TCanvas *c9 = new TCanvas("c9","Particles Spectra",100,100,600,700); |
d2269328 | 595 | c9->Divide(2,2); |
b73bd8af | 596 | //c9->SetFillColor(42); |
d2269328 | 597 | |
598 | c9->cd(1); | |
b73bd8af | 599 | pionspectra->SetFillColor(5); |
d2269328 | 600 | pionspectra->SetXTitle("(GeV)"); |
601 | pionspectra->Draw(); | |
602 | ||
603 | c9->cd(2); | |
b73bd8af | 604 | protonspectra->SetFillColor(5); |
d2269328 | 605 | protonspectra->SetXTitle("(GeV)"); |
606 | protonspectra->Draw(); | |
607 | ||
608 | c9->cd(3); | |
b73bd8af | 609 | kaonspectra->SetFillColor(5); |
d2269328 | 610 | kaonspectra->SetXTitle("(GeV)"); |
611 | kaonspectra->Draw(); | |
612 | ||
613 | c9->cd(4); | |
b73bd8af | 614 | chargedspectra->SetFillColor(5); |
d2269328 | 615 | chargedspectra->SetXTitle("(GeV)"); |
616 | chargedspectra->Draw(); | |
ddae0931 | 617 | |
d2269328 | 618 | break; |
619 | ||
620 | case 3: | |
621 | ||
622 | if (nrawclusters) { | |
6b1de171 | 623 | TCanvas *c3=new TCanvas("c3","Clusters Statistics",50,50,600,700); |
d2269328 | 624 | c3->Divide(2,2); |
b73bd8af | 625 | //c3->SetFillColor(42); |
d2269328 | 626 | |
627 | c3->cd(1); | |
be7c94f7 | 628 | c3_1->SetLogy(); |
b73bd8af | 629 | Clcharge->SetFillColor(5); |
be7c94f7 | 630 | Clcharge->SetXTitle("ADC counts"); |
7da9cdef | 631 | if (evNumber2>10) |
632 | { | |
633 | Clcharge->Fit("expo"); | |
634 | expo->SetLineColor(2); | |
635 | expo->SetLineWidth(3); | |
636 | } | |
d2269328 | 637 | Clcharge->Draw(); |
638 | ||
639 | c3->cd(2); | |
b73bd8af | 640 | padnumber->SetFillColor(5); |
d2269328 | 641 | padnumber->SetXTitle("(counts)"); |
642 | padnumber->Draw(); | |
643 | ||
644 | c3->cd(3); | |
b73bd8af | 645 | clusev->SetFillColor(5); |
d2269328 | 646 | clusev->SetXTitle("(counts)"); |
7da9cdef | 647 | if (evNumber2>10) |
648 | { | |
649 | clusev->Fit("gaus"); | |
650 | gaus->SetLineColor(2); | |
651 | gaus->SetLineWidth(3); | |
652 | } | |
d2269328 | 653 | clusev->Draw(); |
ddae0931 | 654 | |
d2269328 | 655 | c3->cd(4); |
b73bd8af | 656 | padsmip->SetFillColor(5); |
d2269328 | 657 | padsmip->SetXTitle("(counts)"); |
658 | padsmip->Draw(); | |
659 | } | |
be7c94f7 | 660 | |
d2269328 | 661 | if (nev<1) |
662 | { | |
663 | TCanvas *c11 = new TCanvas("c11","Cherenkov per Mip",400,10,600,700); | |
b73bd8af | 664 | mother->SetFillColor(5); |
d2269328 | 665 | mother->SetXTitle("counts"); |
666 | mother->Draw(); | |
667 | } | |
6b1de171 | 668 | |
669 | TCanvas *c7 = new TCanvas("c7","Production Statistics",100,100,600,700); | |
670 | c7->Divide(2,2); | |
b73bd8af | 671 | //c7->SetFillColor(42); |
6b1de171 | 672 | |
673 | c7->cd(1); | |
b73bd8af | 674 | totalphotonsevent->SetFillColor(5); |
6b1de171 | 675 | totalphotonsevent->SetXTitle("Photons (counts)"); |
7da9cdef | 676 | if (evNumber2>10) |
677 | { | |
678 | totalphotonsevent->Fit("gaus"); | |
679 | gaus->SetLineColor(2); | |
680 | gaus->SetLineWidth(3); | |
681 | } | |
6b1de171 | 682 | totalphotonsevent->Draw(); |
d2269328 | 683 | |
6b1de171 | 684 | c7->cd(2); |
b73bd8af | 685 | photev->SetFillColor(5); |
6b1de171 | 686 | photev->SetXTitle("(counts)"); |
7da9cdef | 687 | if (evNumber2>10) |
688 | { | |
689 | photev->Fit("gaus"); | |
690 | gaus->SetLineColor(2); | |
691 | gaus->SetLineWidth(3); | |
692 | } | |
6b1de171 | 693 | photev->Draw(); |
694 | ||
695 | c7->cd(3); | |
b73bd8af | 696 | feedev->SetFillColor(5); |
6b1de171 | 697 | feedev->SetXTitle("(counts)"); |
7da9cdef | 698 | if (evNumber2>10) |
699 | { | |
700 | feedev->Fit("gaus"); | |
701 | gaus->SetLineColor(2); | |
702 | gaus->SetLineWidth(3); | |
703 | } | |
6b1de171 | 704 | feedev->Draw(); |
705 | ||
706 | c7->cd(4); | |
b73bd8af | 707 | padsev->SetFillColor(5); |
6b1de171 | 708 | padsev->SetXTitle("(counts)"); |
7da9cdef | 709 | if (evNumber2>10) |
710 | { | |
711 | padsev->Fit("gaus"); | |
712 | gaus->SetLineColor(2); | |
713 | gaus->SetLineWidth(3); | |
714 | } | |
6b1de171 | 715 | padsev->Draw(); |
716 | ||
717 | break; | |
718 | ||
719 | case 4: | |
720 | ||
721 | TCanvas *c2 = new TCanvas("c2","Angles of incidence",50,50,600,700); | |
d2269328 | 722 | c2->Divide(2,2); |
b73bd8af | 723 | //c2->SetFillColor(42); |
d2269328 | 724 | |
725 | c2->cd(1); | |
b73bd8af | 726 | hitsPhi->SetFillColor(5); |
d2269328 | 727 | hitsPhi->Draw(); |
728 | c2->cd(2); | |
b73bd8af | 729 | hitsTheta->SetFillColor(5); |
d2269328 | 730 | hitsTheta->Draw(); |
731 | c2->cd(3); | |
b73bd8af | 732 | Phi->SetFillColor(5); |
d2269328 | 733 | Phi->Draw(); |
734 | c2->cd(4); | |
b73bd8af | 735 | Theta->SetFillColor(5); |
d2269328 | 736 | Theta->Draw(); |
737 | ||
738 | ||
6b1de171 | 739 | TCanvas *c5 = new TCanvas("c5","Ring Reconstruction",100,100,900,700); |
b3462c7e | 740 | c5->Divide(3,3); |
b73bd8af | 741 | //c5->SetFillColor(42); |
d2269328 | 742 | |
743 | c5->cd(1); | |
b73bd8af | 744 | ckovangle->SetFillColor(5); |
d2269328 | 745 | ckovangle->SetXTitle("angle (radians)"); |
746 | ckovangle->Draw(); | |
747 | ||
748 | c5->cd(2); | |
b73bd8af | 749 | radius->SetFillColor(5); |
d2269328 | 750 | radius->SetXTitle("radius (cm)"); |
751 | radius->Draw(); | |
6b1de171 | 752 | |
d2269328 | 753 | c5->cd(3); |
6b1de171 | 754 | hc0->SetXTitle("pads"); |
755 | hc0->Draw("box"); | |
756 | ||
757 | c5->cd(5); | |
b73bd8af | 758 | Omega1D->SetFillColor(5); |
b3462c7e | 759 | Omega1D->SetXTitle("angle (radians)"); |
760 | Omega1D->Draw(); | |
d2269328 | 761 | |
6b1de171 | 762 | c5->cd(4); |
b73bd8af | 763 | PhotonCer->SetFillColor(5); |
6b1de171 | 764 | PhotonCer->SetXTitle("angle (radians)"); |
765 | PhotonCer->Draw(); | |
766 | ||
767 | c5->cd(6); | |
768 | PadsUsed->SetXTitle("pads"); | |
769 | PadsUsed->Draw("box"); | |
d2269328 | 770 | |
b3462c7e | 771 | c5->cd(7); |
b73bd8af | 772 | Omega3D->SetFillColor(5); |
b3462c7e | 773 | Omega3D->SetXTitle("angle (radians)"); |
774 | Omega3D->Draw(); | |
775 | ||
6b1de171 | 776 | break; |
777 | ||
778 | case 5: | |
d2269328 | 779 | |
be7c94f7 | 780 | printf("Drawing histograms.../n"); |
781 | ||
52c3c553 | 782 | //if (ndigits) |
783 | //{ | |
b73bd8af | 784 | TCanvas *c1 = new TCanvas("c1","Alice RICH digits",50,50,1200,700); |
785 | c1->Divide(4,2); | |
786 | //c1->SetFillColor(42); | |
787 | ||
788 | c1->cd(1); | |
789 | hc1->SetXTitle("ix (npads)"); | |
790 | hc1->Draw("box"); | |
791 | c1->cd(2); | |
792 | hc2->SetXTitle("ix (npads)"); | |
793 | hc2->Draw("box"); | |
794 | c1->cd(3); | |
795 | hc3->SetXTitle("ix (npads)"); | |
796 | hc3->Draw("box"); | |
797 | c1->cd(4); | |
798 | hc4->SetXTitle("ix (npads)"); | |
799 | hc4->Draw("box"); | |
800 | c1->cd(5); | |
801 | hc5->SetXTitle("ix (npads)"); | |
802 | hc5->Draw("box"); | |
803 | c1->cd(6); | |
804 | hc6->SetXTitle("ix (npads)"); | |
805 | hc6->Draw("box"); | |
806 | c1->cd(7); | |
807 | hc7->SetXTitle("ix (npads)"); | |
808 | hc7->Draw("box"); | |
809 | c1->cd(8); | |
810 | hc0->SetXTitle("ix (npads)"); | |
811 | hc0->Draw("box"); | |
52c3c553 | 812 | //} |
6b1de171 | 813 | // |
814 | TCanvas *c4 = new TCanvas("c4","Hits per type",100,100,600,700); | |
815 | c4->Divide(2,2); | |
b73bd8af | 816 | //c4->SetFillColor(42); |
d2269328 | 817 | |
6b1de171 | 818 | c4->cd(1); |
819 | feedback->SetXTitle("x (cm)"); | |
820 | feedback->SetYTitle("y (cm)"); | |
821 | feedback->Draw(); | |
822 | ||
823 | c4->cd(2); | |
b73bd8af | 824 | //mip->SetFillColor(5); |
6b1de171 | 825 | mip->SetXTitle("x (cm)"); |
826 | mip->SetYTitle("y (cm)"); | |
827 | mip->Draw(); | |
828 | ||
829 | c4->cd(3); | |
b73bd8af | 830 | //cerenkov->SetFillColor(5); |
6b1de171 | 831 | cerenkov->SetXTitle("x (cm)"); |
832 | cerenkov->SetYTitle("y (cm)"); | |
833 | cerenkov->Draw(); | |
834 | ||
835 | c4->cd(4); | |
b73bd8af | 836 | //h->SetFillColor(5); |
6b1de171 | 837 | h->SetXTitle("x (cm)"); |
838 | h->SetYTitle("y (cm)"); | |
839 | h->Draw(); | |
d2269328 | 840 | |
6b1de171 | 841 | TCanvas *c10 = new TCanvas("c10","Hits distribution",150,150,600,350); |
842 | c10->Divide(2,1); | |
b73bd8af | 843 | //c10->SetFillColor(42); |
6b1de171 | 844 | |
845 | c10->cd(1); | |
b73bd8af | 846 | hitsX->SetFillColor(5); |
6b1de171 | 847 | hitsX->SetXTitle("(cm)"); |
848 | hitsX->Draw(); | |
849 | ||
850 | c10->cd(2); | |
b73bd8af | 851 | hitsY->SetFillColor(5); |
6b1de171 | 852 | hitsY->SetXTitle("(cm)"); |
853 | hitsY->Draw(); | |
854 | ||
d2269328 | 855 | break; |
856 | ||
857 | } | |
858 | ||
859 | ||
860 | // calculate the number of pads which give a signal | |
861 | ||
862 | ||
863 | Int_t Np=0; | |
c128dc06 | 864 | //for (Int_t i=0;i< NpadX;i++) { |
865 | //for (Int_t j=0;j< NpadY;j++) { | |
866 | //if (Pad[i][j]>=6){ | |
867 | //Np+=1; | |
868 | //} | |
869 | //} | |
870 | //} | |
d2269328 | 871 | //printf("The total number of pads which give a signal: %d %d\n",Nh,Nh1); |
185048a3 | 872 | printf("\nEnd of macro\n"); |
c128dc06 | 873 | printf("**********************************\n");*/ |
ddae0931 | 874 | } |
d2269328 | 875 | |
876 |