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