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.19 2002/02/11 14:25:27 cblume
19 Geometry update, compressed hit structure
21 Revision 1.18 2000/11/30 17:38:08 cblume
22 Changes to get in line with new STEER and EVGEN
24 Revision 1.17 2000/11/01 14:53:21 cblume
25 Merge with TRD-develop
27 Revision 1.14.2.3 2000/10/06 16:49:46 cblume
30 Revision 1.14.2.2 2000/10/04 16:34:58 cblume
31 Replace include files by forward declarations
33 Revision 1.14.2.1 2000/09/18 13:48:18 cblume
34 Adapt to new AliTRDhit
36 Revision 1.16 2000/06/08 18:32:58 cblume
37 Make code compliant to coding conventions
39 Revision 1.15 2000/06/07 16:25:37 cblume
40 Try to remove compiler warnings on Sun and HP
42 Revision 1.14 2000/02/28 19:10:26 cblume
43 Include the new TRD classes
45 Revision 1.13.4.1 2000/02/28 18:01:53 cblume
46 Change to new hit version and introduce geometry class
48 Revision 1.13 1999/11/05 22:50:28 fca
49 Do not use Atan, removed from ROOT too
51 Revision 1.12 1999/11/02 16:35:56 fca
52 New version of TRD introduced
54 Revision 1.11 1999/11/01 20:41:51 fca
55 Added protections against using the wrong version of FRAME
57 Revision 1.10 1999/09/29 09:24:35 fca
58 Introduction of the Copyright and cvs Log
62 ///////////////////////////////////////////////////////////////////////////////
64 // Transition Radiation Detector version 0 -- fast simulator //
68 <img src="picts/AliTRDfullClass.gif">
73 ///////////////////////////////////////////////////////////////////////////////
80 #include <TLorentzVector.h>
87 #include "AliTRDhit.h"
88 #include "AliTRDgeometry.h"
92 //_____________________________________________________________________________
93 AliTRDv0::AliTRDv0():AliTRD()
96 // AliTRDv0 default constructor
103 //_____________________________________________________________________________
104 AliTRDv0::AliTRDv0(const char *name, const char *title)
108 // Standard constructor for Transition Radiation Detector version 0
115 //_____________________________________________________________________________
116 AliTRDv0::~AliTRDv0()
119 // AliTRDv0 destructor
124 //_____________________________________________________________________________
125 void AliTRDv0::CreateGeometry()
128 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
129 // This version covers the full azimuth.
132 // Check that FRAME is there otherwise we have no place where to put the TRD
133 AliModule* frame = gAlice->GetModule("FRAME");
136 // Define the chambers
137 AliTRD::CreateGeometry();
141 //_____________________________________________________________________________
142 void AliTRDv0::CreateMaterials()
145 // Create materials for the Transition Radiation Detector
148 AliTRD::CreateMaterials();
152 //_____________________________________________________________________________
153 void AliTRDv0::Init()
156 // Initialize Transition Radiation Detector after geometry is built
161 printf(" Fast simulator\n\n");
162 for (Int_t i = 0; i < 80; i++) printf("*");
167 //_____________________________________________________________________________
168 void AliTRDv0::StepManager()
171 // Procedure called at every step in the TRD
172 // Fast simulator. If switched on, a hit is produced when a track
173 // crosses the border between amplification region and pad plane.
185 // Use pad plane as sensitive volume
186 TString cIdSens = "L";
188 Char_t cIdChamber[3];
191 const Int_t kNplan = AliTRDgeometry::Nplan();
193 // Writing out hits enabled?
194 if (!(fHitsOn)) return;
196 // Use only charged tracks and count them only once per volume
197 if (gMC->TrackCharge() &&
198 gMC->IsTrackEntering()) {
200 // Check on sensitive volume
201 cIdCurrent = gMC->CurrentVolName();
202 if (cIdCurrent[1] == cIdSens) {
204 gMC->TrackPosition(p);
205 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
207 // The sector number (0 - 17)
208 // The numbering goes clockwise and starts at y = 0
209 Float_t phi = kRaddeg*TMath::ATan2(hits[0],hits[1]);
214 sec = ((Int_t) (phi / 20));
216 // The plane and chamber number
217 cIdChamber[0] = cIdCurrent[2];
218 cIdChamber[1] = cIdCurrent[3];
219 Int_t idChamber = atoi(cIdChamber);
220 cha = ((Int_t) idChamber / kNplan);
221 pla = ((Int_t) idChamber % kNplan);
222 det = fGeometry->GetDetector(pla,cha,sec);
224 AddHit(gAlice->CurrentTrack(),det,hits,0,kTRUE);