1 ///////////////////////////////////////////////////////////////////////////////
3 // Ring Imaging Cherenkov //
4 // This class contains the basic functions for the Ring Imaging Cherenkov //
5 // detector. Functions specific to one particular geometry are //
6 // contained in the derived classes //
10 <img src="gif/AliRICHClass.gif">
15 ///////////////////////////////////////////////////////////////////////////////
29 //_____________________________________________________________________________
33 // Default constructor for RICH
50 //_____________________________________________________________________________
51 AliRICH::AliRICH(const char *name, const char *title)
52 : AliDetector(name,title)
55 // Standard constructor for RICH
62 // Allocate space for different components
63 fHits = new TClonesArray("AliRICHhit", 100);
64 fMips = new TClonesArray("AliRICHmip", 100);
65 fCkovs = new TClonesArray("AliRICHckov", 100);
66 fPadhits = new TClonesArray("AliRICHpadhit", 100);
68 // Set parameters to default value
79 //_____________________________________________________________________________
83 // Destructor for RICH
87 fMips->Delete(); delete fMips;
88 fCkovs->Delete(); delete fCkovs;
89 fPadhits->Delete(); delete fPadhits;
92 //_____________________________________________________________________________
93 void AliRICH::AddHit(Int_t track, Int_t *vol, Float_t *hits)
98 switch ((int) hits[0]) {
103 TClonesArray &lhits = *fHits;
104 new(lhits[fNhits++]) AliHit(fIshunt,track);
105 AliHit *lhit = (AliHit*) fHits->AddrAt(fNhits-1);
113 AddMipHit(track,vol,hits);
118 AddCkovHit(track,vol,hits);
123 AddPadHit(track,vol,hits);
130 printf("Error: AliRICH::AddHit flag %d not defined./n",(int) hits[0]);
135 //_____________________________________________________________________________
136 void AliRICH::AddMipHit(Int_t track, Int_t *vol, Float_t *hits)
138 // Adds a mip hit in the RICH.
139 TClonesArray &lhits = *fMips;
140 new(lhits[fNmips++]) AliRICHmip(fIshunt,track,vol,hits,
144 //_____________________________________________________________________________
145 void AliRICH::AddCkovHit(Int_t track, Int_t *vol, Float_t *hits)
148 // Adds a cerenkov hit in the RICH.
150 TClonesArray &lhits = *fCkovs;
151 AliRICHmip *lmip = (AliRICHmip*) fMips->AddrAt(fNmips-1);
153 // If this ckov come from a mip update the mip lastckov entry.
155 if (lmip->GetZ() != -999.0) {
156 fmipslocal = fNmips-1;
157 lmip->SetLastCkov(fNckovs);
159 new(lhits[fNckovs++]) AliRICHckov(fIshunt,track,vol,hits,
160 fmipslocal,fNpadhits);
163 //_____________________________________________________________________________
164 void AliRICH::AddPadHit(Int_t track, Int_t *vol, Float_t *hits)
167 // Adds pad hits in the RICH
169 TClonesArray &lhits = *fPadhits;
170 // Update the last padhit of the respective particle:
171 if ((int) hits[1]==50) { // a ckov
172 ((AliRICHckov *) fCkovs->AddrAt(fNckovs-1))->SetLastpad(fNpadhits);
173 new(lhits[fNpadhits++]) AliRICHpadhit(fIshunt,track,vol,hits,-1,fNckovs-1);
175 ((AliRICHmip *) fMips->AddrAt(fNmips-1))->SetLastpad(fNpadhits);
176 new(lhits[fNpadhits++]) AliRICHpadhit(fIshunt,track,vol,hits,fNmips-1,-1);
180 //_____________________________________________________________________________
181 void AliRICH::BuildGeometry()
184 // Builds a TNode geometry for event display
188 const int kColorRICH = kGreen;
190 Top=gAlice->GetGeometry()->GetNode("alice");
192 new TRotMatrix("rot993","rot993",90,0,70.69,90,19.30999,-90);
193 new TRotMatrix("rot994","rot994",90,-20,90,70,0,0);
194 new TRotMatrix("rot995","rot995",90,0,90,90,0,0);
195 new TRotMatrix("rot996","rot996",90,20,90,110,0,0);
196 new TRotMatrix("rot997","rot997",90,340,108.1999,70,18.2,70);
197 new TRotMatrix("rot998","rot998",90,0,109.3099,90,19.30999,90);
198 new TRotMatrix("rot999","rot999",90,20,108.1999,110,18.2,110);
199 new TBRIK("S_RICH","S_RICH","void",71.09999,11.5,73.15);
201 Node = new TNode("RICH1","RICH1","S_RICH",0,471.8999,165.2599,"rot993");
202 Node->SetLineColor(kColorRICH);
205 Node = new TNode("RICH2","RICH2","S_RICH",171,470,0,"rot994");
206 Node->SetLineColor(kColorRICH);
209 Node = new TNode("RICH3","RICH3","S_RICH",0,500,0,"rot995");
210 Node->SetLineColor(kColorRICH);
213 Node = new TNode("RICH4","RICH4","S_RICH",-171,470,0,"rot996");
214 Node->SetLineColor(kColorRICH);
217 Node = new TNode("RICH5","RICH5","S_RICH",161.3999,443.3999,-165.3,"rot997");
218 Node->SetLineColor(kColorRICH);
221 Node = new TNode("RICH6","RICH6","S_RICH",0,471.8999,-165.3,"rot998");
222 Node->SetLineColor(kColorRICH);
225 Node = new TNode("RICH7","RICH7","S_RICH",-161.399,443.3999,-165.3,"rot999");
226 Node->SetLineColor(kColorRICH);
230 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
232 // Section for Rich Step
235 static Float_t sVloc[3];
236 static Float_t sVectIn[3];
237 static Float_t sDetot;
238 static Float_t sYanode[MAXPH];
239 static Float_t sXpad[MAXPH];
240 static Float_t sYpad[MAXPH];
247 static Float_t sDpad;
250 static Int_t sNsecon;
251 //static Float_t sQint[2];
256 static Int_t sIpx[MAXSEC];
257 static Int_t sIpy[MAXSEC];
258 static Int_t sIqpad[MAXSEC];
259 static Int_t sNphlink[MAXSEC];
260 static Int_t sNphoton;
262 static Int_t sNfeed, sNfeedd, sNdir;
264 static Float_t sPparent;
265 static Float_t sThincParent;
266 static Int_t sIloss[MAXPH];
267 static Int_t sIprod[MAXPH];
268 static Float_t sXphit[MAXPH];
269 static Float_t sYphit[MAXPH];
271 static Float_t sSycharge;
272 static Float_t sXsox, sYsox, sZsox;
274 static Int_t sMckov[MAXPH];
275 static Int_t idpartgx;
276 static Float_t phisx;
281 static Float_t thetasx;
284 //_____________________________________________________________________________
288 // Initialise RICH after that it has been built
290 const Float_t sconv=2*TMath::Sqrt(2*TMath::Log(2));
291 const Float_t yK3=1.20;
304 for(i=0;i<sNpx;i++) {
308 for(i=0;i<2*sNpy+1;i++) sYanode[i]=ansp/2+i*ansp;
311 sSycharge=4*TMath::ATanH(1/TMath::Sqrt(2*yK3))/TMath::Pi()
312 /(1-0.5*TMath::Sqrt(yK3))/sDpad/sconv;
317 //___________________________________________________________________________
318 void AliRICH::StepManager()
321 // Called at every step in the RICH
324 AliMC* pMC = AliMC::GetMC();
325 TGeant3 *geant3 = (TGeant3*) pMC;
327 const Float_t xshift[3] = { 41.3, 0, -41.3 };
328 static Float_t polar[3] = {0, 0, 0};
329 const Int_t nrooth = 25;
331 static Int_t ixold=-1, iyold=-1;
333 // System generated locals
338 Float_t ranf[2], rrhh[nrooth], phiangle, cost, vmod;
354 //Float_t xtrig[200], ytrig[200];
359 // ILOSS = 0 NOT LOST
360 // 1 REFLECTED FREON-QUARZ
361 // 2 REFLECTED QUARZ-METHANE
362 // 3 REFLECTED METHANE-CSI
363 // 11 ABSORBED IN FREON
364 // 12 ABSORBED IN QUARZ
365 // 13 ABSORBED IN METHANE
367 // IPROD = 1 PRODUCED IN FREON
368 // IPROD = 2 PRODUCED IN QUARZ
370 // new (changed NROOTH from 10 to 25!!!!!!!!!!!!!)
373 Int_t *idtmed = gAlice->Idtmed();
375 //--------------------------------------------------------------------------
379 if (geant3->Gckine()->charge) {
381 // Charged particles treatment
382 if (fIritri && !geant3->Gctrak()->upwght) {
383 if (geant3->Gctmed()->numed == idtmed[fIritri-1]) {
384 if (geant3->Gcking()->ngkine > 0) {
385 strncpy((char *)&lcase,"HADR",4);
386 if (geant3->Gcking()->kcase == lcase) {
387 i1 = geant3->Gcking()->ngkine;
388 for (i = 1; i <= i1; ++i) {
389 pMC->Gmtod(geant3->Gckin3()->gpos[i-1], vxloc, 1);
390 pMC->Gmtod(geant3->Gcking()->gkin[i-1], dir, 2);
391 if (geant3->Gcking()->gkin[i-1][4] == 8. ||
392 geant3->Gcking()->gkin[i-1][4] == 9.) {
394 // Computing 2nd power
396 // Computing 2nd power
398 //theta = TMath::ATan2(TMath::Sqrt(r1*r1+r2*r2),dir[1]);
399 //xtrig[nmult - 1] = theta;
400 //ytrig[nmult - 1] = vxloc[1] + .25;
401 //itrig[nmult - 1] = (Int_t) geant3->Gcking()->gkin[i-1][4];
407 if ((geant3->Gctmed()->numed == idtmed[1006-1] &&
408 geant3->Gctrak()->inwvol == 2) ||
409 geant3->Gctrak()->istop) {
411 printf("NOT TRIGGERED\n");
419 geant3->Gctrak()->istory = 0;
420 geant3->Gctrak()->upwght = 0.;
421 geant3->Gcflag()->ieotri = 1;
426 printf("TRIGGERED %d\n",nmult);
430 // MIP inside Methane
431 if (geant3->Gctmed()->numed == idtmed[1009-1]) {
434 // If particle produced already Cerenkov Photons (istory=1)
435 // update the impact point only
436 if (geant3->Gctrak()->istory == 1) {
437 // Direction of incidence and where did it hit ?
438 pMC->Gmtod(geant3->Gctrak()->vect, sVloc, 1);
439 pMC->Gmtod(&geant3->Gctrak()->vect[3], dir, 2);
440 phiangle = TMath::ATan2(dir[2], dir[0]);
441 if (phiangle < 0.) phiangle += 2*TMath::Pi();
443 for (ll = 0; ll < i1; ++ll) rrhh[ll] = 0;
444 irivol[0] = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
445 irivol[1] = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
447 ihitrak = gAlice->CurrentTrack();
449 // flag to say this is update
450 rrhh[1] = sVloc[0] + sDlx;
452 rrhh[2] = sVloc[2] + sDly;
454 rrhh[3] = (Float_t) geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
456 // Computing 2nd power
458 // Computing 2nd power
460 rrhh[4] = TMath::ATan2(TMath::Sqrt(r1 * r1 + r2 * r2), dir[1]);
463 // PRINT *, 'ITRA = ',ITRA,'ISTAK = ',ISTAK
464 AddHit(ihitrak,irivol,rrhh);
467 // Record particle properties
468 // If particle produced already Cerenkov Photons (istory=1)
470 // update the impact point only
471 if (geant3->Gctrak()->istory != 2) {
472 if (!geant3->Gctrak()->istory) {
475 // Is this a primary particle ?
477 //if (geant3->Gctrak()->upwght) iprimx = 0;
479 // Where did it come from ?
480 sXsox = geant3->Gckine()->vert[0];
481 sYsox = geant3->Gckine()->vert[1];
482 sZsox = geant3->Gckine()->vert[2];
485 psx = geant3->Gctrak()->vect[6];
487 // Particle type and parent
488 //idpartsx = geant3->Gckine()->ipart;
489 r1 = geant3->Gctrak()->upwght / 100.;
490 idpartgx = Int_t(r1+0.5);
491 if (!geant3->Gctrak()->upwght) {
492 sPparent = geant3->Gctrak()->vect[6];
493 sThincParent = thetasx;
496 // Direction of incidence and where did it hit ?
497 pMC->Gmtod(geant3->Gctrak()->vect, sVloc, 1);
498 pMC->Gmtod(&geant3->Gctrak()->vect[3], dir, 2);
499 // Computing 2nd power
501 // Computing 2nd power
503 thetasx = TMath::ATan2(TMath::Sqrt(r1 * r1 + r2 * r2), dir[1]);
504 phisx = TMath::ATan2(dir[2], dir[0]);
505 if (phisx < 0.) phisx += 2*TMath::Pi();
506 ysx = sVloc[2] + sDly;
507 xsx = sVloc[0] + sDlx;
508 nmodsx = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
511 for (ll = 0; ll < i1; ++ll) rrhh[ll] = 0;
512 irivol[0] = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
514 ihitrak = gAlice->CurrentTrack();
516 // Flag to say this is MIP
517 rrhh[1] = (Float_t) geant3->Gckine()->ipart;
520 rrhh[4] = (Float_t) nmodsx;
523 rrhh[6] = geant3->Gctrak()->tofg;
525 rrhh[7] = (Float_t) idpartgx;
529 // charge of current particle in electron charge unit;
530 rrhh[10] = geant3->Gckine()->charge;
532 // Zo of ckov generation
535 AddHit(ihitrak, irivol, rrhh);
538 // Earmark track as being recorded in methane gap
540 geant3->Gctrak()->istory = 2;
544 // Signal generation in methane gap
545 pMC->Gmtod(geant3->Gctrak()->vect, sVloc, 1);
546 pMC->Gmtod(geant3->Gckine()->vert, vxloc, 1);
547 ix = (Int_t) ((sVloc[0] + sDlx) / sDxp);
548 iy = (Int_t) ((sVloc[2] + sDly) / sDyp);
550 // Is this the first step?
551 if (ixold == -1 && iyold == -1) {
554 for(j=0;j<3;j++) sVectIn[j]=geant3->Gctrak()->vect[j];
558 if (geant3->Gctrak()->inwvol == 2 || geant3->Gctrak()->istop) {
559 sDetot += geant3->Gctrak()->destep;
560 if (sDetot > 0.) RichIntegration();
565 // Mip left current pad
566 } else if (ixold != ix || iyold != iy) {
567 if (sDetot > 0.) RichIntegration();
568 for(j=0;j<3;j++) sVectIn[j]=geant3->Gctrak()->vect[j];
569 sDetot = geant3->Gctrak()->destep;
573 sDetot += geant3->Gctrak()->destep;
578 // End charged particles treatment
580 // Treat photons produced in Freon and Quartz
581 if (geant3->Gckin2()->ngphot > 0 &&
582 (geant3->Gctmed()->numed == idtmed[1004-1] ||
583 geant3->Gctmed()->numed == idtmed[1003-1])) {
584 if (!geant3->Gctrak()->upwght) {
586 // If it is a primary, save all generated photons
587 i1 = geant3->Gckin2()->ngphot;
588 for (i = 1; i <= i1; ++i) {
590 if (sNphoton > MAXPH) {
592 printf("ATTENTION NPHOTON %d\n",sNphoton);
598 if (geant3->Gctmed()->numed == idtmed[1003-1]) medprod = 2;
600 // Production angle and energy
604 cost+=geant3->Gckin2()->xphot[i-1][3+j]*geant3->Gctrak()->vect[3+j];
605 vmod+=geant3->Gckin2()->xphot[i-1][3+j]*
606 geant3->Gckin2()->xphot[i-1][3+j];
609 sIloss[sNphoton - 1] = 22;
610 sIprod[sNphoton - 1] = medprod;
611 sXphit[sNphoton - 1] = 0.;
612 sYphit[sNphoton - 1] = 0.;
613 stwght = geant3->Gctrak()->upwght;
614 geant3->Gctrak()->upwght = (Float_t) sNphoton;
616 gAlice->SetTrack(0, gAlice->CurrentTrack(), 50,
617 &geant3->Gckin2()->xphot[i-1][3],geant3->Gckin2()->xphot[i-1],
618 polar,geant3->Gctrak()->tofg,"Cherenkov", ncher);
619 sMckov[sNphoton - 1] = ncher;
620 geant3->Gctrak()->upwght = stwght;
623 stwght = geant3->Gctrak()->upwght;
624 geant3->Gctrak()->upwght = 0.;
626 geant3->Gctrak()->upwght = stwght;
629 // Particle did not yet pass the methane gap
630 if (geant3->Gctrak()->istory == 0) {
631 geant3->Gctrak()->istory = 1;
633 // Is this a primary particle ?
635 //if (geant3->Gctrak()->upwght) iprimx = 0;
637 // Where did it come from ?
638 sXsox = geant3->Gckine()->vert[0];
639 sYsox = geant3->Gckine()->vert[1];
640 sZsox = geant3->Gckine()->vert[2];
642 // Where did it hit ?
643 pMC->Gmtod(geant3->Gctrak()->vect, sVloc, 1);
644 pMC->Gmtod(&geant3->Gctrak()->vect[3], dir, 2);
645 ysx = sVloc[2] + sDly;
646 if (geant3->Gctmed()->numed == idtmed[1004-1]) {
647 nmodsx = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
648 xsx = sVloc[0] + sDlx +
649 xshift[geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 2] - 1];
650 } else if (geant3->Gctmed()->numed == idtmed[1003-1]) {
651 nmodsx = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 3];
652 xsx = sVloc[0] + sDlx;
657 // Momentum and direction of incidence
658 psx = geant3->Gctrak()->vect[6];
659 // Computing 2nd power
661 // Computing 2nd power
663 thetasx = TMath::ATan2(TMath::Sqrt(r1 * r1 + r2 * r2), dir[1]);
664 phisx = TMath::ATan2(dir[2], dir[0]);
665 if (phisx < 0.) phisx += 2*TMath::Pi();
667 // Particle type and parent
668 //idpartsx = geant3->Gckine()->ipart;
669 r1 = geant3->Gctrak()->upwght / 100.;
670 idpartgx = Int_t(r1+0.5);
671 if (!geant3->Gctrak()->upwght) {
672 sPparent = geant3->Gctrak()->vect[6];
673 sThincParent = thetasx;
676 for (ll = 0; ll <nrooth; ++ll) rrhh[ll] = 0;
677 irivol[0] = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
679 ihitrak = gAlice->CurrentTrack();
681 // Flag to say that this is MIP
682 rrhh[1] = (Float_t) geant3->Gckine()->ipart;
685 rrhh[4] = (Float_t) nmodsx;
688 rrhh[6] = geant3->Gctrak()->tofg;
690 rrhh[7] = (Float_t) idpartgx;
694 // charge of current particle in electron charge unit;
695 rrhh[10] = geant3->Gckine()->charge;
697 // Zo of ckov generation
700 AddHit(ihitrak, irivol, rrhh);
705 // Current particle is cherenkov photon
706 if (geant3->Gckine()->ipart == 50) {
707 pMC->Gmtod(geant3->Gctrak()->vect, sVloc, 1);
708 // WRITE(6,* ) UPWGHT, VLOC(2), NUMED, DESTEP
709 // Photon crosses ch4-csi boundary
710 // take into account fresnel losses with complex refraction index
711 if (geant3->Gctrak()->inwvol == 1 && geant3->Gctmed()->numed == idtmed[1006-1]) {
713 // fresnel losses commented out for the moment
714 // make sure that qe correction for fresnel losses is also switched off !
716 // IF (ISTOP .EQ. 2) RETURN
717 // Put transmission of electrodes in by hand
718 pMC->Gmtod(&geant3->Gctrak()->vect[3], dir, 2);
719 cophi = TMath::Cos(TMath::ATan2(dir[0], dir[1]));
720 t = (1. - .025 / cophi) * (1. - .05 / cophi);
723 if (geant3->Gctrak()->upwght && Int_t(geant3->Gctrak()->upwght+0.5)<MAXPH)
724 sIloss[Int_t(geant3->Gctrak()->upwght+0.5) - 1] = 15;
725 geant3->Gctrak()->istop = 2;
730 // Photon lost energy in CsI
731 if (geant3->Gctrak()->destep > 0. && geant3->Gctmed()->numed == idtmed[1006-1]) {
732 geant3->Gctrak()->istop = 2;
733 r1 = geant3->Gctrak()->upwght / 100.;
734 if (Int_t(r1+0.5) > 50) {
739 // WRITE(6,*) 'PHOTON',UPWGHT, MAXPH
740 if (geant3->Gctrak()->upwght && Int_t(geant3->Gctrak()->upwght+0.5) < MAXPH)
741 sIloss[Int_t(geant3->Gctrak()->upwght+0.5) - 1] = 0;
742 // write(6,*) 'photon detected'
743 for(j=0;j<3;j++) sVectIn[j]=geant3->Gctrak()->vect[j];
745 // copied from miphit in Freon or Quartz
746 // Where did it hit ?
747 pMC->Gmtod(&geant3->Gctrak()->vect[3], dir, 2);
749 // Momentum and direction of incidence
750 for (ll = 0; ll < nrooth; ++ll) rrhh[ll]=0;
751 irivol[0] = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
753 irivol[1] = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
755 ihitrak = gAlice->CurrentTrack();
757 // Flag to say that this is CK
758 rrhh[1] = (Float_t) geant3->Gckine()->ipart;
759 rrhh[2] = sVloc[0] + sDlx;
760 rrhh[3] = sVloc[2] + sDly;
761 rrhh[4] = (Float_t) geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 3];
763 // Computing 2nd power
765 // Computing 2nd power
767 rrhh[5] = TMath::ATan2(TMath::Sqrt(r1 * r1 + r2 * r2), dir[1]);
769 rrhh[6] = geant3->Gctrak()->tofg;
771 r1 = geant3->Gctrak()->upwght / 100.;
772 rrhh[7] = (Float_t) Int_t(r1+0.5);
775 rrhh[8] = geant3->Gctrak()->getot;
778 AddHit(ihitrak, irivol, rrhh);
783 if (geant3->Gctrak()->upwght && Int_t(geant3->Gctrak()->upwght+0.5) < MAXPH)
785 // Losses by reflection and absorption and leaving detector
786 if (sIloss[Int_t(geant3->Gctrak()->upwght+0.5) - 1] == 22) {
787 i1 = geant3->Gctrak()->nmec;
788 for (i = 0; i < i1; ++i) {
790 if (geant3->Gctrak()->lmec[i] == 106) {
791 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=10;
792 if (geant3->Gctmed()->numed == idtmed[1004-1])
793 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=1;
795 if (geant3->Gctmed()->numed == idtmed[1003-1])
796 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=2;
799 } else if (geant3->Gctrak()->lmec[i] == 101) {
800 geant3->Gctrak()->istop = 2;
801 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=20;
802 if (geant3->Gctmed()->numed == idtmed[1004-1])
803 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=11;
805 if (geant3->Gctmed()->numed == idtmed[1003-1])
806 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=12;
808 if (geant3->Gctmed()->numed == idtmed[1005-1])
809 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=13;
811 if (geant3->Gctmed()->numed == idtmed[1009-1])
812 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=13;
814 if (geant3->Gctmed()->numed == idtmed[1001-1])
815 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=14;
818 if (geant3->Gctmed()->numed == idtmed[1006-1])
819 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=16;
822 // Photon goes out of tracking scope
823 } else if (geant3->Gctrak()->lmec[i] == 30)
824 sIloss[Int_t(geant3->Gctrak()->upwght+0.5)-1]=21;
833 //_____________________________________________________________________________
834 void AliRICH::RichIntegration()
837 // Integrates over RICH pads
840 AliMC* pMC = AliMC::GetMC();
841 TGeant3 *geant3 = (TGeant3*) pMC;
851 Int_t ixmin, ixmax, iymin, iymax;
856 Float_t y0a, qtot_check, xi1, xi2, yi1, yi2;
858 Int_t ihitrak, modulen;
859 //Int_t isec[MAXSEC];
860 // ILOSS = 0 NOT LOST
861 // 1 REFLECTED FREON-QUARZ
862 // 2 REFLECTED QUARZ-METHANE
863 // 3 REFLECTED METHANE-CSI
864 // 11 ABSORBED IN FREON
865 // 12 ABSORBED IN QUARZ
866 // 13 ABSORBED IN METHANE
868 // IPROD = 1 PRODUCED IN FREON
869 // IPROD = 2 PRODUCED IN QUARZ
870 // get charge for MIP or cherenkov photon
872 if (geant3->Gckine()->ipart == 50) {
874 modulen = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 3];
878 modulen = geant3->Gcvolu()->number[geant3->Gcvolu()->nlevel - 4];
882 pMC->Gmtod(sVectIn, sVloc, 1);
883 if (TMath::Abs(sVloc[0]) >= sDlx) return;
885 if (TMath::Abs(sVloc[2]) >= sDly) return;
892 ixmin = (Int_t) ((x0 - fSxcharge * 5.) / sDxp) + 1;
893 if (ixmin < 1) ixmin = 1;
894 ixmax = (Int_t) ((x0 + fSxcharge * 5.) / sDxp) + 1;
895 if (ixmax > sNpx) ixmax = sNpx;
896 iymin = (Int_t) ((y0a - sSycharge * 5.) / sDyp) + 1;
897 if (iymin < 1) iymin = 1;
898 iymax = (Int_t) ((y0a + sSycharge * 5.) / sDyp) + 1;
899 if (iymax > sNpy) iymax = sNpy;
902 for (ix = ixmin; ix <= i1; ++ix) {
904 for (iy = iymin; iy <= i2; ++iy) {
905 xi1 = (sXpad[ix - 1] - x0) / sDpad;
906 xi2 = xi1 + sDxp / sDpad;
907 yi1 = (sYpad[iy - 1] - y0a) / sDpad;
908 yi2 = yi1 + sDyp / sDpad;
909 qp = qtot * FMathieson(xi1, xi2) * FMathieson(yi1, yi2);
910 iqp = (Int_t) TMath::Abs(qp);
911 qtot_check += TMath::Abs(qp);
913 // FILL COMMON FOR PADS
920 if (sNpads > MAXSEC) {
921 // write(6,*) 'attention npads',npads
924 sIpx[sNpads - 1] = ix;
925 sIpy[sNpads - 1] = iy;
926 sIqpad[sNpads - 1] = iqp;
927 // TAG THE ORIGIN OF THE CHARGE DEPOSITION
928 r1 = geant3->Gctrak()->upwght / 100.;
929 ifeed = Int_t(r1+0.5);
930 sNphlink[sNpads - 1] = 0;
931 if (geant3->Gckine()->ipart != 50) {
933 //isec[sNpads - 1] = sNsecon;
938 nph = Int_t(geant3->Gctrak()->upwght+0.5);
939 sNphlink[sNpads - 1] = nph;
940 sXphit[nph - 1] = sVloc[0];
941 sYphit[nph - 1] = sVloc[2];
942 //isec[sNpads - 1] = sNsecon + 100;
943 } else if (ifeed == 51) {
944 // FEEDBACK FROM CERENKOV
946 //isec[sNpads - 1] = sNsecon + 300;
947 } else if (ifeed == 52) {
950 //isec[sNpads - 1] = sNsecon + 200;
953 // Generate the hit for Root IO
954 for (ll = 0; ll < 25; ++ll) rrhh[ll] = 0;
958 // Flag to say this is a hit
964 rrhh[6] = (Float_t) idpartgx;
968 rrhh[10] = (Float_t) sIpx[sNpads - 1];
969 rrhh[11] = (Float_t) sIpy[sNpads - 1];
970 rrhh[12] = (Float_t) sIqpad[sNpads - 1];
971 ihitrak = gAlice->CurrentTrack();
972 if (sNphlink[sNpads - 1] > 0) {
974 rrhh[14] = sThincParent;
975 rrhh[15] = (Float_t) sIloss[nph - 1];
976 rrhh[16] = (Float_t) sIprod[nph - 1];
977 rrhh[17] = sXphit[nph - 1];
978 rrhh[18] = sYphit[nph - 1];
979 ihitrak = sMckov[nph - 1];
981 // This is the current position of the hit
982 rrhh[19] = geant3->Gctrak()->vect[0];
983 rrhh[20] = geant3->Gctrak()->vect[1];
984 rrhh[21] = geant3->Gctrak()->vect[2];
986 // PRINT *,'RXAHIT(oldhit)=[',RRHH(20),',',RRHH(21),',',
988 // PRINT *, 'ITRA = ',ITRA,'ISTAK = ',ISTAK
989 AddHit(ihitrak, irivol, rrhh);
991 for (ll = 0; ll < 25; ++ll) rrhh[ll] = 0;
993 rrhh[1] = (Float_t) geant3->Gckine()->ipart;
994 rrhh[2] = (Float_t) sIpx[sNpads - 1];
995 rrhh[3] = (Float_t) sIpy[sNpads - 1];
996 rrhh[4] = (Float_t) modulen;
999 rrhh[6] = (Float_t) sIqpad[sNpads - 1];
1000 AddHit(ihitrak, irivol, rrhh);
1005 // IF (IPART .NE. 50) WRITE(6,*) 'CHECK',QTOT,QTOT_CHECK
1007 // GENERATE FEEDBACK PHOTONS
1009 source[0] = x0 - sDlx;
1010 source[1] = sVloc[1] - .2;
1011 source[2] = y0a - sDly;
1012 pMC->Gdtom(source, source, 1);
1013 FeedBack(source, qtot);
1017 //_____________________________________________________________________________
1018 void AliRICH::AnodicWires(Float_t &y0a)
1021 // Position of anodic wires
1027 Float_t ass_i, y0, ass_i1;
1031 i1 = (sNpy << 1) + 1;
1032 for (i = 1; i <= i1; ++i) {
1033 if (y0 > sYanode[i - 1] && y0 <= sYanode[i]) {
1034 ass_i1 = TMath::Abs(sYanode[i] - y0);
1035 ass_i = TMath::Abs(sYanode[i - 1] - y0);
1036 if (ass_i1 <= ass_i) y0a = sYanode[i];
1037 if (ass_i1 > ass_i) y0a = sYanode[i - 1];
1043 //_____________________________________________________________________________
1044 void AliRICH::GetChargeMip(Float_t &qtot)
1047 // Calculates the charge deposited by a MIP
1050 AliMC* pMC = AliMC::GetMC();
1059 // NUMBER OF ELECTRONS
1061 nel = (Int_t) (sDetot * 1e9 / 26.);
1065 for (i = 1; i <= i1; ++i) {
1067 qtot -= fChslope * TMath::Log(ranf[0]);
1071 //_____________________________________________________________________________
1072 void AliRICH::GetCharge(Float_t &qtot)
1078 AliMC* pMC = AliMC::GetMC();
1083 qtot = -fChslope * TMath::Log(ranf[0]);
1086 //_____________________________________________________________________________
1087 void AliRICH::FeedBack(Float_t *source, Float_t qtot)
1090 // Generate FeedBack photons
1093 AliMC* pMC = AliMC::GetMC();
1094 TGeant3 *geant3 = (TGeant3*) pMC;
1100 Float_t cthf, ranf[2], phif, enfp = 0, sthf;
1102 Float_t e1[3], e2[3], e3[3];
1103 Float_t vmod, uswop;
1105 Float_t dir[3], phi;
1107 Float_t pol[3], supwght;
1109 // DETERMINE NUMBER OF FEEDBACK PHOTONS
1112 fp = fAlphaFeed * qtot;
1113 nfp = gRandom->Poisson(fp);
1117 geant3->Gckin2()->ngphot = 0;
1119 for (i = 1; i <= i1; ++i) {
1123 cthf = ranf[0] * 2. - 1.;
1124 if (cthf < 0.) continue;
1125 sthf = TMath::Sqrt((1. - cthf) * (cthf + 1.));
1126 phif = ranf[1] * 2 * TMath::Pi();
1127 ++geant3->Gckin2()->ngphot;
1128 if (geant3->Gckin2()->ngphot > 800) {
1129 printf("ATTENTION NGPHOT ! %d %f %d\n",
1130 geant3->Gckin2()->ngphot,fp,nfp);
1136 geant3->Gckin2()->xphot[geant3->Gckin2()->ngphot-1][j]=source[j];
1139 pMC->Rndm(&random, 1);
1140 if (random <= .57) {
1142 } else if (random > .57 && random <= .7) {
1144 } else if (random > .7) {
1147 geant3->Gckin2()->xphot[geant3->Gckin2()->ngphot-1][6] = enfp;
1148 dir[0] = sthf * TMath::Sin(phif);
1150 dir[2] = sthf * TMath::Cos(phif);
1151 pMC->Gdtom(dir, &geant3->Gckin2()->xphot[geant3->Gckin2()->ngphot-1][3], 2);
1167 for(j=0;j<3;j++) vmod+=e1[j]*e1[j];
1168 if (!vmod) for(j=0;j<3;j++) {
1174 for(j=0;j<3;j++) vmod+=e2[j]*e2[j];
1175 if (!vmod) for(j=0;j<3;j++) {
1182 for(j=0;j<3;j++) vmod+=e1[j]*e1[j];
1183 vmod=TMath::Sqrt(1/vmod);
1184 for(j=0;j<3;j++) e1[j]*=vmod;
1187 for(j=0;j<3;j++) vmod+=e2[j]*e2[j];
1188 vmod=TMath::Sqrt(1/vmod);
1189 for(j=0;j<3;j++) e2[j]*=vmod;
1192 phi = ranf[0] * 2 * TMath::Pi();
1193 r1 = TMath::Sin(phi);
1194 r2 = TMath::Cos(phi);
1195 for(j=0;j<3;j++) pol[j]=e1[j]*r1+e2[j]*r2;
1196 pMC->Gdtom(pol, &geant3->Gckin2()->xphot[geant3->Gckin2()->ngphot-1][7], 2);
1199 geant3->Gckin2()->xphot[geant3->Gckin2()->ngphot-1][10] = 0.;
1201 // PUT PHOTON ON THE STACK AND LABEL IT AS FEEDBACK (51,52)
1202 supwght = geant3->Gctrak()->upwght;
1203 r1 = geant3->Gctrak()->upwght / 100.;
1204 ifeed = Int_t(r1+0.5);
1206 if (geant3->Gckine()->ipart == 50 && ifeed != 52) {
1207 geant3->Gctrak()->upwght = 5100.;
1209 geant3->Gctrak()->upwght = 5200.;
1211 geant3->Gskpho(geant3->Gckin2()->ngphot);
1212 geant3->Gctrak()->upwght = supwght;
1215 geant3->Gckin2()->ngphot = 0;
1218 //_____________________________________________________________________________
1219 Float_t AliRICH::FMathieson(Float_t lambda1, Float_t lambda2)
1222 // Mathieson charge distribution
1224 // CALCULATES INTEGRAL OF GATTI/MATHIESON CHARGE DISTRIBUTION
1225 // FOR CPC AND CSC CHAMBERS
1226 // INTEGRATION LIMITS LAMBDA1,LAMBDA2= X/D WHERE D IS THE ANODE CATHODE
1228 // K3: GEOMETRY PARAMETER
1231 // const Float_t k1=0.2828;
1232 const Float_t k2=0.962;
1233 const Float_t k3=0.6;
1234 const Float_t k4=0.379;
1235 const Float_t sqrtk3=TMath::Sqrt(k3);
1238 u1 = tanh(lambda1 * k2) * sqrtk3;
1239 u2 = tanh(lambda2 * k2) * sqrtk3;
1241 return (atan(u2) - atan(u1)) * 2 * k4;
1246 //_____________________________________________________________________________
1247 void AliRICH::UpdateMipHit(Float_t *hits)
1250 // Update some parameters when the current mip hits the detector.
1252 TClonesArray &lhits = *fMips;
1253 AliRICHmip *lmip = (AliRICHmip *) lhits.AddrAt(fNmips-1);
1254 lmip->SetX ( hits[1]);
1255 lmip->SetY ( hits[2]);
1256 lmip->SetModule((int) hits[3]);
1257 lmip->SetTheta ( hits[4]);
1258 lmip->SetPhi ( hits[5]);
1261 //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1263 //_____________________________________________________________________________
1264 void AliRICH::MakeBranch(Option_t *option)
1267 // Create a new branch in the current Root Tree.
1268 // The branch of fHits is automatically split
1270 AliDetector::MakeBranch(option);
1272 Int_t buffersize = 4000;
1273 if (gAlice->TreeH()) {
1275 gAlice->TreeH()->Branch("RICHmip",&fMips, buffersize);
1276 printf("Making Branch %s for mips\n","RICHmip");
1279 gAlice->TreeH()->Branch("RICHckov",&fCkovs, buffersize);
1280 printf("Making Branch %s for ckovs\n","RICHckov");
1283 gAlice->TreeH()->Branch("RICHpadhit",&fPadhits, buffersize);
1284 printf("Making Branch %s for padhits\n","RICHpadhit");
1289 //_____________________________________________________________________________
1290 void AliRICH::SetTreeAddress()
1293 // Set branch address for the Hits and Digits Tree.
1295 AliDetector::SetTreeAddress();
1297 TTree *treeH = gAlice->TreeH();
1300 branch = treeH->GetBranch("RICHmip");
1301 if (branch) branch->SetAddress(&fMips);
1304 branch = treeH->GetBranch("RICHckov");
1305 if (branch) branch->SetAddress(&fCkovs);
1308 branch = treeH->GetBranch("RICHpadhit");
1309 if (branch) branch->SetAddress(&fPadhits);
1314 //_____________________________________________________________________________
1315 void AliRICH::ResetHits()
1318 // Reset number of mips and the mips array for RICH
1320 AliDetector::ResetHits();
1322 if (fMips) fMips->Clear();
1323 // Reset number of Ckovs and the Ckovs array for RICH
1325 if (fCkovs) fCkovs->Clear();
1326 // Reset number of Padhits and the Padhits array for RICH
1328 if (fPadhits) fPadhits->Clear();
1331 //_____________________________________________________________________________
1332 Int_t AliRICH::DistancetoPrimitive(Int_t , Int_t )
1335 // Distance from mouse RICH on the display
1341 //_____________________________________________________________________________
1342 void AliRICH::PreTrack()
1345 // Called before transporting a track
1356 //_____________________________________________________________________________
1357 void AliRICH::Streamer(TBuffer &R__b)
1360 // Stream an object of class AliRICH.
1362 if (R__b.IsReading()) {
1363 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
1364 AliDetector::Streamer(R__b);
1368 R__b >> fMips; //diff
1369 R__b >> fCkovs; //diff
1370 R__b >> fPadhits; //diff
1376 R__b.WriteVersion(AliRICH::IsA());
1377 AliDetector::Streamer(R__b);
1381 R__b << fMips; //diff
1382 R__b << fCkovs; //diff
1383 R__b << fPadhits; //diff
1393 ///////////////////////////////////////////////////////////////////////////////
1395 // Ring Imaging Cherenkov //
1396 // This class contains version 1 of the Ring Imaging Cherenkov //
1400 <img src="gif/AliRICHv1Class.gif">
1404 ///////////////////////////////////////////////////////////////////////////////
1406 //_____________________________________________________________________________
1407 AliRICHv1::AliRICHv1() : AliRICH()
1410 // Default Constructor RICH for version 1
1414 //_____________________________________________________________________________
1415 AliRICHv1::AliRICHv1(const char *name, const char *title)
1416 : AliRICH(name,title)
1419 // Standard constructor for RICH version 1
1423 //_____________________________________________________________________________
1424 AliRICHv1::~AliRICHv1()
1427 // Standard destructor for RICH version 1
1431 //_____________________________________________________________________________
1432 void AliRICHv1::CreateGeometry()
1435 // Create the geometry for RICH version 1
1437 // Modified by: N. Colonna (INFN - BARI, Nicola.Colonna@ba.infn.it)
1438 // R.A. Fini (INFN - BARI, Rosanna.Fini@ba.infn.it)
1439 // R.A. Loconsole (Bari University, loco@riscom.ba.infn.it)
1443 <img src="gif/AliRICHv1.gif">
1448 <img src="gif/AliRICHv1Tree.gif">
1452 AliMC* pMC = AliMC::GetMC();
1454 Int_t *idtmed = gAlice->Idtmed();
1461 // --- Define the RICH detector
1462 // External aluminium box
1466 pMC->Gsvolu("RICH", "BOX ", idtmed[1009], par, 3);
1468 // Sensitive part of the whole RICH
1472 pMC->Gsvolu("SRIC", "BOX ", idtmed[1000], par, 3);
1478 pMC->Gsvolu("HONE", "BOX ", idtmed[1001], par, 3);
1484 pMC->Gsvolu("ALUM", "BOX ", idtmed[1009], par, 3);
1490 pMC->Gsvolu("QUAR", "BOX ", idtmed[1002], par, 3);
1492 // Spacers (cylinders)
1496 pMC->Gsvolu("SPAC", "TUBE", idtmed[1002], par, 3);
1502 pMC->Gsvolu("OQUA", "BOX ", idtmed[1007], par, 3);
1504 // Frame of opaque quartz
1508 pMC->Gsvolu("OQUF", "BOX ", idtmed[1007], par, 3);
1510 // Little bar of opaque quartz
1514 pMC->Gsvolu("BARR", "BOX ", idtmed[1007], par, 3);
1520 pMC->Gsvolu("FREO", "BOX ", idtmed[1003], par, 3);
1526 pMC->Gsvolu("META", "BOX ", idtmed[1004], par, 3);
1532 pMC->Gsvolu("GAP ", "BOX ", idtmed[1008], par, 3);
1538 pMC->Gsvolu("CSI ", "BOX ", idtmed[1005], par, 3);
1544 pMC->Gsvolu("GRID", "TUBE", idtmed[1006], par, 3);
1546 // --- Places the detectors defined with GSVOLU
1547 // Place material inside RICH
1548 pMC->Gspos("SRIC", 1, "RICH", 0., 0., 0., 0, "ONLY");
1550 pMC->Gspos("ALUM", 1, "SRIC", 0., -6.075, 0., 0, "ONLY");
1551 pMC->Gspos("HONE", 1, "SRIC", 0., -5.862, 0., 0, "ONLY");
1552 pMC->Gspos("ALUM", 2, "SRIC", 0., -5.649, 0., 0, "ONLY");
1553 pMC->Gspos("OQUA", 1, "SRIC", 0., -5.424, 0., 0, "ONLY");
1555 AliMatrix(idrotm[1019], 0., 0., 90., 0., 90., 90.);
1557 for (i = 1; i <= 9; ++i) {
1558 zs = (5 - i) * 14.4;
1559 pMC->Gspos("SPAC", i, "FREO", 6.7, 0., zs, idrotm[1019], "ONLY");
1561 for (i = 10; i <= 18; ++i) {
1562 zs = (14 - i) * 14.4;
1563 pMC->Gspos("SPAC", i, "FREO", -6.7, 0., zs, idrotm[1019], "ONLY");
1566 pMC->Gspos("FREO", 1, "OQUF", 0., 0., 0., 0, "ONLY");
1567 pMC->Gspos("OQUF", 1, "SRIC", 41.3, -4.724, 0., 0, "ONLY");
1568 pMC->Gspos("OQUF", 2, "SRIC", 0., -4.724, 0., 0, "ONLY");
1569 pMC->Gspos("OQUF", 3, "SRIC", -41.3, -4.724, 0., 0, "ONLY");
1570 pMC->Gspos("BARR", 1, "QUAR", 0., 0., -21.65, 0, "ONLY");
1571 pMC->Gspos("BARR", 2, "QUAR", 0., 0., 21.65, 0, "ONLY");
1572 pMC->Gspos("QUAR", 1, "SRIC", 0., -3.974, 0., 0, "ONLY");
1573 pMC->Gspos("GAP ", 1, "META", 0., 4.8, 0., 0, "ONLY");
1574 pMC->Gspos("META", 1, "SRIC", 0., 1.276, 0., 0, "ONLY");
1575 pMC->Gspos("CSI ", 1, "SRIC", 0., 6.526, 0., 0, "ONLY");
1577 // Place RICH inside ALICE apparatus
1579 AliMatrix(idrotm[1000], 90., 0., 70.69, 90., 19.31, -90.);
1580 AliMatrix(idrotm[1001], 90., -20., 90., 70., 0., 0.);
1581 AliMatrix(idrotm[1002], 90., 0., 90., 90., 0., 0.);
1582 AliMatrix(idrotm[1003], 90., 20., 90., 110., 0., 0.);
1583 AliMatrix(idrotm[1004], 90., 340., 108.2, 70., 18.2, 70.);
1584 AliMatrix(idrotm[1005], 90., 0., 109.31, 90., 19.31, 90.);
1585 AliMatrix(idrotm[1006], 90., 20., 108.2, 110., 18.2, 110.);
1587 pMC->Gspos("RICH", 1, "ALIC", 0., 471.9, 165.26, idrotm[1000], "ONLY");
1588 pMC->Gspos("RICH", 2, "ALIC", 171., 470., 0., idrotm[1001], "ONLY");
1589 pMC->Gspos("RICH", 3, "ALIC", 0., 500., 0., idrotm[1002], "ONLY");
1590 pMC->Gspos("RICH", 4, "ALIC", -171., 470., 0., idrotm[1003], "ONLY");
1591 pMC->Gspos("RICH", 5, "ALIC", 161.4, 443.4, -165.3, idrotm[1004], "ONLY");
1592 pMC->Gspos("RICH", 6, "ALIC", 0., 471.9, -165.3, idrotm[1005], "ONLY");
1593 pMC->Gspos("RICH", 7, "ALIC", -161.4, 443.4, -165.3, idrotm[1006], "ONLY");
1597 //_____________________________________________________________________________
1598 void AliRICHv1::DrawModule()
1601 // Draw a shaded view of the Ring Imaging Cherenkov
1604 AliMC* pMC = AliMC::GetMC();
1605 TGeant3 *geant3 = (TGeant3*) pMC;
1607 // Set everything unseen
1608 pMC->Gsatt("*", "seen", -1);
1610 // Set ALIC mother transparent
1611 pMC->Gsatt("ALIC","SEEN",0);
1613 // Set the volumes visible
1615 pMC->Gsatt("RICH","seen",0);
1616 pMC->Gsatt("SRIC","seen",0);
1617 pMC->Gsatt("HONE","seen",1);
1618 pMC->Gsatt("ALUM","seen",1);
1619 pMC->Gsatt("QUAR","seen",1);
1620 pMC->Gsatt("SPAC","seen",1);
1621 pMC->Gsatt("OQUA","seen",1);
1622 pMC->Gsatt("OQUF","seen",1);
1623 pMC->Gsatt("BARR","seen",1);
1624 pMC->Gsatt("FREO","seen",1);
1625 pMC->Gsatt("META","seen",1);
1626 pMC->Gsatt("GAP ","seen",1);
1627 pMC->Gsatt("CSI ","seen",1);
1628 pMC->Gsatt("GRID","seen",1);
1631 geant3->Gdopt("hide", "on");
1632 geant3->Gdopt("shad", "on");
1633 geant3->Gsatt("*", "fill", 7);
1634 geant3->SetClipBox(".");
1635 geant3->Gdopt("hide", "on");
1636 geant3->Gdopt("shad", "on");
1637 geant3->Gsatt("*", "fill", 7);
1638 geant3->SetClipBox(".");
1639 // geant3->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 2000);
1640 geant3->DefaultRange();
1641 pMC->Gdraw("alic", 60, 50, 0, 10, 0, .03, .03);
1642 geant3->Gdhead(1111, "Ring Imaging Cherenkov version 1");
1643 geant3->Gdman(16, 6, "MAN");
1644 geant3->Gdopt("hide", "off");
1647 //_____________________________________________________________________________
1648 void AliRICHv1::CreateMaterials()
1651 // *** DEFINITION OF AVAILABLE RICH MATERIALS ***
1652 // ORIGIN : NICK VAN EIJNDHOVEN
1653 // Modified by: N. Colonna (INFN - BARI, Nicola.Colonna@ba.infn.it)
1654 // R.A. Fini (INFN - BARI, Rosanna.Fini@ba.infn.it)
1655 // R.A. Loconsole (Bari University, loco@riscom.ba.infn.it)
1657 Int_t ISXFLD = gAlice->Field()->Integ();
1658 Float_t SXMGMX = gAlice->Field()->Max();
1660 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,
1661 6.7e-9,6.88e-9,7.08e-9,7.3e-9,7.51e-9,7.74e-9,8e-9 };
1662 Float_t rindex_quarz[14] = { 1.528309,1.533333,
1663 1.538243,1.544223,1.550568,1.55777,
1664 1.565463,1.574765,1.584831,1.597027,
1665 1.611858,1.6277,1.6472,1.6724 };
1666 Float_t rindex_quarzo[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1667 Float_t rindex_methane[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1668 Float_t rindex_gri[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1669 Float_t absco_freon[14] = { 179.0987,179.0987,
1670 179.0987,179.0987,179.0987,35.7,12.54,5.92,4.92,3.86,1.42,.336,.134,0. };
1671 Float_t absco_quarz[14] = { 20.126,16.27,13.49,11.728,9.224,8.38,7.44,7.17,
1672 6.324,4.483,1.6,.323,.073,0. };
1673 Float_t absco_quarzo[14] = { 1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,1e-5,
1674 1e-5,1e-5,1e-5,1e-5,1e-5 };
1675 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,
1676 1e-4,1e-4,1e-4,1e-4 };
1677 Float_t absco_methane[14] = { 1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,1e6,
1679 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,
1680 1e-4,1e-4,1e-4,1e-4 };
1681 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1682 Float_t effic_csi[14] = { 4.74e-4,.00438,.009,.0182,.0282,.0653,.1141,.163,
1683 .2101,.2554,.293,.376,.3861,.418 };
1684 Float_t effic_gri[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1686 Float_t afre[2], agri, amet[2], aqua[2], ahon, zfre[2], zgri, zhon,
1690 Int_t nlmatmet, nlmatqua;
1691 Float_t wmatquao[2], rindex_freon[14];
1693 Float_t aquao[2], epsil, stmin, zquao[2];
1695 Float_t radlal, densal, tmaxfd, deemax, stemax;
1696 Float_t aal, zal, radlgri, densfre, radlhon, densgri, denshon,densqua, densmet, wmatfre[2], wmatmet[2], wmatqua[2];
1698 Int_t *idtmed = gAlice->Idtmed();
1700 AliMC* pMC = AliMC::GetMC();
1701 TGeant3 *geant3 = (TGeant3*) pMC;
1703 // --- Photon energy (GeV)
1704 // --- Refraction indexes
1705 for (i = 0; i < 14; ++i) {
1706 rindex_freon[i] = ppckov[i] * .01095 * 1e9 + 1.2177;
1708 // need to be changed
1710 // --- Absorbtion lenghts (in cm)
1711 // DATA ABSCO_QUARZ /
1713 // & 29.85, 7.34, 4.134, 1.273, 0.722,
1714 // & 0.365, 0.365, 0.365, 0. /
1715 // need to be changed
1717 // --- Detection efficiencies (quantum efficiency for CsI)
1718 // --- Define parameters for honeycomb.
1719 // Used carbon of equivalent rad. lenght
1726 // --- Parameters to include in GSMIXT, relative to Quarz (SiO2)
1737 // --- Parameters to include in GSMIXT, relative to opaque Quarz (SiO2)
1748 // --- Parameters to include in GSMIXT, relative to Freon (C6F14)
1759 // --- Parameters to include in GSMIXT, relative to methane (CH4)
1770 // --- Parameters to include in GSMIXT, relative to anode grid (Cu)
1777 // --- Parameters to include in GSMATE related to aluminium sheet
1784 AliMaterial(1, "Air $", 14.61, 7.3, .001205, 30420., 67500);
1785 AliMaterial(6, "HON", ahon, zhon, denshon, radlhon, 0);
1786 AliMaterial(16, "CSI", ahon, zhon, denshon, radlhon, 0);
1787 AliMixture(20, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
1788 AliMixture(21, "QUAO", aquao, zquao, densquao, nlmatquao, wmatquao);
1789 AliMixture(30, "FRE", afre, zfre, densfre, nlmatfre, wmatfre);
1790 AliMixture(40, "MET", amet, zmet, densmet, nlmatmet, wmatmet);
1791 AliMixture(41, "METG", amet, zmet, densmet, nlmatmet, wmatmet);
1792 AliMaterial(11, "GRI", agri, zgri, densgri, radlgri, 0);
1793 AliMaterial(50, "ALUM", aal, zal, densal, radlal, 0);
1801 AliMedium(1001, "DEFAULT MEDIUM AIR$", 1, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1802 AliMedium(1002, "HONEYCOMB$", 6, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1803 AliMedium(1003, "QUARZO$", 20, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1804 AliMedium(1004, "FREON$", 30, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1805 AliMedium(1005, "METANO$", 40, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1806 AliMedium(1006, "CSI$", 16, 1, ISXFLD, SXMGMX,tmaxfd, stemax, deemax, epsil, stmin);
1807 AliMedium(1007, "GRIGLIA$", 11, 0, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1808 AliMedium(1008, "QUARZOO$", 21, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1809 AliMedium(1009, "GAP$", 41, 1, ISXFLD, SXMGMX,tmaxfd, .1, -deemax, epsil, -stmin);
1810 AliMedium(1010, "ALUMINUM$", 50, 1, ISXFLD, SXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
1813 // Switch on delta-ray production in the methane and freon gaps
1815 pMC->Gstpar(idtmed[1002], "LOSS", 1.);
1816 pMC->Gstpar(idtmed[1003], "LOSS", 1.);
1817 pMC->Gstpar(idtmed[1004], "LOSS", 1.);
1818 pMC->Gstpar(idtmed[1008], "LOSS", 1.);
1819 pMC->Gstpar(idtmed[1005], "LOSS", 1.);
1820 pMC->Gstpar(idtmed[1002], "HADR", 1.);
1821 pMC->Gstpar(idtmed[1003], "HADR", 1.);
1822 pMC->Gstpar(idtmed[1004], "HADR", 1.);
1823 pMC->Gstpar(idtmed[1008], "HADR", 1.);
1824 pMC->Gstpar(idtmed[1005], "HADR", 1.);
1825 pMC->Gstpar(idtmed[1002], "DCAY", 1.);
1826 pMC->Gstpar(idtmed[1003], "DCAY", 1.);
1827 pMC->Gstpar(idtmed[1004], "DCAY", 1.);
1828 pMC->Gstpar(idtmed[1008], "DCAY", 1.);
1829 pMC->Gstpar(idtmed[1005], "DCAY", 1.);
1830 geant3->Gsckov(idtmed[1000], 14, ppckov, absco_methane, effic_all, rindex_methane);
1831 geant3->Gsckov(idtmed[1001], 14, ppckov, absco_methane, effic_all, rindex_methane);
1832 geant3->Gsckov(idtmed[1002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
1833 geant3->Gsckov(idtmed[1003], 14, ppckov, absco_freon, effic_all,rindex_freon);
1834 geant3->Gsckov(idtmed[1004], 14, ppckov, absco_methane, effic_all, rindex_methane);
1835 geant3->Gsckov(idtmed[1005], 14, ppckov, absco_csi, effic_csi, rindex_methane);
1836 geant3->Gsckov(idtmed[1006], 14, ppckov, absco_gri, effic_gri, rindex_gri);
1837 geant3->Gsckov(idtmed[1007], 14, ppckov, absco_quarzo, effic_all, rindex_quarzo);
1838 geant3->Gsckov(idtmed[1008], 14, ppckov, absco_methane, effic_all, rindex_methane);
1839 geant3->Gsckov(idtmed[1009], 14, ppckov, absco_gri, effic_gri, rindex_gri);
1842 ClassImp(AliRICHhit)
1844 //_____________________________________________________________________________
1845 AliRICHhit::AliRICHhit(Int_t shunt, Int_t track, Int_t *vol,
1846 Float_t *hits, Int_t fNpadhits) :
1850 // Standard constructor for RICH hit
1853 for (i=0;i<2;i++) fVolume[i] = vol[i];
1854 fTrack = (int) track;
1856 fPart = (int) hits[ 1];
1857 //AliHit information, position of the hit
1861 fFirstpad = fNpadhits;
1862 fLastpad = fNpadhits-1;
1865 fModule = (int) hits[ 4];
1867 fArrivaltime= hits[ 6];
1868 fFeed = (int) hits[ 7];
1871 ClassImp(AliRICHmip)
1873 //_____________________________________________________________________________
1874 AliRICHmip::AliRICHmip(Int_t shunt, Int_t track, Int_t *vol,
1875 Float_t *hits, Int_t fNckovs, Int_t fNpadhits) :
1876 AliRICHhit(shunt,track,vol,hits,fNpadhits)
1879 // Standard constructor for RICH Mip hit
1886 if ((int) hits[12]){
1887 fFirstCkov = fNckovs;
1888 fLastCkov = fNckovs-1;
1895 ClassImp(AliRICHckov)
1897 //_____________________________________________________________________________
1898 AliRICHckov::AliRICHckov(Int_t shunt, Int_t track, Int_t *vol,
1899 Float_t *hits, Int_t fNmips, Int_t fNpadhits) :
1900 AliRICHhit(shunt,track,vol,hits,fNpadhits)
1903 // Standard creator for RICH Cherenkov information
1906 fStop = (int) hits[9];
1912 ClassImp(AliRICHpadhit)
1915 //_____________________________________________________________________________
1916 AliRICHpadhit::AliRICHpadhit(Int_t shunt, Int_t track, Int_t *vol,
1917 Float_t *hits, Int_t fNmips, Int_t fNckovs):
1921 // Standard constructor for RICH pad hit
1924 for (i=0;i<2;i++) fVolume[i] = vol[i];
1927 fX = (int) hits[ 2];
1928 fY = (int) hits[ 3];
1929 fModule = (int) hits[ 4];
1930 fParentMip = fNmips;
1931 fParentCkov = fNckovs;
1932 fProd = (int) hits[ 5];
1934 fZ = -999.0; // Not implemented