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 **************************************************************************/
18 Revision 1.14.2.3 2000/10/06 16:49:46 cblume
21 Revision 1.14.2.2 2000/10/04 16:34:58 cblume
22 Replace include files by forward declarations
24 Revision 1.14.2.1 2000/09/18 13:48:18 cblume
25 Adapt to new AliTRDhit
27 Revision 1.16 2000/06/08 18:32:58 cblume
28 Make code compliant to coding conventions
30 Revision 1.15 2000/06/07 16:25:37 cblume
31 Try to remove compiler warnings on Sun and HP
33 Revision 1.14 2000/02/28 19:10:26 cblume
34 Include the new TRD classes
36 Revision 1.13.4.1 2000/02/28 18:01:53 cblume
37 Change to new hit version and introduce geometry class
39 Revision 1.13 1999/11/05 22:50:28 fca
40 Do not use Atan, removed from ROOT too
42 Revision 1.12 1999/11/02 16:35:56 fca
43 New version of TRD introduced
45 Revision 1.11 1999/11/01 20:41:51 fca
46 Added protections against using the wrong version of FRAME
48 Revision 1.10 1999/09/29 09:24:35 fca
49 Introduction of the Copyright and cvs Log
53 ///////////////////////////////////////////////////////////////////////////////
55 // Transition Radiation Detector version 0 -- fast simulator //
59 <img src="picts/AliTRDfullClass.gif">
64 ///////////////////////////////////////////////////////////////////////////////
75 #include "AliTRDhit.h"
76 #include "AliTRDgeometry.h"
80 //_____________________________________________________________________________
81 AliTRDv0::AliTRDv0():AliTRD()
84 // AliTRDv0 default constructor
96 //_____________________________________________________________________________
97 AliTRDv0::AliTRDv0(const char *name, const char *title)
101 // Standard constructor for Transition Radiation Detector version 0
113 //_____________________________________________________________________________
114 AliTRDv0::~AliTRDv0()
117 // AliTRDv0 destructor
122 //_____________________________________________________________________________
123 void AliTRDv0::CreateGeometry()
126 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
127 // This version covers the full azimuth.
130 // Check that FRAME is there otherwise we have no place where to put the TRD
131 AliModule* frame = gAlice->GetModule("FRAME");
134 // Define the chambers
135 AliTRD::CreateGeometry();
139 //_____________________________________________________________________________
140 void AliTRDv0::CreateMaterials()
143 // Create materials for the Transition Radiation Detector
146 AliTRD::CreateMaterials();
150 //_____________________________________________________________________________
151 void AliTRDv0::Init()
154 // Initialize Transition Radiation Detector after geometry is built
159 // Identifier of the sensitive volume (amplification region)
160 fIdSens = gMC->VolId("UL06");
162 // Identifier of the TRD-driftchambers
163 fIdChamber1 = gMC->VolId("UCIO");
164 fIdChamber2 = gMC->VolId("UCIM");
165 fIdChamber3 = gMC->VolId("UCII");
167 printf(" Fast simulator\n\n");
168 for (Int_t i = 0; i < 80; i++) printf("*");
173 //_____________________________________________________________________________
174 void AliTRDv0::StepManager()
177 // Procedure called at every step in the TRD
178 // Fast simulator. If switched on, a hit is produced when a track
179 // crosses the border between amplification region and pad plane.
185 Int_t iIdSens, icSens;
186 Int_t iIdChamber, icChamber;
192 TClonesArray &lhits = *fHits;
194 // Writing out hits enabled?
195 if (!(fHitsOn)) return;
197 // Use only charged tracks and count them only once per volume
198 if (gMC->TrackCharge() &&
199 gMC->IsTrackExiting()) {
201 // Check on sensitive volume
202 iIdSens = gMC->CurrentVolID(icSens);
203 if (iIdSens == fIdSens) {
205 gMC->TrackPosition(p);
206 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
208 // The sector number (0 - 17)
209 // The numbering goes clockwise and starts at y = 0
210 Float_t phi = kRaddeg*TMath::ATan2(hits[0],hits[1]);
215 sec = ((Int_t) (phi / 20));
217 // The chamber number
223 iIdChamber = gMC->CurrentVolOffID(1,icChamber);
224 if (iIdChamber == fIdChamber1)
225 cha = (hits[2] < 0 ? 0 : 4);
226 else if (iIdChamber == fIdChamber2)
227 cha = (hits[2] < 0 ? 1 : 3);
228 else if (iIdChamber == fIdChamber3)
231 // The plane number (0 - 5)
232 pla = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6 - 1;
233 det = fGeometry->GetDetector(pla,cha,sec);
235 new(lhits[fNhits++]) AliTRDhit(fIshunt
236 ,gAlice->CurrentTrack()