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">
51 AliMC* pMC = AliMC::GetMC();
55 Float_t phos_phi, zcor2, zcor3, ztof0, ztof1, ztof2;
60 Float_t par[10], fil_min, fil_max, ysz, fil0;
62 Int_t *idtmed = gAlice->Idtmed();
64 // barrel size along Z axis
71 // TOF width along radius of barrel
79 // PHOS and RICH angles
86 zcor2 = ztof0 - ztof1 / 2.;
87 zcor3 = ztof0 - ztof2 / 2.;
88 phos_phi = TMath::ATan(phos_x / (phos_r * 2.));
89 fil_min = (kPI - phos_phi * 4.) * kRaddeg - 180. / lmax;
90 fil_max = (phos_phi * 4. + kPI) * kRaddeg + 180. / lmax;
91 // barrel radius in ALIC
95 pMC->Gsvolu("FBAR", "TUBE", idtmed[500], par, 3);
96 pMC->Gspos("FBAR", 1, "ALIC", 0., 0., 0., 0, "ONLY");
97 pMC->Gsatt("FBAR", "SEEN", 0);
99 par[0] = (rp1+rp2-ysz)/2.;
100 par[1] = (rp1+rp2+ysz)/2.;
102 par[3] = 90. - fil_min;
103 par[4] = 90. - fil_rich;
104 fil0 = 180. - (par[3] + par[4]);
105 pMC->Gsvolu("FBT1", "TUBS", idtmed[507], par, 5);
106 AliMatrix(idrotm[1], 90., fil0, 90., fil0 + 90., 0., 0.);
107 pMC->Gspos("FBT1", 0, "FBAR", 0., 0., 0., 0, "ONLY");
108 pMC->Gspos("FBT1", 1, "FBAR", 0., 0., 0., idrotm[1], "ONLY");
111 par[3] = 90. - fil_max;
112 par[4] = 90. - fil_min;
113 pMC->Gsvolu("FBT2", "TUBS", idtmed[507], par, 5);
114 pMC->Gspos("FBT2", 0, "FBAR", 0., 0., zcor2, 0, "ONLY");
115 pMC->Gspos("FBT2", 1, "FBAR", 0., 0.,-zcor2, 0, "ONLY");
118 par[3] = 90. - fil_rich;
119 par[4] = fil_rich + 90.;
120 pMC->Gsvolu("FBT3", "TUBS", idtmed[507], par, 5);
121 pMC->Gspos("FBT3", 0, "FBAR", 0., 0., zcor3, 0, "ONLY");
122 pMC->Gspos("FBT3", 1, "FBAR", 0., 0., -zcor3, 0, "ONLY");
125 //_____________________________________________________________________________
126 void AliTOFv0::DrawModule()
129 // Draw a shaded view of the common part of the TOF geometry
130 // for versions 2 and 3
133 AliMC* pMC = AliMC::GetMC();
135 // Set everything unseen
136 pMC->Gsatt("*", "seen", -1);
138 // Set ALIC mother transparent
139 pMC->Gsatt("ALIC","SEEN",0);
141 // Set the volumes visible
142 pMC->Gsatt("FBAR","SEEN",0);
143 pMC->Gsatt("FBT1","SEEN",1);
144 pMC->Gsatt("FBT2","SEEN",1);
145 pMC->Gsatt("FBT3","SEEN",1);
147 pMC->Gdopt("hide", "on");
148 pMC->Gdopt("shad", "on");
149 pMC->Gsatt("*", "fill", 7);
151 pMC->SetClipBox(".");
152 pMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
154 pMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02);
155 pMC->Gdhead(1111, "Time Of Flight");
156 pMC->Gdman(18, 4, "MAN");
157 pMC->Gdopt("hide","off");
160 //_____________________________________________________________________________
161 void AliTOFv0::CreateMaterials()
164 // Define materials for the Time Of Flight
166 AliTOF::CreateMaterials();
169 //_____________________________________________________________________________
170 void AliTOFv0::Init()
173 // Initialise detector after that it has been built
176 AliMC* pMC = AliMC::GetMC();
179 fIdFBT2=pMC->VolId("FBT2");
180 fIdFBT3=pMC->VolId("FBT3");
183 //_____________________________________________________________________________
184 void AliTOFv0::StepManager()
187 // Procedure called at each step in the Time Of Flight
192 // Get the pointer to the MonteCarlo
193 AliMC *pMC= AliMC::GetMC();
194 Int_t *idtmed = gAlice->Idtmed();
195 if(pMC->GetMedium()==idtmed[510-1] &&
196 pMC->TrackEntering() && pMC->TrackCharge()
197 && (id=pMC->CurrentVol(0,copy))==fIdSens) {
198 TClonesArray &lhits = *fHits;
200 // Record only charged tracks at entrance
202 vol[1]=pMC->CurrentVolOff(1,0,copy);
203 if(id==fIdFBT2) copy+=2; else
204 if(id==fIdFBT2) copy+=4;
206 pMC->TrackPosition(hits);
207 pMC->TrackMomentum(&hits[3]);
208 hits[7]=pMC->TrackTime();
209 new(lhits[fNhits++]) AliTOFhit(fIshunt,gAlice->CurrentTrack(),vol,hits);