1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 0 of the Time Of Flight //
9 <img src="picts/AliTOFv0Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
21 //_____________________________________________________________________________
25 // Default constructor
29 //_____________________________________________________________________________
30 AliTOFv0::AliTOFv0(const char *name, const char *title)
34 // Standard constructor for version 0 of the Time Of Flight
38 //_____________________________________________________________________________
39 void AliTOFv0::CreateGeometry()
42 // Definition of Geometry
43 // Authors : Maxim Martemianov, Boris Zagreev (ITEP) 18/09/98
46 <img src="picts/AliTOFv0.gif">
53 Float_t phos_phi, zcor2, zcor3, ztof0, ztof1, ztof2;
58 Float_t par[10], fil_min, fil_max, ysz, fil0;
60 Int_t *idtmed = fIdtmed->GetArray()-499;
62 // barrel size along Z axis
69 // TOF width along radius of barrel
77 // PHOS and RICH angles
84 zcor2 = ztof0 - ztof1 / 2.;
85 zcor3 = ztof0 - ztof2 / 2.;
86 phos_phi = TMath::ATan(phos_x / (phos_r * 2.));
87 fil_min = (kPI - phos_phi * 4.) * kRaddeg - 180. / lmax;
88 fil_max = (phos_phi * 4. + kPI) * kRaddeg + 180. / lmax;
89 // barrel radius in ALIC
93 gMC->Gsvolu("FBAR", "TUBE", idtmed[500], par, 3);
94 gMC->Gspos("FBAR", 1, "ALIC", 0., 0., 0., 0, "ONLY");
95 gMC->Gsatt("FBAR", "SEEN", 0);
97 par[0] = (rp1+rp2-ysz)/2.;
98 par[1] = (rp1+rp2+ysz)/2.;
100 par[3] = 90. - fil_min;
101 par[4] = 90. - fil_rich;
102 fil0 = 180. - (par[3] + par[4]);
103 gMC->Gsvolu("FBT1", "TUBS", idtmed[507], par, 5);
104 AliMatrix(idrotm[1], 90., fil0, 90., fil0 + 90., 0., 0.);
105 gMC->Gspos("FBT1", 0, "FBAR", 0., 0., 0., 0, "ONLY");
106 gMC->Gspos("FBT1", 1, "FBAR", 0., 0., 0., idrotm[1], "ONLY");
109 par[3] = 90. - fil_max;
110 par[4] = 90. - fil_min;
111 gMC->Gsvolu("FBT2", "TUBS", idtmed[507], par, 5);
112 gMC->Gspos("FBT2", 0, "FBAR", 0., 0., zcor2, 0, "ONLY");
113 gMC->Gspos("FBT2", 1, "FBAR", 0., 0.,-zcor2, 0, "ONLY");
116 par[3] = 90. - fil_rich;
117 par[4] = fil_rich + 90.;
118 gMC->Gsvolu("FBT3", "TUBS", idtmed[507], par, 5);
119 gMC->Gspos("FBT3", 0, "FBAR", 0., 0., zcor3, 0, "ONLY");
120 gMC->Gspos("FBT3", 1, "FBAR", 0., 0., -zcor3, 0, "ONLY");
123 //_____________________________________________________________________________
124 void AliTOFv0::DrawModule()
127 // Draw a shaded view of the common part of the TOF geometry
128 // for versions 2 and 3
131 // Set everything unseen
132 gMC->Gsatt("*", "seen", -1);
134 // Set ALIC mother transparent
135 gMC->Gsatt("ALIC","SEEN",0);
137 // Set the volumes visible
138 gMC->Gsatt("FBAR","SEEN",0);
139 gMC->Gsatt("FBT1","SEEN",1);
140 gMC->Gsatt("FBT2","SEEN",1);
141 gMC->Gsatt("FBT3","SEEN",1);
143 gMC->Gdopt("hide", "on");
144 gMC->Gdopt("shad", "on");
145 gMC->Gsatt("*", "fill", 7);
147 gMC->SetClipBox(".");
148 gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
150 gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
151 gMC->Gdhead(1111, "Time Of Flight");
152 gMC->Gdman(18, 4, "MAN");
153 gMC->Gdopt("hide","off");
156 //_____________________________________________________________________________
157 void AliTOFv0::CreateMaterials()
160 // Define materials for the Time Of Flight
162 AliTOF::CreateMaterials();
165 //_____________________________________________________________________________
166 void AliTOFv0::Init()
169 // Initialise detector after that it has been built
173 fIdFBT2=gMC->VolId("FBT2");
174 fIdFBT3=gMC->VolId("FBT3");
177 //_____________________________________________________________________________
178 void AliTOFv0::StepManager()
181 // Procedure called at each step in the Time Of Flight
186 // Get the pointer to the MonteCarlo
187 Int_t *idtmed = fIdtmed->GetArray()-499;
188 if(gMC->GetMedium()==idtmed[510-1] &&
189 gMC->TrackEntering() && gMC->TrackCharge()
190 && (id=gMC->CurrentVol(0,copy))==fIdSens) {
191 TClonesArray &lhits = *fHits;
193 // Record only charged tracks at entrance
195 vol[1]=gMC->CurrentVolOff(1,0,copy);
196 if(id==fIdFBT2) copy+=2; else
197 if(id==fIdFBT2) copy+=4;
199 gMC->TrackPosition(hits);
200 gMC->TrackMomentum(&hits[3]);
201 hits[7]=gMC->TrackTime();
202 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);