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