]>
Commit | Line | Data |
---|---|---|
4c039060 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
16 | /* | |
17 | $Log$ | |
851d3db9 | 18 | Revision 1.13.4.1 2000/02/28 18:01:53 cblume |
19 | Change to new hit version and introduce geometry class | |
20 | ||
21 | Revision 1.13 1999/11/05 22:50:28 fca | |
22 | Do not use Atan, removed from ROOT too | |
23 | ||
90f8d287 | 24 | Revision 1.12 1999/11/02 16:35:56 fca |
25 | New version of TRD introduced | |
26 | ||
5c7f4665 | 27 | Revision 1.11 1999/11/01 20:41:51 fca |
28 | Added protections against using the wrong version of FRAME | |
29 | ||
ab76897d | 30 | Revision 1.10 1999/09/29 09:24:35 fca |
31 | Introduction of the Copyright and cvs Log | |
32 | ||
4c039060 | 33 | */ |
34 | ||
fe4da5cc | 35 | /////////////////////////////////////////////////////////////////////////////// |
36 | // // | |
5c7f4665 | 37 | // Transition Radiation Detector version 0 -- fast simulator // |
fe4da5cc | 38 | // // |
39 | //Begin_Html | |
40 | /* | |
5c7f4665 | 41 | <img src="picts/AliTRDfullClass.gif"> |
fe4da5cc | 42 | */ |
43 | //End_Html | |
44 | // // | |
45 | // // | |
46 | /////////////////////////////////////////////////////////////////////////////// | |
47 | ||
48 | #include <TMath.h> | |
49 | #include <TRandom.h> | |
50 | #include <TVector.h> | |
fe4da5cc | 51 | |
fe4da5cc | 52 | #include "AliRun.h" |
53 | #include "AliMC.h" | |
54 | #include "AliConst.h" | |
55 | ||
851d3db9 | 56 | #include "AliTRDv0.h" |
57 | #include "AliTRDgeometry.h" | |
fe4da5cc | 58 | |
851d3db9 | 59 | ClassImp(AliTRDv0) |
60 | ||
fe4da5cc | 61 | //_____________________________________________________________________________ |
62 | AliTRDv0::AliTRDv0(const char *name, const char *title) | |
63 | :AliTRD(name, title) | |
64 | { | |
65 | // | |
66 | // Standard constructor for Transition Radiation Detector version 0 | |
67 | // | |
82bbf98a | 68 | |
69 | fIdSens = 0; | |
70 | fHitsOn = 0; | |
71 | ||
82bbf98a | 72 | fIdChamber1 = 0; |
73 | fIdChamber2 = 0; | |
74 | fIdChamber3 = 0; | |
75 | ||
fe4da5cc | 76 | } |
851d3db9 | 77 | |
fe4da5cc | 78 | //_____________________________________________________________________________ |
79 | void AliTRDv0::CreateGeometry() | |
80 | { | |
81 | // | |
82bbf98a | 82 | // Create the GEANT geometry for the Transition Radiation Detector - Version 0 |
83 | // This version covers the full azimuth. | |
d3f347ff | 84 | // |
d3f347ff | 85 | |
82bbf98a | 86 | // Check that FRAME is there otherwise we have no place where to put the TRD |
87 | AliModule* FRAME = gAlice->GetModule("FRAME"); | |
88 | if (!FRAME) return; | |
fe4da5cc | 89 | |
82bbf98a | 90 | // Define the chambers |
91 | AliTRD::CreateGeometry(); | |
fe4da5cc | 92 | |
fe4da5cc | 93 | } |
94 | ||
95 | //_____________________________________________________________________________ | |
96 | void AliTRDv0::CreateMaterials() | |
97 | { | |
98 | // | |
99 | // Create materials for the Transition Radiation Detector | |
100 | // | |
82bbf98a | 101 | |
fe4da5cc | 102 | AliTRD::CreateMaterials(); |
82bbf98a | 103 | |
fe4da5cc | 104 | } |
105 | ||
106 | //_____________________________________________________________________________ | |
107 | void AliTRDv0::Init() | |
108 | { | |
109 | // | |
851d3db9 | 110 | // Initialize Transition Radiation Detector after geometry is built |
fe4da5cc | 111 | // |
82bbf98a | 112 | |
fe4da5cc | 113 | AliTRD::Init(); |
82bbf98a | 114 | |
82bbf98a | 115 | // Identifier of the sensitive volume (amplification region) |
116 | fIdSens = gMC->VolId("UL06"); | |
117 | ||
82bbf98a | 118 | // Identifier of the TRD-driftchambers |
119 | fIdChamber1 = gMC->VolId("UCIO"); | |
120 | fIdChamber2 = gMC->VolId("UCIM"); | |
121 | fIdChamber3 = gMC->VolId("UCII"); | |
122 | ||
851d3db9 | 123 | printf(" Fast simulator\n\n"); |
5c7f4665 | 124 | for (Int_t i = 0; i < 80; i++) printf("*"); |
125 | printf("\n"); | |
126 | ||
fe4da5cc | 127 | } |
128 | ||
129 | //_____________________________________________________________________________ | |
130 | void AliTRDv0::StepManager() | |
131 | { | |
132 | // | |
133 | // Procedure called at every step in the TRD | |
82bbf98a | 134 | // Fast simulator. If switched on, a hit is produced when a track |
135 | // crosses the border between amplification region and pad plane. | |
fe4da5cc | 136 | // |
137 | ||
851d3db9 | 138 | Int_t pla = 0; |
139 | Int_t cha = 0; | |
140 | Int_t sec = 0; | |
82bbf98a | 141 | Int_t iIdSens, icSens; |
82bbf98a | 142 | Int_t iIdChamber, icChamber; |
143 | ||
82bbf98a | 144 | Float_t hits[4]; |
fe4da5cc | 145 | |
0a6d8768 | 146 | TLorentzVector p; |
82bbf98a | 147 | TClonesArray &lhits = *fHits; |
fe4da5cc | 148 | |
82bbf98a | 149 | // Writing out hits enabled? |
150 | if (!(fHitsOn)) return; | |
fe4da5cc | 151 | |
fe4da5cc | 152 | // Use only charged tracks and count them only once per volume |
82bbf98a | 153 | if (gMC->TrackCharge() && |
154 | gMC->IsTrackExiting()) { | |
fe4da5cc | 155 | |
156 | // Check on sensitive volume | |
82bbf98a | 157 | iIdSens = gMC->CurrentVolID(icSens); |
158 | if (iIdSens == fIdSens) { | |
159 | ||
160 | gMC->TrackPosition(p); | |
161 | for (Int_t i = 0; i < 3; i++) hits[i] = p[i]; | |
162 | // No charge created | |
163 | hits[3] = 0; | |
164 | ||
851d3db9 | 165 | // The sector number (0 - 17) |
166 | // The numbering goes clockwise and starts at y = 0 | |
167 | Float_t phi = kRaddeg*TMath::ATan2(hits[0],hits[1]); | |
168 | if (phi < 90.) | |
169 | phi = phi + 270.; | |
170 | else | |
171 | phi = phi - 90.; | |
172 | sec = ((Int_t) (phi / 20)); | |
82bbf98a | 173 | |
d3f347ff | 174 | // The chamber number |
851d3db9 | 175 | // 0: outer left |
176 | // 1: middle left | |
177 | // 2: inner | |
178 | // 3: middle right | |
179 | // 4: outer right | |
5c7f4665 | 180 | iIdChamber = gMC->CurrentVolOffID(1,icChamber); |
82bbf98a | 181 | if (iIdChamber == fIdChamber1) |
851d3db9 | 182 | cha = (hits[2] < 0 ? 0 : 4); |
82bbf98a | 183 | else if (iIdChamber == fIdChamber2) |
851d3db9 | 184 | cha = (hits[2] < 0 ? 1 : 3); |
82bbf98a | 185 | else if (iIdChamber == fIdChamber3) |
851d3db9 | 186 | cha = 2; |
82bbf98a | 187 | |
851d3db9 | 188 | // The plane number (0 - 5) |
189 | pla = icChamber - TMath::Nint((Float_t) (icChamber / 7)) * 6 - 1; | |
82bbf98a | 190 | |
851d3db9 | 191 | new(lhits[fNhits++]) AliTRDhit(fIshunt |
192 | ,gAlice->CurrentTrack() | |
193 | ,fGeometry->GetDetector(pla,cha,sec) | |
194 | ,hits); | |
d3f347ff | 195 | |
fe4da5cc | 196 | } |
d3f347ff | 197 | |
fe4da5cc | 198 | } |
d3f347ff | 199 | |
fe4da5cc | 200 | } |