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 | |
b2a60966 |
16 | /* $Id$ */ |
17 | |
d15a28e7 |
18 | //_________________________________________________________________________ |
b2a60966 |
19 | // Implementation version v0 of PHOS Manager class |
20 | // Layout EMC + PPSD has name GPS2 |
a3dfe79c |
21 | // Layout EMC + CPV has name IHEP |
5f20d3fb |
22 | // An object of this class does not produce hits nor digits |
23 | // It is the one to use if you do not want to produce outputs in TREEH or TREED |
b2a60966 |
24 | // |
25 | //*-- Author: Yves Schutz (SUBATECH) |
26 | |
d2cf0e38 |
27 | |
fe4da5cc |
28 | // --- ROOT system --- |
d15a28e7 |
29 | |
fe4da5cc |
30 | #include "TBRIK.h" |
31 | #include "TNode.h" |
0869cea5 |
32 | #include "TRandom.h" |
94de3818 |
33 | #include "TGeometry.h" |
fe4da5cc |
34 | |
81e92872 |
35 | |
d15a28e7 |
36 | // --- Standard library --- |
37 | |
de9ec31b |
38 | #include <stdio.h> |
39 | #include <string.h> |
40 | #include <stdlib.h> |
41 | #include <strstream.h> |
d15a28e7 |
42 | |
43 | // --- AliRoot header files --- |
44 | |
fe4da5cc |
45 | #include "AliPHOSv0.h" |
46 | #include "AliRun.h" |
d15a28e7 |
47 | #include "AliConst.h" |
94de3818 |
48 | #include "AliMC.h" |
fe4da5cc |
49 | |
50 | ClassImp(AliPHOSv0) |
51 | |
d15a28e7 |
52 | //____________________________________________________________________________ |
53 | AliPHOSv0::AliPHOSv0(const char *name, const char *title): |
54 | AliPHOS(name,title) |
55 | { |
b2a60966 |
56 | // ctor : title is used to identify the layout |
57 | // GPS2 = 5 modules (EMC + PPSD) |
fe4da5cc |
58 | |
d15a28e7 |
59 | // gets an instance of the geometry parameters class |
e04976bd |
60 | |
61 | if (strcmp(GetTitle(),"") != 0 ) |
62 | fGeom = AliPHOSGeometry::GetInstance(GetTitle(), "") ; |
63 | |
d15a28e7 |
64 | } |
65 | |
d15a28e7 |
66 | //____________________________________________________________________________ |
67 | void AliPHOSv0::BuildGeometry() |
fe4da5cc |
68 | { |
b2a60966 |
69 | // Build the PHOS geometry for the ROOT display |
70 | //BEGIN_HTML |
71 | /* |
72 | <H2> |
73 | PHOS in ALICE displayed by root |
74 | </H2> |
75 | <UL> |
76 | <LI> All Views |
77 | <P> |
78 | <CENTER> |
79 | <IMG Align=BOTTOM ALT="All Views" SRC="../images/AliPHOSv0AllViews.gif"> |
80 | </CENTER></P></LI> |
81 | <LI> Front View |
82 | <P> |
83 | <CENTER> |
84 | <IMG Align=BOTTOM ALT="Front View" SRC="../images/AliPHOSv0FrontView.gif"> |
85 | </CENTER></P></LI> |
86 | <LI> 3D View 1 |
87 | <P> |
88 | <CENTER> |
89 | <IMG Align=BOTTOM ALT="3D View 1" SRC="../images/AliPHOSv03DView1.gif"> |
90 | </CENTER></P></LI> |
91 | <LI> 3D View 2 |
92 | <P> |
93 | <CENTER> |
94 | <IMG Align=BOTTOM ALT="3D View 2" SRC="../images/AliPHOSv03DView2.gif"> |
95 | </CENTER></P></LI> |
96 | </UL> |
97 | */ |
98 | //END_HTML |
d15a28e7 |
99 | |
100 | this->BuildGeometryforPHOS() ; |
bacd0b23 |
101 | if ( ( strcmp(fGeom->GetName(), "GPS2" ) == 0 ) ) |
d15a28e7 |
102 | this->BuildGeometryforPPSD() ; |
bacd0b23 |
103 | else if ( ( strcmp(fGeom->GetName(), "IHEP" ) == 0 ) ) |
104 | this->BuildGeometryforCPV() ; |
d15a28e7 |
105 | else |
106 | cout << "AliPHOSv0::BuildGeometry : no charged particle identification system installed" << endl; |
107 | |
fe4da5cc |
108 | } |
d15a28e7 |
109 | |
110 | //____________________________________________________________________________ |
111 | void AliPHOSv0:: BuildGeometryforPHOS(void) |
112 | { |
b2a60966 |
113 | // Build the PHOS-EMC geometry for the ROOT display |
d15a28e7 |
114 | |
115 | const Int_t kColorPHOS = kRed ; |
116 | const Int_t kColorXTAL = kBlue ; |
117 | |
92862013 |
118 | Double_t const kRADDEG = 180.0 / kPI ; |
d15a28e7 |
119 | |
120 | new TBRIK( "OuterBox", "PHOS box", "void", fGeom->GetOuterBoxSize(0)/2, |
121 | fGeom->GetOuterBoxSize(1)/2, |
122 | fGeom->GetOuterBoxSize(2)/2 ); |
123 | |
124 | // Textolit Wall box, position inside PHOS |
125 | |
126 | new TBRIK( "TextolitBox", "PHOS Textolit box ", "void", fGeom->GetTextolitBoxSize(0)/2, |
127 | fGeom->GetTextolitBoxSize(1)/2, |
128 | fGeom->GetTextolitBoxSize(2)/2); |
129 | |
130 | // Polystyrene Foam Plate |
131 | |
132 | new TBRIK( "UpperFoamPlate", "PHOS Upper foam plate", "void", fGeom->GetTextolitBoxSize(0)/2, |
133 | fGeom->GetSecondUpperPlateThickness()/2, |
134 | fGeom->GetTextolitBoxSize(2)/2 ) ; |
135 | |
136 | // Air Filled Box |
fe4da5cc |
137 | |
d15a28e7 |
138 | new TBRIK( "AirFilledBox", "PHOS air filled box", "void", fGeom->GetAirFilledBoxSize(0)/2, |
139 | fGeom->GetAirFilledBoxSize(1)/2, |
140 | fGeom->GetAirFilledBoxSize(2)/2 ); |
141 | |
142 | // Crystals Box |
143 | |
92862013 |
144 | Float_t xtlX = fGeom->GetCrystalSize(0) ; |
145 | Float_t xtlY = fGeom->GetCrystalSize(1) ; |
146 | Float_t xtlZ = fGeom->GetCrystalSize(2) ; |
d15a28e7 |
147 | |
92862013 |
148 | Float_t xl = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; |
149 | Float_t yl = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 |
d15a28e7 |
150 | + fGeom->GetModuleBoxThickness() / 2.0 ; |
92862013 |
151 | Float_t zl = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; |
d15a28e7 |
152 | |
92862013 |
153 | new TBRIK( "CrystalsBox", "PHOS crystals box", "void", xl, yl, zl ) ; |
d15a28e7 |
154 | |
155 | // position PHOS into ALICE |
156 | |
92862013 |
157 | Float_t r = fGeom->GetIPtoOuterCoverDistance() + fGeom->GetOuterBoxSize(1) / 2.0 ; |
d15a28e7 |
158 | Int_t number = 988 ; |
159 | Float_t pphi = TMath::ATan( fGeom->GetOuterBoxSize(0) / ( 2.0 * fGeom->GetIPtoOuterCoverDistance() ) ) ; |
92862013 |
160 | pphi *= kRADDEG ; |
161 | TNode * top = gAlice->GetGeometry()->GetNode("alice") ; |
d15a28e7 |
162 | |
163 | char * nodename = new char[20] ; |
164 | char * rotname = new char[20] ; |
165 | |
166 | for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { |
167 | Float_t angle = pphi * 2 * ( i - fGeom->GetNModules() / 2.0 - 0.5 ) ; |
168 | sprintf(rotname, "%s%d", "rot", number++) ; |
169 | new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0); |
92862013 |
170 | top->cd(); |
d15a28e7 |
171 | sprintf(nodename,"%s%d", "Module", i) ; |
92862013 |
172 | Float_t x = r * TMath::Sin( angle / kRADDEG ) ; |
173 | Float_t y = -r * TMath::Cos( angle / kRADDEG ) ; |
174 | TNode * outerboxnode = new TNode(nodename, nodename, "OuterBox", x, y, 0, rotname ) ; |
175 | outerboxnode->SetLineColor(kColorPHOS) ; |
176 | fNodes->Add(outerboxnode) ; |
177 | outerboxnode->cd() ; |
d15a28e7 |
178 | // now inside the outer box the textolit box |
92862013 |
179 | y = ( fGeom->GetOuterBoxThickness(1) - fGeom->GetUpperPlateThickness() ) / 2. ; |
d15a28e7 |
180 | sprintf(nodename,"%s%d", "TexBox", i) ; |
92862013 |
181 | TNode * textolitboxnode = new TNode(nodename, nodename, "TextolitBox", 0, y, 0) ; |
182 | textolitboxnode->SetLineColor(kColorPHOS) ; |
183 | fNodes->Add(textolitboxnode) ; |
d15a28e7 |
184 | // upper foam plate inside outre box |
92862013 |
185 | outerboxnode->cd() ; |
d15a28e7 |
186 | sprintf(nodename, "%s%d", "UFPlate", i) ; |
92862013 |
187 | y = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetSecondUpperPlateThickness() ) / 2.0 ; |
188 | TNode * upperfoamplatenode = new TNode(nodename, nodename, "UpperFoamPlate", 0, y, 0) ; |
189 | upperfoamplatenode->SetLineColor(kColorPHOS) ; |
190 | fNodes->Add(upperfoamplatenode) ; |
d15a28e7 |
191 | // air filled box inside textolit box (not drawn) |
92862013 |
192 | textolitboxnode->cd(); |
193 | y = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetAirFilledBoxSize(1) ) / 2.0 - fGeom->GetSecondUpperPlateThickness() ; |
d15a28e7 |
194 | sprintf(nodename, "%s%d", "AFBox", i) ; |
92862013 |
195 | TNode * airfilledboxnode = new TNode(nodename, nodename, "AirFilledBox", 0, y, 0) ; |
196 | fNodes->Add(airfilledboxnode) ; |
d15a28e7 |
197 | // crystals box inside air filled box |
92862013 |
198 | airfilledboxnode->cd() ; |
199 | y = fGeom->GetAirFilledBoxSize(1) / 2.0 - yl |
d15a28e7 |
200 | - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness() |
201 | - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() ) ; |
202 | sprintf(nodename, "%s%d", "XTBox", i) ; |
92862013 |
203 | TNode * crystalsboxnode = new TNode(nodename, nodename, "CrystalsBox", 0, y, 0) ; |
204 | crystalsboxnode->SetLineColor(kColorXTAL) ; |
205 | fNodes->Add(crystalsboxnode) ; |
d15a28e7 |
206 | } |
b27d82c8 |
207 | |
208 | delete[] rotname ; |
209 | delete[] nodename ; |
d15a28e7 |
210 | } |
211 | |
212 | //____________________________________________________________________________ |
213 | void AliPHOSv0:: BuildGeometryforPPSD(void) |
fe4da5cc |
214 | { |
b2a60966 |
215 | // Build the PHOS-PPSD geometry for the ROOT display |
216 | //BEGIN_HTML |
217 | /* |
218 | <H2> |
219 | PPSD displayed by root |
220 | </H2> |
221 | <UL> |
222 | <LI> Zoom on PPSD: Front View |
223 | <P> |
224 | <CENTER> |
225 | <IMG Align=BOTTOM ALT="PPSD Front View" SRC="../images/AliPHOSv0PPSDFrontView.gif"> |
226 | </CENTER></P></LI> |
227 | <LI> Zoom on PPSD: Perspective View |
228 | <P> |
229 | <CENTER> |
230 | <IMG Align=BOTTOM ALT="PPSD Prespective View" SRC="../images/AliPHOSv0PPSDPerspectiveView.gif"> |
231 | </CENTER></P></LI> |
232 | </UL> |
233 | */ |
234 | //END_HTML |
92862013 |
235 | Double_t const kRADDEG = 180.0 / kPI ; |
d15a28e7 |
236 | |
237 | const Int_t kColorPHOS = kRed ; |
238 | const Int_t kColorPPSD = kGreen ; |
239 | const Int_t kColorGas = kBlue ; |
240 | const Int_t kColorAir = kYellow ; |
241 | |
242 | // Box for a full PHOS module |
243 | |
bacd0b23 |
244 | new TBRIK( "PPSDBox", "PPSD box", "void", fGeom->GetCPVBoxSize(0)/2, |
245 | fGeom->GetCPVBoxSize(1)/2, |
246 | fGeom->GetCPVBoxSize(2)/2 ); |
d15a28e7 |
247 | |
248 | // Box containing one micromegas module |
249 | |
250 | new TBRIK( "PPSDModule", "PPSD module", "void", fGeom->GetPPSDModuleSize(0)/2, |
251 | fGeom->GetPPSDModuleSize(1)/2, |
252 | fGeom->GetPPSDModuleSize(2)/2 ); |
253 | // top lid |
254 | |
255 | new TBRIK ( "TopLid", "Micromegas top lid", "void", fGeom->GetPPSDModuleSize(0)/2, |
256 | fGeom->GetLidThickness()/2, |
257 | fGeom->GetPPSDModuleSize(2)/2 ) ; |
258 | // composite panel (top and bottom) |
259 | |
260 | new TBRIK ( "TopPanel", "Composite top panel", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, |
261 | fGeom->GetCompositeThickness()/2, |
262 | ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; |
263 | |
264 | new TBRIK ( "BottomPanel", "Composite bottom panel", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, |
265 | fGeom->GetCompositeThickness()/2, |
266 | ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; |
267 | // gas gap (conversion and avalanche) |
268 | |
269 | new TBRIK ( "GasGap", "gas gap", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, |
270 | ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() )/2, |
271 | ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; |
272 | |
273 | // anode and cathode |
274 | |
275 | new TBRIK ( "Anode", "Anode", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, |
276 | fGeom->GetAnodeThickness()/2, |
277 | ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; |
278 | |
279 | new TBRIK ( "Cathode", "Cathode", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, |
280 | fGeom->GetCathodeThickness()/2, |
281 | ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; |
282 | // PC |
283 | |
284 | new TBRIK ( "PCBoard", "Printed Circuit", "void", ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() )/2, |
285 | fGeom->GetPCThickness()/2, |
286 | ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() )/2 ) ; |
287 | // Gap between Lead and top micromegas |
288 | |
bacd0b23 |
289 | new TBRIK ( "LeadToM", "Air Gap top", "void", fGeom->GetCPVBoxSize(0)/2, |
d15a28e7 |
290 | fGeom->GetMicro1ToLeadGap()/2, |
bacd0b23 |
291 | fGeom->GetCPVBoxSize(2)/2 ) ; |
d15a28e7 |
292 | |
293 | // Gap between Lead and bottom micromegas |
294 | |
bacd0b23 |
295 | new TBRIK ( "MToLead", "Air Gap bottom", "void", fGeom->GetCPVBoxSize(0)/2, |
d15a28e7 |
296 | fGeom->GetLeadToMicro2Gap()/2, |
bacd0b23 |
297 | fGeom->GetCPVBoxSize(2)/2 ) ; |
d15a28e7 |
298 | // Lead converter |
299 | |
bacd0b23 |
300 | new TBRIK ( "Lead", "Lead converter", "void", fGeom->GetCPVBoxSize(0)/2, |
d15a28e7 |
301 | fGeom->GetLeadConverterThickness()/2, |
bacd0b23 |
302 | fGeom->GetCPVBoxSize(2)/2 ) ; |
d15a28e7 |
303 | |
304 | // position PPSD into ALICE |
305 | |
306 | char * nodename = new char[20] ; |
307 | char * rotname = new char[20] ; |
308 | |
bacd0b23 |
309 | Float_t r = fGeom->GetIPtoTopLidDistance() + fGeom->GetCPVBoxSize(1) / 2.0 ; |
d15a28e7 |
310 | Int_t number = 988 ; |
92862013 |
311 | TNode * top = gAlice->GetGeometry()->GetNode("alice") ; |
d15a28e7 |
312 | |
313 | for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { // the number of PHOS modules |
314 | Float_t angle = fGeom->GetPHOSAngle(i) ; |
315 | sprintf(rotname, "%s%d", "rotg", number++) ; |
316 | new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0); |
92862013 |
317 | top->cd(); |
d15a28e7 |
318 | sprintf(nodename, "%s%d", "Moduleg", i) ; |
92862013 |
319 | Float_t x = r * TMath::Sin( angle / kRADDEG ) ; |
320 | Float_t y = -r * TMath::Cos( angle / kRADDEG ) ; |
321 | TNode * ppsdboxnode = new TNode(nodename , nodename ,"PPSDBox", x, y, 0, rotname ) ; |
322 | ppsdboxnode->SetLineColor(kColorPPSD) ; |
323 | fNodes->Add(ppsdboxnode) ; |
324 | ppsdboxnode->cd() ; |
d15a28e7 |
325 | // inside the PPSD box: |
326 | // 1. fNumberOfModulesPhi x fNumberOfModulesZ top micromegas |
bacd0b23 |
327 | x = ( fGeom->GetCPVBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ; |
31aa6d6c |
328 | { |
329 | for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module |
bacd0b23 |
330 | Float_t z = ( fGeom->GetCPVBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. ; |
31aa6d6c |
331 | TNode * micro1node ; |
332 | for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module |
bacd0b23 |
333 | y = ( fGeom->GetCPVBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ; |
31aa6d6c |
334 | sprintf(nodename, "%s%d%d%d", "Mic1", i, iphi, iz) ; |
335 | micro1node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ; |
336 | micro1node->SetLineColor(kColorPPSD) ; |
337 | fNodes->Add(micro1node) ; |
338 | // inside top micromegas |
339 | micro1node->cd() ; |
340 | // a. top lid |
341 | y = ( fGeom->GetMicromegas1Thickness() - fGeom->GetLidThickness() ) / 2. ; |
342 | sprintf(nodename, "%s%d%d%d", "Lid", i, iphi, iz) ; |
343 | TNode * toplidnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ; |
344 | toplidnode->SetLineColor(kColorPPSD) ; |
345 | fNodes->Add(toplidnode) ; |
346 | // b. composite panel |
347 | y = y - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; |
348 | sprintf(nodename, "%s%d%d%d", "CompU", i, iphi, iz) ; |
349 | TNode * compupnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ; |
350 | compupnode->SetLineColor(kColorPPSD) ; |
351 | fNodes->Add(compupnode) ; |
352 | // c. anode |
353 | y = y - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ; |
354 | sprintf(nodename, "%s%d%d%d", "Ano", i, iphi, iz) ; |
355 | TNode * anodenode = new TNode(nodename, nodename, "Anode", 0, y, 0) ; |
356 | anodenode->SetLineColor(kColorPHOS) ; |
357 | fNodes->Add(anodenode) ; |
358 | // d. gas |
359 | y = y - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ; |
360 | sprintf(nodename, "%s%d%d%d", "GGap", i, iphi, iz) ; |
361 | TNode * ggapnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ; |
362 | ggapnode->SetLineColor(kColorGas) ; |
363 | fNodes->Add(ggapnode) ; |
d15a28e7 |
364 | // f. cathode |
31aa6d6c |
365 | y = y - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ; |
366 | sprintf(nodename, "%s%d%d%d", "Cathode", i, iphi, iz) ; |
367 | TNode * cathodenode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ; |
368 | cathodenode->SetLineColor(kColorPHOS) ; |
369 | fNodes->Add(cathodenode) ; |
370 | // g. printed circuit |
371 | y = y - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ; |
372 | sprintf(nodename, "%s%d%d%d", "PC", i, iphi, iz) ; |
373 | TNode * pcnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ; |
374 | pcnode->SetLineColor(kColorPPSD) ; |
375 | fNodes->Add(pcnode) ; |
376 | // h. composite panel |
377 | y = y - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; |
378 | sprintf(nodename, "%s%d%d%d", "CompDown", i, iphi, iz) ; |
379 | TNode * compdownnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ; |
380 | compdownnode->SetLineColor(kColorPPSD) ; |
381 | fNodes->Add(compdownnode) ; |
382 | z = z - fGeom->GetPPSDModuleSize(2) ; |
383 | ppsdboxnode->cd() ; |
384 | } // end of Z module loop |
385 | x = x - fGeom->GetPPSDModuleSize(0) ; |
92862013 |
386 | ppsdboxnode->cd() ; |
31aa6d6c |
387 | } // end of phi module loop |
388 | } |
d15a28e7 |
389 | // 2. air gap |
92862013 |
390 | ppsdboxnode->cd() ; |
bacd0b23 |
391 | y = ( fGeom->GetCPVBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ; |
d15a28e7 |
392 | sprintf(nodename, "%s%d", "GapUp", i) ; |
92862013 |
393 | TNode * gapupnode = new TNode(nodename, nodename, "LeadToM", 0, y, 0) ; |
394 | gapupnode->SetLineColor(kColorAir) ; |
395 | fNodes->Add(gapupnode) ; |
d15a28e7 |
396 | // 3. lead converter |
92862013 |
397 | y = y - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ; |
d15a28e7 |
398 | sprintf(nodename, "%s%d", "LeadC", i) ; |
92862013 |
399 | TNode * leadcnode = new TNode(nodename, nodename, "Lead", 0, y, 0) ; |
400 | leadcnode->SetLineColor(kColorPPSD) ; |
401 | fNodes->Add(leadcnode) ; |
d15a28e7 |
402 | // 4. air gap |
92862013 |
403 | y = y - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ; |
d15a28e7 |
404 | sprintf(nodename, "%s%d", "GapDown", i) ; |
92862013 |
405 | TNode * gapdownnode = new TNode(nodename, nodename, "MToLead", 0, y, 0) ; |
406 | gapdownnode->SetLineColor(kColorAir) ; |
407 | fNodes->Add(gapdownnode) ; |
d15a28e7 |
408 | // 5. fNumberOfModulesPhi x fNumberOfModulesZ bottom micromegas |
bacd0b23 |
409 | x = ( fGeom->GetCPVBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. - fGeom->GetPhiDisplacement() ; |
31aa6d6c |
410 | { |
411 | for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { |
bacd0b23 |
412 | Float_t z = ( fGeom->GetCPVBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. - fGeom->GetZDisplacement() ;; |
31aa6d6c |
413 | TNode * micro2node ; |
414 | for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { |
bacd0b23 |
415 | y = - ( fGeom->GetCPVBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ; |
31aa6d6c |
416 | sprintf(nodename, "%s%d%d%d", "Mic2", i, iphi, iz) ; |
417 | micro2node = new TNode(nodename, nodename, "PPSDModule", x, y, z) ; |
418 | micro2node->SetLineColor(kColorPPSD) ; |
419 | fNodes->Add(micro2node) ; |
420 | // inside bottom micromegas |
421 | micro2node->cd() ; |
d15a28e7 |
422 | // a. top lid |
92862013 |
423 | y = ( fGeom->GetMicromegas2Thickness() - fGeom->GetLidThickness() ) / 2. ; |
d15a28e7 |
424 | sprintf(nodename, "%s%d", "Lidb", i) ; |
92862013 |
425 | TNode * toplidbnode = new TNode(nodename, nodename, "TopLid", 0, y, 0) ; |
426 | toplidbnode->SetLineColor(kColorPPSD) ; |
427 | fNodes->Add(toplidbnode) ; |
d15a28e7 |
428 | // b. composite panel |
92862013 |
429 | y = y - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; |
d15a28e7 |
430 | sprintf(nodename, "%s%d", "CompUb", i) ; |
92862013 |
431 | TNode * compupbnode = new TNode(nodename, nodename, "TopPanel", 0, y, 0) ; |
432 | compupbnode->SetLineColor(kColorPPSD) ; |
433 | fNodes->Add(compupbnode) ; |
d15a28e7 |
434 | // c. anode |
92862013 |
435 | y = y - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ; |
d15a28e7 |
436 | sprintf(nodename, "%s%d", "Anob", i) ; |
92862013 |
437 | TNode * anodebnode = new TNode(nodename, nodename, "Anode", 0, y, 0) ; |
438 | anodebnode->SetLineColor(kColorPPSD) ; |
439 | fNodes->Add(anodebnode) ; |
d15a28e7 |
440 | // d. conversion gas |
92862013 |
441 | y = y - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ; |
d15a28e7 |
442 | sprintf(nodename, "%s%d", "GGapb", i) ; |
92862013 |
443 | TNode * ggapbnode = new TNode(nodename, nodename, "GasGap", 0, y, 0) ; |
444 | ggapbnode->SetLineColor(kColorGas) ; |
445 | fNodes->Add(ggapbnode) ; |
d15a28e7 |
446 | // f. cathode |
92862013 |
447 | y = y - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ; |
d15a28e7 |
448 | sprintf(nodename, "%s%d", "Cathodeb", i) ; |
92862013 |
449 | TNode * cathodebnode = new TNode(nodename, nodename, "Cathode", 0, y, 0) ; |
450 | cathodebnode->SetLineColor(kColorPPSD) ; |
451 | fNodes->Add(cathodebnode) ; |
d15a28e7 |
452 | // g. printed circuit |
92862013 |
453 | y = y - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ; |
d15a28e7 |
454 | sprintf(nodename, "%s%d", "PCb", i) ; |
92862013 |
455 | TNode * pcbnode = new TNode(nodename, nodename, "PCBoard", 0, y, 0) ; |
456 | pcbnode->SetLineColor(kColorPPSD) ; |
457 | fNodes->Add(pcbnode) ; |
d15a28e7 |
458 | // h. composite pane |
92862013 |
459 | y = y - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; |
d15a28e7 |
460 | sprintf(nodename, "%s%d", "CompDownb", i) ; |
92862013 |
461 | TNode * compdownbnode = new TNode(nodename, nodename, "BottomPanel", 0, y, 0) ; |
462 | compdownbnode->SetLineColor(kColorPPSD) ; |
463 | fNodes->Add(compdownbnode) ; |
464 | z = z - fGeom->GetPPSDModuleSize(2) ; |
465 | ppsdboxnode->cd() ; |
d15a28e7 |
466 | } // end of Z module loop |
92862013 |
467 | x = x - fGeom->GetPPSDModuleSize(0) ; |
468 | ppsdboxnode->cd() ; |
31aa6d6c |
469 | } // end of phi module loop |
470 | } |
471 | } // PHOS modules |
472 | |
e126816e |
473 | delete[] rotname ; |
474 | delete[] nodename ; |
31aa6d6c |
475 | |
fe4da5cc |
476 | } |
477 | |
bacd0b23 |
478 | //____________________________________________________________________________ |
479 | void AliPHOSv0:: BuildGeometryforCPV(void) |
480 | { |
481 | // Build the PHOS-CPV geometry for the ROOT display |
482 | // Author: Yuri Kharlov 11 September 2000 |
483 | // |
484 | //BEGIN_HTML |
485 | /* |
486 | <H2> |
487 | CPV displayed by root |
488 | </H2> |
489 | <table width=700> |
490 | |
491 | <tr> |
492 | <td>CPV perspective view</td> |
493 | <td>CPV front view </td> |
494 | </tr> |
495 | |
496 | <tr> |
497 | <td> <img height=300 width=290 src="../images/CPVRootPersp.gif"> </td> |
498 | <td> <img height=300 width=290 src="../images/CPVRootFront.gif"> </td> |
499 | </tr> |
500 | |
501 | </table> |
502 | |
503 | */ |
504 | //END_HTML |
505 | |
506 | const Double_t kRADDEG = 180.0 / kPI ; |
507 | const Int_t kColorCPV = kGreen ; |
508 | const Int_t kColorFrame = kYellow ; |
509 | const Int_t kColorGassiplex = kRed; |
510 | const Int_t kColorPCB = kCyan; |
511 | |
512 | // Box for a full PHOS module |
513 | |
514 | new TBRIK ("CPVBox", "CPV box", "void", fGeom->GetCPVBoxSize(0)/2, |
515 | fGeom->GetCPVBoxSize(1)/2, |
516 | fGeom->GetCPVBoxSize(2)/2 ); |
517 | new TBRIK ("CPVFrameLR", "CPV frame Left-Right", "void", fGeom->GetCPVFrameSize(0)/2, |
518 | fGeom->GetCPVFrameSize(1)/2, |
519 | fGeom->GetCPVBoxSize(2)/2 ); |
520 | new TBRIK ("CPVFrameUD", "CPV frame Up-Down", "void", fGeom->GetCPVBoxSize(0)/2 - fGeom->GetCPVFrameSize(0), |
521 | fGeom->GetCPVFrameSize(1)/2, |
522 | fGeom->GetCPVFrameSize(2)/2); |
523 | new TBRIK ("CPVPCB", "CPV PCB", "void", fGeom->GetCPVActiveSize(0)/2, |
524 | fGeom->GetCPVTextoliteThickness()/2, |
525 | fGeom->GetCPVActiveSize(1)/2); |
526 | new TBRIK ("CPVGassiplex", "CPV Gassiplex PCB", "void", fGeom->GetGassiplexChipSize(0)/2, |
527 | fGeom->GetGassiplexChipSize(1)/2, |
528 | fGeom->GetGassiplexChipSize(2)/2); |
529 | |
530 | // position CPV into ALICE |
531 | |
532 | char * nodename = new char[25] ; |
533 | char * rotname = new char[25] ; |
534 | |
535 | Float_t r = fGeom->GetIPtoCPVDistance() + fGeom->GetCPVBoxSize(1) / 2.0 ; |
536 | Int_t number = 988 ; |
537 | TNode * top = gAlice->GetGeometry()->GetNode("alice") ; |
538 | for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { // the number of PHOS modules |
539 | |
540 | // One CPV module |
541 | |
542 | Float_t angle = fGeom->GetPHOSAngle(i) ; |
543 | sprintf(rotname, "%s%d", "rotg", number++) ; |
544 | new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0); |
545 | top->cd(); |
546 | sprintf(nodename, "%s%d", "CPVModule", i) ; |
547 | Float_t x = r * TMath::Sin( angle / kRADDEG ) ; |
548 | Float_t y = -r * TMath::Cos( angle / kRADDEG ) ; |
549 | Float_t z; |
550 | TNode * cpvBoxNode = new TNode(nodename , nodename ,"CPVBox", x, y, 0, rotname ) ; |
551 | cpvBoxNode->SetLineColor(kColorCPV) ; |
552 | fNodes->Add(cpvBoxNode) ; |
553 | cpvBoxNode->cd() ; |
554 | |
555 | // inside each CPV box: |
556 | |
557 | // Frame around CPV |
cd461ab8 |
558 | Int_t j; |
559 | for (j=0; j<=1; j++) { |
bacd0b23 |
560 | sprintf(nodename, "CPVModule%d Frame%d", i, j+1) ; |
561 | x = TMath::Sign(1,2*j-1) * (fGeom->GetCPVBoxSize(0) - fGeom->GetCPVFrameSize(0)) / 2; |
562 | TNode * cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameLR", x, 0, 0) ; |
563 | cpvFrameNode->SetLineColor(kColorFrame) ; |
564 | fNodes->Add(cpvFrameNode) ; |
565 | |
566 | sprintf(nodename, "CPVModule%d Frame%d", i, j+3) ; |
567 | z = TMath::Sign(1,2*j-1) * (fGeom->GetCPVBoxSize(2) - fGeom->GetCPVFrameSize(2)) / 2; |
568 | cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameUD", 0, 0, z) ; |
569 | cpvFrameNode->SetLineColor(kColorFrame) ; |
570 | fNodes->Add(cpvFrameNode) ; |
571 | } |
572 | |
573 | // 4 printed circuit boards |
cd461ab8 |
574 | for (j=0; j<4; j++) { |
bacd0b23 |
575 | sprintf(nodename, "CPVModule%d PCB%d", i, j+1) ; |
576 | y = fGeom->GetCPVFrameSize(1) / 2 - fGeom->GetFTPosition(j) + fGeom->GetCPVTextoliteThickness()/2; |
577 | TNode * cpvPCBNode = new TNode(nodename , nodename ,"CPVPCB", 0, y, 0) ; |
578 | cpvPCBNode->SetLineColor(kColorPCB) ; |
579 | fNodes->Add(cpvPCBNode) ; |
580 | } |
581 | |
582 | // Gassiplex chips |
583 | Float_t xStep = fGeom->GetCPVActiveSize(0) / (fGeom->GetNumberOfCPVChipsPhi() + 1); |
584 | Float_t zStep = fGeom->GetCPVActiveSize(1) / (fGeom->GetNumberOfCPVChipsZ() + 1); |
585 | y = fGeom->GetCPVFrameSize(1)/2 - fGeom->GetFTPosition(0) + |
586 | fGeom->GetCPVTextoliteThickness() / 2 + fGeom->GetGassiplexChipSize(1) / 2 + 0.1; |
587 | for (Int_t ix=0; ix<fGeom->GetNumberOfCPVChipsPhi(); ix++) { |
588 | x = xStep * (ix+1) - fGeom->GetCPVActiveSize(0)/2; |
589 | for (Int_t iz=0; iz<fGeom->GetNumberOfCPVChipsZ(); iz++) { |
590 | z = zStep * (iz+1) - fGeom->GetCPVActiveSize(1)/2; |
591 | sprintf(nodename, "CPVModule%d Chip(%dx%d)", i, ix+1,iz+1) ; |
592 | TNode * cpvGassiplexNode = new TNode(nodename , nodename ,"CPVGassiplex", x, y, z) ; |
593 | cpvGassiplexNode->SetLineColor(kColorGassiplex) ; |
594 | fNodes->Add(cpvGassiplexNode) ; |
595 | } |
596 | } |
597 | |
598 | } // PHOS modules |
599 | |
600 | delete[] rotname ; |
601 | delete[] nodename ; |
602 | } |
603 | |
d15a28e7 |
604 | //____________________________________________________________________________ |
fe4da5cc |
605 | void AliPHOSv0::CreateGeometry() |
606 | { |
b2a60966 |
607 | // Create the PHOS geometry for Geant |
d15a28e7 |
608 | |
92862013 |
609 | AliPHOSv0 *phostmp = (AliPHOSv0*)gAlice->GetModule("PHOS") ; |
d15a28e7 |
610 | |
92862013 |
611 | if ( phostmp == NULL ) { |
d15a28e7 |
612 | |
613 | fprintf(stderr, "PHOS detector not found!\n") ; |
614 | return; |
fe4da5cc |
615 | |
d15a28e7 |
616 | } |
d15a28e7 |
617 | // Get pointer to the array containing media indeces |
92862013 |
618 | Int_t *idtmed = fIdtmed->GetArray() - 699 ; |
d15a28e7 |
619 | |
92862013 |
620 | Float_t bigbox[3] ; |
621 | bigbox[0] = fGeom->GetOuterBoxSize(0) / 2.0 ; |
bacd0b23 |
622 | bigbox[1] = ( fGeom->GetOuterBoxSize(1) + fGeom->GetCPVBoxSize(1) ) / 2.0 ; |
92862013 |
623 | bigbox[2] = fGeom->GetOuterBoxSize(2) / 2.0 ; |
d15a28e7 |
624 | |
92862013 |
625 | gMC->Gsvolu("PHOS", "BOX ", idtmed[798], bigbox, 3) ; |
d15a28e7 |
626 | |
627 | this->CreateGeometryforPHOS() ; |
bacd0b23 |
628 | if ( strcmp( fGeom->GetName(), "GPS2") == 0 ) |
d15a28e7 |
629 | this->CreateGeometryforPPSD() ; |
bacd0b23 |
630 | else if ( strcmp( fGeom->GetName(), "IHEP") == 0 ) |
631 | this->CreateGeometryforCPV() ; |
d15a28e7 |
632 | else |
633 | cout << "AliPHOSv0::CreateGeometry : no charged particle identification system installed" << endl; |
634 | |
635 | // --- Position PHOS mdules in ALICE setup --- |
636 | |
92862013 |
637 | Int_t idrotm[99] ; |
638 | Double_t const kRADDEG = 180.0 / kPI ; |
d15a28e7 |
639 | |
640 | for( Int_t i = 1; i <= fGeom->GetNModules(); i++ ) { |
641 | |
642 | Float_t angle = fGeom->GetPHOSAngle(i) ; |
92862013 |
643 | AliMatrix(idrotm[i-1], 90.0, angle, 90.0, 90.0+angle, 0.0, 0.0) ; |
d15a28e7 |
644 | |
bacd0b23 |
645 | Float_t r = fGeom->GetIPtoOuterCoverDistance() + ( fGeom->GetOuterBoxSize(1) + fGeom->GetCPVBoxSize(1) ) / 2.0 ; |
d15a28e7 |
646 | |
92862013 |
647 | Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ; |
648 | Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ; |
d15a28e7 |
649 | |
92862013 |
650 | gMC->Gspos("PHOS", i, "ALIC", xP1, yP1, 0.0, idrotm[i-1], "ONLY") ; |
d15a28e7 |
651 | |
652 | } // for GetNModules |
653 | |
fe4da5cc |
654 | } |
d15a28e7 |
655 | |
656 | //____________________________________________________________________________ |
657 | void AliPHOSv0::CreateGeometryforPHOS() |
658 | { |
b2a60966 |
659 | // Create the PHOS-EMC geometry for GEANT |
660 | //BEGIN_HTML |
661 | /* |
662 | <H2> |
663 | Geant3 geometry tree of PHOS-EMC in ALICE |
664 | </H2> |
665 | <P><CENTER> |
666 | <IMG Align=BOTTOM ALT="EMC geant tree" SRC="../images/EMCinAlice.gif"> |
667 | </CENTER><P> |
668 | */ |
669 | //END_HTML |
670 | |
671 | // Get pointer to the array containing media indexes |
92862013 |
672 | Int_t *idtmed = fIdtmed->GetArray() - 699 ; |
d15a28e7 |
673 | |
674 | // --- |
675 | // --- Define PHOS box volume, fPUFPill with thermo insulating foam --- |
676 | // --- Foam Thermo Insulating outer cover dimensions --- |
92862013 |
677 | // --- Put it in bigbox = PHOS |
d15a28e7 |
678 | |
92862013 |
679 | Float_t dphos[3] ; |
680 | dphos[0] = fGeom->GetOuterBoxSize(0) / 2.0 ; |
681 | dphos[1] = fGeom->GetOuterBoxSize(1) / 2.0 ; |
682 | dphos[2] = fGeom->GetOuterBoxSize(2) / 2.0 ; |
d15a28e7 |
683 | |
92862013 |
684 | gMC->Gsvolu("EMCA", "BOX ", idtmed[706], dphos, 3) ; |
d15a28e7 |
685 | |
bacd0b23 |
686 | Float_t yO = - fGeom->GetCPVBoxSize(1) / 2.0 ; |
d15a28e7 |
687 | |
92862013 |
688 | gMC->Gspos("EMCA", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
689 | |
690 | // --- |
691 | // --- Define Textolit Wall box, position inside EMCA --- |
692 | // --- Textolit Wall box dimentions --- |
693 | |
694 | |
92862013 |
695 | Float_t dptxw[3]; |
696 | dptxw[0] = fGeom->GetTextolitBoxSize(0) / 2.0 ; |
697 | dptxw[1] = fGeom->GetTextolitBoxSize(1) / 2.0 ; |
698 | dptxw[2] = fGeom->GetTextolitBoxSize(2) / 2.0 ; |
d15a28e7 |
699 | |
92862013 |
700 | gMC->Gsvolu("PTXW", "BOX ", idtmed[707], dptxw, 3); |
d15a28e7 |
701 | |
92862013 |
702 | yO = ( fGeom->GetOuterBoxThickness(1) - fGeom->GetUpperPlateThickness() ) / 2. ; |
d15a28e7 |
703 | |
92862013 |
704 | gMC->Gspos("PTXW", 1, "EMCA", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
705 | |
706 | // --- |
707 | // --- Define Upper Polystyrene Foam Plate, place inside PTXW --- |
708 | // --- immediately below Foam Thermo Insulation Upper plate --- |
709 | |
710 | // --- Upper Polystyrene Foam plate thickness --- |
711 | |
92862013 |
712 | Float_t dpufp[3] ; |
713 | dpufp[0] = fGeom->GetTextolitBoxSize(0) / 2.0 ; |
714 | dpufp[1] = fGeom->GetSecondUpperPlateThickness() / 2. ; |
715 | dpufp[2] = fGeom->GetTextolitBoxSize(2) /2.0 ; |
d15a28e7 |
716 | |
92862013 |
717 | gMC->Gsvolu("PUFP", "BOX ", idtmed[703], dpufp, 3) ; |
d15a28e7 |
718 | |
92862013 |
719 | yO = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetSecondUpperPlateThickness() ) / 2.0 ; |
d15a28e7 |
720 | |
92862013 |
721 | gMC->Gspos("PUFP", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
722 | |
723 | // --- |
724 | // --- Define air-filled box, place inside PTXW --- |
725 | // --- Inner AIR volume dimensions --- |
fe4da5cc |
726 | |
d15a28e7 |
727 | |
92862013 |
728 | Float_t dpair[3] ; |
729 | dpair[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; |
730 | dpair[1] = fGeom->GetAirFilledBoxSize(1) / 2.0 ; |
731 | dpair[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; |
d15a28e7 |
732 | |
92862013 |
733 | gMC->Gsvolu("PAIR", "BOX ", idtmed[798], dpair, 3) ; |
d15a28e7 |
734 | |
92862013 |
735 | yO = ( fGeom->GetTextolitBoxSize(1) - fGeom->GetAirFilledBoxSize(1) ) / 2.0 - fGeom->GetSecondUpperPlateThickness() ; |
d15a28e7 |
736 | |
92862013 |
737 | gMC->Gspos("PAIR", 1, "PTXW", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
738 | |
739 | // --- Dimensions of PbWO4 crystal --- |
740 | |
92862013 |
741 | Float_t xtlX = fGeom->GetCrystalSize(0) ; |
742 | Float_t xtlY = fGeom->GetCrystalSize(1) ; |
743 | Float_t xtlZ = fGeom->GetCrystalSize(2) ; |
d15a28e7 |
744 | |
92862013 |
745 | Float_t dptcb[3] ; |
746 | dptcb[0] = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; |
747 | dptcb[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 |
d15a28e7 |
748 | + fGeom->GetModuleBoxThickness() / 2.0 ; |
92862013 |
749 | dptcb[2] = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 + fGeom->GetModuleBoxThickness() ; |
d15a28e7 |
750 | |
92862013 |
751 | gMC->Gsvolu("PTCB", "BOX ", idtmed[706], dptcb, 3) ; |
d15a28e7 |
752 | |
92862013 |
753 | yO = fGeom->GetAirFilledBoxSize(1) / 2.0 - dptcb[1] |
d15a28e7 |
754 | - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness() |
755 | - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() ) ; |
756 | |
92862013 |
757 | gMC->Gspos("PTCB", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
758 | |
759 | // --- |
760 | // --- Define Crystal BLock filled with air, position it inside PTCB --- |
92862013 |
761 | Float_t dpcbl[3] ; |
d15a28e7 |
762 | |
92862013 |
763 | dpcbl[0] = fGeom->GetNPhi() * ( xtlX + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 ; |
764 | dpcbl[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ; |
765 | dpcbl[2] = fGeom->GetNZ() * ( xtlZ + 2 * fGeom->GetGapBetweenCrystals() ) / 2.0 ; |
d15a28e7 |
766 | |
92862013 |
767 | gMC->Gsvolu("PCBL", "BOX ", idtmed[798], dpcbl, 3) ; |
d15a28e7 |
768 | |
769 | // --- Divide PCBL in X (phi) and Z directions -- |
770 | gMC->Gsdvn("PROW", "PCBL", Int_t (fGeom->GetNPhi()), 1) ; |
771 | gMC->Gsdvn("PCEL", "PROW", Int_t (fGeom->GetNZ()), 3) ; |
772 | |
92862013 |
773 | yO = -fGeom->GetModuleBoxThickness() / 2.0 ; |
d15a28e7 |
774 | |
92862013 |
775 | gMC->Gspos("PCBL", 1, "PTCB", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
776 | |
777 | // --- |
778 | // --- Define STeel (actually, it's titanium) Cover volume, place inside PCEL |
92862013 |
779 | Float_t dpstc[3] ; |
d15a28e7 |
780 | |
92862013 |
781 | dpstc[0] = ( xtlX + 2 * fGeom->GetCrystalWrapThickness() ) / 2.0 ; |
782 | dpstc[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ; |
783 | dpstc[2] = ( xtlZ + 2 * fGeom->GetCrystalWrapThickness() + 2 * fGeom->GetCrystalHolderThickness() ) / 2.0 ; |
d15a28e7 |
784 | |
92862013 |
785 | gMC->Gsvolu("PSTC", "BOX ", idtmed[704], dpstc, 3) ; |
d15a28e7 |
786 | |
787 | gMC->Gspos("PSTC", 1, "PCEL", 0.0, 0.0, 0.0, 0, "ONLY") ; |
788 | |
789 | // --- |
790 | // --- Define Tyvek volume, place inside PSTC --- |
92862013 |
791 | Float_t dppap[3] ; |
d15a28e7 |
792 | |
92862013 |
793 | dppap[0] = xtlX / 2.0 + fGeom->GetCrystalWrapThickness() ; |
794 | dppap[1] = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 ; |
795 | dppap[2] = xtlZ / 2.0 + fGeom->GetCrystalWrapThickness() ; |
d15a28e7 |
796 | |
92862013 |
797 | gMC->Gsvolu("PPAP", "BOX ", idtmed[702], dppap, 3) ; |
d15a28e7 |
798 | |
92862013 |
799 | yO = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 |
800 | - ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() + fGeom->GetCrystalHolderThickness() ) / 2.0 ; |
d15a28e7 |
801 | |
92862013 |
802 | gMC->Gspos("PPAP", 1, "PSTC", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
803 | |
804 | // --- |
805 | // --- Define PbWO4 crystal volume, place inside PPAP --- |
92862013 |
806 | Float_t dpxtl[3] ; |
d15a28e7 |
807 | |
92862013 |
808 | dpxtl[0] = xtlX / 2.0 ; |
809 | dpxtl[1] = xtlY / 2.0 ; |
810 | dpxtl[2] = xtlZ / 2.0 ; |
d15a28e7 |
811 | |
92862013 |
812 | gMC->Gsvolu("PXTL", "BOX ", idtmed[699], dpxtl, 3) ; |
d15a28e7 |
813 | |
92862013 |
814 | yO = ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 - xtlY / 2.0 - fGeom->GetCrystalWrapThickness() ; |
d15a28e7 |
815 | |
92862013 |
816 | gMC->Gspos("PXTL", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
817 | |
818 | // --- |
819 | // --- Define crystal support volume, place inside PPAP --- |
92862013 |
820 | Float_t dpsup[3] ; |
d15a28e7 |
821 | |
92862013 |
822 | dpsup[0] = xtlX / 2.0 + fGeom->GetCrystalWrapThickness() ; |
823 | dpsup[1] = fGeom->GetCrystalSupportHeight() / 2.0 ; |
824 | dpsup[2] = xtlZ / 2.0 + fGeom->GetCrystalWrapThickness() ; |
d15a28e7 |
825 | |
92862013 |
826 | gMC->Gsvolu("PSUP", "BOX ", idtmed[798], dpsup, 3) ; |
d15a28e7 |
827 | |
92862013 |
828 | yO = fGeom->GetCrystalSupportHeight() / 2.0 - ( xtlY + fGeom->GetCrystalSupportHeight() + fGeom->GetCrystalWrapThickness() ) / 2.0 ; |
d15a28e7 |
829 | |
92862013 |
830 | gMC->Gspos("PSUP", 1, "PPAP", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
831 | |
832 | // --- |
833 | // --- Define PIN-diode volume and position it inside crystal support --- |
834 | // --- right behind PbWO4 crystal |
835 | |
836 | // --- PIN-diode dimensions --- |
837 | |
838 | |
92862013 |
839 | Float_t dppin[3] ; |
840 | dppin[0] = fGeom->GetPinDiodeSize(0) / 2.0 ; |
841 | dppin[1] = fGeom->GetPinDiodeSize(1) / 2.0 ; |
842 | dppin[2] = fGeom->GetPinDiodeSize(2) / 2.0 ; |
d15a28e7 |
843 | |
92862013 |
844 | gMC->Gsvolu("PPIN", "BOX ", idtmed[705], dppin, 3) ; |
d15a28e7 |
845 | |
92862013 |
846 | yO = fGeom->GetCrystalSupportHeight() / 2.0 - fGeom->GetPinDiodeSize(1) / 2.0 ; |
d15a28e7 |
847 | |
92862013 |
848 | gMC->Gspos("PPIN", 1, "PSUP", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
849 | |
850 | // --- |
851 | // --- Define Upper Cooling Panel, place it on top of PTCB --- |
92862013 |
852 | Float_t dpucp[3] ; |
d15a28e7 |
853 | // --- Upper Cooling Plate thickness --- |
854 | |
92862013 |
855 | dpucp[0] = dptcb[0] ; |
856 | dpucp[1] = fGeom->GetUpperCoolingPlateThickness() ; |
857 | dpucp[2] = dptcb[2] ; |
d15a28e7 |
858 | |
92862013 |
859 | gMC->Gsvolu("PUCP", "BOX ", idtmed[701], dpucp,3) ; |
d15a28e7 |
860 | |
92862013 |
861 | yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetUpperCoolingPlateThickness() ) / 2. |
d15a28e7 |
862 | - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetModuleBoxThickness() |
863 | - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() - fGeom->GetUpperCoolingPlateThickness() ) ; |
864 | |
92862013 |
865 | gMC->Gspos("PUCP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
866 | |
867 | // --- |
868 | // --- Define Al Support Plate, position it inside PAIR --- |
869 | // --- right beneath PTCB --- |
870 | // --- Al Support Plate thickness --- |
871 | |
92862013 |
872 | Float_t dpasp[3] ; |
873 | dpasp[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; |
874 | dpasp[1] = fGeom->GetSupportPlateThickness() / 2.0 ; |
875 | dpasp[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; |
d15a28e7 |
876 | |
92862013 |
877 | gMC->Gsvolu("PASP", "BOX ", idtmed[701], dpasp, 3) ; |
d15a28e7 |
878 | |
92862013 |
879 | yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetSupportPlateThickness() ) / 2. |
d15a28e7 |
880 | - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() |
92862013 |
881 | - fGeom->GetUpperPlateThickness() - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 ) ; |
d15a28e7 |
882 | |
92862013 |
883 | gMC->Gspos("PASP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
884 | |
885 | // --- |
886 | // --- Define Thermo Insulating Plate, position it inside PAIR --- |
887 | // --- right beneath PASP --- |
888 | // --- Lower Thermo Insulating Plate thickness --- |
889 | |
92862013 |
890 | Float_t dptip[3] ; |
891 | dptip[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; |
892 | dptip[1] = fGeom->GetLowerThermoPlateThickness() / 2.0 ; |
893 | dptip[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; |
d15a28e7 |
894 | |
92862013 |
895 | gMC->Gsvolu("PTIP", "BOX ", idtmed[706], dptip, 3) ; |
d15a28e7 |
896 | |
92862013 |
897 | yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetLowerThermoPlateThickness() ) / 2. |
d15a28e7 |
898 | - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetUpperPlateThickness() |
92862013 |
899 | - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + fGeom->GetSupportPlateThickness() ) ; |
d15a28e7 |
900 | |
92862013 |
901 | gMC->Gspos("PTIP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
902 | |
903 | // --- |
904 | // --- Define Textolit Plate, position it inside PAIR --- |
905 | // --- right beneath PTIP --- |
906 | // --- Lower Textolit Plate thickness --- |
907 | |
92862013 |
908 | Float_t dptxp[3] ; |
909 | dptxp[0] = fGeom->GetAirFilledBoxSize(0) / 2.0 ; |
910 | dptxp[1] = fGeom->GetLowerTextolitPlateThickness() / 2.0 ; |
911 | dptxp[2] = fGeom->GetAirFilledBoxSize(2) / 2.0 ; |
d15a28e7 |
912 | |
92862013 |
913 | gMC->Gsvolu("PTXP", "BOX ", idtmed[707], dptxp, 3) ; |
d15a28e7 |
914 | |
92862013 |
915 | yO = ( fGeom->GetAirFilledBoxSize(1) - fGeom->GetLowerTextolitPlateThickness() ) / 2. |
d15a28e7 |
916 | - ( fGeom->GetIPtoCrystalSurface() - fGeom->GetIPtoOuterCoverDistance() - fGeom->GetUpperPlateThickness() |
92862013 |
917 | - fGeom->GetSecondUpperPlateThickness() + dpcbl[1] * 2 + fGeom->GetSupportPlateThickness() |
d15a28e7 |
918 | + fGeom->GetLowerThermoPlateThickness() ) ; |
919 | |
92862013 |
920 | gMC->Gspos("PTXP", 1, "PAIR", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
921 | |
922 | } |
923 | |
924 | //____________________________________________________________________________ |
925 | void AliPHOSv0::CreateGeometryforPPSD() |
fe4da5cc |
926 | { |
b2a60966 |
927 | // Create the PHOS-PPSD geometry for GEANT |
b2a60966 |
928 | //BEGIN_HTML |
929 | /* |
930 | <H2> |
931 | Geant3 geometry tree of PHOS-PPSD in ALICE |
932 | </H2> |
933 | <P><CENTER> |
934 | <IMG Align=BOTTOM ALT="PPSD geant tree" SRC="../images/PPSDinAlice.gif"> |
935 | </CENTER><P> |
936 | */ |
937 | //END_HTML |
938 | |
939 | // Get pointer to the array containing media indexes |
92862013 |
940 | Int_t *idtmed = fIdtmed->GetArray() - 699 ; |
d15a28e7 |
941 | |
92862013 |
942 | // The box containing all ppsd's for one PHOS module filled with air |
943 | Float_t ppsd[3] ; |
bacd0b23 |
944 | ppsd[0] = fGeom->GetCPVBoxSize(0) / 2.0 ; |
945 | ppsd[1] = fGeom->GetCPVBoxSize(1) / 2.0 ; |
946 | ppsd[2] = fGeom->GetCPVBoxSize(2) / 2.0 ; |
fe4da5cc |
947 | |
92862013 |
948 | gMC->Gsvolu("PPSD", "BOX ", idtmed[798], ppsd, 3) ; |
d15a28e7 |
949 | |
92862013 |
950 | Float_t yO = fGeom->GetOuterBoxSize(1) / 2.0 ; |
d15a28e7 |
951 | |
92862013 |
952 | gMC->Gspos("PPSD", 1, "PHOS", 0.0, yO, 0.0, 0, "ONLY") ; |
d15a28e7 |
953 | |
954 | // Now we build a micromegas module |
955 | // The box containing the whole module filled with epoxy (FR4) |
956 | |
92862013 |
957 | Float_t mppsd[3] ; |
958 | mppsd[0] = fGeom->GetPPSDModuleSize(0) / 2.0 ; |
959 | mppsd[1] = fGeom->GetPPSDModuleSize(1) / 2.0 ; |
960 | mppsd[2] = fGeom->GetPPSDModuleSize(2) / 2.0 ; |
d15a28e7 |
961 | |
92862013 |
962 | gMC->Gsvolu("MPPS", "BOX ", idtmed[708], mppsd, 3) ; |
d15a28e7 |
963 | |
92862013 |
964 | // Inside mppsd : |
d15a28e7 |
965 | // 1. The Top Lid made of epoxy (FR4) |
966 | |
92862013 |
967 | Float_t tlppsd[3] ; |
968 | tlppsd[0] = fGeom->GetPPSDModuleSize(0) / 2.0 ; |
969 | tlppsd[1] = fGeom->GetLidThickness() / 2.0 ; |
970 | tlppsd[2] = fGeom->GetPPSDModuleSize(2) / 2.0 ; |
d15a28e7 |
971 | |
92862013 |
972 | gMC->Gsvolu("TLPS", "BOX ", idtmed[708], tlppsd, 3) ; |
d15a28e7 |
973 | |
92862013 |
974 | Float_t y0 = ( fGeom->GetMicromegas1Thickness() - fGeom->GetLidThickness() ) / 2. ; |
d15a28e7 |
975 | |
92862013 |
976 | gMC->Gspos("TLPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
977 | |
978 | // 2. the upper panel made of composite material |
979 | |
92862013 |
980 | Float_t upppsd[3] ; |
981 | upppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
982 | upppsd[1] = fGeom->GetCompositeThickness() / 2.0 ; |
983 | upppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
d15a28e7 |
984 | |
92862013 |
985 | gMC->Gsvolu("UPPS", "BOX ", idtmed[709], upppsd, 3) ; |
d15a28e7 |
986 | |
92862013 |
987 | y0 = y0 - fGeom->GetLidThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; |
d15a28e7 |
988 | |
92862013 |
989 | gMC->Gspos("UPPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
990 | |
991 | // 3. the anode made of Copper |
992 | |
92862013 |
993 | Float_t anppsd[3] ; |
994 | anppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
995 | anppsd[1] = fGeom->GetAnodeThickness() / 2.0 ; |
996 | anppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
d15a28e7 |
997 | |
92862013 |
998 | gMC->Gsvolu("ANPS", "BOX ", idtmed[710], anppsd, 3) ; |
d15a28e7 |
999 | |
92862013 |
1000 | y0 = y0 - fGeom->GetCompositeThickness() / 2. - fGeom->GetAnodeThickness() / 2. ; |
d15a28e7 |
1001 | |
92862013 |
1002 | gMC->Gspos("ANPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1003 | |
1004 | // 4. the conversion gap + avalanche gap filled with gas |
1005 | |
92862013 |
1006 | Float_t ggppsd[3] ; |
1007 | ggppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
1008 | ggppsd[1] = ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2.0 ; |
1009 | ggppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
d15a28e7 |
1010 | |
92862013 |
1011 | gMC->Gsvolu("GGPS", "BOX ", idtmed[715], ggppsd, 3) ; |
d15a28e7 |
1012 | |
1013 | // --- Divide GGPP in X (phi) and Z directions -- |
1014 | gMC->Gsdvn("GROW", "GGPS", fGeom->GetNumberOfPadsPhi(), 1) ; |
1015 | gMC->Gsdvn("GCEL", "GROW", fGeom->GetNumberOfPadsZ() , 3) ; |
1016 | |
92862013 |
1017 | y0 = y0 - fGeom->GetAnodeThickness() / 2. - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. ; |
d15a28e7 |
1018 | |
92862013 |
1019 | gMC->Gspos("GGPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1020 | |
1021 | |
1022 | // 6. the cathode made of Copper |
1023 | |
92862013 |
1024 | Float_t cappsd[3] ; |
1025 | cappsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
1026 | cappsd[1] = fGeom->GetCathodeThickness() / 2.0 ; |
1027 | cappsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
d15a28e7 |
1028 | |
92862013 |
1029 | gMC->Gsvolu("CAPS", "BOX ", idtmed[710], cappsd, 3) ; |
d15a28e7 |
1030 | |
39544c2e |
1031 | y0 = y0 - ( fGeom->GetConversionGap() + fGeom->GetAvalancheGap() ) / 2. - fGeom->GetCathodeThickness() / 2. ; |
d15a28e7 |
1032 | |
92862013 |
1033 | gMC->Gspos("CAPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1034 | |
1035 | // 7. the printed circuit made of G10 |
1036 | |
92862013 |
1037 | Float_t pcppsd[3] ; |
1038 | pcppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2,.0 ; |
1039 | pcppsd[1] = fGeom->GetPCThickness() / 2.0 ; |
1040 | pcppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
d15a28e7 |
1041 | |
92862013 |
1042 | gMC->Gsvolu("PCPS", "BOX ", idtmed[711], cappsd, 3) ; |
d15a28e7 |
1043 | |
92862013 |
1044 | y0 = y0 - fGeom->GetCathodeThickness() / 2. - fGeom->GetPCThickness() / 2. ; |
d15a28e7 |
1045 | |
92862013 |
1046 | gMC->Gspos("PCPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1047 | |
1048 | // 8. the lower panel made of composite material |
1049 | |
92862013 |
1050 | Float_t lpppsd[3] ; |
1051 | lpppsd[0] = ( fGeom->GetPPSDModuleSize(0) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
1052 | lpppsd[1] = fGeom->GetCompositeThickness() / 2.0 ; |
1053 | lpppsd[2] = ( fGeom->GetPPSDModuleSize(2) - fGeom->GetMicromegasWallThickness() ) / 2.0 ; |
d15a28e7 |
1054 | |
92862013 |
1055 | gMC->Gsvolu("LPPS", "BOX ", idtmed[709], lpppsd, 3) ; |
d15a28e7 |
1056 | |
92862013 |
1057 | y0 = y0 - fGeom->GetPCThickness() / 2. - fGeom->GetCompositeThickness() / 2. ; |
d15a28e7 |
1058 | |
92862013 |
1059 | gMC->Gspos("LPPS", 1, "MPPS", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1060 | |
92862013 |
1061 | // Position the fNumberOfModulesPhi x fNumberOfModulesZ modules (mppsd) inside PPSD to cover a PHOS module |
d15a28e7 |
1062 | // the top and bottom one's (which are assumed identical) : |
1063 | |
bacd0b23 |
1064 | Float_t yt = ( fGeom->GetCPVBoxSize(1) - fGeom->GetMicromegas1Thickness() ) / 2. ; |
1065 | Float_t yb = - ( fGeom->GetCPVBoxSize(1) - fGeom->GetMicromegas2Thickness() ) / 2. ; |
d15a28e7 |
1066 | |
92862013 |
1067 | Int_t copyNumbertop = 0 ; |
1068 | Int_t copyNumberbot = fGeom->GetNumberOfModulesPhi() * fGeom->GetNumberOfModulesZ() ; |
d15a28e7 |
1069 | |
bacd0b23 |
1070 | Float_t x = ( fGeom->GetCPVBoxSize(0) - fGeom->GetPPSDModuleSize(0) ) / 2. ; |
d15a28e7 |
1071 | |
1072 | for ( Int_t iphi = 1; iphi <= fGeom->GetNumberOfModulesPhi(); iphi++ ) { // the number of micromegas modules in phi per PHOS module |
bacd0b23 |
1073 | Float_t z = ( fGeom->GetCPVBoxSize(2) - fGeom->GetPPSDModuleSize(2) ) / 2. ; |
d15a28e7 |
1074 | |
1075 | for ( Int_t iz = 1; iz <= fGeom->GetNumberOfModulesZ(); iz++ ) { // the number of micromegas modules in z per PHOS module |
92862013 |
1076 | gMC->Gspos("MPPS", ++copyNumbertop, "PPSD", x, yt, z, 0, "ONLY") ; |
1077 | gMC->Gspos("MPPS", ++copyNumberbot, "PPSD", x, yb, z, 0, "ONLY") ; |
1078 | z = z - fGeom->GetPPSDModuleSize(2) ; |
d15a28e7 |
1079 | } // end of Z module loop |
92862013 |
1080 | x = x - fGeom->GetPPSDModuleSize(0) ; |
d15a28e7 |
1081 | } // end of phi module loop |
1082 | |
1083 | // The Lead converter between two air gaps |
1084 | // 1. Upper air gap |
1085 | |
92862013 |
1086 | Float_t uappsd[3] ; |
bacd0b23 |
1087 | uappsd[0] = fGeom->GetCPVBoxSize(0) / 2.0 ; |
92862013 |
1088 | uappsd[1] = fGeom->GetMicro1ToLeadGap() / 2.0 ; |
bacd0b23 |
1089 | uappsd[2] = fGeom->GetCPVBoxSize(2) / 2.0 ; |
d15a28e7 |
1090 | |
92862013 |
1091 | gMC->Gsvolu("UAPPSD", "BOX ", idtmed[798], uappsd, 3) ; |
d15a28e7 |
1092 | |
bacd0b23 |
1093 | y0 = ( fGeom->GetCPVBoxSize(1) - 2 * fGeom->GetMicromegas1Thickness() - fGeom->GetMicro1ToLeadGap() ) / 2. ; |
d15a28e7 |
1094 | |
92862013 |
1095 | gMC->Gspos("UAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1096 | |
1097 | // 2. Lead converter |
1098 | |
92862013 |
1099 | Float_t lcppsd[3] ; |
bacd0b23 |
1100 | lcppsd[0] = fGeom->GetCPVBoxSize(0) / 2.0 ; |
92862013 |
1101 | lcppsd[1] = fGeom->GetLeadConverterThickness() / 2.0 ; |
bacd0b23 |
1102 | lcppsd[2] = fGeom->GetCPVBoxSize(2) / 2.0 ; |
d15a28e7 |
1103 | |
92862013 |
1104 | gMC->Gsvolu("LCPPSD", "BOX ", idtmed[712], lcppsd, 3) ; |
d15a28e7 |
1105 | |
92862013 |
1106 | y0 = y0 - fGeom->GetMicro1ToLeadGap() / 2. - fGeom->GetLeadConverterThickness() / 2. ; |
d15a28e7 |
1107 | |
92862013 |
1108 | gMC->Gspos("LCPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1109 | |
1110 | // 3. Lower air gap |
1111 | |
92862013 |
1112 | Float_t lappsd[3] ; |
bacd0b23 |
1113 | lappsd[0] = fGeom->GetCPVBoxSize(0) / 2.0 ; |
92862013 |
1114 | lappsd[1] = fGeom->GetLeadToMicro2Gap() / 2.0 ; |
bacd0b23 |
1115 | lappsd[2] = fGeom->GetCPVBoxSize(2) / 2.0 ; |
d15a28e7 |
1116 | |
92862013 |
1117 | gMC->Gsvolu("LAPPSD", "BOX ", idtmed[798], lappsd, 3) ; |
fe4da5cc |
1118 | |
92862013 |
1119 | y0 = y0 - fGeom->GetLeadConverterThickness() / 2. - fGeom->GetLeadToMicro2Gap() / 2. ; |
d15a28e7 |
1120 | |
92862013 |
1121 | gMC->Gspos("LAPPSD", 1, "PPSD", 0.0, y0, 0.0, 0, "ONLY") ; |
d15a28e7 |
1122 | |
fe4da5cc |
1123 | } |
1124 | |
d15a28e7 |
1125 | |
bacd0b23 |
1126 | //____________________________________________________________________________ |
1127 | void AliPHOSv0::CreateGeometryforCPV() |
1128 | { |
1129 | // Create the PHOS-CPV geometry for GEANT |
1130 | // Author: Yuri Kharlov 11 September 2000 |
bacd0b23 |
1131 | //BEGIN_HTML |
1132 | /* |
1133 | <H2> |
1134 | Geant3 geometry of PHOS-CPV in ALICE |
1135 | </H2> |
1136 | <table width=700> |
1137 | |
1138 | <tr> |
1139 | <td>CPV perspective view</td> |
1140 | <td>CPV front view </td> |
1141 | </tr> |
1142 | |
1143 | <tr> |
1144 | <td> <img height=300 width=290 src="../images/CPVallPersp.gif"> </td> |
1145 | <td> <img height=300 width=290 src="../images/CPVallFront.gif"> </td> |
1146 | </tr> |
1147 | |
1148 | <tr> |
1149 | <td>One CPV module, perspective view </td> |
1150 | <td>One CPV module, front view (extended in vertical direction) </td> |
1151 | </tr> |
1152 | |
1153 | <tr> |
1154 | <td><img height=300 width=290 src="../images/CPVmodulePers.gif"></td> |
1155 | <td><img height=300 width=290 src="../images/CPVmoduleSide.gif"></td> |
1156 | </tr> |
1157 | |
1158 | </table> |
1159 | |
1160 | <H2> |
1161 | Geant3 geometry tree of PHOS-CPV in ALICE |
1162 | </H2> |
1163 | <center> |
1164 | <img height=300 width=290 src="../images/CPVtree.gif"> |
1165 | </center> |
1166 | */ |
1167 | //END_HTML |
1168 | |
1169 | Float_t par[3], x,y,z; |
1170 | |
1171 | // Get pointer to the array containing media indexes |
1172 | Int_t *idtmed = fIdtmed->GetArray() - 699 ; |
1173 | |
1174 | // The box containing all CPV for one PHOS module filled with air |
1175 | par[0] = fGeom->GetCPVBoxSize(0) / 2.0 ; |
1176 | par[1] = fGeom->GetCPVBoxSize(1) / 2.0 ; |
1177 | par[2] = fGeom->GetCPVBoxSize(2) / 2.0 ; |
1178 | gMC->Gsvolu("CPV ", "BOX ", idtmed[798], par, 3) ; |
1179 | |
1180 | y = fGeom->GetOuterBoxSize(1) / 2.0 ; |
1181 | gMC->Gspos("CPV ", 1, "PHOS", 0.0, y, 0.0, 0, "ONLY") ; |
1182 | |
1183 | // Gassiplex board |
1184 | |
1185 | par[0] = fGeom->GetGassiplexChipSize(0)/2.; |
1186 | par[1] = fGeom->GetGassiplexChipSize(1)/2.; |
1187 | par[2] = fGeom->GetGassiplexChipSize(2)/2.; |
1188 | gMC->Gsvolu("CPVC","BOX ",idtmed[707],par,3); |
1189 | |
1190 | // Cu+Ni foil covers Gassiplex board |
1191 | |
1192 | par[1] = fGeom->GetCPVCuNiFoilThickness()/2; |
1193 | gMC->Gsvolu("CPVD","BOX ",idtmed[710],par,3); |
1194 | y = -(fGeom->GetGassiplexChipSize(1)/2 - par[1]); |
1195 | gMC->Gspos("CPVD",1,"CPVC",0,y,0,0,"ONLY"); |
1196 | |
1197 | // Position of the chip inside CPV |
1198 | |
1199 | Float_t xStep = fGeom->GetCPVActiveSize(0) / (fGeom->GetNumberOfCPVChipsPhi() + 1); |
1200 | Float_t zStep = fGeom->GetCPVActiveSize(1) / (fGeom->GetNumberOfCPVChipsZ() + 1); |
1201 | Int_t copy = 0; |
1202 | y = fGeom->GetCPVFrameSize(1)/2 - fGeom->GetFTPosition(0) + |
1203 | fGeom->GetCPVTextoliteThickness() / 2 + fGeom->GetGassiplexChipSize(1) / 2 + 0.1; |
1204 | for (Int_t ix=0; ix<fGeom->GetNumberOfCPVChipsPhi(); ix++) { |
1205 | x = xStep * (ix+1) - fGeom->GetCPVActiveSize(0)/2; |
1206 | for (Int_t iz=0; iz<fGeom->GetNumberOfCPVChipsZ(); iz++) { |
1207 | copy++; |
1208 | z = zStep * (iz+1) - fGeom->GetCPVActiveSize(1)/2; |
1209 | gMC->Gspos("CPVC",copy,"CPV",x,y,z,0,"ONLY"); |
1210 | } |
1211 | } |
1212 | |
1213 | // Foiled textolite (1 mm of textolite + 50 mkm of Cu + 6 mkm of Ni) |
1214 | |
1215 | par[0] = fGeom->GetCPVActiveSize(0) / 2; |
1216 | par[1] = fGeom->GetCPVTextoliteThickness() / 2; |
1217 | par[2] = fGeom->GetCPVActiveSize(1) / 2; |
1218 | gMC->Gsvolu("CPVF","BOX ",idtmed[707],par,3); |
1219 | |
1220 | // Argon gas volume |
1221 | |
1222 | par[1] = (fGeom->GetFTPosition(2) - fGeom->GetFTPosition(1) - fGeom->GetCPVTextoliteThickness()) / 2; |
1223 | gMC->Gsvolu("CPVG","BOX ",idtmed[715],par,3); |
1224 | |
1225 | for (Int_t i=0; i<4; i++) { |
1226 | y = fGeom->GetCPVFrameSize(1) / 2 - fGeom->GetFTPosition(i) + fGeom->GetCPVTextoliteThickness()/2; |
1227 | gMC->Gspos("CPVF",i+1,"CPV",0,y,0,0,"ONLY"); |
1228 | if(i==1){ |
1229 | y-= (fGeom->GetFTPosition(2) - fGeom->GetFTPosition(1)) / 2; |
1230 | gMC->Gspos("CPVG",1,"CPV ",0,y,0,0,"ONLY"); |
1231 | } |
1232 | } |
1233 | |
1234 | // Dummy sensitive plane in the middle of argone gas volume |
1235 | |
1236 | par[1]=0.001; |
1237 | gMC->Gsvolu("CPVQ","BOX ",idtmed[715],par,3); |
1238 | gMC->Gspos ("CPVQ",1,"CPVG",0,0,0,0,"ONLY"); |
1239 | |
1240 | // Cu+Ni foil covers textolite |
1241 | |
1242 | par[1] = fGeom->GetCPVCuNiFoilThickness() / 2; |
1243 | gMC->Gsvolu("CPV1","BOX ",idtmed[710],par,3); |
1244 | y = fGeom->GetCPVTextoliteThickness()/2 - par[1]; |
1245 | gMC->Gspos ("CPV1",1,"CPVF",0,y,0,0,"ONLY"); |
1246 | |
1247 | // Aluminum frame around CPV |
1248 | |
1249 | par[0] = fGeom->GetCPVFrameSize(0)/2; |
1250 | par[1] = fGeom->GetCPVFrameSize(1)/2; |
1251 | par[2] = fGeom->GetCPVBoxSize(2) /2; |
1252 | gMC->Gsvolu("CFR1","BOX ",idtmed[701],par,3); |
1253 | |
1254 | par[0] = fGeom->GetCPVBoxSize(0)/2 - fGeom->GetCPVFrameSize(0); |
1255 | par[1] = fGeom->GetCPVFrameSize(1)/2; |
1256 | par[2] = fGeom->GetCPVFrameSize(2)/2; |
1257 | gMC->Gsvolu("CFR2","BOX ",idtmed[701],par,3); |
1258 | |
1259 | for (Int_t j=0; j<=1; j++) { |
1260 | x = TMath::Sign(1,2*j-1) * (fGeom->GetCPVBoxSize(0) - fGeom->GetCPVFrameSize(0)) / 2; |
1261 | gMC->Gspos("CFR1",j+1,"CPV", x,0,0,0,"ONLY"); |
1262 | z = TMath::Sign(1,2*j-1) * (fGeom->GetCPVBoxSize(2) - fGeom->GetCPVFrameSize(2)) / 2; |
1263 | gMC->Gspos("CFR2",j+1,"CPV",0, 0,z,0,"ONLY"); |
1264 | } |
1265 | |
1266 | } |
1267 | |
1268 | |
d15a28e7 |
1269 | //____________________________________________________________________________ |
1270 | void AliPHOSv0::Init(void) |
1271 | { |
b2a60966 |
1272 | // Just prints an information message |
1273 | |
d15a28e7 |
1274 | Int_t i; |
1275 | |
1276 | printf("\n"); |
1277 | for(i=0;i<35;i++) printf("*"); |
1278 | printf(" PHOS_INIT "); |
1279 | for(i=0;i<35;i++) printf("*"); |
1280 | printf("\n"); |
1281 | |
1282 | // Here the PHOS initialisation code (if any!) |
1283 | |
e04976bd |
1284 | if (fGeom!=0) |
1285 | cout << "AliPHOS" << Version() << " : PHOS geometry intialized for " << fGeom->GetName() << endl ; |
1286 | else |
1287 | cout << "AliPHOS" << Version() << " : PHOS geometry initialization failed !" << endl ; |
1288 | |
d15a28e7 |
1289 | for(i=0;i<80;i++) printf("*"); |
1290 | printf("\n"); |
1291 | |
1292 | } |
1293 | |