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 // **************************************************************************
17 #include "AliRICHv1.h"
18 #include "AliRICHParam.h"
19 #include "AliRICHChamber.h"
20 #include <TParticle.h>
22 #include <TVirtualMC.h>
31 //__________________________________________________________________________________________________
32 void AliRICHv1::StepManager()
37 static Int_t iCurrentChamber;
40 static TLorentzVector cerX4;
41 if((gMC->TrackPid()==kCerenkov||gMC->TrackPid()==kFeedback)&&gMC->CurrentVolID(copy)==gMC->VolId("CSI ")){//photon in CSI
42 if(gMC->Edep()>0.){//CF+CSI+DE
43 if(IsLostByFresnel()){ gMC->StopTrack(); return;}
44 gMC->TrackPosition(cerX4); gMC->CurrentVolOffID(2,iCurrentChamber);
46 AddHit(iCurrentChamber,gAlice->GetMCApp()->GetCurrentTrackNumber(),cerX4.Vect(),cerX4.Vect());//HIT for PHOTON in conditions CF+CSI+DE
47 GenerateFeedbacks(iCurrentChamber);
51 //Treat charged particles
53 static TLorentzVector mipInX4,mipOutX4;
54 if(gMC->TrackCharge() && gMC->CurrentVolID(copy)==gMC->VolId("GAP ")){//MIP in GAP
55 gMC->CurrentVolOffID(3,iCurrentChamber);
56 if(gMC->IsTrackEntering()||gMC->IsNewTrack()) {//MIP in GAP entering or newly created
58 gMC->TrackPosition(mipInX4);
59 }else if(gMC->IsTrackExiting()||gMC->IsTrackStop()||gMC->IsTrackDisappeared()){//MIP in GAP exiting or disappeared
60 eloss+=gMC->Edep();//take into account last step dEdX
61 gMC->TrackPosition(mipOutX4);
62 AddHit(iCurrentChamber,gAlice->GetMCApp()->GetCurrentTrackNumber(),mipInX4.Vect(),mipOutX4.Vect(),eloss);//HIT for MIP: MIP in GAP Exiting
63 GenerateFeedbacks(iCurrentChamber,eloss);//MIP+GAP+Exit
64 }else//MIP in GAP going inside
68 //__________________________________________________________________________________________________
69 Bool_t AliRICHv1::IsLostByFresnel()
72 Double_t mom[3],localMom[3];
73 gMC->TrackMomentum(p4); mom[0]=p4(1); mom[1]=p4(2); mom[2]=p4(3);
74 localMom[0]=0; localMom[1]=0; localMom[2]=0;
75 gMC->Gmtod(mom,localMom,2);
76 Double_t localTc = localMom[0]*localMom[0]+localMom[2]*localMom[2];
77 Double_t localTheta = TMath::ATan2(TMath::Sqrt(localTc),localMom[1]);
78 Double_t cotheta = TMath::Abs(TMath::Cos(localTheta));
79 if(gMC->GetRandom()->Rndm() < Fresnel(p4.E()*1e9,cotheta,1)){
80 if(GetDebug()) Info("IsLostByFresnel","");
85 //__________________________________________________________________________________________________