1 ///////////////////////////////////////////////////////////////////////////////
4 // This class contains the functions for version 0 of the Time Of Flight //
9 <img src="gif/AliTOFv0Class.gif">
13 ///////////////////////////////////////////////////////////////////////////////
22 //_____________________________________________________________________________
23 AliTOFv0::AliTOFv0() : AliTOF()
26 // Default constructor
30 //_____________________________________________________________________________
31 AliTOFv0::AliTOFv0(const char *name, const char *title)
35 // Standard constructor for version 0 of the Time Of Flight
39 //_____________________________________________________________________________
40 void AliTOFv0::CreateGeometry()
43 // Definition of Geometry
44 // Authors : Maxim Martemianov, Boris Zagreev (ITEP) 18/09/98
47 <img src="gif/AliTOFv0.gif">
52 AliMC* pMC = AliMC::GetMC();
56 Float_t phos_phi, zcor2, zcor3, ztof0, ztof1, ztof2;
61 Float_t par[10], fil_min, fil_max, ysz, fil0;
63 Int_t *idtmed = gAlice->Idtmed();
65 // barrel size along Z axis
70 // TOF width along radius of barrel
78 // PHOS and RICH angles
85 zcor2 = ztof0 - ztof1 / 2.;
86 zcor3 = ztof0 - ztof2 / 2.;
87 phos_phi = TMath::ATan(phos_x / (phos_r * 2.));
88 fil_min = (kPI - phos_phi * 4.) * kRaddeg - 180. / lmax;
89 fil_max = (phos_phi * 4. + kPI) * kRaddeg + 180. / lmax;
90 // barrel radius in ALIC
94 pMC->Gsvolu("FBAR", "TUBE", idtmed[500], par, 3);
95 pMC->Gspos("FBAR", 1, "ALIC", 0., 0., 0., 0, "ONLY");
96 pMC->Gsatt("FBAR", "SEEN", 0);
98 par[0] = (rp1+rp2-ysz)/2.;
99 par[1] = (rp1+rp2+ysz)/2.;
101 par[3] = 90. - fil_min;
102 par[4] = 90. - fil_rich;
103 fil0 = 180. - (par[3] + par[4]);
104 pMC->Gsvolu("FBT1", "TUBS", idtmed[507], par, 5);
105 AliMatrix(idrotm[1], 90., fil0, 90., fil0 + 90., 0., 0.);
106 pMC->Gspos("FBT1", 0, "FBAR", 0., 0., 0., 0, "ONLY");
107 pMC->Gspos("FBT1", 1, "FBAR", 0., 0., 0., idrotm[1], "ONLY");
110 par[3] = 90. - fil_max;
111 par[4] = 90. - fil_min;
112 pMC->Gsvolu("FBT2", "TUBS", idtmed[507], par, 5);
113 pMC->Gspos("FBT2", 0, "FBAR", 0., 0., zcor2, 0, "ONLY");
114 pMC->Gspos("FBT2", 1, "FBAR", 0., 0.,-zcor2, 0, "ONLY");
117 par[3] = 90. - fil_rich;
118 par[4] = fil_rich + 90.;
119 pMC->Gsvolu("FBT3", "TUBS", idtmed[507], par, 5);
120 pMC->Gspos("FBT3", 0, "FBAR", 0., 0., zcor3, 0, "ONLY");
121 pMC->Gspos("FBT3", 1, "FBAR", 0., 0., -zcor3, 0, "ONLY");
124 //_____________________________________________________________________________
125 void AliTOFv0::DrawModule()
128 // Draw a shaded view of the common part of the TOF geometry
129 // for versions 2 and 3
132 AliMC* pMC = AliMC::GetMC();
134 // Set everything unseen
135 pMC->Gsatt("*", "seen", -1);
137 // Set ALIC mother transparent
138 pMC->Gsatt("ALIC","SEEN",0);
140 // Set the volumes visible
141 pMC->Gsatt("FBAR","SEEN",0);
142 pMC->Gsatt("FBT1","SEEN",1);
143 pMC->Gsatt("FBT2","SEEN",1);
144 pMC->Gsatt("FBT3","SEEN",1);
146 pMC->Gdopt("hide", "on");
147 pMC->Gdopt("shad", "on");
148 pMC->Gsatt("*", "fill", 7);
150 pMC->SetClipBox(".");
151 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
153 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
154 pMC->Gdhead(1111, "Time Of Flight");
155 pMC->Gdman(18, 4, "MAN");
156 pMC->Gdopt("hide","off");
159 //_____________________________________________________________________________
160 void AliTOFv0::CreateMaterials()
163 // Define materials for the Time Of Flight
165 AliTOF::CreateMaterials();
168 //_____________________________________________________________________________
169 void AliTOFv0::Init()
172 // Initialise detector after that it has been built
175 AliMC* pMC = AliMC::GetMC();
178 fIdFBT2=pMC->VolId("FBT2");
179 fIdFBT3=pMC->VolId("FBT3");
182 //_____________________________________________________________________________
183 void AliTOFv0::StepManager()
186 // Procedure called at each step in the Time Of Flight
191 // Get the pointer to the MonteCarlo
192 AliMC *pMC= AliMC::GetMC();
193 Int_t *idtmed = gAlice->Idtmed();
194 if(pMC->GetMedium()==idtmed[510-1] &&
195 pMC->TrackEntering() && pMC->TrackCharge()
196 && (id=pMC->CurrentVol(0,copy))==fIdSens) {
197 TClonesArray &lhits = *fHits;
199 // Record only charged tracks at entrance
201 vol[1]=pMC->CurrentVolOff(1,0,copy);
202 if(id==fIdFBT2) copy+=2; else
203 if(id==fIdFBT2) copy+=4;
205 pMC->TrackPosition(hits);
206 pMC->TrackMomentum(&hits[3]);
207 hits[7]=pMC->TrackTime();
208 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);