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 2000/02/28 19:10:26 cblume
19 Include the new TRD classes
21 Revision 1.13.4.1 2000/02/28 18:01:53 cblume
22 Change to new hit version and introduce geometry class
24 Revision 1.13 1999/11/05 22:50:28 fca
25 Do not use Atan, removed from ROOT too
27 Revision 1.12 1999/11/02 16:35:56 fca
28 New version of TRD introduced
30 Revision 1.11 1999/11/01 20:41:51 fca
31 Added protections against using the wrong version of FRAME
33 Revision 1.10 1999/09/29 09:24:35 fca
34 Introduction of the Copyright and cvs Log
38 ///////////////////////////////////////////////////////////////////////////////
40 // Transition Radiation Detector version 0 -- fast simulator //
44 <img src="picts/AliTRDfullClass.gif">
49 ///////////////////////////////////////////////////////////////////////////////
60 #include "AliTRDgeometry.h"
64 //_____________________________________________________________________________
65 AliTRDv0::AliTRDv0(const char *name, const char *title)
69 // Standard constructor for Transition Radiation Detector version 0
81 //_____________________________________________________________________________
82 void AliTRDv0::CreateGeometry()
85 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
86 // This version covers the full azimuth.
89 // Check that FRAME is there otherwise we have no place where to put the TRD
90 AliModule* FRAME = gAlice->GetModule("FRAME");
93 // Define the chambers
94 AliTRD::CreateGeometry();
98 //_____________________________________________________________________________
99 void AliTRDv0::CreateMaterials()
102 // Create materials for the Transition Radiation Detector
105 AliTRD::CreateMaterials();
109 //_____________________________________________________________________________
110 void AliTRDv0::Init()
113 // Initialize Transition Radiation Detector after geometry is built
118 // Identifier of the sensitive volume (amplification region)
119 fIdSens = gMC->VolId("UL06");
121 // Identifier of the TRD-driftchambers
122 fIdChamber1 = gMC->VolId("UCIO");
123 fIdChamber2 = gMC->VolId("UCIM");
124 fIdChamber3 = gMC->VolId("UCII");
126 printf(" Fast simulator\n\n");
127 for (Int_t i = 0; i < 80; i++) printf("*");
132 //_____________________________________________________________________________
133 void AliTRDv0::StepManager()
136 // Procedure called at every step in the TRD
137 // Fast simulator. If switched on, a hit is produced when a track
138 // crosses the border between amplification region and pad plane.
144 Int_t iIdSens, icSens;
145 Int_t iIdChamber, icChamber;
151 TClonesArray &lhits = *fHits;
153 // Writing out hits enabled?
154 if (!(fHitsOn)) return;
156 // Use only charged tracks and count them only once per volume
157 if (gMC->TrackCharge() &&
158 gMC->IsTrackExiting()) {
160 // Check on sensitive volume
161 iIdSens = gMC->CurrentVolID(icSens);
162 if (iIdSens == fIdSens) {
164 gMC->TrackPosition(p);
165 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
169 // The sector number (0 - 17)
170 // The numbering goes clockwise and starts at y = 0
171 Float_t phi = kRaddeg*TMath::ATan2(hits[0],hits[1]);
176 sec = ((Int_t) (phi / 20));
178 // The chamber number
184 iIdChamber = gMC->CurrentVolOffID(1,icChamber);
185 if (iIdChamber == fIdChamber1)
186 cha = (hits[2] < 0 ? 0 : 4);
187 else if (iIdChamber == fIdChamber2)
188 cha = (hits[2] < 0 ? 1 : 3);
189 else if (iIdChamber == fIdChamber3)
192 // The plane number (0 - 5)
193 pla = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6 - 1;
195 det[0] = fGeometry->GetDetector(pla,cha,sec);
196 new(lhits[fNhits++]) AliTRDhit(fIshunt
197 ,gAlice->CurrentTrack()