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 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // Transition Radiation Detector version 1 -- coarse simulation //
23 // This version has two detector arms, leaving the space in front of the //
24 // HMPID and PHOS empty //
28 <img src="picts/AliTRDv1Class.gif">
33 ///////////////////////////////////////////////////////////////////////////////
46 //_____________________________________________________________________________
47 AliTRDv1::AliTRDv1(const char *name, const char *title)
51 // Standard constructor for the Transition Radiation Detector version 1
67 //_____________________________________________________________________________
68 void AliTRDv1::CreateGeometry()
71 // Create the GEANT geometry for the Transition Radiation Detector - Version 1
72 // This version covers only part of the azimuth.
74 // Author: Christoph Blume (C.Blume@gsi.de) 20/07/99
77 Float_t xpos, ypos, zpos;
79 // Check that FRAME is there otherwise we have no place where to put the TRD
80 AliModule* FRAME = gAlice->GetModule("FRAME");
83 // Define the chambers
84 AliTRD::CreateGeometry();
86 // Position the the TRD-sectors only in one TRD-volume in the spaceframe
90 gMC->Gspos("TRD ",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
94 //_____________________________________________________________________________
95 void AliTRDv1::CreateMaterials()
98 // Create materials for the Transition Radiation Detector version 1
101 AliTRD::CreateMaterials();
105 //_____________________________________________________________________________
106 void AliTRDv1::Init()
109 // Initialise the Transition Radiation Detector after the geometry is built
114 for (Int_t i = 0; i < 80; i++) printf("*");
117 // Identifier of the sensitive volume (amplification region)
118 fIdSens = gMC->VolId("UL06");
120 // Identifier of the TRD-spaceframe volumina
121 fIdSpace1 = gMC->VolId("B028");
122 fIdSpace2 = gMC->VolId("B029");
123 fIdSpace3 = gMC->VolId("B030");
125 // Identifier of the TRD-driftchambers
126 fIdChamber1 = gMC->VolId("UCIO");
127 fIdChamber2 = gMC->VolId("UCIM");
128 fIdChamber3 = gMC->VolId("UCII");
132 //_____________________________________________________________________________
133 void AliTRDv1::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.
142 Int_t iIdSens, icSens;
143 Int_t iIdSpace, icSpace;
144 Int_t iIdChamber, icChamber;
146 Int_t secMap1[10] = { 3, 7, 8, 9, 10, 11, 2, 1, 18, 17 };
147 Int_t secMap2[ 5] = { 16, 15, 14, 13, 12 };
148 Int_t secMap3[ 3] = { 5, 6, 4 };
153 TClonesArray &lhits = *fHits;
155 // Writing out hits enabled?
156 if (!(fHitsOn)) return;
158 // Use only charged tracks and count them only once per volume
159 if (gMC->TrackCharge() &&
160 gMC->IsTrackExiting()) {
162 // Check on sensitive volume
163 iIdSens = gMC->CurrentVolID(icSens);
164 if (iIdSens == fIdSens) {
166 gMC->TrackPosition(p);
167 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
171 iIdSpace = gMC->CurrentVolOffID(4,icSpace );
172 iIdChamber = gMC->CurrentVolOffID(1,icChamber);
175 if (iIdSpace == fIdSpace1)
176 vol[0] = secMap1[icSpace-1];
177 else if (iIdSpace == fIdSpace2)
178 vol[0] = secMap2[icSpace-1];
179 else if (iIdSpace == fIdSpace3)
180 vol[0] = secMap3[icSpace-1];
182 // The chamber number
188 if (iIdChamber == fIdChamber1)
189 vol[1] = (hits[2] < 0 ? 1 : 5);
190 else if (iIdChamber == fIdChamber2)
191 vol[1] = (hits[2] < 0 ? 2 : 4);
192 else if (iIdChamber == fIdChamber3)
196 vol[2] = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6;
198 new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);