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 **************************************************************************/
20 /////////////////////////////////////////////////////////
21 // Manager and hits classes for set:RICH version 0 //
22 /////////////////////////////////////////////////////////
28 #include "AliRICHv0.h"
32 #include "AliCallf77.h"
38 //___________________________________________
39 AliRICHv0::AliRICHv0() : AliRICH()
44 //___________________________________________
45 AliRICHv0::AliRICHv0(const char *name, const char *title)
49 fChambers = new TObjArray(7);
50 for (Int_t i=0; i<7; i++) {
52 (*fChambers)[i] = new AliRICHchamber();
58 //___________________________________________
59 void AliRICHv0::CreateGeometry()
62 // Create the geometry for RICH version 1
64 // Modified by: N. Colonna (INFN - BARI, Nicola.Colonna@ba.infn.it)
65 // R.A. Fini (INFN - BARI, Rosanna.Fini@ba.infn.it)
66 // R.A. Loconsole (Bari University, loco@riscom.ba.infn.it)
70 <img src="picts/AliRICHv1.gif">
75 <img src="picts/AliRICHv1Tree.gif">
80 Int_t *idtmed = fIdtmed->GetArray()-999;
87 // --- Define the RICH detector
88 // External aluminium box
92 gMC->Gsvolu("RICH", "BOX ", idtmed[1009], par, 3);
94 // Sensitive part of the whole RICH
98 gMC->Gsvolu("SRIC", "BOX ", idtmed[1000], par, 3);
104 gMC->Gsvolu("HONE", "BOX ", idtmed[1001], par, 3);
110 gMC->Gsvolu("ALUM", "BOX ", idtmed[1009], par, 3);
116 gMC->Gsvolu("QUAR", "BOX ", idtmed[1002], par, 3);
118 // Spacers (cylinders)
122 gMC->Gsvolu("SPAC", "TUBE", idtmed[1002], par, 3);
128 gMC->Gsvolu("OQUA", "BOX ", idtmed[1007], par, 3);
130 // Frame of opaque quartz
134 gMC->Gsvolu("OQUF", "BOX ", idtmed[1007], par, 3);
136 // Little bar of opaque quartz
140 gMC->Gsvolu("BARR", "BOX ", idtmed[1007], par, 3);
146 gMC->Gsvolu("FREO", "BOX ", idtmed[1003], par, 3);
152 gMC->Gsvolu("META", "BOX ", idtmed[1004], par, 3);
158 gMC->Gsvolu("GAP ", "BOX ", idtmed[1008], par, 3);
164 gMC->Gsvolu("CSI ", "BOX ", idtmed[1005], par, 3);
170 gMC->Gsvolu("GRID", "TUBE", idtmed[1006], par, 3);
172 // --- Places the detectors defined with GSVOLU
173 // Place material inside RICH
174 gMC->Gspos("SRIC", 1, "RICH", 0., 0., 0., 0, "ONLY");
176 gMC->Gspos("ALUM", 1, "SRIC", 0., -6.075, 0., 0, "ONLY");
177 gMC->Gspos("HONE", 1, "SRIC", 0., -5.862, 0., 0, "ONLY");
178 gMC->Gspos("ALUM", 2, "SRIC", 0., -5.649, 0., 0, "ONLY");
179 gMC->Gspos("OQUA", 1, "SRIC", 0., -5.424, 0., 0, "ONLY");
181 AliMatrix(idrotm[1019], 0., 0., 90., 0., 90., 90.);
183 for (i = 1; i <= 9; ++i) {
185 gMC->Gspos("SPAC", i, "FREO", 6.7, 0., zs, idrotm[1019], "ONLY");
187 for (i = 10; i <= 18; ++i) {
188 zs = (14 - i) * 14.4;
189 gMC->Gspos("SPAC", i, "FREO", -6.7, 0., zs, idrotm[1019], "ONLY");
192 gMC->Gspos("FREO", 1, "OQUF", 0., 0., 0., 0, "ONLY");
193 gMC->Gspos("OQUF", 1, "SRIC", 41.3, -4.724, 0., 0, "ONLY");
194 gMC->Gspos("OQUF", 2, "SRIC", 0., -4.724, 0., 0, "ONLY");
195 gMC->Gspos("OQUF", 3, "SRIC", -41.3, -4.724, 0., 0, "ONLY");
196 gMC->Gspos("BARR", 1, "QUAR", 0., 0., -21.65, 0, "ONLY");
197 gMC->Gspos("BARR", 2, "QUAR", 0., 0., 21.65, 0, "ONLY");
198 gMC->Gspos("QUAR", 1, "SRIC", 0., -3.974, 0., 0, "ONLY");
199 gMC->Gspos("GAP ", 1, "META", 0., 4.8, 0., 0, "ONLY");
200 gMC->Gspos("META", 1, "SRIC", 0., 1.276, 0., 0, "ONLY");
201 gMC->Gspos("CSI ", 1, "SRIC", 0., 6.526, 0., 0, "ONLY");
203 // Place RICH inside ALICE apparatus
205 AliMatrix(idrotm[1000], 90., 0., 70.69, 90., 19.31, -90.);
206 AliMatrix(idrotm[1001], 90., -20., 90., 70., 0., 0.);
207 AliMatrix(idrotm[1002], 90., 0., 90., 90., 0., 0.);
208 AliMatrix(idrotm[1003], 90., 20., 90., 110., 0., 0.);
209 AliMatrix(idrotm[1004], 90., 340., 108.2, 70., 18.2, 70.);
210 AliMatrix(idrotm[1005], 90., 0., 109.31, 90., 19.31, 90.);
211 AliMatrix(idrotm[1006], 90., 20., 108.2, 110., 18.2, 110.);
213 gMC->Gspos("RICH", 1, "ALIC", 0., 471.9, 165.26, idrotm[1000], "ONLY");
214 gMC->Gspos("RICH", 2, "ALIC", 171., 470., 0., idrotm[1001], "ONLY");
215 gMC->Gspos("RICH", 3, "ALIC", 0., 500., 0., idrotm[1002], "ONLY");
216 gMC->Gspos("RICH", 4, "ALIC", -171., 470., 0., idrotm[1003], "ONLY");
217 gMC->Gspos("RICH", 5, "ALIC", 161.4, 443.4, -165.3, idrotm[1004], "ONLY");
218 gMC->Gspos("RICH", 6, "ALIC", 0., 471.9, -165.3, idrotm[1005], "ONLY");
219 gMC->Gspos("RICH", 7, "ALIC", -161.4, 443.4, -165.3, idrotm[1006], "ONLY");
224 //___________________________________________
225 void AliRICHv0::CreateMaterials()
228 // *** DEFINITION OF AVAILABLE RICH MATERIALS ***
229 // ORIGIN : NICK VAN EIJNDHOVEN
230 // Modified by: N. Colonna (INFN - BARI, Nicola.Colonna@ba.infn.it)
231 // R.A. Fini (INFN - BARI, Rosanna.Fini@ba.infn.it)
232 // R.A. Loconsole (Bari University, loco@riscom.ba.infn.it)
234 Int_t ISXFLD = gAlice->Field()->Integ();
235 Float_t SXMGMX = gAlice->Field()->Max();
237 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,
238 6.7e-9,6.88e-9,7.08e-9,7.3e-9,7.51e-9,7.74e-9,8e-9 };
239 Float_t rindex_quarz[14] = { 1.528309,1.533333,
240 1.538243,1.544223,1.550568,1.55777,
241 1.565463,1.574765,1.584831,1.597027,
242 1.611858,1.6277,1.6472,1.6724 };
243 Float_t rindex_quarzo[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
244 Float_t rindex_methane[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
245 Float_t rindex_gri[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
246 Float_t absco_freon[14] = { 179.0987,179.0987,
247 179.0987,179.0987,179.0987,35.7,12.54,5.92,4.92,3.86,1.42,.336,.134,0. };
248 Float_t absco_quarz[14] = { 20.126,16.27,13.49,11.728,9.224,8.38,7.44,7.17,
249 6.324,4.483,1.6,.323,.073,0. };
250 Float_t absco_quarzo[14] = { 1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,
251 1e-5,1e-5,1e-5,1e-5,1e-5 };
252 Float_t absco_csi[14] = { 1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,
253 1e-4,1e-4,1e-4,1e-4 };
254 Float_t absco_methane[14] = { 1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,
256 Float_t absco_gri[14] = { 1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,
257 1e-4,1e-4,1e-4,1e-4 };
258 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
259 Float_t effic_csi[14] = { 4.74e-4,.00438,.009,.0182,.0282,.0653,.1141,.163,
260 .2101,.2554,.293,.376,.3861,.418 };
261 Float_t effic_gri[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
263 Float_t afre[2], agri, amet[2], aqua[2], ahon, zfre[2], zgri, zhon,
267 Int_t nlmatmet, nlmatqua;
268 Float_t wmatquao[2], rindex_freon[14];
270 Float_t aquao[2], epsil, stmin, zquao[2];
272 Float_t radlal, densal, tmaxfd, deemax, stemax;
273 Float_t aal, zal, radlgri, densfre, radlhon, densgri, denshon,densqua, densmet, wmatfre[2], wmatmet[2], wmatqua[2];
275 Int_t *idtmed = fIdtmed->GetArray()-999;
277 TGeant3 *geant3 = (TGeant3*) gMC;
279 // --- Photon energy (GeV)
280 // --- Refraction indexes
281 for (i = 0; i < 14; ++i) {
282 rindex_freon[i] = ppckov[i] * .01095 * 1e9 + 1.2177;
284 // need to be changed
286 // --- Absorbtion lenghts (in cm)
287 // DATA ABSCO_QUARZ /
289 // & 29.85, 7.34, 4.134, 1.273, 0.722,
290 // & 0.365, 0.365, 0.365, 0. /
291 // need to be changed
293 // --- Detection efficiencies (quantum efficiency for CsI)
294 // --- Define parameters for honeycomb.
295 // Used carbon of equivalent rad. lenght
302 // --- Parameters to include in GSMIXT, relative to Quarz (SiO2)
313 // --- Parameters to include in GSMIXT, relative to opaque Quarz (SiO2)
324 // --- Parameters to include in GSMIXT, relative to Freon (C6F14)
335 // --- Parameters to include in GSMIXT, relative to methane (CH4)
346 // --- Parameters to include in GSMIXT, relative to anode grid (Cu)
353 // --- Parameters to include in GSMATE related to aluminium sheet
360 AliMaterial(1, "Air $", 14.61, 7.3, .001205, 30420., 67500);
361 AliMaterial(6, "HON", ahon, zhon, denshon, radlhon, 0);
362 AliMaterial(16, "CSI", ahon, zhon, denshon, radlhon, 0);
363 AliMixture(20, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
364 AliMixture(21, "QUAO", aquao, zquao, densquao, nlmatquao, wmatquao);
365 AliMixture(30, "FRE", afre, zfre, densfre, nlmatfre, wmatfre);
366 AliMixture(40, "MET", amet, zmet, densmet, nlmatmet, wmatmet);
367 AliMixture(41, "METG", amet, zmet, densmet, nlmatmet, wmatmet);
368 AliMaterial(11, "GRI", agri, zgri, densgri, radlgri, 0);
369 AliMaterial(50, "ALUM", aal, zal, densal, radlal, 0);
377 AliMedium(1, "DEFAULT MEDIUM AIR$", 1, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
378 AliMedium(2, "HONEYCOMB$", 6, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
379 AliMedium(3, "QUARZO$", 20, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
380 AliMedium(4, "FREON$", 30, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
381 AliMedium(5, "METANO$", 40, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
382 AliMedium(6, "CSI$", 16, 1, ISXFLD, SXMGMX,tmaxfd, stemax, deemax, epsil, stmin);
383 AliMedium(7, "GRIGLIA$", 11, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
384 AliMedium(8, "QUARZOO$", 21, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
385 AliMedium(9, "GAP$", 41, 1, ISXFLD, SXMGMX,tmaxfd, .1, -deemax, epsil, -stmin);
386 AliMedium(10, "ALUMINUM$", 50, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
389 // Switch on delta-ray production in the methane and freon gaps
391 gMC->Gstpar(idtmed[1002], "LOSS", 1.);
392 gMC->Gstpar(idtmed[1003], "LOSS", 1.);
393 gMC->Gstpar(idtmed[1004], "LOSS", 1.);
394 gMC->Gstpar(idtmed[1008], "LOSS", 1.);
395 gMC->Gstpar(idtmed[1005], "LOSS", 1.);
396 gMC->Gstpar(idtmed[1002], "HADR", 1.);
397 gMC->Gstpar(idtmed[1003], "HADR", 1.);
398 gMC->Gstpar(idtmed[1004], "HADR", 1.);
399 gMC->Gstpar(idtmed[1008], "HADR", 1.);
400 gMC->Gstpar(idtmed[1005], "HADR", 1.);
401 gMC->Gstpar(idtmed[1002], "DCAY", 1.);
402 gMC->Gstpar(idtmed[1003], "DCAY", 1.);
403 gMC->Gstpar(idtmed[1004], "DCAY", 1.);
404 gMC->Gstpar(idtmed[1008], "DCAY", 1.);
405 gMC->Gstpar(idtmed[1005], "DCAY", 1.);
406 geant3->Gsckov(idtmed[1000], 14, ppckov, absco_methane, effic_all, rindex_methane);
407 geant3->Gsckov(idtmed[1001], 14, ppckov, absco_methane, effic_all, rindex_methane);
408 geant3->Gsckov(idtmed[1002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
409 geant3->Gsckov(idtmed[1003], 14, ppckov, absco_freon, effic_all,rindex_freon);
410 geant3->Gsckov(idtmed[1004], 14, ppckov, absco_methane, effic_all, rindex_methane);
411 geant3->Gsckov(idtmed[1005], 14, ppckov, absco_csi, effic_csi, rindex_methane);
412 geant3->Gsckov(idtmed[1006], 14, ppckov, absco_gri, effic_gri, rindex_gri);
413 geant3->Gsckov(idtmed[1007], 14, ppckov, absco_quarzo, effic_all, rindex_quarzo);
414 geant3->Gsckov(idtmed[1008], 14, ppckov, absco_methane, effic_all, rindex_methane);
415 geant3->Gsckov(idtmed[1009], 14, ppckov, absco_gri, effic_gri, rindex_gri);
418 //___________________________________________
420 void AliRICHv0::Init()
422 printf("\n\n\n Start Init for version 0 - CPC chamber type \n\n\n");
425 // Initialize Tracking Chambers
427 for (Int_t i=0; i<7; i++) {
428 ( (AliRICHchamber*) (*fChambers)[i])->Init();
432 // Set the chamber (sensitive region) GEANT identifier
434 ((AliRICHchamber*)(*fChambers)[0])->SetGid(1);
435 ((AliRICHchamber*)(*fChambers)[1])->SetGid(2);
436 ((AliRICHchamber*)(*fChambers)[2])->SetGid(3);
437 ((AliRICHchamber*)(*fChambers)[3])->SetGid(4);
438 ((AliRICHchamber*)(*fChambers)[4])->SetGid(5);
439 ((AliRICHchamber*)(*fChambers)[5])->SetGid(6);
440 ((AliRICHchamber*)(*fChambers)[6])->SetGid(7);
442 printf("\n\n\n Finished Init for version 0 - CPC chamber type\n\n\n");
445 //___________________________________________
446 void AliRICHv0::StepManager()
452 static Float_t hits[9];
453 TLorentzVector Position;
454 TLorentzVector Momentum;
459 Float_t Localtheta,Localphi;
461 Float_t destep, step;
462 static Float_t eloss, xhit, yhit, tlength;
463 const Float_t big=1.e10;
465 TClonesArray &lhits = *fHits;
466 TClonesArray &lcerenkovs = *fCerenkovs;
468 // Only gas gap inside chamber
469 // Tag chambers and record hits when track enters
472 id=gMC->CurrentVolID(copy);
473 Float_t cherenkov_loss=0.00001;
475 // Treat photons produced in Freon and Quartz
476 if (gMC->TrackPid() == 50000050 ) {
477 if (gMC->IsTrackEntering()){
478 if (gMC->VolId("FREO")==gMC->CurrentVolID(copy) || gMC->VolId("QUAR")==gMC->CurrentVolID(copy)){
479 //printf("GOT ONE! Type:%d \n",gMC->TrackPid());
485 if (gMC->TrackPid() == 50000050 ) {
486 if (gMC->VolId("CSI ")==gMC->CurrentVolID(copy))
488 if (gMC->Edep() > 0.){
489 gMC->TrackPosition(Position);
490 gMC->TrackMomentum(Momentum);
498 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
499 Double_t rt = TMath::Sqrt(tc);
500 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
501 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
502 gMC->Gmtod(pos,Localpos,1);
503 gMC->Gmtod(mom,Localmom,2);
505 gMC->CurrentVolOffID(2,copy);
509 ((AliRICHchamber*) (*fChambers)[idvol])
510 ->SigGenInit(Localpos[0], Localpos[2], Localpos[1]);
512 hits[0] = 50000050; // particle type
513 hits[1] = pos[0]; // X-position for hit
514 hits[2] = pos[1]; // Y-position for hit
515 hits[3] = pos[2]; // Z-position for hit
516 hits[4] = theta; // theta angle of incidence
517 hits[5] = phi; // phi angle of incidence
518 hits[8] = (Float_t) fNclusters; // first padhit
519 hits[9] = -1; // last pad hit
521 MakePadHits(Localpos[0],Localpos[2],cherenkov_loss,idvol,cerenkov);
522 if (fNclusters > (Int_t)hits[8]) {
524 hits[9]= (Float_t) fNclusters;
527 AddHit(gAlice->CurrentTrack(),vol,hits);
528 new(lcerenkovs[fNcerenkovs++]) AliRICHCerenkov(fIshunt,gAlice->CurrentTrack(),vol,hits);
536 // treat charged particles
537 } else if (gMC->TrackCharge())
541 if (gMC->VolId("GAP ")== gMC->CurrentVolID(copy)) {
542 // Get current particle id (ipart), track position (pos) and momentum (mom)
544 gMC->CurrentVolOffID(3,copy);
548 gMC->TrackPosition(Position);
549 gMC->TrackMomentum(Momentum);
557 gMC->Gmtod(pos,Localpos,1);
558 gMC->Gmtod(mom,Localmom,2);
560 ipart = gMC->TrackPid();
562 // momentum loss and steplength in last step
563 destep = gMC->Edep();
564 step = gMC->TrackStep();
567 // record hits when track enters ...
568 if( gMC->IsTrackEntering()) {
569 gMC->SetMaxStep(fMaxStepGas);
570 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
571 Double_t rt = TMath::Sqrt(tc);
572 theta = Float_t(TMath::ATan2(rt,Double_t(mom[2])))*kRaddeg;
573 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
575 Localtheta = Float_t(TMath::ATan2(rt,Double_t(Localmom[2])))*kRaddeg;
576 Localphi = Float_t(TMath::ATan2(Double_t(Localmom[1]),Double_t(Localmom[0])))*kRaddeg;
578 hits[0] = Float_t(ipart); // particle type
579 hits[1] = pos[0]; // X-position for hit
580 hits[2] = pos[1]; // Y-position for hit
581 hits[3] = pos[2]; // Z-position for hit
582 hits[4] = theta; // theta angle of incidence
583 hits[5] = phi; // phi angle of incidence
584 hits[8] = (Float_t) fNclusters; // first padhit
585 hits[9] = -1; // last pad hit
586 // phi angle of incidence
590 Chamber(idvol).LocaltoGlobal(Localpos,hits+1);
592 //To make chamber coordinates x-y had to pass LocalPos[0], LocalPos[2]
595 // Only if not trigger chamber
598 // Initialize hit position (cursor) in the segmentation model
599 ((AliRICHchamber*) (*fChambers)[idvol])
600 ->SigGenInit(Localpos[0], Localpos[2], Localpos[1]);
605 // Calculate the charge induced on a pad (disintegration) in case
607 // Mip left chamber ...
608 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
609 gMC->SetMaxStep(big);
615 // Only if not trigger chamber
617 if (eloss > 0) MakePadHits(xhit,yhit,eloss,idvol,mip);
622 if (fNclusters > (Int_t)hits[8]) {
624 hits[9]= (Float_t) fNclusters;
628 AliRICHhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
631 // Check additional signal generation conditions
632 // defined by the segmentation
633 // model (boundary crossing conditions)
635 (((AliRICHchamber*) (*fChambers)[idvol])
636 ->SigGenCond(Localpos[0], Localpos[2], Localpos[1]))
638 ((AliRICHchamber*) (*fChambers)[idvol])
639 ->SigGenInit(Localpos[0], Localpos[2], Localpos[1]);
640 if (eloss > 0) MakePadHits(xhit,yhit,eloss,idvol,mip);
646 // nothing special happened, add up energy loss
656 //___________________________________________
657 void AliRICH::MakePadHits(Float_t xhit,Float_t yhit,Float_t eloss, Int_t idvol, Response_t res)
660 // Calls the charge disintegration method of the current chamber and adds
661 // the simulated cluster to the root treee
664 Float_t newclust[6][500];
668 // Integrated pulse height on chamber
672 ((AliRICHchamber*) (*fChambers)[idvol])->DisIntegration(eloss, xhit, yhit, nnew, newclust, res);
677 for (Int_t i=0; i<nnew; i++) {
678 if (Int_t(newclust[3][i]) > 0) {
681 clhits[1] = Int_t(newclust[5][i]);
683 clhits[2] = Int_t(newclust[0][i]);
685 clhits[3] = Int_t(newclust[1][i]);
687 clhits[4] = Int_t(newclust[2][i]);
689 clhits[5] = Int_t(newclust[3][i]);
690 // Pad: chamber sector
691 clhits[6] = Int_t(newclust[4][i]);
698 ClassImp(AliRICHchamber)
700 AliRICHchamber::AliRICHchamber()
702 fSegmentation = new TObjArray(2);
703 fResponse= new TObjArray(2);
710 // Get reference to response model
711 AliRICHresponse* AliRICHchamber::GetResponseModel(Response_t res)
714 return (AliRICHresponse*) (*fResponse)[0];
715 } else if (res==cerenkov) {
716 return (AliRICHresponse*) (*fResponse)[1];
718 return (AliRICHresponse*) (*fResponse)[0];
721 // Configure response model
722 void AliRICHchamber::ResponseModel(Response_t res, AliRICHresponse* thisResponse)
726 (*fResponse)[0]=thisResponse;
727 } else if (res==cerenkov) {
728 (*fResponse)[1]=thisResponse;
732 void AliRICHchamber::Init()
735 ((AliRICHsegmentation *) (*fSegmentation)[0])->Init(this);
737 ((AliRICHsegmentation *) (*fSegmentation)[1])->Init(this);
741 void AliRICHchamber::LocaltoGlobal(Float_t pos[3],Float_t Localpos[3])
745 fMatrix = fChamberMatrix->GetMatrix();
746 Localpos[0]=pos[0]*fMatrix[0]+pos[1]*fMatrix[3]+pos[2]*fMatrix[6];
747 Localpos[1]=pos[0]*fMatrix[1]+pos[1]*fMatrix[4]+pos[2]*fMatrix[7];
748 Localpos[2]=pos[0]*fMatrix[2]+pos[1]*fMatrix[5]+pos[2]*fMatrix[8];
749 Localpos[0]+=fChamberTrans[0];
750 Localpos[1]+=fChamberTrans[1];
751 Localpos[2]+=fChamberTrans[2];
755 void AliRICHchamber::DisIntegration(Float_t eloss, Float_t xhit, Float_t yhit,
756 Int_t& nnew,Float_t newclust[6][500],Response_t res)
759 // Generates pad hits (simulated cluster)
760 // using the segmentation and the response model
770 // Width of the integration area
772 dx=((AliRICHresponse*) (*fResponse)[0])->Nsigma()*((AliRICHresponse*) (*fResponse)[0])->ChwX();
773 dy=((AliRICHresponse*) (*fResponse)[0])->Nsigma()*((AliRICHresponse*) (*fResponse)[0])->ChwY();
775 // Get pulse height from energy loss
779 qtot = ((AliRICHresponse*) (*fResponse)[0])->IntPH(eloss);
782 //Z position of the wires relative to the RICH mother volume
785 //Generate feedback photons
786 Nfp = ((AliRICHresponse*) (*fResponse)[0])->FeedBackPhotons(source,qtot);
787 //printf("\nFeedbacks (Mip) :%d",Nfp);
788 } else if (res==cerenkov) {
789 qtot = ((AliRICHresponse*) (*fResponse)[1])->IntPH();
793 Nfp = ((AliRICHresponse*) (*fResponse)[1])->FeedBackPhotons(source,qtot);
794 //printf("\nFeedbacks (Cerenkov):%d",Nfp);
800 Float_t qcheck=0, qp;
802 for (Int_t i=1; i<=fnsec; i++) {
804 AliRICHsegmentation * segmentation=(AliRICHsegmentation *) (*fSegmentation)[i-1];
805 for (segmentation->FirstPad(xhit, yhit, dx, dy);
806 segmentation->MorePads();
807 segmentation->NextPad())
810 qp= ((AliRICHresponse*) (*fResponse)[0])->IntXY(segmentation);
813 qp= ((AliRICHresponse*) (*fResponse)[0])->IntXY(segmentation);
821 // --- store signal information
822 newclust[0][nnew]=qtot;
823 newclust[1][nnew]=segmentation->Ix();
824 newclust[2][nnew]=segmentation->Iy();
825 newclust[3][nnew]=qp * qtot;
826 newclust[4][nnew]=segmentation->ISector();
827 newclust[5][nnew]=(Float_t) i;
833 } // Cathode plane loop