GetMedium replaced by CurrentMedium (I.Hrivnacova)
[u/mrichter/AliRoot.git] / RICH / AliRICHv0.cxx
CommitLineData
53fd478b 1//**************************************************************************
2// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3// *
4// Author: The ALICE Off-line Project. *
5// Contributors are mentioned in the code where appropriate. *
6// *
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//**************************************************************************
4c039060 15
88cb7938 16#include "AliRICHv0.h"
53fd478b 17#include "AliRICHChamber.h"
18#include <AliRun.h>
19#include <AliMC.h>
c021cb15 20#include <TVirtualMC.h>
21#include <TPDGCode.h>
c021cb15 22#include <TLorentzVector.h>
53fd478b 23#include <TMath.h>
ddae0931 24
e42a7b46 25#include <TGeoManager.h>
26
ddae0931 27ClassImp(AliRICHv0)
fbeabb4b 28
e14b8113 29void AliRICHv0::StepManager()
fbeabb4b 30{
53fd478b 31//This StepManager is a provision for different test-learn activities on the current MC layer
998b831f 32 static Int_t iStepN;
8e8eae84 33 const char *sParticle;
c021cb15 34 switch(gMC->TrackPid()){
998b831f 35 case kProton: sParticle="proton" ;break;
36 case kNeutron: sParticle="neutron" ;break;
37 case kGamma: sParticle="gamma" ;break;
38 case kCerenkov: sParticle="photon" ;break;
39 case kPi0: sParticle="Pi0" ;break;
40 case kPiPlus: sParticle="Pi+" ;break;
41 case kPiMinus: sParticle="Pi-" ;break;
42 case kElectron: sParticle="electron" ;break;
43 default: sParticle="not known" ;break;
c021cb15 44 }
45
998b831f 46 Info(Form("Step %i",iStepN),"event=%i hunt=%i tid=%i pid=%i(%s) m=%f q=%3.1f dEdX=%9.3f",
fbeabb4b 47 gMC->CurrentEvent(),
48 fIshunt,
5d12ce38 49 gAlice->GetMCApp()->GetCurrentTrackNumber(),
fbeabb4b 50 gMC->TrackPid(),
51 sParticle,
52 gMC->TrackMass(),
ed3ceb24 53 gMC->TrackCharge(),
998b831f 54 gMC->Edep()*1e9);
55 Info("Flags","alive(%i) disap(%i) enter(%i) exit(%i) inside(%i) out(%i) stop(%i) new(%i)",
c021cb15 56 gMC->IsTrackAlive(),
fbeabb4b 57 gMC->IsTrackDisappeared(),
58 gMC->IsTrackEntering(),
59 gMC->IsTrackExiting(),
60 gMC->IsTrackInside(),
61 gMC->IsTrackOut(),
62 gMC->IsTrackStop(),
63 gMC->IsNewTrack());
998b831f 64 Int_t copy0=0,copy1=0,copy2=0,copy3=0;
fbeabb4b 65 Int_t vid0=gMC->CurrentVolID(copy0);
66 Int_t vid1=gMC->CurrentVolOffID(1,copy1);
67 Int_t vid2=gMC->CurrentVolOffID(2,copy2);
68 Int_t vid3=gMC->CurrentVolOffID(3,copy3);
998b831f 69 Info("Volumes","vid0=%i(%s)c%i vid1=%i(%s)c%i vid2=%i(%s)c%i vid3=%i(%s)c%i %s-%s-%s-%s",
fbeabb4b 70 vid0,gMC->VolName(vid0),copy0,
71 vid1,gMC->VolName(vid1),copy1,
72 vid2,gMC->VolName(vid2),copy2,
73 vid3,gMC->VolName(vid3),copy3,
74 gMC->CurrentVolName(),
75 gMC->CurrentVolOffName(1),
76 gMC->CurrentVolOffName(2),
77 gMC->CurrentVolOffName(3));
78
0fe8fa07 79 Float_t a,z,den,rad,abs; a=z=den=rad=abs=-1;
fbeabb4b 80 Int_t mid=gMC->CurrentMaterial(a,z,den,rad,abs);
998b831f 81 Info("Material","id=%i a=%7.2f z=%7.2f den=%9.4f rad=%9.2f abs=%9.2f",mid,a,z,den,rad,abs);
82
fa914fe6 83 Int_t iTmedId=gMC->CurrentMedium();
998b831f 84 const char *sTmed;
85 switch(iTmedId){
86 case kAir: sTmed="Air" ;break;
87 case kRoha: sTmed="Rohacell" ;break;
88 case kSiO2: sTmed="SiO2" ;break;
89 case kC6F14: sTmed="C6F14" ;break;
90 case kGridCu: sTmed="GridCu" ;break;
91 case kOpSiO2: sTmed="OpSiO2" ;break;
92 case kGap: sTmed="Gap" ;break;
93 case kGlass: sTmed="Glass" ;break;
94 case kCu: sTmed="Cu" ;break;
95 case kSteel: sTmed="Steel" ;break;
96 case kPerpex: sTmed="Perpex" ;break;
97 case kCH4: sTmed="CH4" ;break;
98 case kCsI: sTmed="CsI" ;break;
99 case kAl: sTmed="Al" ;break;
100 case kW: sTmed="W" ;break;
101 default: sTmed="not known";break;
102 }
103 Info("Medium","id=%i (%s)",iTmedId,sTmed);
fbeabb4b 104
a25b3368 105 TLorentzVector x4; gMC->TrackPosition(x4);
fbeabb4b 106 Float_t glo[3],loc[3];
107 glo[0]=x4.X();glo[1]=x4.Y();glo[2]=x4.Z();
108 gMC->Gmtod(glo,loc,1);
998b831f 109 Info("X4 glo","(x,y,z)=(%+8.3f,%+8.3f,%+8.3f) (r,theta,phi)=(%8.3f,%8.3f,%8.3f)",
53fd478b 110 glo[0],glo[1],glo[2],x4.Rho(),x4.Theta()*TMath::RadToDeg(),x4.Phi()*TMath::RadToDeg());
998b831f 111 Info("X4 loc","(x,y,z)=(%+8.3f,%+8.3f,%8.3f) by gMC->Gmtod()",loc[0],loc[1],loc[2]);
d6fb41ac 112 static Int_t idGAP = gMC->VolId("GAP ");
113 if(idGAP==gMC->CurrentVolID(copy0)){
c60862bf 114 Int_t iChamber;
115 gMC->CurrentVolOffID(2,iChamber);
998b831f 116 TVector2 x2=C(iChamber)->Mrs2Pc(x4);
117 Info("X4 loc","(%+8.3f,%+8.3f) by Mrs2Pc", x2.X(),x2.Y());
c60862bf 118 }
998b831f 119 Info(Form("Step %i",iStepN++),"end of current step\n");
53fd478b 120}//StepManager()