1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ////////////////////////////////////////////////
19 // Manager and hits classes for set:RICH //
20 ////////////////////////////////////////////////
22 #include <Riostream.h>
30 #include <TGeometry.h>
34 #include <TObjArray.h>
36 #include <TParticle.h>
45 #include "AliPoints.h"
47 #include "AliRICHClusterFinder.h"
48 #include "AliRICHDigit.h"
49 #include "AliRICHDigitizer.h"
50 #include "AliRICHHitMapA1.h"
51 #include "AliRICHMerger.h"
52 #include "AliRICHRawCluster.h"
53 #include "AliRICHRecHit1D.h"
54 #include "AliRICHRecHit3D.h"
55 #include "AliRICHSDigit.h"
56 #include "AliRICHSegmentationV0.h"
57 #include "AliRICHTransientDigit.h"
59 #include "AliRunDigitizer.h"
60 #include "AliSegmentation.h"
61 #include "AliRICHParam.h"
63 static Int_t sMaxIterPad=0; // Static variables for the pad-hit iterator routines
64 static Int_t sCurIterPad=0;
67 ClassImp(AliRICHdigit)
70 //___________________________________________
74 <img src="gif/alirich.gif">
79 {//Default ctor should not contain any new operators
91 for (Int_t i=0; i<kNCH; i++){
100 }//AliRICH::AliRICH()
101 //______________________________________________________________________________
102 AliRICH::AliRICH(const char *name, const char *title)
103 :AliDetector(name,title)
105 if(GetDebug())Info("named ctor","Start.");
106 fpParam =new AliRICHParam;
107 fHits =new TClonesArray("AliRICHhit",1000 );
108 fCerenkovs =new TClonesArray("AliRICHCerenkov",1000);
109 fSDigits =new TClonesArray("AliRICHdigit",100000);
110 gAlice->AddHitList(fHits);
111 gAlice->AddHitList(fCerenkovs);
115 fDchambers =new TObjArray(kNCH);
116 fRawClusters=new TObjArray(kNCH);
117 fRecHits1D =new TObjArray(kNCH);
118 fRecHits3D =new TObjArray(kNCH);
119 for(int i=0;i<kNCH;i++) {
120 fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
121 fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
122 fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
123 fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
127 SetMarkerColor(kRed);
128 fCkovNumber=fFreonProd=0;
131 if(GetDebug())Info("named ctor","Stop.");
132 }//AliRICH::AliRICH(const char *name, const char *title)
133 //______________________________________________________________________________
136 if(GetDebug()) Info("dtor","Start.");
143 //PH Delete TObjArrays
149 fDchambers->Delete();
153 fRawClusters->Delete();
157 fRecHits1D->Delete();
161 fRecHits3D->Delete();
164 if(GetDebug()) Info("dtor","Stop.");
165 }//AliRICH::~AliRICH()
166 //______________________________________________________________________________
167 Int_t AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
168 {//calls the charge disintegration method of the current chamber and adds all generated sdigits to the list of digits
170 Int_t iChamber,iPadX,iPadY,iAdc,iTrack;
171 Float_t list[4][500];
175 ((AliRICHChamber*)fChambers->At(idvol))->DisIntegration(eloss, xhit, yhit, iNdigits, list, res);
178 for(Int_t i=0; i<iNdigits; i++) {
179 if(Int_t(list[0][i]) > 0) {
181 iAdc = Int_t(list[0][i]);
182 iPadX = Int_t(list[1][i]);
183 iPadY = Int_t(list[2][i]);
184 iChamber = Int_t(list[3][i]);
187 AddSDigit(iChamber,iPadX,iPadY,iAdc,iTrack);
192 gAlice->TreeS()->Fill();
193 gAlice->TreeS()->Write(0,TObject::kOverwrite);
196 }//Int_t AliRICH::Hits2SDigits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, ResponseType res)
197 //______________________________________________________________________________
198 void AliRICH::Hits2SDigits()
199 {//Create a list of sdigits corresponding to list of hits. Every hit generates sdigit.
200 if(GetDebug()) Info("Hit2SDigits","Start.");
202 for(Int_t iEventN=0;iEventN<gAlice->GetEventsPerRun();iEventN++){//loop on events
203 fLoader->GetRunLoader()->GetEvent(iEventN);
205 if(!fLoader->TreeH()) fLoader->LoadHits();
206 if(!fLoader->TreeS()) fLoader->MakeTree("S");
209 for(int iPrimN=0;iPrimN<TreeH()->GetEntries();iPrimN++){//loop on primary tracks
210 fLoader->TreeH()->GetEntry(iPrimN);
211 for(Int_t iHitN=0;iHitN<Hits()->GetEntries();iHitN++){//loop on hits for given primary track
212 AddSDigit(4,13,24,55,4);//chamber-xpad-ypad-qdc-track1-2-3
213 }//loop on hits for given primary track
214 }//loop on primary tracks
216 fLoader->TreeS()->Fill();
217 fLoader->WriteSDigits("OVERWRITE");
220 if(GetDebug()) Info("Hit2SDigits","Stop.");
222 //______________________________________________________________________________
223 void AliRICH::SDigits2Digits()
224 {//Generate digits from sdigits.
225 if(GetDebug()) Info("SDigits2Digits","Start.");
226 //AliRICHChamber* iChamber;
229 //for(Int_t i=0;i<7;i++) {
230 //iChamber = &(Chamber(i));
231 //iChamber->GenerateTresholds();
234 //int nparticles = gAlice->GetNtrack();
235 //cout << "Particles (RICH):" <<nparticles<<endl;
236 //if (nparticles <= 0) return;
238 //fMerger = new AliRICHMerger();
243 //fMerger->Digitise(nev,flag);
245 AliRunDigitizer * manager = new AliRunDigitizer(1,1);
246 manager->SetInputStream(0,"galice.root");
247 //AliRICHDigitizer *dRICH = new AliRICHDigitizer(manager);
248 manager->Exec("deb");
249 if(GetDebug()) Info("SDigits2Digits","Stop.");
250 }//void AliRICH::SDigits2Digits()
251 //______________________________________________________________________________
252 void AliRICH::Digits2Reco()
255 // Called from alirun, single event only.
256 if(GetDebug()) Info("Digits2Reco","Start.");
258 int nparticles = gAlice->GetNtrack();
259 cout << "Particles (RICH):" <<nparticles<<endl;
260 if (nparticles > 0) FindClusters(0);
262 }//void AliRICH::Digits2Reco()
265 void AliRICH::AddDigits(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
266 {// Add a RICH digit to the list
268 TClonesArray &ldigits = *((TClonesArray*)fDchambers->At(id));
269 new(ldigits[fNdch[id]++]) AliRICHDigit(tracks,charges,digits);
272 void AliRICH::AddRawCluster(Int_t id, const AliRICHRawCluster& c)
273 {// Add a RICH digit to the list
275 TClonesArray &lrawcl = *((TClonesArray*)fRawClusters->At(id));
276 new(lrawcl[fNrawch[id]++]) AliRICHRawCluster(c);
278 //_____________________________________________________________________________
279 void AliRICH::AddRecHit1D(Int_t id, Float_t *rechit, Float_t *photons, Int_t *padsx, Int_t* padsy)
280 {// Add a RICH reconstructed hit to the list
282 TClonesArray &lrec1D = *((TClonesArray*)fRecHits1D->At(id));
283 new(lrec1D[fNrechits1D[id]++]) AliRICHRecHit1D(id,rechit,photons,padsx,padsy);
285 //_____________________________________________________________________________
286 void AliRICH::AddRecHit3D(Int_t id, Float_t *rechit, Float_t omega, Float_t theta, Float_t phi)
287 {// Add a RICH reconstructed hit to the list
289 TClonesArray &lrec3D = *((TClonesArray*)fRecHits3D->At(id));
290 new(lrec3D[fNrechits3D[id]++]) AliRICHRecHit3D(id,rechit,omega,theta,phi);
292 //______________________________________________________________________________
293 void AliRICH::BuildGeometry()
294 {//Builds a TNode geometry for event display
295 if(GetDebug())Info("BuildGeometry","Start.");
297 TNode *node, *subnode, *top;
298 top=gAlice->GetGeometry()->GetNode("alice");
300 new TBRIK("S_RICH","S_RICH","void",71.09999,11.5,73.15);
302 Float_t wid=fpParam->PadPlaneWidth();
303 Float_t len=fpParam->PadPlaneLength();
304 new TBRIK("PHOTO","PHOTO","void",wid/2,0.1,len/2);
306 for(int i=0;i<kNCH;i++){
308 node = new TNode(Form("RICH%i",i+1),Form("RICH%i",i+1),"S_RICH",C(i)->X(),C(i)->Y(),C(i)->Z(),C(i)->RotMatrixName());
309 node->SetLineColor(kRed);
311 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",wid+fpParam->DeadZone(),5,len/2+fpParam->DeadZone()/2,"");
312 subnode->SetLineColor(kGreen);
313 fNodes->Add(subnode);
314 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,len/2+fpParam->DeadZone()/2,"");
315 subnode->SetLineColor(kGreen);
316 fNodes->Add(subnode);
317 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-wid-fpParam->DeadZone(),5,len/2+fpParam->DeadZone()/2,"");
318 subnode->SetLineColor(kGreen);
319 fNodes->Add(subnode);
320 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",wid+fpParam->DeadZone(),5,-len/2-fpParam->DeadZone()/2,"");
321 subnode->SetLineColor(kGreen);
322 fNodes->Add(subnode);
323 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",0,5,-len/2 -fpParam->DeadZone()/2,"");
324 subnode->SetLineColor(kGreen);
325 fNodes->Add(subnode);
326 subnode = new TNode("PHOTO1","PHOTO1","PHOTO",-wid-fpParam->DeadZone(),5,-len/2 - fpParam->DeadZone()/2,"");
327 subnode->SetLineColor(kGreen);
328 fNodes->Add(subnode);
331 if(GetDebug())Info("BuildGeometry","Stop.");
332 }//void AliRICH::BuildGeometry()
333 //______________________________________________________________________________
334 void AliRICH::CreateMaterials()
337 // *** DEFINITION OF AVAILABLE RICH MATERIALS ***
338 // ORIGIN : NICK VAN EIJNDHOVEN
339 // Modified by: N. Colonna (INFN - BARI, Nicola.Colonna@ba.infn.it)
340 // R.A. Fini (INFN - BARI, Rosanna.Fini@ba.infn.it)
341 // R.A. Loconsole (Bari University, loco@riscom.ba.infn.it)
343 Int_t isxfld = gAlice->Field()->Integ();
344 Float_t sxmgmx = gAlice->Field()->Max();
347 /************************************Antonnelo's Values (14-vectors)*****************************************/
349 Float_t ppckov[14] = { 5.63e-9,5.77e-9,5.9e-9,6.05e-9,6.2e-9,6.36e-9,6.52e-9,
350 6.7e-9,6.88e-9,7.08e-9,7.3e-9,7.51e-9,7.74e-9,8e-9 };
351 Float_t rIndexQuarz[14] = { 1.528309,1.533333,
352 1.538243,1.544223,1.550568,1.55777,
353 1.565463,1.574765,1.584831,1.597027,
354 1.611858,1.6277,1.6472,1.6724 };
355 Float_t rIndexOpaqueQuarz[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
356 Float_t rIndexMethane[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
357 Float_t rIndexGrid[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
358 Float_t abscoFreon[14] = { 179.0987,179.0987,
359 179.0987,179.0987,179.0987,142.92,56.65,13.95,10.43,7.07,2.03,.5773,.33496,0. };
360 //Float_t abscoFreon[14] = { 1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,
361 // 1e-5,1e-5,1e-5,1e-5,1e-5 };
362 Float_t abscoQuarz[14] = { 64.035,39.98,35.665,31.262,27.527,22.815,21.04,17.52,
363 14.177,9.282,4.0925,1.149,.3627,.10857 };
364 Float_t abscoOpaqueQuarz[14] = { 1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,
365 1e-5,1e-5,1e-5,1e-5,1e-5 };
366 Float_t abscoCsI[14] = { 1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,
367 1e-4,1e-4,1e-4,1e-4 };
368 Float_t abscoMethane[14] = { 1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,
370 Float_t abscoGrid[14] = { 1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,
371 1e-4,1e-4,1e-4,1e-4 };
372 Float_t efficAll[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
373 Float_t efficCsI[14] = { 6e-4,.005,.0075,.01125,.045,.117,.135,.16575,
374 .17425,.1785,.1836,.1904,.1938,.221 };
375 Float_t efficGrid[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
379 /**********************************End of Antonnelo's Values**********************************/
381 /**********************************Values from rich_media.f (31-vectors)**********************************/
384 //Photons energy intervals
388 ppckov[i] = (Float_t(i)*0.1+5.5)*1e-9;
392 //Refraction index for quarz
393 Float_t rIndexQuarz[26];
400 Float_t ene=ppckov[i]*1e9;
401 Float_t a=f1/(e1*e1 - ene*ene);
402 Float_t b=f2/(e2*e2 - ene*ene);
403 rIndexQuarz[i] = TMath::Sqrt(1. + a + b );
406 //Refraction index for opaque quarz, methane and grid
407 Float_t rIndexOpaqueQuarz[26];
408 Float_t rIndexMethane[26];
409 Float_t rIndexGrid[26];
412 rIndexOpaqueQuarz[i]=1;
413 rIndexMethane[i]=1.000444;
417 //Absorption index for freon
418 Float_t abscoFreon[26] = {179.0987, 179.0987, 179.0987, 179.0987, 179.0987, 179.0987, 179.0987, 179.0987,
419 179.0987, 142.9206, 56.64957, 25.58622, 13.95293, 12.03905, 10.42953, 8.804196,
420 7.069031, 4.461292, 2.028366, 1.293013, .577267, .40746, .334964, 0., 0., 0.};
422 //Absorption index for quarz
423 /*Float_t Qzt [21] = {.0,.0,.005,.04,.35,.647,.769,.808,.829,.844,.853,.858,.869,.887,.903,.902,.902,
424 .906,.907,.907,.907};
425 Float_t Wavl2[] = {150.,155.,160.0,165.0,170.0,175.0,180.0,185.0,190.0,195.0,200.0,205.0,210.0,
426 215.0,220.0,225.0,230.0,235.0,240.0,245.0,250.0};
427 Float_t abscoQuarz[31];
428 for (Int_t i=0;i<31;i++)
430 Float_t Xlam = 1237.79 / (ppckov[i]*1e9);
431 if (Xlam <= 160) abscoQuarz[i] = 0;
432 if (Xlam > 250) abscoQuarz[i] = 1;
435 for (Int_t j=0;j<21;j++)
437 if (Xlam > Wavl2[j] && Xlam < Wavl2[j+1])
439 Float_t Dabs = (Qzt[j+1] - Qzt[j])/(Wavl2[j+1] - Wavl2[j]);
440 Float_t Abso = Qzt[j] + Dabs*(Xlam - Wavl2[j]);
441 abscoQuarz[i] = -5.0/(TMath::Log(Abso));
447 /*Float_t abscoQuarz[31] = {49.64211, 48.41296, 47.46989, 46.50492, 45.13682, 44.47883, 43.1929 , 41.30922, 40.5943 ,
448 39.82956, 38.98623, 38.6247 , 38.43448, 37.41084, 36.22575, 33.74852, 30.73901, 24.25086,
449 17.94531, 11.88753, 5.99128, 3.83503, 2.36661, 1.53155, 1.30582, 1.08574, .8779708,
450 .675275, 0., 0., 0.};
452 for (Int_t i=0;i<31;i++)
454 abscoQuarz[i] = abscoQuarz[i]/10;
457 Float_t abscoQuarz [26] = {105.8, 65.52, 48.58, 42.85, 35.79, 31.262, 28.598, 27.527, 25.007, 22.815, 21.004,
458 19.266, 17.525, 15.878, 14.177, 11.719, 9.282, 6.62, 4.0925, 2.601, 1.149, .667, .3627,
459 .192, .1497, .10857};
461 //Absorption index for methane
462 Float_t abscoMethane[26];
465 abscoMethane[i]=AbsoCH4(ppckov[i]*1e9);
468 //Absorption index for opaque quarz, csi and grid, efficiency for all and grid
469 Float_t abscoOpaqueQuarz[26];
470 Float_t abscoCsI[26];
471 Float_t abscoGrid[26];
472 Float_t efficAll[26];
473 Float_t efficGrid[26];
476 abscoOpaqueQuarz[i]=1e-5;
485 Float_t efficCsI[26] = {0.000199999995, 0.000600000028, 0.000699999975, 0.00499999989, 0.00749999983, 0.010125,
486 0.0242999997, 0.0405000001, 0.0688500032, 0.105299994, 0.121500008, 0.141749993, 0.157949999,
487 0.162, 0.166050002, 0.167669997, 0.174299985, 0.176789999, 0.179279998, 0.182599992, 0.18592,
488 0.187579989, 0.189239994, 0.190899998, 0.207499996, 0.215799987};
492 //FRESNEL LOSS CORRECTION FOR PERPENDICULAR INCIDENCE AND
493 //UNPOLARIZED PHOTONS
497 efficCsI[i] = efficCsI[i]/(1.-Fresnel(ppckov[i]*1e9,1.,0));
500 /*******************************************End of rich_media.f***************************************/
507 Float_t afre[2], agri, amet[2], aqua[2], ahon, zfre[2], zgri, zhon,
511 Int_t nlmatmet, nlmatqua;
512 Float_t wmatquao[2], rIndexFreon[26];
513 Float_t aquao[2], epsil, stmin, zquao[2];
515 Float_t radlal, densal, tmaxfd, deemax, stemax;
516 Float_t aal, zal, radlgri, densfre, radlhon, densgri, denshon,densqua, densmet, wmatfre[2], wmatmet[2], wmatqua[2];
518 Int_t *idtmed = fIdtmed->GetArray()-999;
520 // --- Photon energy (GeV)
521 // --- Refraction indexes
522 for (i = 0; i < 26; ++i) {
523 rIndexFreon[i] = ppckov[i] * .0172 * 1e9 + 1.177;
524 //rIndexFreon[i] = 1;
527 // --- Detection efficiencies (quantum efficiency for CsI)
528 // --- Define parameters for honeycomb.
529 // Used carbon of equivalent rad. lenght
536 // --- Parameters to include in GSMIXT, relative to Quarz (SiO2)
547 // --- Parameters to include in GSMIXT, relative to opaque Quarz (SiO2)
558 // --- Parameters to include in GSMIXT, relative to Freon (C6F14)
569 // --- Parameters to include in GSMIXT, relative to methane (CH4)
580 // --- Parameters to include in GSMIXT, relative to anode grid (Cu)
587 // --- Parameters to include in GSMATE related to aluminium sheet
594 // --- Glass parameters
596 Float_t aglass[5]={12.01, 28.09, 16., 10.8, 23.};
597 Float_t zglass[5]={ 6., 14., 8., 5., 11.};
598 Float_t wglass[5]={ 0.5, 0.105, 0.355, 0.03, 0.01};
602 AliMaterial(1, "Air $", 14.61, 7.3, .001205, 30420., 67500);
603 AliMaterial(6, "HON", ahon, zhon, denshon, radlhon, 0);
604 AliMaterial(16, "CSI", ahon, zhon, denshon, radlhon, 0);
605 AliMixture(20, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
606 AliMixture(21, "QUAO", aquao, zquao, densquao, nlmatquao, wmatquao);
607 AliMixture(30, "FRE", afre, zfre, densfre, nlmatfre, wmatfre);
608 AliMixture(40, "MET", amet, zmet, densmet, nlmatmet, wmatmet);
609 AliMixture(41, "METG", amet, zmet, densmet, nlmatmet, wmatmet);
610 AliMaterial(11, "GRI", agri, zgri, densgri, radlgri, 0);
611 AliMaterial(50, "ALUM", aal, zal, densal, radlal, 0);
612 AliMixture(32, "GLASS",aglass, zglass, dglass, 5, wglass);
613 AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
621 AliMedium(1, "DEFAULT MEDIUM AIR$", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
622 AliMedium(2, "HONEYCOMB$", 6, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
623 AliMedium(3, "QUARZO$", 20, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
624 AliMedium(4, "FREON$", 30, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
625 AliMedium(5, "METANO$", 40, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
626 AliMedium(6, "CSI$", 16, 1, isxfld, sxmgmx,tmaxfd, stemax, deemax, epsil, stmin);
627 AliMedium(7, "GRIGLIA$", 11, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
628 AliMedium(8, "QUARZOO$", 21, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
629 AliMedium(9, "GAP$", 41, 1, isxfld, sxmgmx,tmaxfd, .1, -deemax, epsil, -stmin);
630 AliMedium(10, "ALUMINUM$", 50, 1, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
631 AliMedium(11, "GLASS", 32, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
632 AliMedium(12, "PCB_COPPER", 31, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
635 gMC->SetCerenkov(idtmed[1000], 26, ppckov, abscoMethane, efficAll, rIndexMethane);
636 gMC->SetCerenkov(idtmed[1001], 26, ppckov, abscoMethane, efficAll, rIndexMethane);
637 gMC->SetCerenkov(idtmed[1002], 26, ppckov, abscoQuarz, efficAll,rIndexQuarz);
638 gMC->SetCerenkov(idtmed[1003], 26, ppckov, abscoFreon, efficAll,rIndexFreon);
639 gMC->SetCerenkov(idtmed[1004], 26, ppckov, abscoMethane, efficAll, rIndexMethane);
640 gMC->SetCerenkov(idtmed[1005], 26, ppckov, abscoCsI, efficCsI, rIndexMethane);
641 gMC->SetCerenkov(idtmed[1006], 26, ppckov, abscoGrid, efficGrid, rIndexGrid);
642 gMC->SetCerenkov(idtmed[1007], 26, ppckov, abscoOpaqueQuarz, efficAll, rIndexOpaqueQuarz);
643 gMC->SetCerenkov(idtmed[1008], 26, ppckov, abscoMethane, efficAll, rIndexMethane);
644 gMC->SetCerenkov(idtmed[1009], 26, ppckov, abscoGrid, efficGrid, rIndexGrid);
645 gMC->SetCerenkov(idtmed[1010], 26, ppckov, abscoOpaqueQuarz, efficAll, rIndexOpaqueQuarz);
647 //______________________________________________________________________________
648 Float_t AliRICH::Fresnel(Float_t ene,Float_t pdoti, Bool_t pola)
651 //ENE(EV), PDOTI=COS(INC.ANG.), PDOTR=COS(POL.PLANE ROT.ANG.)
653 Float_t en[36] = {5.0,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.0,6.1,6.2,
654 6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.0,7.1,7.2,7.3,7.4,7.5,7.6,7.7,
655 7.8,7.9,8.0,8.1,8.2,8.3,8.4,8.5};
658 Float_t csin[36] = {2.14,2.21,2.33,2.48,2.76,2.97,2.99,2.59,2.81,3.05,
659 2.86,2.53,2.55,2.66,2.79,2.96,3.18,3.05,2.84,2.81,2.38,2.11,
660 2.01,2.13,2.39,2.73,3.08,3.15,2.95,2.73,2.56,2.41,2.12,1.95,
663 Float_t csik[36] = {0.,0.,0.,0.,0.,0.196,0.408,0.208,0.118,0.49,0.784,0.543,
664 0.424,0.404,0.371,0.514,0.922,1.102,1.139,1.376,1.461,1.253,0.878,
665 0.69,0.612,0.649,0.824,1.347,1.571,1.678,1.763,1.857,1.824,1.824,
668 Int_t j=Int_t(xe*10)-49;
669 Float_t cn=csin[j]+((csin[j+1]-csin[j])/0.1)*(xe-en[j]);
670 Float_t ck=csik[j]+((csik[j+1]-csik[j])/0.1)*(xe-en[j]);
672 //FORMULAE FROM HANDBOOK OF OPTICS, 33.23 OR
673 //W.R. HUNTER, J.O.S.A. 54 (1964),15 , J.O.S.A. 55(1965),1197
675 Float_t sinin=TMath::Sqrt(1-pdoti*pdoti);
676 Float_t tanin=sinin/pdoti;
678 Float_t c1=cn*cn-ck*ck-sinin*sinin;
679 Float_t c2=4*cn*cn*ck*ck;
680 Float_t aO=TMath::Sqrt(0.5*(TMath::Sqrt(c1*c1+c2)+c1));
681 Float_t b2=0.5*(TMath::Sqrt(c1*c1+c2)-c1);
683 Float_t rs=((aO-pdoti)*(aO-pdoti)+b2)/((aO+pdoti)*(aO+pdoti)+b2);
684 Float_t rp=rs*((aO-sinin*tanin)*(aO-sinin*tanin)+b2)/((aO+sinin*tanin)*(aO+sinin*tanin)+b2);
687 //CORRECTION FACTOR FOR SURFACE ROUGHNESS
688 //B.J. STAGG APPLIED OPTICS, 30(1991),4113
691 Float_t lamb=1240/ene;
694 Float_t rO=TMath::Exp(-(4*TMath::Pi()*pdoti*sigraf/lamb)*(4*TMath::Pi()*pdoti*sigraf/lamb));
698 Float_t pdotr=0.8; //DEGREE OF POLARIZATION : 1->P , -1->S
699 fresn=0.5*(rp*(1+pdotr)+rs*(1-pdotr));
708 //__________________________________________
709 Float_t AliRICH::AbsoCH4(Float_t x)
712 //KLOSCH,SCH4(9),WL(9),EM(9),ALENGTH(31)
713 Float_t sch4[9] = {.12,.16,.23,.38,.86,2.8,7.9,28.,80.}; //MB X 10^22
714 //Float_t wl[9] = {153.,152.,151.,150.,149.,148.,147.,146.,145};
715 Float_t em[9] = {8.1,8.158,8.212,8.267,8.322,8.378,8.435,8.493,8.55};
716 const Float_t kLosch=2.686763E19; // LOSCHMIDT NUMBER IN CM-3
717 const Float_t kIgas1=100, kIgas2=0, kOxy=10., kWater=5., kPressure=750.,kTemperature=283.;
718 Float_t pn=kPressure/760.;
719 Float_t tn=kTemperature/273.16;
722 // ------- METHANE CROSS SECTION -----------------
723 // ASTROPH. J. 214, L47 (1978)
729 if(x>=7.75 && x<=8.1)
731 Float_t c0=-1.655279e-1;
732 Float_t c1=6.307392e-2;
733 Float_t c2=-8.011441e-3;
734 Float_t c3=3.392126e-4;
735 sm=(c0+c1*x+c2*x*x+c3*x*x*x)*1.e-18;
741 while (x<=em[j] && x>=em[j+1])
744 Float_t a=(sch4[j+1]-sch4[j])/(em[j+1]-em[j]);
745 sm=(sch4[j]+a*(x-em[j]))*1e-22;
749 Float_t dm=(kIgas1/100.)*(1.-((kOxy+kWater)/1.e6))*kLosch*pn/tn;
750 Float_t abslm=1./sm/dm;
752 // ------- ISOBUTHANE CROSS SECTION --------------
753 // i-C4H10 (ai) abs. length from curves in
754 // Lu-McDonald paper for BARI RICH workshop .
755 // -----------------------------------------------------------
764 if(x>=7.25 && x<7.375)
770 Float_t si = 1./(ai*kLosch*273.16/293.); // ISOB. CRO.SEC.IN CM2
771 Float_t di=(kIgas2/100.)*(1.-((kOxy+kWater)/1.e6))*kLosch*pn/tn;
776 // ---------------------------------------------------------
778 // transmission of O2
780 // y= path in cm, x=energy in eV
781 // so= cross section for UV absorption in cm2
782 // do= O2 molecular density in cm-3
783 // ---------------------------------------------------------
791 so=3.392709e-13 * TMath::Exp(2.864104 *x);
797 so=2.910039e-34 * TMath::Exp(10.3337*x);
804 Float_t a0=-73770.76;
806 Float_t a2=-11475.44;
808 Float_t a4=-86.07027;
810 so= a0+(a1*x)+(a2*x*x)+(a3*x*x*x)+(a4*x*x*x*x)+(a5*x*x*x*x*x);
814 Float_t dox=(kOxy/1e6)*kLosch*pn/tn;
819 // ---------------------------------------------------------
821 // transmission of H2O
823 // y= path in cm, x=energy in eV
824 // sw= cross section for UV absorption in cm2
825 // dw= H2O molecular density in cm-3
826 // ---------------------------------------------------------
831 Float_t b1=-15807.74;
833 Float_t b3=-285.4809;
838 Float_t sw= b0+(b1*x)+(b2*x*x)+(b3*x*x*x)+(b4*x*x*x*x);
840 Float_t dw=(kWater/1e6)*kLosch*pn/tn;
846 // ---------------------------------------------------------
848 Float_t alength=1./(1./abslm+1./absli+1./abslo+1./abslw);
854 //___________________________________________
855 //____________________________________________
856 void AliRICH::ResetDigits()
857 {//Reset number of digits and the digits array for this detector
858 for ( int i=0;i<kNCH;i++ ) {
859 if (fDchambers && fDchambers->At(i)) fDchambers->At(i)->Clear();
860 if (fNdch) fNdch[i]=0;
863 //____________________________________________
864 void AliRICH::ResetRawClusters()
865 {//Reset number of raw clusters and the raw clust array for this detector
866 for ( int i=0;i<kNCH;i++ ) {
867 if (fRawClusters->At(i)) ((TClonesArray*)fRawClusters->At(i))->Clear();
868 if (fNrawch) fNrawch[i]=0;
871 //____________________________________________
872 void AliRICH::ResetRecHits1D()
873 {//Reset number of raw clusters and the raw clust array for this detector
874 for ( int i=0;i<kNCH;i++ ) {
875 if (fRecHits1D->At(i)) ((TClonesArray*)fRecHits1D->At(i))->Clear();
876 if (fNrechits1D) fNrechits1D[i]=0;
880 //____________________________________________
881 void AliRICH::ResetRecHits3D()
882 {// Reset number of raw clusters and the raw clust array for this detector
883 for ( int i=0;i<kNCH;i++ ) {
884 if (fRecHits3D->At(i)) ((TClonesArray*)fRecHits3D->At(i))->Clear();
885 if (fNrechits3D) fNrechits3D[i]=0;
888 //______________________________________________________________________________
889 void AliRICH::FindClusters(Int_t nev /*kir,Int_t lastEntry*/)
890 {// Loop on chambers and on cathode planes
891 for (Int_t icat=1;icat<2;icat++) {
892 gAlice->ResetDigits();
893 gAlice->TreeD()->GetEvent(0);
894 for (Int_t ich=0;ich<kNCH;ich++) {
895 //PH AliRICHChamber* iChamber=(AliRICHChamber*) (*fChambers)[ich];
896 AliRICHChamber* iChamber=(AliRICHChamber*)fChambers->At(ich);
897 TClonesArray *pRICHdigits = this->DigitsAddress(ich);
898 if (pRICHdigits == 0)
901 // Get ready the current chamber stuff
903 AliRICHResponse* response = iChamber->GetResponseModel();
904 AliSegmentation* seg = iChamber->GetSegmentationModel();
905 AliRICHClusterFinder* rec = iChamber->GetReconstructionModel();
907 rec->SetSegmentation(seg);
908 rec->SetResponse(response);
909 rec->SetDigits(pRICHdigits);
910 rec->SetChamber(ich);
911 if (nev==0) rec->CalibrateCOG();
912 rec->FindRawClusters();
915 fRch=RawClustAddress(ich);
919 gAlice->TreeR()->Fill();
921 for (int i=0;i<kNCH;i++) {
922 fRch=RawClustAddress(i);
923 fRch->GetEntriesFast();
931 sprintf(hname,"TreeR%d",nev);
932 gAlice->TreeR()->Write(hname,kOverwrite,0);
933 gAlice->TreeR()->Reset();
934 }//void AliRICH::FindClusters(Int_t nev)
935 //______________________________________________________________________________
936 AliRICHSDigit* AliRICH::FirstPad(AliRICHhit* hit,TClonesArray *clusters )
937 {// Initialise the pad iterator Return the address of the first sdigit for hit
938 TClonesArray *theClusters = clusters;
939 Int_t nclust = theClusters->GetEntriesFast();
940 if (nclust && hit->PHlast() > 0) {
941 sMaxIterPad=Int_t(hit->PHlast());
942 sCurIterPad=Int_t(hit->PHfirst());
943 return (AliRICHSDigit*) clusters->UncheckedAt(sCurIterPad-1);
949 //______________________________________________________________________________
950 AliRICHSDigit* AliRICH::NextPad(TClonesArray *clusters)
951 {// Iterates over pads
954 if (sCurIterPad <= sMaxIterPad) {
955 return (AliRICHSDigit*) clusters->UncheckedAt(sCurIterPad-1);
962 void AliRICH::DiagnosticsFE(Int_t evNumber1,Int_t evNumber2)
965 Int_t NpadX = 162; // number of pads on X
966 Int_t NpadY = 162; // number of pads on Y
969 for (Int_t i=0;i<NpadX;i++) {
970 for (Int_t j=0;j<NpadY;j++) {
975 // Create some histograms
977 TH1F *pionspectra1 = new TH1F("pionspectra1","Pion Spectra",200,-4,2);
978 TH1F *pionspectra2 = new TH1F("pionspectra2","Pion Spectra",200,-4,2);
979 TH1F *pionspectra3 = new TH1F("pionspectra3","Pion Spectra",200,-4,2);
980 TH1F *protonspectra1 = new TH1F("protonspectra1","Proton Spectra",200,-4,2);
981 TH1F *protonspectra2 = new TH1F("protonspectra2","Proton Spectra",200,-4,2);
982 TH1F *protonspectra3 = new TH1F("protonspectra3","Proton Spectra",200,-4,2);
983 TH1F *kaonspectra1 = new TH1F("kaonspectra1","Kaon Spectra",100,-4,2);
984 TH1F *kaonspectra2 = new TH1F("kaonspectra2","Kaon Spectra",100,-4,2);
985 TH1F *kaonspectra3 = new TH1F("kaonspectra3","Kaon Spectra",100,-4,2);
986 TH1F *electronspectra1 = new TH1F("electronspectra1","Electron Spectra",100,-4,2);
987 TH1F *electronspectra2 = new TH1F("electronspectra2","Electron Spectra",100,-4,2);
988 TH1F *electronspectra3 = new TH1F("electronspectra3","Electron Spectra",100,-4,2);
989 TH1F *muonspectra1 = new TH1F("muonspectra1","Muon Spectra",100,-4,2);
990 TH1F *muonspectra2 = new TH1F("muonspectra2","Muon Spectra",100,-4,2);
991 TH1F *muonspectra3 = new TH1F("muonspectra3","Muon Spectra",100,-4,2);
992 TH1F *neutronspectra1 = new TH1F("neutronspectra1","Neutron Spectra",100,-4,2);
993 TH1F *neutronspectra2 = new TH1F("neutronspectra2","Neutron Spectra",100,-4,2);
994 TH1F *neutronspectra3 = new TH1F("neutronspectra2","Neutron Spectra",100,-4,2);
995 TH1F *chargedspectra1 = new TH1F("chargedspectra1","Charged particles above 1 GeV Spectra",100,-1,3);
996 TH1F *chargedspectra2 = new TH1F("chargedspectra2","Charged particles above 1 GeV Spectra",100,-1,3);
997 TH1F *chargedspectra3 = new TH1F("chargedspectra2","Charged particles above 1 GeV Spectra",100,-1,3);
998 TH1F *pionptspectrafinal = new TH1F("pionptspectrafinal","Primary Pions Transverse Momenta at HMPID",20,0,5);
999 TH1F *pionptspectravertex = new TH1F("pionptspectravertex","Primary Pions Transverse Momenta at vertex",20,0,5);
1000 TH1F *kaonptspectrafinal = new TH1F("kaonptspectrafinal","Primary Kaons Transverse Momenta at HMPID",20,0,5);
1001 TH1F *kaonptspectravertex = new TH1F("kaonptspectravertex","Primary Kaons Transverse Momenta at vertex",20,0,5);
1002 //TH1F *hitsPhi = new TH1F("hitsPhi","Distribution of phi angle of incidence",100,-180,180);
1003 TH1F *hitsTheta = new TH1F("hitsTheta","Distribution of Theta angle of incidence, all tracks",100,0,50);
1004 TH1F *hitsTheta500MeV = new TH1F("hitsTheta500MeV","Distribution of Theta angle of incidence, 0.5-1 GeV primary tracks",100,0,50);
1005 TH1F *hitsTheta1GeV = new TH1F("hitsTheta1GeV","Distribution of Theta angle of incidence, 1-2 GeV primary tracks",100,0,50);
1006 TH1F *hitsTheta2GeV = new TH1F("hitsTheta2GeV","Distribution of Theta angle of incidence, 2-3 GeV primary tracks",100,0,50);
1007 TH1F *hitsTheta3GeV = new TH1F("hitsTheta3GeV","Distribution of Theta angle of incidence, >3 GeV primary tracks",100,0,50);
1008 TH2F *production = new TH2F("production","Mother production vertices",100,-300,300,100,0,600);
1013 // Start loop over events
1015 Int_t pion=0, kaon=0, proton=0, electron=0, positron=0, neutron=0, highneutrons=0, muon=0;
1016 Int_t chargedpions=0,primarypions=0,highprimarypions=0,chargedkaons=0,primarykaons=0,highprimarykaons=0;
1017 Int_t photons=0, primaryphotons=0, highprimaryphotons=0;
1020 for (int nev=0; nev<= evNumber2; nev++) {
1021 Int_t nparticles = gAlice->GetEvent(nev);
1024 if (nev < evNumber1) continue;
1025 if (nparticles <= 0) return;
1027 // Get pointers to RICH detector and Hits containers
1029 AliRICH *pRICH = (AliRICH *) gAlice->GetDetector("RICH");
1031 TTree *treeH = TreeH();
1032 Int_t ntracks =(Int_t) treeH->GetEntries();
1034 // Start loop on tracks in the hits containers
1036 for (Int_t track=0; track<ntracks;track++) {
1037 printf ("Processing Track: %d\n",track);
1038 gAlice->ResetHits();
1039 treeH->GetEvent(track);
1041 for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1);
1043 mHit=(AliRICHhit*)pRICH->NextHit())
1045 //Int_t nch = mHit->fChamber; // chamber number
1046 //Float_t x = mHit->X(); // x-pos of hit
1047 //Float_t y = mHit->Z(); // y-pos
1048 //Float_t z = mHit->Y();
1049 //Float_t phi = mHit->Phi(); //Phi angle of incidence
1050 Float_t theta = mHit->Theta(); //Theta angle of incidence
1051 Float_t px = mHit->MomX();
1052 Float_t py = mHit->MomY();
1053 Int_t index = mHit->Track();
1054 Int_t particle = (Int_t)(mHit->Particle());
1059 TParticle *current = gAlice->Particle(index);
1061 //Float_t energy=current->Energy();
1063 R=TMath::Sqrt(current->Vx()*current->Vx() + current->Vy()*current->Vy());
1064 PTfinal=TMath::Sqrt(px*px + py*py);
1065 PTvertex=TMath::Sqrt(current->Px()*current->Px() + current->Py()*current->Py());
1069 if (TMath::Abs(particle) < 10000000)
1071 hitsTheta->Fill(theta,(float) 1);
1074 if (PTvertex>.5 && PTvertex<=1)
1076 hitsTheta500MeV->Fill(theta,(float) 1);
1078 if (PTvertex>1 && PTvertex<=2)
1080 hitsTheta1GeV->Fill(theta,(float) 1);
1082 if (PTvertex>2 && PTvertex<=3)
1084 hitsTheta2GeV->Fill(theta,(float) 1);
1088 hitsTheta3GeV->Fill(theta,(float) 1);
1097 if (TMath::Abs(particle) < 50000051)
1099 //if (TMath::Abs(particle) == 50000050 || TMath::Abs(particle) == 2112)
1100 if (TMath::Abs(particle) == 2112 || TMath::Abs(particle) == 50000050)
1102 //gMC->Rndm(&random, 1);
1103 if (random->Rndm() < .1)
1104 production->Fill(current->Vz(),R,(float) 1);
1105 if (TMath::Abs(particle) == 50000050)
1106 //if (TMath::Abs(particle) > 50000000)
1112 if (current->Energy()>0.001)
1113 highprimaryphotons +=1;
1116 if (TMath::Abs(particle) == 2112)
1119 if (current->Energy()>0.0001)
1123 if (TMath::Abs(particle) < 50000000)
1125 production->Fill(current->Vz(),R,(float) 1);
1127 //mip->Fill(x,y,(float) 1);
1130 if (TMath::Abs(particle)==211 || TMath::Abs(particle)==111)
1134 pionptspectravertex->Fill(PTvertex,(float) 1);
1135 pionptspectrafinal->Fill(PTfinal,(float) 1);
1139 if (TMath::Abs(particle)==321 || TMath::Abs(particle)==130 || TMath::Abs(particle)==310
1140 || TMath::Abs(particle)==311)
1144 kaonptspectravertex->Fill(PTvertex,(float) 1);
1145 kaonptspectrafinal->Fill(PTfinal,(float) 1);
1150 if (TMath::Abs(particle)==211 || TMath::Abs(particle)==111)
1152 pionspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1153 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1154 pionspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1157 pionspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1160 if (TMath::Abs(particle)==211)
1166 if (current->Energy()>1)
1167 highprimarypions +=1;
1171 if (TMath::Abs(particle)==2212)
1173 protonspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1174 //ptspectra->Fill(Pt,(float) 1);
1175 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1176 protonspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1178 protonspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1181 if (TMath::Abs(particle)==321 || TMath::Abs(particle)==130 || TMath::Abs(particle)==310
1182 || TMath::Abs(particle)==311)
1184 kaonspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1185 //ptspectra->Fill(Pt,(float) 1);
1186 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1187 kaonspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1189 kaonspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1191 if (TMath::Abs(particle)==321)
1197 if (current->Energy()>1)
1198 highprimarykaons +=1;
1202 if (TMath::Abs(particle)==11)
1204 electronspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1205 //ptspectra->Fill(Pt,(float) 1);
1206 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1207 electronspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1209 electronspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1212 if (particle == -11)
1215 if (TMath::Abs(particle)==13)
1217 muonspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1218 //ptspectra->Fill(Pt,(float) 1);
1219 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1220 muonspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1222 muonspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1225 if (TMath::Abs(particle)==2112)
1227 neutronspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1228 //ptspectra->Fill(Pt,(float) 1);
1229 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1230 neutronspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1233 neutronspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1237 if(TMath::Abs(particle)==211 || TMath::Abs(particle)==2212 || TMath::Abs(particle)==321)
1239 if (current->Energy()-current->GetCalcMass()>1)
1241 chargedspectra1->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1242 if (current->Vx()>5 && current->Vy()>5 && current->Vz()>5)
1243 chargedspectra2->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1245 chargedspectra3->Fill(TMath::Log10(current->Energy() - current->GetCalcMass()),(float) 1);
1248 // Fill the histograms
1250 //h->Fill(x,y,(float) 1);
1260 TStyle *mystyle=new TStyle("Plain","mystyle");
1261 mystyle->SetPalette(1,0);
1264 //Create canvases, set the view range, show histograms
1266 TCanvas *c2 = new TCanvas("c2","Angles of incidence",150,150,100,150);
1268 //c2->SetFillColor(42);
1271 hitsTheta500MeV->SetFillColor(5);
1272 hitsTheta500MeV->Draw();
1274 hitsTheta1GeV->SetFillColor(5);
1275 hitsTheta1GeV->Draw();
1277 hitsTheta2GeV->SetFillColor(5);
1278 hitsTheta2GeV->Draw();
1280 hitsTheta3GeV->SetFillColor(5);
1281 hitsTheta3GeV->Draw();
1285 TCanvas *c15 = new TCanvas("c15","Mothers Production Vertices",50,50,600,600);
1287 production->SetFillColor(42);
1288 production->SetXTitle("z (m)");
1289 production->SetYTitle("R (m)");
1292 TCanvas *c10 = new TCanvas("c10","Pt Spectra",50,50,600,700);
1295 pionptspectravertex->SetFillColor(5);
1296 pionptspectravertex->SetXTitle("Pt (GeV)");
1297 pionptspectravertex->Draw();
1299 pionptspectrafinal->SetFillColor(5);
1300 pionptspectrafinal->SetXTitle("Pt (GeV)");
1301 pionptspectrafinal->Draw();
1303 kaonptspectravertex->SetFillColor(5);
1304 kaonptspectravertex->SetXTitle("Pt (GeV)");
1305 kaonptspectravertex->Draw();
1307 kaonptspectrafinal->SetFillColor(5);
1308 kaonptspectrafinal->SetXTitle("Pt (GeV)");
1309 kaonptspectrafinal->Draw();
1312 TCanvas *c16 = new TCanvas("c16","Particles Spectra II",150,150,600,350);
1316 //TCanvas *c13 = new TCanvas("c13","Electron Spectra",400,10,600,700);
1317 electronspectra1->SetFillColor(5);
1318 electronspectra1->SetXTitle("log(GeV)");
1319 electronspectra2->SetFillColor(46);
1320 electronspectra2->SetXTitle("log(GeV)");
1321 electronspectra3->SetFillColor(10);
1322 electronspectra3->SetXTitle("log(GeV)");
1324 electronspectra1->Draw();
1325 electronspectra2->Draw("same");
1326 electronspectra3->Draw("same");
1329 //TCanvas *c14 = new TCanvas("c14","Muon Spectra",400,10,600,700);
1330 muonspectra1->SetFillColor(5);
1331 muonspectra1->SetXTitle("log(GeV)");
1332 muonspectra2->SetFillColor(46);
1333 muonspectra2->SetXTitle("log(GeV)");
1334 muonspectra3->SetFillColor(10);
1335 muonspectra3->SetXTitle("log(GeV)");
1337 muonspectra1->Draw();
1338 muonspectra2->Draw("same");
1339 muonspectra3->Draw("same");
1342 //TCanvas *c16 = new TCanvas("c16","Neutron Spectra",400,10,600,700);
1343 //neutronspectra1->SetFillColor(42);
1344 //neutronspectra1->SetXTitle("log(GeV)");
1345 //neutronspectra2->SetFillColor(46);
1346 //neutronspectra2->SetXTitle("log(GeV)");
1347 //neutronspectra3->SetFillColor(10);
1348 //neutronspectra3->SetXTitle("log(GeV)");
1350 //neutronspectra1->Draw();
1351 //neutronspectra2->Draw("same");
1352 //neutronspectra3->Draw("same");
1354 TCanvas *c9 = new TCanvas("c9","Particles Spectra",150,150,600,700);
1355 //TCanvas *c9 = new TCanvas("c9","Pion Spectra",400,10,600,700);
1359 pionspectra1->SetFillColor(5);
1360 pionspectra1->SetXTitle("log(GeV)");
1361 pionspectra2->SetFillColor(46);
1362 pionspectra2->SetXTitle("log(GeV)");
1363 pionspectra3->SetFillColor(10);
1364 pionspectra3->SetXTitle("log(GeV)");
1366 pionspectra1->Draw();
1367 pionspectra2->Draw("same");
1368 pionspectra3->Draw("same");
1371 //TCanvas *c10 = new TCanvas("c10","Proton Spectra",400,10,600,700);
1372 protonspectra1->SetFillColor(5);
1373 protonspectra1->SetXTitle("log(GeV)");
1374 protonspectra2->SetFillColor(46);
1375 protonspectra2->SetXTitle("log(GeV)");
1376 protonspectra3->SetFillColor(10);
1377 protonspectra3->SetXTitle("log(GeV)");
1379 protonspectra1->Draw();
1380 protonspectra2->Draw("same");
1381 protonspectra3->Draw("same");
1384 //TCanvas *c11 = new TCanvas("c11","Kaon Spectra",400,10,600,700);
1385 kaonspectra1->SetFillColor(5);
1386 kaonspectra1->SetXTitle("log(GeV)");
1387 kaonspectra2->SetFillColor(46);
1388 kaonspectra2->SetXTitle("log(GeV)");
1389 kaonspectra3->SetFillColor(10);
1390 kaonspectra3->SetXTitle("log(GeV)");
1392 kaonspectra1->Draw();
1393 kaonspectra2->Draw("same");
1394 kaonspectra3->Draw("same");
1397 //TCanvas *c12 = new TCanvas("c12","Charged Particles Spectra",400,10,600,700);
1398 chargedspectra1->SetFillColor(5);
1399 chargedspectra1->SetXTitle("log(GeV)");
1400 chargedspectra2->SetFillColor(46);
1401 chargedspectra2->SetXTitle("log(GeV)");
1402 chargedspectra3->SetFillColor(10);
1403 chargedspectra3->SetXTitle("log(GeV)");
1405 chargedspectra1->Draw();
1406 chargedspectra2->Draw("same");
1407 chargedspectra3->Draw("same");
1411 printf("*****************************************\n");
1412 printf("* Particle * Counts *\n");
1413 printf("*****************************************\n");
1415 printf("* Pions: * %4d *\n",pion);
1416 printf("* Charged Pions: * %4d *\n",chargedpions);
1417 printf("* Primary Pions: * %4d *\n",primarypions);
1418 printf("* Primary Pions (p>1GeV/c): * %4d *\n",highprimarypions);
1419 printf("* Kaons: * %4d *\n",kaon);
1420 printf("* Charged Kaons: * %4d *\n",chargedkaons);
1421 printf("* Primary Kaons: * %4d *\n",primarykaons);
1422 printf("* Primary Kaons (p>1GeV/c): * %4d *\n",highprimarykaons);
1423 printf("* Muons: * %4d *\n",muon);
1424 printf("* Electrons: * %4d *\n",electron);
1425 printf("* Positrons: * %4d *\n",positron);
1426 printf("* Protons: * %4d *\n",proton);
1427 printf("* All Charged: * %4d *\n",(chargedpions+chargedkaons+muon+electron+positron+proton));
1428 printf("*****************************************\n");
1429 //printf("* Photons: * %3.1f *\n",photons);
1430 //printf("* Primary Photons: * %3.1f *\n",primaryphotons);
1431 //printf("* Primary Photons (p>1MeV/c):* %3.1f *\n",highprimaryphotons);
1432 //printf("*****************************************\n");
1433 //printf("* Neutrons: * %3.1f *\n",neutron);
1434 //printf("* Neutrons (p>100keV/c): * %3.1f *\n",highneutrons);
1435 //printf("*****************************************\n");
1437 if (gAlice->TreeD())
1439 gAlice->TreeD()->GetEvent(0);
1444 printf("\n*****************************************\n");
1445 printf("* Chamber * Digits * Occupancy *\n");
1446 printf("*****************************************\n");
1448 for (Int_t ich=0;ich<7;ich++)
1450 TClonesArray *Digits = DigitsAddress(ich); // Raw clusters branch
1451 Int_t ndigits = Digits->GetEntriesFast();
1452 occ[ich] = Float_t(ndigits)/(160*144);
1453 sum += Float_t(ndigits)/(160*144);
1454 printf("* %d * %d * %3.1f%% *\n",ich,ndigits,occ[ich]*100);
1457 printf("*****************************************\n");
1458 printf("* Mean occupancy * %3.1f%% *\n",mean*100);
1459 printf("*****************************************\n");
1462 printf("\nEnd of analysis\n");
1464 }//void AliRICH::DiagnosticsFE(Int_t evNumber1,Int_t evNumber2)
1465 //______________________________________________________________________________
1466 void AliRICH::DiagnosticsSE(Int_t diaglevel,Int_t evNumber1,Int_t evNumber2)
1469 AliRICH *pRICH = (AliRICH*)gAlice->GetDetector("RICH");
1470 AliRICHSegmentationV0* segmentation;
1471 AliRICHChamber* chamber;
1473 chamber = &(pRICH->Chamber(0));
1474 segmentation=(AliRICHSegmentationV0*) chamber->GetSegmentationModel();
1476 Int_t NpadX = segmentation->Npx(); // number of pads on X
1477 Int_t NpadY = segmentation->Npy(); // number of pads on Y
1479 //Int_t Pad[144][160];
1480 /*for (Int_t i=0;i<NpadX;i++) {
1481 for (Int_t j=0;j<NpadY;j++) {
1487 Int_t xmin= -NpadX/2;
1488 Int_t xmax= NpadX/2;
1489 Int_t ymin= -NpadY/2;
1490 Int_t ymax= NpadY/2;
1492 Float_t PTfinal = 0;
1493 Int_t pionCount = 0;
1494 Int_t kaonCount = 0;
1495 Int_t protonCount = 0;
1504 TH2F *hc0 = new TH2F("hc0","Zoom on center of central chamber",150,-25,25,150,-45,5);
1508 printf("Single Ring Hits\n");
1509 feedback = new TH2F("feedback","Feedback hit distribution",150,-20,20,150,-35,5);
1510 mip = new TH2F("mip","Mip hit distribution",150,-20,20,150,-35,5);
1511 cerenkov = new TH2F("cerenkov","Cerenkov hit distribution",150,-20,20,150,-35,5);
1512 h = new TH2F("h","Detector hit distribution",150,-20,20,150,-35,5);
1513 hitsX = new TH1F("hitsX","Distribution of hits along x-axis",150,-50,50);
1514 hitsY = new TH1F("hitsY","Distribution of hits along z-axis",150,-50,50);
1518 printf("Full Event Hits\n");
1520 feedback = new TH2F("feedback","Feedback hit distribution",150,-300,300,150,-300,300);
1521 mip = new TH2F("mip","Mip hit distribution",150,-300,300,150,-300,300);
1522 cerenkov = new TH2F("cerenkov","Cerenkov hit distribution",150,-300,300,150,-300,300);
1523 h = new TH2F("h","Detector hit distribution",150,-300,300,150,-300,300);
1524 hitsX = new TH1F("digitsX","Distribution of hits along x-axis",200,-300,300);
1525 hitsY = new TH1F("digitsY","Distribution of hits along z-axis",200,-300,300);
1530 TH2F *hc1 = new TH2F("hc1","Chamber 1 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1531 TH2F *hc2 = new TH2F("hc2","Chamber 2 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1532 TH2F *hc3 = new TH2F("hc3","Chamber 3 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1533 TH2F *hc4 = new TH2F("hc4","Chamber 4 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1534 TH2F *hc5 = new TH2F("hc5","Chamber 5 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1535 TH2F *hc6 = new TH2F("hc6","Chamber 6 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1536 TH2F *hc7 = new TH2F("hc7","Chamber 7 signal distribution",NpadX,xmin,xmax,NpadY,ymin,ymax);
1538 TH1F *Clcharge = new TH1F("Clcharge","Cluster Charge Distribution",500,0.,500.);
1539 TH1F *ckovangle = new TH1F("ckovangle","Cerenkov angle per photon",100,.35,.8);
1540 TH1F *hckphi = new TH1F("hckphi","Cerenkov phi angle per photon",620,-3.1,3.1);
1541 TH1F *mother = new TH1F("mother","Cerenkovs per Mip",75,0.,75.);
1542 TH1F *radius = new TH1F("radius","Mean distance to Mip",100,0.,20.);
1543 TH1F *phspectra1 = new TH1F("phspectra1","Detected Photon Spectra",200,5.,10.);
1544 TH1F *phspectra2 = new TH1F("phspectra2","Produced Photon Spectra",200,5.,10.);
1545 TH1F *totalphotonstrack = new TH1F("totalphotonstrack","Produced Photons per Mip",100,200,700.);
1546 TH1F *totalphotonsevent = new TH1F("totalphotonsevent","Produced Photons per Mip",100,200,700.);
1547 //TH1F *feedbacks = new TH1F("feedbacks","Produced Feedbacks per Mip",50,0.5,50.);
1548 TH1F *padnumber = new TH1F("padnumber","Number of pads per cluster",50,-0.5,50.);
1549 TH1F *padsev = new TH1F("padsev","Number of pads hit per MIP",50,0.5,100.);
1550 TH1F *clusev = new TH1F("clusev","Number of clusters per MIP",50,0.5,50.);
1551 TH1F *photev = new TH1F("photev","Number of detected photons per MIP",50,0.5,50.);
1552 TH1F *feedev = new TH1F("feedev","Number of feedbacks per MIP",50,0.5,50.);
1553 TH1F *padsmip = new TH1F("padsmip","Number of pads per event inside MIP region",50,0.5,50.);
1554 TH1F *padscl = new TH1F("padscl","Number of pads per event from cluster count",50,0.5,100.);
1555 TH1F *pionspectra = new TH1F("pionspectra","Pion Spectra",200,.5,10.);
1556 TH1F *protonspectra = new TH1F("protonspectra","Proton Spectra",200,.5,10.);
1557 TH1F *kaonspectra = new TH1F("kaonspectra","Kaon Spectra",100,.5,10.);
1558 TH1F *chargedspectra = new TH1F("chargedspectra","Charged particles above 1 GeV Spectra",100,.5,10.);
1559 TH1F *hitsPhi = new TH1F("hitsPhi","Distribution of phi angle of incidence",50,0,360);
1560 TH1F *hitsTheta = new TH1F("hitsTheta","Distribution of theta angle of incidence",50,0,15);
1561 TH1F *Omega1D = new TH1F("omega","Reconstructed Cerenkov angle per track",50,.5,1);
1562 TH1F *Theta = new TH1F("theta","Reconstructed theta incidence angle per track",100,0,15);
1563 TH1F *Phi = new TH1F("phi","Reconstructed phi incidence per track",100,0,360);
1564 TH1F *Omega3D = new TH1F("omega","Reconstructed Cerenkov angle per track",100,.35,.8);
1565 TH1F *PhotonCer = new TH1F("photoncer","Reconstructed Cerenkov angle per photon",100,.35,.8);
1566 TH2F *PadsUsed = new TH2F("padsused","Pads Used for Reconstruction",100,-30,30,100,-30,30);
1567 TH1F *MeanRadius = new TH1F("radius","Mean Radius for reconstructed track",100,0.,20.);
1568 TH2F *identification = new TH2F("identification","Particle Identification",100,1,5,100,0,.8);
1569 TH1F *OriginalOmega = new TH1F("Original Omega","Cerenkov angle per track",100,.35,.8);
1570 TH1F *OriginalPhi = new TH1F("Original Phi","Distribution of phi angle of incidence per track",100,0,360);
1571 TH1F *OriginalTheta = new TH1F("Original Theta","Distribution of theta angle per track",100,0,15);
1572 TH1F *OmegaError = new TH1F("Omega Error","Difference between original an reconstructed cerenkov angle",100,0,.2);
1573 TH1F *PhiError = new TH1F("Phi Error","Difference between original an reconstructed phi angle",100,0,360);
1574 TH1F *ThetaError = new TH1F("Theta Error","Difference between original an reconstructed phi angle",100,0,15);
1577 // Start loop over events
1582 Int_t mothers[80000];
1583 Int_t mothers2[80000];
1591 Float_t chiSquareOmega = 0;
1592 Float_t chiSquareTheta = 0;
1593 Float_t chiSquarePhi = 0;
1595 Float_t recEffEvent = 0;
1596 Float_t recEffTotal = 0;
1598 Float_t trackglob[3];
1599 Float_t trackloc[3];
1602 for (Int_t i=0;i<100;i++) mothers[i]=0;
1604 for (int nev=0; nev<= evNumber2; nev++) {
1605 Int_t nparticles = gAlice->GetEvent(nev);
1608 //cout<<"nev "<<nev<<endl;
1609 printf ("\n**********************************\nProcessing Event: %d\n",nev);
1610 //cout<<"nparticles "<<nparticles<<endl;
1611 printf ("Particles : %d\n\n",nparticles);
1612 if (nev < evNumber1) continue;
1613 if (nparticles <= 0) return;
1615 // Get pointers to RICH detector and Hits containers
1618 TTree *TH = TreeH();
1619 Stat_t ntracks = TH->GetEntries();
1621 // Start loop on tracks in the hits containers
1623 for (Int_t track=0; track<ntracks;track++) {
1625 printf ("\nProcessing Track: %d\n",track);
1626 gAlice->ResetHits();
1627 TH->GetEvent(track);
1628 Int_t nhits = pRICH->Hits()->GetEntriesFast();
1629 if (nhits) Nh+=nhits;
1630 printf("Hits : %d\n",nhits);
1631 for(AliRICHhit* mHit=(AliRICHhit*)pRICH->FirstHit(-1);
1633 mHit=(AliRICHhit*)pRICH->NextHit())
1635 Int_t nch = mHit->Chamber(); // chamber number
1636 trackglob[0] = mHit->X(); // x-pos of hit
1637 trackglob[1] = mHit->Y();
1638 trackglob[2] = mHit->Z(); // y-pos of hit
1639 //x = mHit->X(); // x-pos of hit
1640 //y = mHit->Z(); // y-pos
1641 Float_t phi = mHit->Phi(); //Phi angle of incidence
1642 Float_t theta = mHit->Theta(); //Theta angle of incidence
1643 Int_t index = mHit->Track();
1644 Int_t particle = (Int_t)(mHit->Particle());
1645 //Int_t freon = (Int_t)(mHit->fLoss);
1646 Float_t px = mHit->MomX();
1647 Float_t py = mHit->MomY();
1649 if (TMath::Abs(particle) < 10000000)
1651 PTfinal=TMath::Sqrt(px*px + py*py);
1654 chamber = &(pRICH->Chamber(nch-1));
1657 chamber->GlobaltoLocal(trackglob,trackloc);
1659 chamber->LocaltoGlobal(trackloc,trackglob);
1665 hitsX->Fill(x,(float) 1);
1666 hitsY->Fill(y,(float) 1);
1669 TParticle *current = (TParticle*)gAlice->Particle(index);
1670 //printf("Particle type: %d\n",sizeoff(Particles));
1672 hitsTheta->Fill(theta,(float) 1);
1673 //hitsPhi->Fill(phi,(float) 1);
1674 //if (pRICH->GetDebugLevel() == -1)
1676 if (current->GetPdgCode() < 10000000)
1678 mip->Fill(x,y,(float) 1);
1679 //printf("adding mip\n");
1680 //if (current->Energy() - current->GetCalcMass()>1 && freon==1)
1682 hitsPhi->Fill(TMath::Abs(phi),(float) 1);
1683 //hitsTheta->Fill(theta,(float) 1);
1684 //printf("Theta:%f, Phi:%f\n",theta,phi);
1688 if (TMath::Abs(particle)==211 || TMath::Abs(particle)==111)
1690 pionspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
1692 if (TMath::Abs(particle)==2212)
1694 protonspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
1696 if (TMath::Abs(particle)==321 || TMath::Abs(particle)==130 || TMath::Abs(particle)==310
1697 || TMath::Abs(particle)==311)
1699 kaonspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
1701 if(TMath::Abs(particle)==211 || TMath::Abs(particle)==2212 || TMath::Abs(particle)==321)
1703 if (current->Energy() - current->GetCalcMass()>1)
1704 chargedspectra->Fill(current->Energy() - current->GetCalcMass(),(float) 1);
1706 //printf("Hits:%d\n",hit);
1707 //printf ("Chamber number:%d x:%f y:%f\n",nch,x,y);
1708 // Fill the histograms
1710 h->Fill(x,y,(float) 1);
1715 Int_t ncerenkovs = pRICH->Cerenkovs()->GetEntriesFast();
1716 //if (current->GetPdgCode() < 50000051 && current->GetPdgCode() > 50000040)
1717 //totalphotonsevent->Fill(ncerenkovs,(float) 1);
1720 printf("Cerenkovs : %d\n",ncerenkovs);
1721 totalphotonsevent->Fill(ncerenkovs,(float) 1);
1722 for (Int_t hit=0;hit<ncerenkovs;hit++) {
1723 AliRICHCerenkov* cHit = (AliRICHCerenkov*) pRICH->Cerenkovs()->UncheckedAt(hit);
1724 Int_t nchamber = cHit->fChamber; // chamber number
1725 Int_t index = cHit->Track();
1726 //Int_t pindex = (Int_t)(cHit->fIndex);
1727 trackglob[0] = cHit->X(); // x-pos of hit
1728 trackglob[1] = cHit->Y();
1729 trackglob[2] = cHit->Z(); // y-pos of hit
1730 //Float_t cx = cHit->X(); // x-position
1731 //Float_t cy = cHit->Z(); // y-position
1732 Int_t cmother = cHit->fCMother; // Index of mother particle
1733 Int_t closs = (Int_t)(cHit->fLoss); // How did the particle get lost?
1734 Float_t cherenkov = cHit->fCerenkovAngle; //production cerenkov angle
1736 chamber = &(pRICH->Chamber(nchamber-1));
1738 //printf("Nch:%d\n",nch);
1740 chamber->GlobaltoLocal(trackglob,trackloc);
1742 chamber->LocaltoGlobal(trackloc,trackglob);
1745 Float_t cx=trackloc[0];
1746 Float_t cy=trackloc[2];
1748 //printf ("Cerenkov hit number %d/%d, X:%f, Y:%f\n",hit,ncerenkovs,cx,cy);
1751 //printf("Particle:%9d\n",index);
1753 TParticle *current = (TParticle*)gAlice->Particle(index);
1754 Float_t energyckov = current->Energy();
1756 if (current->GetPdgCode() == 50000051)
1760 feedback->Fill(cx,cy,(float) 1);
1764 if (current->GetPdgCode() == 50000050)
1769 phspectra2->Fill(energyckov*1e9,(float) 1);
1774 cerenkov->Fill(cx,cy,(float) 1);
1776 //printf ("Cerenkov hit number %d/%d, X:%d, Y:%d\n",hit,ncerenkovs,cx,cy);
1778 //TParticle *MIP = (TParticle*)gAlice->Particle(cmother);
1779 AliRICHhit* mipHit = (AliRICHhit*) pRICH->Hits()->UncheckedAt(0);
1780 mom[0] = current->Px();
1781 mom[1] = current->Py();
1782 mom[2] = current->Pz();
1783 //mom[0] = cHit->fMomX;
1784 // mom[1] = cHit->fMomZ;
1785 //mom[2] = cHit->fMomY;
1786 //Float_t energymip = MIP->Energy();
1787 //Float_t Mip_px = mipHit->fMomFreoX;
1788 //Float_t Mip_py = mipHit->fMomFreoY;
1789 //Float_t Mip_pz = mipHit->fMomFreoZ;
1790 //Float_t Mip_px = MIP->Px();
1791 //Float_t Mip_py = MIP->Py();
1792 //Float_t Mip_pz = MIP->Pz();
1796 //Float_t r = mom[0]*mom[0] + mom[1]*mom[1] + mom[2]*mom[2];
1797 //Float_t rt = TMath::Sqrt(r);
1798 //Float_t Mip_r = Mip_px*Mip_px + Mip_py*Mip_py + Mip_pz*Mip_pz;
1799 //Float_t Mip_rt = TMath::Sqrt(Mip_r);
1800 //Float_t coscerenkov = (mom[0]*Mip_px + mom[1]*Mip_py + mom[2]*Mip_pz)/(rt*Mip_rt+0.0000001);
1801 //Float_t cherenkov = TMath::ACos(coscerenkov);
1802 ckovangle->Fill(cherenkov,(float) 1); //Cerenkov angle calculus
1803 //printf("Cherenkov: %f\n",cherenkov);
1804 Float_t ckphi=TMath::ATan2(mom[0], mom[2]);
1805 hckphi->Fill(ckphi,(float) 1);
1808 //Float_t mix = MIP->Vx();
1809 //Float_t miy = MIP->Vy();
1810 Float_t mx = mipHit->X();
1811 Float_t my = mipHit->Z();
1812 //printf("FX %e, FY %e, VX %e, VY %e\n",cx,cy,mx,my);
1813 Float_t dx = trackglob[0] - mx;
1814 Float_t dy = trackglob[2] - my;
1815 //printf("Dx:%f, Dy:%f\n",dx,dy);
1816 Float_t final_radius = TMath::Sqrt(dx*dx+dy*dy);
1817 //printf("Final radius:%f\n",final_radius);
1818 radius->Fill(final_radius,(float) 1);
1820 phspectra1->Fill(energyckov*1e9,(float) 1);
1823 for (Int_t nmothers=0;nmothers<=ntracks;nmothers++){
1824 if (cmother == nmothers){
1826 mothers2[cmother]++;
1837 Int_t nent=(Int_t)gAlice->TreeR()->GetEntries();
1838 gAlice->TreeR()->GetEvent(nent-1);
1839 TClonesArray *Rawclusters = pRICH->RawClustAddress(2); // Raw clusters branch
1840 //printf ("Rawclusters:%p",Rawclusters);
1841 Int_t nrawclusters = Rawclusters->GetEntriesFast();
1844 printf("Raw Clusters : %d\n",nrawclusters);
1845 for (Int_t hit=0;hit<nrawclusters;hit++) {
1846 AliRICHRawCluster* rcHit = (AliRICHRawCluster*) pRICH->RawClustAddress(2)->UncheckedAt(hit);
1847 //Int_t nchamber = rcHit->fChamber; // chamber number
1848 //Int_t nhit = cHit->fHitNumber; // hit number
1849 Int_t qtot = rcHit->fQ; // charge
1850 Float_t fx = rcHit->fX; // x-position
1851 Float_t fy = rcHit->fY; // y-position
1852 //Int_t type = rcHit->fCtype; // cluster type ?
1853 Int_t mult = rcHit->fMultiplicity; // How many pads form the cluster
1856 //printf ("fx: %d, fy: %d\n",fx,fy);
1857 if (fx>(x-4) && fx<(x+4) && fy>(y-4) && fy<(y+4)) {
1858 //printf("There %d \n",mult);
1861 padnumber->Fill(mult,(float) 1);
1863 if (mult<4) Clcharge->Fill(qtot,(float) 1);
1871 TClonesArray *RecHits1D = pRICH->RecHitsAddress1D(2);
1872 Int_t nrechits1D = RecHits1D->GetEntriesFast();
1873 //printf (" nrechits:%d\n",nrechits);
1877 for (Int_t hit=0;hit<nrechits1D;hit++) {
1878 AliRICHRecHit1D* recHit1D = (AliRICHRecHit1D*) pRICH->RecHitsAddress1D(2)->UncheckedAt(hit);
1879 Float_t r_omega = recHit1D->fOmega; // Cerenkov angle
1880 Float_t *cer_pho = recHit1D->fCerPerPhoton; // Cerenkov angle per photon
1881 Int_t *padsx = recHit1D->fPadsUsedX; // Pads Used fo reconstruction (x)
1882 Int_t *padsy = recHit1D->fPadsUsedY; // Pads Used fo reconstruction (y)
1883 Int_t goodPhotons = recHit1D->fGoodPhotons; // Number of pads used for reconstruction
1885 Omega1D->Fill(r_omega,(float) 1);
1887 for (Int_t i=0; i<goodPhotons; i++)
1889 PhotonCer->Fill(cer_pho[i],(float) 1);
1890 PadsUsed->Fill(padsx[i],padsy[i],1);
1891 //printf("Angle:%f, pad: %d %d\n",cer_pho[i],padsx[i],padsy[i]);
1894 //printf("Omega: %f, Theta: %f, Phi: %f\n",r_omega,r_theta,r_phi);
1899 TClonesArray *RecHits3D = pRICH->RecHitsAddress3D(2);
1900 Int_t nrechits3D = RecHits3D->GetEntriesFast();
1901 //printf (" nrechits:%d\n",nrechits);
1907 //for (Int_t hit=0;hit<nrechits3D;hit++) {
1908 AliRICHRecHit3D* recHit3D = (AliRICHRecHit3D*) pRICH->RecHitsAddress3D(2)->UncheckedAt(track);
1909 Float_t r_omega = recHit3D->fOmega; // Cerenkov angle
1910 Float_t r_theta = recHit3D->fTheta; // Theta angle of incidence
1911 Float_t r_phi = recHit3D->fPhi; // Phi angle if incidence
1912 Float_t meanradius = recHit3D->fMeanRadius; // Mean radius for reconstructed point
1913 Float_t originalOmega = recHit3D->fOriginalOmega; // Real Cerenkov angle
1914 Float_t originalTheta = recHit3D->fOriginalTheta; // Real incidence angle
1915 Float_t originalPhi = recHit3D->fOriginalPhi; // Real azimuthal angle
1918 //correction to track cerenkov angle
1919 originalOmega = (Float_t) ckovangle->GetMean();
1923 printf("\nMean cerenkov angle: %f\n", originalOmega);
1924 printf("Reconstructed cerenkov angle: %f\n",r_omega);
1927 Float_t omegaError = TMath::Abs(originalOmega - r_omega);
1928 Float_t thetaError = TMath::Abs(originalTheta - r_theta);
1929 Float_t phiError = TMath::Abs(originalPhi - r_phi);
1931 //chiSquareOmega += (omegaError/originalOmega)*(omegaError/originalOmega);
1932 //chiSquareTheta += (thetaError/originalTheta)*(thetaError/originalTheta);
1933 //chiSquarePhi += (phiError/originalPhi)*(phiError/originalPhi);
1935 if(TMath::Abs(omegaError) < 0.015)
1940 //printf("rechit %f %f %f %f %f\n",recHit3D->fOmega,recHit3D->fTheta,recHit3D->fPhi, recHit3D->fX,recHit3D->fY);
1942 Omega3D->Fill(r_omega,(float) 1);
1943 Theta->Fill(r_theta*180/TMath::Pi(),(float) 1);
1944 Phi->Fill(r_phi*180/TMath::Pi()-180,(float) 1);
1945 MeanRadius->Fill(meanradius,(float) 1);
1946 identification->Fill(PTfinal, r_omega,1);
1947 OriginalOmega->Fill(originalOmega, (float) 1);
1948 OriginalTheta->Fill(originalTheta, (float) 1);
1949 OriginalPhi->Fill(TMath::Abs(originalPhi), (float) 1);
1950 OmegaError->Fill(omegaError, (float) 1);
1951 ThetaError->Fill(thetaError, (float) 1);
1952 PhiError->Fill(phiError, (float) 1);
1954 recEffEvent = recEffEvent;
1955 recEffTotal += recEffEvent;
1957 Float_t pioncer = acos(sqrt((.139*.139+PTfinal*PTfinal)/(PTfinal*PTfinal*1.285*1.285)));
1958 Float_t kaoncer = acos(sqrt((.439*.439+PTfinal*PTfinal)/(PTfinal*PTfinal*1.285*1.285)));
1959 Float_t protoncer = acos(sqrt((.938*.938+PTfinal*PTfinal)/(PTfinal*PTfinal*1.285*1.285)));
1961 Float_t piondist = TMath::Abs(r_omega - pioncer);
1962 Float_t kaondist = TMath::Abs(r_omega - kaoncer);
1963 Float_t protondist = TMath::Abs(r_omega - protoncer);
1969 printf("Identified as a PION!\n");
1972 if(kaoncer<r_omega && pioncer>r_omega)
1974 if(kaondist>piondist)
1976 printf("Identified as a PION!\n");
1981 printf("Identified as a KAON!\n");
1985 if(protoncer<r_omega && kaoncer>r_omega)
1987 if(kaondist>protondist)
1989 printf("Identified as a PROTON!\n");
1994 printf("Identified as a KAON!\n");
1998 if(protoncer>r_omega)
2000 printf("Identified as a PROTON!\n");
2004 printf("\nReconstruction efficiency: %5.2f%%\n", recEffEvent*100);
2010 for (Int_t nmothers=0;nmothers<ntracks;nmothers++){
2011 totalphotonstrack->Fill(mothers[nmothers],(float) 1);
2012 mother->Fill(mothers2[nmothers],(float) 1);
2013 //printf ("Entries in %d : %d\n",nmothers, mothers[nmothers]);
2016 clusev->Fill(nraw,(float) 1);
2017 photev->Fill(phot,(float) 1);
2018 feedev->Fill(feed,(float) 1);
2019 padsmip->Fill(padmip,(float) 1);
2020 padscl->Fill(pads,(float) 1);
2021 //printf("Photons:%d\n",phot);
2030 gAlice->ResetDigits();
2031 //Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
2032 gAlice->TreeD()->GetEvent(0);
2038 TClonesArray *Digits = pRICH->DigitsAddress(2);
2039 Int_t ndigits = Digits->GetEntriesFast();
2040 printf("Digits : %d\n",ndigits);
2041 padsev->Fill(ndigits,(float) 1);
2042 for (Int_t hit=0;hit<ndigits;hit++) {
2043 AliRICHDigit* dHit = (AliRICHDigit*) Digits->UncheckedAt(hit);
2044 Int_t qtot = dHit->Signal(); // charge
2045 Int_t ipx = dHit->PadX(); // pad number on X
2046 Int_t ipy = dHit->PadY(); // pad number on Y
2047 //printf("%d, %d\n",ipx,ipy);
2048 if( ipx<=100 && ipy <=100) hc0->Fill(ipx,ipy,(float) qtot);
2054 for (Int_t ich=0;ich<7;ich++)
2056 TClonesArray *Digits = pRICH->DigitsAddress(ich); // Raw clusters branch
2057 Int_t ndigits = Digits->GetEntriesFast();
2058 //printf("Digits:%d\n",ndigits);
2059 padsev->Fill(ndigits,(float) 1);
2061 for (Int_t hit=0;hit<ndigits;hit++) {
2062 AliRICHDigit* dHit = (AliRICHDigit*) Digits->UncheckedAt(hit);
2063 //Int_t nchamber = dHit->GetChamber(); // chamber number
2064 //Int_t nhit = dHit->fHitNumber; // hit number
2065 Int_t qtot = dHit->Signal(); // charge
2066 Int_t ipx = dHit->PadX(); // pad number on X
2067 Int_t ipy = dHit->PadY(); // pad number on Y
2068 //Int_t iqpad = dHit->fQpad; // charge per pad
2069 //Int_t rpad = dHit->fRSec; // R-position of pad
2070 //printf ("Pad hit, PadX:%d, PadY:%d\n",ipx,ipy);
2071 if( ipx<=100 && ipy <=100 && ich==2) hc0->Fill(ipx,ipy,(float) qtot);
2072 if( ipx<=162 && ipy <=162 && ich==0) hc1->Fill(ipx,ipy,(float) qtot);
2073 if( ipx<=162 && ipy <=162 && ich==1) hc2->Fill(ipx,ipy,(float) qtot);
2074 if( ipx<=162 && ipy <=162 && ich==2) hc3->Fill(ipx,ipy,(float) qtot);
2075 if( ipx<=162 && ipy <=162 && ich==3) hc4->Fill(ipx,ipy,(float) qtot);
2076 if( ipx<=162 && ipy <=162 && ich==4) hc5->Fill(ipx,ipy,(float) qtot);
2077 if( ipx<=162 && ipy <=162 && ich==5) hc6->Fill(ipx,ipy,(float) qtot);
2078 if( ipx<=162 && ipy <=162 && ich==6) hc7->Fill(ipx,ipy,(float) qtot);
2096 for(Int_t i=0;i<99;i++)
2098 omegaE = OriginalOmega->GetBinContent(i);
2101 omegaO = Omega3D->GetBinContent(i);
2102 chiSquareOmega += (TMath::Power(omegaE,2) - TMath::Power(omegaO,2))/omegaO;
2105 thetaE = OriginalTheta->GetBinContent(i);
2108 thetaO = Theta->GetBinContent(i);
2109 chiSquareTheta += (TMath::Power(thetaE,2) - TMath::Power(thetaO,2))/thetaO;
2112 phiE = OriginalPhi->GetBinContent(i);
2115 phiO = Phi->GetBinContent(i);
2116 chiSquarePhi += (TMath::Power(phiE,2) - TMath::Power(phiO,2))/phiO;
2119 //printf(" o: %f t: %f p: %f\n", OriginalOmega->GetBinContent(i), OriginalTheta->GetBinContent(i),OriginalPhi->GetBinContent(i));
2125 printf("\nChi square test values: Omega - %f\n", chiSquareOmega);
2126 printf(" Theta - %f\n", chiSquareTheta);
2127 printf(" Phi - %f\n", chiSquarePhi);
2129 printf("\nKolmogorov test values: Omega - %5.4f\n", Omega3D->KolmogorovTest(OriginalOmega));
2130 printf(" Theta - %5.4f\n", Theta->KolmogorovTest(OriginalTheta));
2131 printf(" Phi - %5.4f\n", Phi->KolmogorovTest(OriginalPhi));
2133 recEffTotal = recEffTotal/evNumber2;
2134 printf("\nTotal reconstruction efficiency: %5.2f%%\n", recEffTotal*100);
2135 printf("\n Pions: %d\n Kaons: %d\n Protons:%d\n",pionCount, kaonCount, protonCount);
2140 //Create canvases, set the view range, show histograms
2159 TStyle *mystyle=new TStyle("Plain","mystyle");
2160 mystyle->SetPalette(1,0);
2161 //mystyle->SetTitleYSize(0.2);
2162 //mystyle->SetStatW(0.19);
2163 //mystyle->SetStatH(0.1);
2164 //mystyle->SetStatFontSize(0.01);
2165 //mystyle->SetTitleYSize(0.3);
2166 mystyle->SetFuncColor(2);
2167 //mystyle->SetOptStat(0111);
2168 mystyle->SetDrawBorder(0);
2169 mystyle->SetTitleBorderSize(0);
2170 mystyle->SetOptFit(1111);
2174 TClonesArray *RecHits3D = pRICH->RecHitsAddress3D(2);
2175 Int_t nrechits3D = RecHits3D->GetEntriesFast();
2176 TClonesArray *RecHits1D = pRICH->RecHitsAddress1D(2);
2177 Int_t nrechits1D = RecHits1D->GetEntriesFast();
2183 c1 = new TCanvas("c1","Alice RICH digits",50,50,300,350);
2184 hc0->SetXTitle("ix (npads)");
2188 c2 = new TCanvas("c2","Hits per type",100,100,600,700);
2190 //c4->SetFillColor(42);
2193 feedback->SetXTitle("x (cm)");
2194 feedback->SetYTitle("y (cm)");
2195 feedback->Draw("colz");
2198 //mip->SetFillColor(5);
2199 mip->SetXTitle("x (cm)");
2200 mip->SetYTitle("y (cm)");
2204 //cerenkov->SetFillColor(5);
2205 cerenkov->SetXTitle("x (cm)");
2206 cerenkov->SetYTitle("y (cm)");
2207 cerenkov->Draw("colz");
2210 //h->SetFillColor(5);
2211 h->SetXTitle("x (cm)");
2212 h->SetYTitle("y (cm)");
2215 c3 = new TCanvas("c3","Hits distribution",150,150,600,350);
2217 //c10->SetFillColor(42);
2220 hitsX->SetFillColor(5);
2221 hitsX->SetXTitle("(cm)");
2225 hitsY->SetFillColor(5);
2226 hitsY->SetXTitle("(cm)");
2234 c4 = new TCanvas("c4","Photon Spectra",50,50,600,350);
2236 //c6->SetFillColor(42);
2239 phspectra2->SetFillColor(5);
2240 phspectra2->SetXTitle("energy (eV)");
2243 phspectra1->SetFillColor(5);
2244 phspectra1->SetXTitle("energy (eV)");
2247 c5 = new TCanvas("c5","Particles Spectra",100,100,600,700);
2249 //c9->SetFillColor(42);
2252 pionspectra->SetFillColor(5);
2253 pionspectra->SetXTitle("(GeV)");
2254 pionspectra->Draw();
2257 protonspectra->SetFillColor(5);
2258 protonspectra->SetXTitle("(GeV)");
2259 protonspectra->Draw();
2262 kaonspectra->SetFillColor(5);
2263 kaonspectra->SetXTitle("(GeV)");
2264 kaonspectra->Draw();
2267 chargedspectra->SetFillColor(5);
2268 chargedspectra->SetXTitle("(GeV)");
2269 chargedspectra->Draw();
2278 c6=new TCanvas("c6","Clusters Statistics",50,50,600,700);
2280 //c3->SetFillColor(42);
2285 Clcharge->SetFillColor(5);
2286 Clcharge->SetXTitle("ADC counts");
2289 Clcharge->Fit("expo");
2290 //expo->SetLineColor(2);
2291 //expo->SetLineWidth(3);
2296 padnumber->SetFillColor(5);
2297 padnumber->SetXTitle("(counts)");
2301 clusev->SetFillColor(5);
2302 clusev->SetXTitle("(counts)");
2305 clusev->Fit("gaus");
2306 //gaus->SetLineColor(2);
2307 //gaus->SetLineWidth(3);
2312 padsmip->SetFillColor(5);
2313 padsmip->SetXTitle("(counts)");
2319 c11 = new TCanvas("c11","Cherenkov per Mip",400,10,600,700);
2320 mother->SetFillColor(5);
2321 mother->SetXTitle("counts");
2325 c7 = new TCanvas("c7","Production Statistics",100,100,600,700);
2327 //c7->SetFillColor(42);
2330 totalphotonsevent->SetFillColor(5);
2331 totalphotonsevent->SetXTitle("Photons (counts)");
2334 totalphotonsevent->Fit("gaus");
2335 //gaus->SetLineColor(2);
2336 //gaus->SetLineWidth(3);
2338 totalphotonsevent->Draw();
2341 photev->SetFillColor(5);
2342 photev->SetXTitle("(counts)");
2345 photev->Fit("gaus");
2346 //gaus->SetLineColor(2);
2347 //gaus->SetLineWidth(3);
2352 feedev->SetFillColor(5);
2353 feedev->SetXTitle("(counts)");
2356 feedev->Fit("gaus");
2357 //gaus->SetLineColor(2);
2358 //gaus->SetLineWidth(3);
2363 padsev->SetFillColor(5);
2364 padsev->SetXTitle("(counts)");
2367 padsev->Fit("gaus");
2368 //gaus->SetLineColor(2);
2369 //gaus->SetLineWidth(3);
2380 c8 = new TCanvas("c8","3D reconstruction of Phi angle",50,50,300,1050);
2382 //c2->SetFillColor(42);
2387 hitsPhi->SetFillColor(5);
2389 hitsPhi->Fit("gaus");
2394 OriginalPhi->SetFillColor(5);
2396 OriginalPhi->Fit("gaus");
2397 OriginalPhi->Draw();
2401 Phi->SetFillColor(5);
2406 c9 = new TCanvas("c9","3D reconstruction of theta angle",75,75,300,1050);
2411 hitsTheta->SetFillColor(5);
2413 hitsTheta->Fit("gaus");
2418 OriginalTheta->SetFillColor(5);
2420 OriginalTheta->Fit("gaus");
2421 OriginalTheta->Draw();
2425 Theta->SetFillColor(5);
2430 c10 = new TCanvas("c10","3D reconstruction of cherenkov angle",100,100,300,1050);
2435 ckovangle->SetFillColor(5);
2436 ckovangle->SetXTitle("angle (radians)");
2438 ckovangle->Fit("gaus");
2443 OriginalOmega->SetFillColor(5);
2444 OriginalOmega->SetXTitle("angle (radians)");
2446 OriginalOmega->Fit("gaus");
2447 OriginalOmega->Draw();
2451 Omega3D->SetFillColor(5);
2452 Omega3D->SetXTitle("angle (radians)");
2454 Omega3D->Fit("gaus");
2458 c11 = new TCanvas("c11","3D reconstruction of mean radius",125,125,300,700);
2463 radius->SetFillColor(5);
2464 radius->SetXTitle("radius (cm)");
2469 MeanRadius->SetFillColor(5);
2470 MeanRadius->SetXTitle("radius (cm)");
2474 c12 = new TCanvas("c12","Cerenkov angle vs. Momentum",150,150,550,350);
2477 identification->SetFillColor(5);
2478 identification->SetXTitle("Momentum (GeV/c)");
2479 identification->SetYTitle("Cherenkov angle (radians)");
2481 //Float_t pionmass=.139;
2482 //Float_t kaonmass=.493;
2483 //Float_t protonmass=.938;
2486 TF1 *pionplot = new TF1("pion","acos(sqrt((.139*.139+x*x)/(x*x*1.285*1.285)))",1,5);
2487 TF1 *kaonplot = new TF1("kaon","acos(sqrt((.439*.439+x*x)/(x*x*1.285*1.285)))",1,5);
2488 TF1 *protonplot = new TF1("proton","acos(sqrt((.938*.938+x*x)/(x*x*1.285*1.285)))",1,5);
2490 identification->Draw();
2492 pionplot->SetLineColor(5);
2493 pionplot->Draw("same");
2495 kaonplot->SetLineColor(4);
2496 kaonplot->Draw("same");
2498 protonplot->SetLineColor(3);
2499 protonplot->Draw("same");
2500 //identification->Draw("same");
2504 c13 = new TCanvas("c13","Reconstruction Errors",200,200,900,350);
2508 PhiError->SetFillColor(5);
2510 PhiError->Fit("gaus");
2513 ThetaError->SetFillColor(5);
2515 ThetaError->Fit("gaus");
2518 OmegaError->SetFillColor(5);
2519 OmegaError->SetXTitle("angle (radians)");
2521 OmegaError->Fit("gaus");
2528 c9 = new TCanvas("c9","1D Reconstruction",100,100,1100,700);
2530 //c5->SetFillColor(42);
2533 ckovangle->SetFillColor(5);
2534 ckovangle->SetXTitle("angle (radians)");
2538 radius->SetFillColor(5);
2539 radius->SetXTitle("radius (cm)");
2543 hc0->SetXTitle("pads");
2547 Omega1D->SetFillColor(5);
2548 Omega1D->SetXTitle("angle (radians)");
2552 PhotonCer->SetFillColor(5);
2553 PhotonCer->SetXTitle("angle (radians)");
2557 PadsUsed->SetXTitle("pads");
2558 PadsUsed->Draw("box");
2565 printf("Drawing histograms.../n");
2569 c10 = new TCanvas("c10","Alice RICH digits",50,50,1200,700);
2571 //c1->SetFillColor(42);
2574 hc1->SetXTitle("ix (npads)");
2577 hc2->SetXTitle("ix (npads)");
2580 hc3->SetXTitle("ix (npads)");
2583 hc4->SetXTitle("ix (npads)");
2586 hc5->SetXTitle("ix (npads)");
2589 hc6->SetXTitle("ix (npads)");
2592 hc7->SetXTitle("ix (npads)");
2595 hc0->SetXTitle("ix (npads)");
2599 c11 = new TCanvas("c11","Hits per type",100,100,600,700);
2601 //c4->SetFillColor(42);
2604 feedback->SetXTitle("x (cm)");
2605 feedback->SetYTitle("y (cm)");
2609 //mip->SetFillColor(5);
2610 mip->SetXTitle("x (cm)");
2611 mip->SetYTitle("y (cm)");
2615 //cerenkov->SetFillColor(5);
2616 cerenkov->SetXTitle("x (cm)");
2617 cerenkov->SetYTitle("y (cm)");
2621 //h->SetFillColor(5);
2622 h->SetXTitle("x (cm)");
2623 h->SetYTitle("y (cm)");
2626 c12 = new TCanvas("c12","Hits distribution",150,150,600,350);
2628 //c10->SetFillColor(42);
2631 hitsX->SetFillColor(5);
2632 hitsX->SetXTitle("(cm)");
2636 hitsY->SetFillColor(5);
2637 hitsY->SetXTitle("(cm)");
2645 // calculate the number of pads which give a signal
2649 /*for (Int_t i=0;i< NpadX;i++) {
2650 for (Int_t j=0;j< NpadY;j++) {
2656 //printf("The total number of pads which give a signal: %d %d\n",Nh,Nh1);
2657 printf("\nEnd of analysis\n");
2658 printf("**********************************\n");
2659 }//void AliRICH::DiagnosticsSE(Int_t diaglevel,Int_t evNumber1,Int_t evNumber2)
2660 //______________________________________________________________________________
2661 void AliRICH::MakeBranchInTreeD(TTree *treeD, const char *file)
2662 {// Create TreeD branches for the RICH.
2663 if(GetDebug())Info("MakeBranchInTreeD","Start.");
2665 const Int_t kBufferSize = 4000;
2666 char branchname[30];
2669 // one branch for digits per chamber
2671 for (Int_t i=0; i<kNCH ;i++) {
2672 sprintf(branchname,"%sDigits%d",GetName(),i+1);
2673 if (fDchambers && treeD) {
2674 MakeBranchInTree(treeD,branchname, &((*fDchambers)[i]), kBufferSize, file);
2675 // printf("Making Branch %s for digits in chamber %d\n",branchname,i+1);
2679 //______________________________________________________________________________
2680 void AliRICH::MakeBranch(Option_t* option)
2681 {//Create Tree branches for the RICH.
2682 if(GetDebug())Info("MakeBranch","Start with option= %s.",option);
2684 const Int_t kBufferSize = 4000;
2685 char branchname[20];
2688 const char *cH = strstr(option,"H");
2689 const char *cD = strstr(option,"D");
2690 const char *cR = strstr(option,"R");
2691 const char *cS = strstr(option,"S");
2695 if(!fHits) fHits=new TClonesArray("AliRICHhit",1000 );
2696 if(!fCerenkovs) fCerenkovs = new TClonesArray("AliRICHCerenkov",1000);
2697 MakeBranchInTree(TreeH(),"RICHCerenkov", &fCerenkovs, kBufferSize, 0) ;
2699 //kir if(!fSDigits) fSDigits = new TClonesArray("AliRICHdigit",100000);
2700 //kir MakeBranchInTree(TreeH(),"RICHSDigits", &fSDigits, kBufferSize, 0) ;
2702 AliDetector::MakeBranch(option);//this is after cH because we need to guarantee that fHits array is created
2704 if(cS&&fLoader->TreeS()){
2705 if(!fSDigits) fSDigits=new TClonesArray("AliRICHdigit",100000);
2706 MakeBranchInTree(fLoader->TreeS(),"RICH",&fSDigits,kBufferSize,0) ;
2710 if (cD&&fLoader->TreeD()){
2712 fDchambers=new TObjArray(kNCH); // one branch for digits per chamber
2713 for(i=0;i<kNCH;i++){
2714 fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
2717 for (i=0; i<kNCH ;i++)
2719 sprintf(branchname,"%sDigits%d",GetName(),i+1);
2720 MakeBranchInTree(fLoader->TreeD(),branchname, &((*fDchambers)[i]), kBufferSize, 0);
2724 if (cR&&gAlice->TreeR()){//one branch for raw clusters per chamber
2726 if (fRawClusters == 0x0 )
2728 fRawClusters = new TObjArray(kNCH);
2729 for (i=0; i<kNCH ;i++)
2731 fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
2735 if (fRecHits1D == 0x0)
2737 fRecHits1D = new TObjArray(kNCH);
2738 for (i=0; i<kNCH ;i++)
2740 fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
2744 if (fRecHits3D == 0x0)
2746 fRecHits3D = new TObjArray(kNCH);
2747 for (i=0; i<kNCH ;i++)
2749 fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
2753 for (i=0; i<kNCH ;i++){
2754 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
2755 MakeBranchInTree(gAlice->TreeR(),branchname, &((*fRawClusters)[i]), kBufferSize, 0);
2756 sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
2757 MakeBranchInTree(fLoader->TreeR(),branchname, &((*fRecHits1D)[i]), kBufferSize, 0);
2758 sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
2759 MakeBranchInTree(fLoader->TreeR(),branchname, &((*fRecHits3D)[i]), kBufferSize, 0);
2761 }//if (cR && gAlice->TreeR())
2762 if(GetDebug())Info("MakeBranch","Stop.");
2764 //______________________________________________________________________________
2765 void AliRICH::SetTreeAddress()
2766 {//Set branch address for the Hits and Digits Tree.
2767 if(GetDebug())Info("SetTreeAddress","Start.");
2769 char branchname[20];
2774 TTree *treeH = fLoader->TreeH();
2775 TTree *treeD = fLoader->TreeD();
2776 TTree *treeR = fLoader->TreeR();
2777 TTree *treeS = fLoader->TreeS();
2780 if(GetDebug())Info("SetTreeAddress","tree H is requested.");
2781 if(fHits==0x0) fHits=new TClonesArray("AliRICHhit",1000);
2783 branch = treeH->GetBranch("RICHCerenkov");
2785 if (fCerenkovs == 0x0) fCerenkovs = new TClonesArray("AliRICHCerenkov",1000);
2786 branch->SetAddress(&fCerenkovs);
2789 //kir branch = treeH->GetBranch("RICHSDigits");
2792 //kir if (fSDigits == 0x0) fSDigits = new TClonesArray("AliRICHdigit",100000);
2793 //kir branch->SetAddress(&fSDigits);
2797 //this is after TreeH because we need to guarantee that fHits array is created
2798 AliDetector::SetTreeAddress();
2801 if(GetDebug())Info("SetTreeAddress","tree S is requested.");
2802 branch = treeS->GetBranch("RICH");
2804 if(!fSDigits) fSDigits=new TClonesArray("AliRICHdigit",100000);
2805 branch->SetAddress(&fSDigits);
2811 if(GetDebug())Info("SetTreeAddress","tree D is requested.");
2813 if (fDchambers == 0x0)
2815 fDchambers = new TObjArray(kNCH);
2816 for (i=0; i<kNCH ;i++)
2818 fDchambers->AddAt(new TClonesArray("AliRICHDigit",10000), i);
2822 for (i=0; i<kNCH; i++) {
2823 sprintf(branchname,"%sDigits%d",GetName(),i+1);
2825 branch = treeD->GetBranch(branchname);
2826 if (branch) branch->SetAddress(&((*fDchambers)[i]));
2832 if(GetDebug())Info("SetTreeAddress","tree R is requested.");
2834 if (fRawClusters == 0x0 )
2836 fRawClusters = new TObjArray(kNCH);
2837 for (i=0; i<kNCH ;i++)
2839 fRawClusters->AddAt(new TClonesArray("AliRICHRawCluster",10000), i);
2843 if (fRecHits1D == 0x0)
2845 fRecHits1D = new TObjArray(kNCH);
2846 for (i=0; i<kNCH ;i++)
2848 fRecHits1D->AddAt(new TClonesArray("AliRICHRecHit1D",1000), i);
2852 if (fRecHits3D == 0x0)
2854 fRecHits3D = new TObjArray(kNCH);
2855 for (i=0; i<kNCH ;i++)
2857 fRecHits3D->AddAt(new TClonesArray("AliRICHRecHit3D",1000), i);
2861 for (i=0; i<kNCH; i++) {
2862 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
2864 branch = treeR->GetBranch(branchname);
2865 if (branch) branch->SetAddress(&((*fRawClusters)[i]));
2869 for (i=0; i<kNCH; i++) {
2870 sprintf(branchname,"%sRecHits1D%d",GetName(),i+1);
2872 branch = treeR->GetBranch(branchname);
2873 if (branch) branch->SetAddress(&((*fRecHits1D)[i]));
2877 for (i=0; i<kNCH; i++) {
2878 sprintf(branchname,"%sRecHits3D%d",GetName(),i+1);
2880 branch = treeR->GetBranch(branchname);
2881 if (branch) branch->SetAddress(&((*fRecHits3D)[i]));
2886 if(GetDebug())Info("SetTreeAddress","Stop.");
2887 }//void AliRICH::SetTreeAddress()
2888 //______________________________________________________________________________
2889 void AliRICH::Print(Option_t *option)const
2891 TObject::Print(option);
2893 Chambers()->Print(option);
2894 }//void AliRICH::Print(Option_t *option)const
2895 //______________________________________________________________________________
2896 void AliRICH::CreateGeometry()
2897 {//Creates detailed geometry simulation (currently GEANT volumes tree)
2898 if(GetDebug())Info("CreateGeometry","Start.");
2899 //???????? to be removed to AliRICHParam?
2900 fpParam->RadiatorToPads(fpParam->FreonThickness()/2+fpParam->QuartzThickness()+fpParam->GapThickness());
2902 //Opaque quartz thickness
2903 Float_t oqua_thickness = .5;
2905 Float_t csi_width =fpParam->Nx()*fpParam->PadX()+fpParam->DeadZone();
2906 Float_t csi_length=fpParam->Ny()*fpParam->PadY()+2*fpParam->DeadZone();
2908 Int_t *idtmed = fIdtmed->GetArray()-999;
2915 //External aluminium box
2916 par[0]=68.8;par[1]=13;par[2]=70.86;//Original Settings
2917 gMC->Gsvolu("RICH", "BOX ", idtmed[1009], par, 3);
2919 par[0]=66.3; par[1] = 13; par[2] = 68.35; //Original Settings
2920 gMC->Gsvolu("SRIC", "BOX ", idtmed[1000], par, 3);
2921 //Air 2 (cutting the lower part of the box)
2922 par[0]=1.25; par[1] = 3; par[2] = 70.86; //Original Settings
2923 gMC->Gsvolu("AIR2", "BOX ", idtmed[1000], par, 3);
2924 //Air 3 (cutting the lower part of the box)
2925 par[0]=66.3; par[1] = 3; par[2] = 1.2505; //Original Settings
2926 gMC->Gsvolu("AIR3", "BOX ", idtmed[1000], par, 3);
2928 par[0]=66.3;par[1]=0.188; par[2] = 68.35; //Original Settings
2929 gMC->Gsvolu("HONE", "BOX ", idtmed[1001], par, 3);
2931 par[0]=66.3;par[1]=0.025;par[2]=68.35; //Original Settings
2932 //par[0] = 66.5; par[1] = .025; par[2] = 63.1;
2933 gMC->Gsvolu("ALUM", "BOX ", idtmed[1009], par, 3);
2935 par[0]=fpParam->QuartzWidth()/2;par[1]=fpParam->QuartzThickness()/2;par[2]=fpParam->QuartzLength()/2;
2936 gMC->Gsvolu("QUAR", "BOX ", idtmed[1002], par, 3);
2937 //Spacers (cylinders)
2938 par[0]=0.;par[1]=.5;par[2]=fpParam->FreonThickness()/2;
2939 gMC->Gsvolu("SPAC", "TUBE", idtmed[1002], par, 3);
2940 //Feet (freon slabs supports)
2941 par[0] = .7; par[1] = .3; par[2] = 1.9;
2942 gMC->Gsvolu("FOOT", "BOX", idtmed[1009], par, 3);
2944 par[0]=fpParam->QuartzWidth()/2;par[1]= .2;par[2]=fpParam->QuartzLength()/2;
2945 gMC->Gsvolu("OQUA", "BOX ", idtmed[1007], par, 3);
2946 //Frame of opaque quartz
2947 par[0]=fpParam->OuterFreonWidth()/2;par[1]=fpParam->FreonThickness()/2;par[2]=fpParam->OuterFreonLength()/2;
2948 gMC->Gsvolu("OQF1", "BOX ", idtmed[1007], par, 3);
2949 par[0]=fpParam->InnerFreonWidth()/2;par[1]=fpParam->FreonThickness()/2;par[2]=fpParam->InnerFreonLength()/2;
2950 gMC->Gsvolu("OQF2", "BOX ", idtmed[1007], par, 3);
2952 par[0]=fpParam->OuterFreonWidth()/2 - oqua_thickness;
2953 par[1]=fpParam->FreonThickness()/2;
2954 par[2]=fpParam->OuterFreonLength()/2 - 2*oqua_thickness;
2955 gMC->Gsvolu("FRE1", "BOX ", idtmed[1003], par, 3);
2957 par[0]=fpParam->InnerFreonWidth()/2 - oqua_thickness;
2958 par[1]=fpParam->FreonThickness()/2;
2959 par[2]=fpParam->InnerFreonLength()/2 - 2*oqua_thickness;
2960 gMC->Gsvolu("FRE2", "BOX ", idtmed[1003], par, 3);
2962 par[0]=csi_width/2;par[1]=fpParam->GapThickness()/2;par[2]=csi_length/2;
2963 gMC->Gsvolu("META", "BOX ", idtmed[1004], par, 3);
2965 par[0]=csi_width/2;par[1]=fpParam->ProximityGapThickness()/2;par[2] = csi_length/2;
2966 gMC->Gsvolu("GAP ", "BOX ", idtmed[1008], par, 3);
2968 par[0]=csi_width/2;par[1]=.25;par[2]=csi_length/2;
2969 gMC->Gsvolu("CSI ", "BOX ", idtmed[1005], par, 3);
2971 par[0] = 0.;par[1] = .001;par[2] = 20.;
2972 gMC->Gsvolu("GRID", "TUBE", idtmed[1006], par, 3);
2976 par[0]=csi_width/2;par[1]=1.05;par[2]=1.05;
2977 gMC->Gsvolu("WSMe", "BOX ", idtmed[1009], par, 3);
2978 //Ceramic pick up (base)
2979 par[0]=csi_width/2;par[1]= .25;par[2]=1.05;
2980 gMC->Gsvolu("WSG1", "BOX ", idtmed[1010], par, 3);
2981 //Ceramic pick up (head)
2982 par[0] = csi_width/2;par[1] = .1;par[2] = .1;
2983 gMC->Gsvolu("WSG2", "BOX ", idtmed[1010], par, 3);
2985 //Aluminium supports for methane and CsI
2987 par[0]=csi_width/2;par[1]=fpParam->GapThickness()/2 + .25; par[2] = (68.35 - csi_length/2)/2;
2988 gMC->Gsvolu("SMSH", "BOX", idtmed[1009], par, 3);
2990 par[0]=(66.3 - csi_width/2)/2;par[1]=fpParam->GapThickness()/2+.25;par[2]=csi_length/2+68.35-csi_length/2;
2991 gMC->Gsvolu("SMLG", "BOX", idtmed[1009], par, 3);
2993 //Aluminium supports for freon
2995 par[0] = fpParam->QuartzWidth()/2; par[1] = .3; par[2] = (68.35 - fpParam->QuartzLength()/2)/2;
2996 gMC->Gsvolu("SFSH", "BOX", idtmed[1009], par, 3);
2998 par[0] = (66.3 - fpParam->QuartzWidth()/2)/2; par[1] = .3;
2999 par[2] = fpParam->QuartzLength()/2 + 68.35 - fpParam->QuartzLength()/2;
3000 gMC->Gsvolu("SFLG", "BOX", idtmed[1009], par, 3);
3002 par[0] = csi_width/2;par[1] = .25; par[2] = csi_length/4 -.5025;
3003 gMC->Gsvolu("PCB ", "BOX", idtmed[1011], par, 3);
3005 //Backplane supports
3007 par[0] = 33.15;par[1] = 2;par[2] = 21.65;
3008 gMC->Gsvolu("BACK", "BOX", idtmed[1009], par, 3);
3010 par[0] = 9.05; par[1] = 2; par[2] = 4.4625;
3011 gMC->Gsvolu("BKHL", "BOX", idtmed[1000], par, 3);
3013 par[0] = 5.7;par[1] = 2;par[2] = 4.4625;
3014 gMC->Gsvolu("BKHS", "BOX", idtmed[1000], par, 3);
3015 //Place holes inside backplane support
3016 gMC->Gspos("BKHS", 1, "BACK", .8 + 5.7,0., .6 + 4.4625, 0, "ONLY");
3017 gMC->Gspos("BKHS", 2, "BACK", -.8 - 5.7,0., .6 + 4.4625, 0, "ONLY");
3018 gMC->Gspos("BKHS", 3, "BACK", .8 + 5.7,0., -.6 - 4.4625, 0, "ONLY");
3019 gMC->Gspos("BKHS", 4, "BACK", -.8 - 5.7,0., -.6 - 4.4625, 0, "ONLY");
3020 gMC->Gspos("BKHS", 5, "BACK", .8 + 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
3021 gMC->Gspos("BKHS", 6, "BACK", -.8 - 5.7,0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
3022 gMC->Gspos("BKHS", 7, "BACK", .8 + 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
3023 gMC->Gspos("BKHS", 8, "BACK", -.8 - 5.7,0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
3024 gMC->Gspos("BKHL", 1, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., .6 + 4.4625, 0, "ONLY");
3025 gMC->Gspos("BKHL", 2, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 4.4625, 0, "ONLY");
3026 gMC->Gspos("BKHL", 3, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 4.4625, 0, "ONLY");
3027 gMC->Gspos("BKHL", 4, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 4.4625, 0, "ONLY");
3028 gMC->Gspos("BKHL", 5, "BACK", .8 + 11.4+ 1.6 + 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
3029 gMC->Gspos("BKHL", 6, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., .6 + 8.925 + 1.2 + 4.4625, 0, "ONLY");
3030 gMC->Gspos("BKHL", 7, "BACK", .8 + 11.4 + 1.6 + 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
3031 gMC->Gspos("BKHL", 8, "BACK", -.8 - 11.4 - 1.6 - 9.05, 0., -.6 - 8.925 - 1.2 - 4.4625, 0, "ONLY");
3032 //Place material inside RICH
3033 gMC->Gspos("SRIC", 1, "RICH", 0.,0., 0., 0, "ONLY");
3034 gMC->Gspos("AIR2", 1, "RICH", 66.3 + 1.2505, 1.276-fpParam->GapThickness()/2-fpParam->QuartzThickness()-fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
3035 gMC->Gspos("AIR2", 2, "RICH", -66.3 - 1.2505,1.276-fpParam->GapThickness()/2-fpParam->QuartzThickness()-fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 0., 0, "ONLY");
3036 gMC->Gspos("AIR3", 1, "RICH", 0., 1.276-fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, -68.35 - 1.25, 0, "ONLY");
3037 gMC->Gspos("AIR3", 2, "RICH", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.5 - 3.35, 68.35 + 1.25, 0, "ONLY");
3038 gMC->Gspos("ALUM", 1, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .376 -.025, 0., 0, "ONLY");
3039 gMC->Gspos("HONE", 1, "SRIC", 0., 1.276- fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .05 - .188, 0., 0, "ONLY");
3040 gMC->Gspos("ALUM", 2, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .6 - .025, 0., 0, "ONLY");
3041 gMC->Gspos("FOOT", 1, "SRIC", 64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, 36.9, 0, "ONLY");
3042 gMC->Gspos("FOOT", 2, "SRIC", 21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3 , 36.9, 0, "ONLY");
3043 gMC->Gspos("FOOT", 3, "SRIC", -21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, 36.9, 0, "ONLY");
3044 gMC->Gspos("FOOT", 4, "SRIC", -64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, 36.9, 0, "ONLY");
3045 gMC->Gspos("FOOT", 5, "SRIC", 64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
3046 gMC->Gspos("FOOT", 6, "SRIC", 21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
3047 gMC->Gspos("FOOT", 7, "SRIC", -21.65, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
3048 gMC->Gspos("FOOT", 8, "SRIC", -64.95, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .4 - .3, -36.9, 0, "ONLY");
3049 gMC->Gspos("OQUA", 1, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()- .2, 0., 0, "ONLY");
3051 gMC->Gspos("SMLG", 1, "SRIC", csi_width/2 + (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
3052 gMC->Gspos("SMLG", 2, "SRIC", - csi_width/2 - (66.3 - csi_width/2)/2, 1.276 + .25, 0., 0, "ONLY");
3053 gMC->Gspos("SMSH", 1, "SRIC", 0., 1.276 + .25, csi_length/2 + (68.35 - csi_length/2)/2, 0, "ONLY");
3054 gMC->Gspos("SMSH", 2, "SRIC", 0., 1.276 + .25, - csi_length/2 - (68.35 - csi_length/2)/2, 0, "ONLY");
3056 Float_t supp_y = 1.276 - fpParam->GapThickness()/2- fpParam->QuartzThickness() -fpParam->FreonThickness() - .2 + .3; //y position of freon supports
3057 gMC->Gspos("SFLG", 1, "SRIC", fpParam->QuartzWidth()/2 + (66.3 - fpParam->QuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
3058 gMC->Gspos("SFLG", 2, "SRIC", - fpParam->QuartzWidth()/2 - (66.3 - fpParam->QuartzWidth()/2)/2, supp_y, 0., 0, "ONLY");
3059 gMC->Gspos("SFSH", 1, "SRIC", 0., supp_y, fpParam->QuartzLength()/2 + (68.35 - fpParam->QuartzLength()/2)/2, 0, "ONLY");
3060 gMC->Gspos("SFSH", 2, "SRIC", 0., supp_y, - fpParam->QuartzLength()/2 - (68.35 - fpParam->QuartzLength()/2)/2, 0, "ONLY");
3061 AliMatrix(idrotm[1019], 0., 0., 90., 0., 90., 90.);
3063 Int_t nspacers = 30;
3064 for (i = 0; i < nspacers/3; i++) {
3065 zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
3066 gMC->Gspos("SPAC", i, "FRE1", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
3068 for (i = nspacers/3; i < (nspacers*2)/3; i++) {
3069 zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
3070 gMC->Gspos("SPAC", i, "FRE1", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
3072 for (i = (nspacers*2)/3; i < nspacers; ++i) {
3073 zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
3074 gMC->Gspos("SPAC", i, "FRE1", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
3076 for (i = 0; i < nspacers/3; i++) {
3077 zs = -11.6/2 + (TMath::Abs(nspacers/6) - i) * 12.2;
3078 gMC->Gspos("SPAC", i, "FRE2", 10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
3080 for (i = nspacers/3; i < (nspacers*2)/3; i++) {
3081 zs = -11.6/2 + (nspacers/3 + TMath::Abs(nspacers/6) - i) * 12.2;
3082 gMC->Gspos("SPAC", i, "FRE2", 0, 0., zs, idrotm[1019], "ONLY"); //Original settings
3084 for (i = (nspacers*2)/3; i < nspacers; ++i) {
3085 zs = -11.6/2 + ((nspacers*2)/3 + TMath::Abs(nspacers/6) - i) * 12.2;
3086 gMC->Gspos("SPAC", i, "FRE2", -10.5, 0., zs, idrotm[1019], "ONLY"); //Original settings
3088 gMC->Gspos("FRE1", 1, "OQF1", 0., 0., 0., 0, "ONLY");
3089 gMC->Gspos("FRE2", 1, "OQF2", 0., 0., 0., 0, "ONLY");
3090 gMC->Gspos("OQF1", 1, "SRIC", fpParam->OuterFreonWidth()/2 + fpParam->InnerFreonWidth()/2 + 2, 1.276 - fpParam->GapThickness()/2- fpParam->QuartzThickness() -fpParam->FreonThickness()/2, 0., 0, "ONLY"); //Original settings (31.3)
3091 gMC->Gspos("OQF2", 2, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()/2, 0., 0, "ONLY"); //Original settings
3092 gMC->Gspos("OQF1", 3, "SRIC", - (fpParam->OuterFreonWidth()/2 + fpParam->InnerFreonWidth()/2) - 2, 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness() - fpParam->FreonThickness()/2, 0., 0, "ONLY"); //Original settings (-31.3)
3093 gMC->Gspos("QUAR", 1, "SRIC", 0., 1.276 - fpParam->GapThickness()/2 - fpParam->QuartzThickness()/2, 0., 0, "ONLY");
3094 gMC->Gspos("GAP ", 1, "META", 0., fpParam->GapThickness()/2 - fpParam->ProximityGapThickness()/2 - 0.0001, 0., 0, "ONLY");
3095 gMC->Gspos("META", 1, "SRIC", 0., 1.276, 0., 0, "ONLY");
3096 gMC->Gspos("CSI ", 1, "SRIC", 0., 1.276 + fpParam->GapThickness()/2 + .25, 0., 0, "ONLY");
3097 //Wire support placing
3098 gMC->Gspos("WSG2", 1, "GAP ", 0., fpParam->ProximityGapThickness()/2 - .1, 0., 0, "ONLY");
3099 gMC->Gspos("WSG1", 1, "CSI ", 0., 0., 0., 0, "ONLY");
3100 gMC->Gspos("WSMe", 1, "SRIC ", 0., 1.276 + fpParam->GapThickness()/2 + .5 + 1.05, 0., 0, "ONLY");
3102 gMC->Gspos("BACK", 1, "SRIC ", -33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, 43.3, 0, "ONLY");
3103 gMC->Gspos("BACK", 2, "SRIC ", 33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2 , 43.3, 0, "ONLY");
3104 gMC->Gspos("BACK", 3, "SRIC ", -33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
3105 gMC->Gspos("BACK", 4, "SRIC ", 33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, 0., 0, "ONLY");
3106 gMC->Gspos("BACK", 5, "SRIC ", 33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
3107 gMC->Gspos("BACK", 6, "SRIC ", -33.15, 1.276 + fpParam->GapThickness()/2 + .5 + 2.1 + 2, -43.3, 0, "ONLY");
3109 gMC->Gspos("PCB ", 1, "SRIC ", 0., 1.276 + fpParam->GapThickness()/2 + .5 + 1.05, csi_width/4 + .5025 + 2.5, 0, "ONLY");
3110 gMC->Gspos("PCB ", 2, "SRIC ", 0., 1.276 + fpParam->GapThickness()/2 + .5 + 1.05, -csi_width/4 - .5025 - 2.5, 0, "ONLY");
3112 //place chambers into mother volume ALIC
3115 for(int i=0;i<kNCH;i++){
3116 AliMatrix(idrotm[1000+i],C(i)->ThetaXd(),C(i)->PhiXd(),
3117 C(i)->ThetaYd(),C(i)->PhiYd(),
3118 C(i)->ThetaZd(),C(i)->PhiZd());
3119 gMC->Gspos("RICH",i+1,"ALIC",C(i)->X(),C(i)->Y(),C(i)->Z(),idrotm[1000+i], "ONLY");
3122 if(GetDebug())Info("CreateGeometry","Stop.");
3123 }//void AliRICH::CreateGeometry()
3124 //______________________________________________________________________________
3125 void AliRICH::CreateChambers()
3126 {//(re)create all RICH Chambers
3127 if(GetDebug())Info("CreateChambers","Start.");
3129 if(fChambers) delete fChambers;//recreate chambers
3130 fChambers=new TObjArray(kNCH);
3131 fChambers->SetOwner();
3132 for(int i=0;i<kNCH;i++){
3133 fChambers->AddAt(new AliRICHChamber(i+1,fpParam),i);
3136 if(GetDebug())Info("CreateChambers","Stop.");
3137 }//void AliRICH::CreateChambers()