1 ///////////////////////////////////////////////////////////////////////////////
3 // Transition Radiation Detector version 0 -- coarse simulation //
7 <img src="picts/AliTRDv0Class.gif">
12 ///////////////////////////////////////////////////////////////////////////////
25 //_____________________________________________________________________________
26 AliTRDv0::AliTRDv0(const char *name, const char *title)
30 // Standard constructor for Transition Radiation Detector version 0
46 //_____________________________________________________________________________
47 void AliTRDv0::CreateGeometry()
50 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
51 // This version covers the full azimuth.
53 // Author: Christoph Blume (C.Blume@gsi.de) 20/07/99
56 Float_t xpos, ypos, zpos;
58 // Check that FRAME is there otherwise we have no place where to put the TRD
59 AliModule* FRAME = gAlice->GetModule("FRAME");
62 // Define the chambers
63 AliTRD::CreateGeometry();
65 // Position the the TRD-sectors in all TRD-volumes in the spaceframe
69 gMC->Gspos("TRD ",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
70 gMC->Gspos("TRD ",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
71 gMC->Gspos("TRD ",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
75 //_____________________________________________________________________________
76 void AliTRDv0::CreateMaterials()
79 // Create materials for the Transition Radiation Detector
82 AliTRD::CreateMaterials();
86 //_____________________________________________________________________________
90 // Initialise Transition Radiation Detector after geometry is built
95 for (Int_t i = 0; i < 80; i++) printf("*");
98 // Identifier of the sensitive volume (amplification region)
99 fIdSens = gMC->VolId("UL06");
101 // Identifier of the TRD-spaceframe volumina
102 fIdSpace1 = gMC->VolId("B028");
103 fIdSpace2 = gMC->VolId("B029");
104 fIdSpace3 = gMC->VolId("B030");
106 // Identifier of the TRD-driftchambers
107 fIdChamber1 = gMC->VolId("UCIO");
108 fIdChamber2 = gMC->VolId("UCIM");
109 fIdChamber3 = gMC->VolId("UCII");
113 //_____________________________________________________________________________
114 void AliTRDv0::StepManager()
117 // Procedure called at every step in the TRD
118 // Fast simulator. If switched on, a hit is produced when a track
119 // crosses the border between amplification region and pad plane.
123 Int_t iIdSens, icSens;
124 Int_t iIdSpace, icSpace;
125 Int_t iIdChamber, icChamber;
127 Int_t secMap1[10] = { 3, 7, 8, 9, 10, 11, 2, 1, 18, 17 };
128 Int_t secMap2[ 5] = { 16, 15, 14, 13, 12 };
129 Int_t secMap3[ 3] = { 5, 6, 4 };
134 TClonesArray &lhits = *fHits;
136 // Writing out hits enabled?
137 if (!(fHitsOn)) return;
139 // Use only charged tracks and count them only once per volume
140 if (gMC->TrackCharge() &&
141 gMC->IsTrackExiting()) {
143 // Check on sensitive volume
144 iIdSens = gMC->CurrentVolID(icSens);
145 if (iIdSens == fIdSens) {
147 gMC->TrackPosition(p);
148 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
152 iIdSpace = gMC->CurrentVolOffID(4,icSpace );
153 iIdChamber = gMC->CurrentVolOffID(1,icChamber);
156 if (iIdSpace == fIdSpace1)
157 vol[0] = secMap1[icSpace-1];
158 else if (iIdSpace == fIdSpace2)
159 vol[0] = secMap2[icSpace-1];
160 else if (iIdSpace == fIdSpace3)
161 vol[0] = secMap3[icSpace-1];
163 // The chamber number
169 if (iIdChamber == fIdChamber1)
170 vol[1] = (hits[2] < 0 ? 1 : 5);
171 else if (iIdChamber == fIdChamber2)
172 vol[1] = (hits[2] < 0 ? 2 : 4);
173 else if (iIdChamber == fIdChamber3)
177 vol[2] = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6;
179 new(lhits[fNhits++]) AliTRDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);