Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
7 : * Permission to use, copy, modify and distribute this software and its *
8 : * documentation strictly for non-commercial purposes is hereby granted *
9 : * without fee, provided that the above copyright notice appears in all *
10 : * copies and that both the copyright notice and this permission notice *
11 : * appear in the supporting documentation. The authors make no claims *
12 : * about the suitability of this software for any purpose. It is *
13 : * provided "as is" without express or implied warranty. *
14 : **************************************************************************/
15 :
16 : #include <TVirtualMC.h>
17 : #include <TGeoManager.h>
18 : #include <TGeoVolume.h>
19 : #include <TGeoMedium.h>
20 : #include <TGeoMatrix.h>
21 : #include <TGeoVolume.h>
22 : #include <TGeoTube.h>
23 : #include <TGeoCone.h>
24 : #include <TGeoPcon.h>
25 : #include <TGeoCompositeShape.h>
26 :
27 : #include "AliConst.h"
28 : #include "AliEMCALSpaceFrame.h"
29 : #include "AliMagF.h"
30 : #include "AliRun.h"
31 : #include "AliLog.h"
32 :
33 42 : ClassImp(AliEMCALSpaceFrame)
34 :
35 : //_____________________________________________________________________________
36 : AliEMCALSpaceFrame::AliEMCALSpaceFrame()
37 13 : : TNamed("EMCALSpaceFrame","Steel Space Frame that supports EMCAL"),
38 13 : fNumCross(0),
39 13 : fNumSubSets(0),
40 13 : fTotalHalfWidth(0.),
41 13 : fBeginPhi(0.),
42 13 : fEndPhi(0.),
43 13 : fTotalPhi(0.),
44 13 : fBeginRadius(0.),
45 13 : fHalfFrameTrans(0.),
46 13 : fFlangeHeight(0.),
47 13 : fFlangeWidth(0.),
48 13 : fRibHeight(0.),
49 13 : fRibWidth(0.),
50 13 : fCrossBottomWidth(0.),
51 13 : fCrossTopWidth(0.),
52 13 : fCrossBottomHeight(0.),
53 13 : fCrossBottomRadThick(0.),
54 13 : fCrossBeamArcLength(0.),
55 13 : fCrossBottomStartRadius(0.),
56 13 : fCrossTopHeight(0.),
57 13 : fCrossTopRadThick(0.),
58 13 : fCrossTopStart(0.),
59 13 : fEndRadius(0.),
60 13 : fEndBeamRadThick(0),
61 13 : fEndBeamBeginRadius(0)
62 65 : {
63 : // default constructor for EMCAL Space Frame
64 : //initialize parameters
65 13 : fNumCross = 12;
66 13 : fNumSubSets = 3;
67 13 : fTotalHalfWidth = 152.3; // Half Width of a Half Frame
68 : // (CalFrame comes in 2 sections)
69 13 : fBeginPhi = 76.8;
70 13 : fEndPhi = 193.03;
71 13 : fBeginRadius = 490.;
72 :
73 13 : fHalfFrameTrans = fTotalHalfWidth+57.2/2.; // Half Frame Connector is 57.2cm wide,
74 : // Supermodule is 340cm wide
75 : // Sources: HALF-FRAME-CONNECTOR-27E226A.pdf
76 : // provided by LBL
77 :
78 13 : fFlangeWidth = 15.2;
79 13 : fRibWidth = 1.5;
80 13 : fCrossBottomHeight = 15.2;
81 13 : fCrossBottomRadThick = 1.5;
82 13 : fCrossTopHeight = 1.5;
83 13 : fCrossTopRadThick = 35./2.;
84 :
85 13 : fTotalPhi = fEndPhi - fBeginPhi;
86 13 : fFlangeHeight = fBeginRadius + 3.;
87 13 : fRibHeight = fFlangeHeight + 35;
88 13 : fCrossBottomWidth = 0.5/(Double_t)fNumSubSets * (2.*fTotalHalfWidth - 8. * fFlangeWidth);
89 13 : fCrossTopWidth = fCrossBottomWidth; // fCrossBottomWidth + fFlangeWidth - fRibWidth;
90 : // for future release pending
91 : // overlap correction - new TGeoVolume creation
92 :
93 13 : fCrossBeamArcLength = (112.62597)/(fNumCross-1)-.001; // To account for shape of TGeoBBox
94 13 : fCrossBottomStartRadius = fBeginRadius + fCrossBottomRadThick;
95 13 : fCrossTopStart = fBeginRadius + 2.*fCrossBottomRadThick + fCrossTopRadThick+0.015; // 0.015 is a
96 : // bubblegum and duct tape
97 : // fix for an overlap problem
98 : // will be worked out in future releases
99 13 : fEndRadius = fRibHeight+1.15;
100 13 : fEndBeamRadThick = fCrossBottomRadThick+fCrossTopRadThick;
101 13 : fEndBeamBeginRadius = fBeginRadius + fEndBeamRadThick;
102 26 : }
103 :
104 : //_____________________________________________________________________________
105 : AliEMCALSpaceFrame::AliEMCALSpaceFrame(const AliEMCALSpaceFrame &frame)
106 0 : : TNamed(frame.GetName(),frame.GetTitle()),
107 0 : fNumCross(frame.fNumCross),
108 0 : fNumSubSets(frame.fNumSubSets),
109 0 : fTotalHalfWidth(frame.fTotalHalfWidth),
110 0 : fBeginPhi(frame.fBeginPhi),
111 0 : fEndPhi(frame.fEndPhi),
112 0 : fTotalPhi(frame.fTotalPhi),
113 0 : fBeginRadius(frame.fBeginRadius),
114 0 : fHalfFrameTrans(frame.fHalfFrameTrans),
115 0 : fFlangeHeight(frame.fFlangeHeight),
116 0 : fFlangeWidth(frame.fFlangeWidth),
117 0 : fRibHeight(frame.fRibHeight),
118 0 : fRibWidth(frame.fRibWidth),
119 0 : fCrossBottomWidth(frame.fCrossBottomWidth),
120 0 : fCrossTopWidth(frame.fCrossTopWidth),
121 0 : fCrossBottomHeight(frame.fCrossBottomHeight),
122 0 : fCrossBottomRadThick(frame.fCrossBottomRadThick),
123 0 : fCrossBeamArcLength(frame.fCrossBeamArcLength),
124 0 : fCrossBottomStartRadius(frame.fCrossBottomStartRadius),
125 0 : fCrossTopHeight(frame.fCrossTopHeight),
126 0 : fCrossTopRadThick(frame.fCrossTopRadThick),
127 0 : fCrossTopStart(frame.fCrossTopStart),
128 0 : fEndRadius(frame.fEndRadius),
129 0 : fEndBeamRadThick(frame.fEndBeamRadThick),
130 0 : fEndBeamBeginRadius(frame.fEndBeamBeginRadius)
131 0 : {
132 : // copy constructor for EMCAL Space Frame
133 :
134 0 : }
135 :
136 : //_____________________________________________________________________________
137 : void AliEMCALSpaceFrame::CreateGeometry()
138 : {
139 : // create geometry
140 :
141 4 : AliDebug(1,"Create CalFrame Geometry");
142 : //////////////////////////////////////Setup/////////////////////////////////////////
143 1 : TGeoVolume* top = gGeoManager->GetVolume("ALIC");
144 1 : TGeoMedium *steel = gGeoManager->GetMedium("EMCAL_S steel$");
145 1 : TGeoMedium *air = gGeoManager->GetMedium("EMCAL_Air$");
146 :
147 :
148 : //////////////////////////////////// Volumes ///////////////////////////////////////
149 : TGeoVolume *calFrameMO =
150 2 : gGeoManager->MakeTubs("CalFrame", air, fBeginRadius-2.1,fEndRadius,
151 1 : fTotalHalfWidth*3,fBeginPhi-3,fEndPhi+3); // Mother Volume
152 :
153 1 : calFrameMO->SetVisibility(kFALSE);
154 :
155 : // Half Frame Mother Volume
156 : TGeoVolume *calHalfFrameMO =
157 2 : gGeoManager->MakeTubs("HalfFrame", air, fBeginRadius-2,fEndRadius,
158 1 : fTotalHalfWidth,fBeginPhi-2.9,fEndPhi+2.9);
159 :
160 1 : calHalfFrameMO->SetVisibility(kFALSE);
161 :
162 : TGeoVolume *endBeams =
163 1 : gGeoManager->MakeBox("End Beams", steel, fEndBeamRadThick, fCrossTopHeight, fTotalHalfWidth); // End Beams
164 :
165 : TGeoVolume *skin =
166 2 : gGeoManager->MakeTubs("skin", steel, fRibHeight+0.15, fEndRadius,
167 1 : fTotalHalfWidth, fBeginPhi, fEndPhi);// back frame
168 :
169 : TGeoVolume *flangeVolume =
170 2 : gGeoManager->MakeTubs("supportBottom", steel, fBeginRadius, fFlangeHeight,
171 1 : fFlangeWidth, fBeginPhi, fEndPhi); // FlangeVolume Beams
172 :
173 : TGeoVolume *ribVolume =
174 1 : gGeoManager->MakeTubs("RibVolume", steel, fFlangeHeight, fRibHeight, fRibWidth, fBeginPhi, fEndPhi);
175 :
176 : TGeoVolume *subSetCross =
177 3 : gGeoManager->MakeTubs("subSetCross", air, fBeginRadius-1, fBeginRadius+2*fCrossBottomRadThick+
178 2 : 2*fCrossTopRadThick+0.15, fCrossBottomWidth, fBeginPhi, fEndPhi); // Cross Beam Containers
179 1 : subSetCross->SetVisibility(kFALSE);
180 : /* // Obsolete for now
181 : TGeoVolume *subSetCrossTop =
182 : gGeoManager->MakeTubs("SubSetCrossTop", air, fBeginRadius+2*fCrossBottomRadThick-1, fBeginRadius+2*fCrossBottomRadThick+
183 : 2*fCrossTopRadThick+1, fCrossTopWidth, fBeginPhi, fEndPhi); // Cross
184 : subSetCrossTop->SetVisibility(kFALSE);
185 : */
186 : TGeoVolume *crossBottomBeams =
187 1 : gGeoManager->MakeBox("crossBottom", steel, fCrossBottomRadThick, fCrossBottomHeight, fCrossBottomWidth); // Cross Beams
188 :
189 : TGeoVolume *crossTopBeams =
190 1 : gGeoManager->MakeBox("crossTop", steel, fCrossTopRadThick, fCrossTopHeight, fCrossTopWidth); // Cross Beams
191 :
192 1 : TGeoTranslation *trTEST = new TGeoTranslation();
193 1 : TGeoRotation *rotTEST = new TGeoRotation();
194 :
195 1 : Double_t conv = TMath::Pi()/180.;
196 : Double_t radAngle = 0;
197 : Double_t endBeamParam=.4;
198 : //cout<<"\nfCrossBottomStartRadius: "<<fCrossBottomStartRadius<<"\n";
199 :
200 26 : for(Int_t i = 0; i < fNumCross; i++){
201 :
202 12 : Double_t loopPhi = fBeginPhi + 1.8;
203 :
204 : // Cross Bottom Beams
205 :
206 12 : radAngle = (loopPhi + i*fCrossBeamArcLength)*conv;
207 :
208 12 : rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
209 12 : trTEST->SetTranslation(cos(radAngle)*fCrossBottomStartRadius, sin(radAngle)*fCrossBottomStartRadius,0);
210 :
211 12 : TGeoCombiTrans *combo = new TGeoCombiTrans(*trTEST, *rotTEST); // TGeoTranslation &tr, const TGeoRotation &rot);
212 12 : combo->RegisterYourself();
213 12 : crossBottomBeams->SetVisibility(1);
214 12 : subSetCross->AddNode(crossBottomBeams, i+1, combo);
215 23 : if (i != 0 && i!=fNumCross-1){
216 : // Cross Bottom Beams
217 10 : rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
218 10 : trTEST->SetTranslation(cos(radAngle)*fCrossTopStart, sin(radAngle)*fCrossTopStart,0);
219 10 : crossTopBeams->SetVisibility(1);
220 20 : subSetCross->AddNode(crossTopBeams, i+1, new TGeoCombiTrans(*trTEST, *rotTEST));
221 10 : }
222 :
223 :
224 2 : else if(i ==0){
225 1 : rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
226 1 : trTEST->SetTranslation(cos((77-endBeamParam)*conv)*(fEndBeamBeginRadius), sin((77-endBeamParam)*conv)*(fEndBeamBeginRadius),0);
227 1 : endBeams->SetVisibility(1);
228 2 : calHalfFrameMO->AddNode(endBeams, 1, new TGeoCombiTrans(*trTEST, *rotTEST));
229 1 : }
230 : else{
231 1 : rotTEST->SetAngles(193.03, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
232 1 : trTEST->SetTranslation(cos((193.03+endBeamParam)*conv)*(fEndBeamBeginRadius)/*more duct tape*/, sin((193.03+endBeamParam)*conv)*(fEndBeamBeginRadius),0);
233 1 : endBeams->SetVisibility(1);
234 2 : calHalfFrameMO->AddNode(endBeams, 2, new TGeoCombiTrans(*trTEST, *rotTEST));
235 : }
236 : }
237 :
238 : //Beam Containers
239 :
240 : // Translations
241 :
242 1 : TGeoTranslation *origin1 = new TGeoTranslation(0,0,0); // Equivalent to gGeoIdentity
243 1 : TGeoTranslation *origin2 = new TGeoTranslation(0,0,2*(fCrossBottomWidth+fFlangeWidth));
244 1 : TGeoTranslation *origin3 = new TGeoTranslation(0,0,-2*(fCrossBottomWidth+fFlangeWidth));
245 :
246 : // FlangeVolume translations
247 1 : TGeoTranslation *str1 = new TGeoTranslation(0,0,-3*(fCrossBottomWidth+fFlangeWidth));
248 1 : TGeoTranslation *str2 = new TGeoTranslation(0,0,-(fCrossBottomWidth+fFlangeWidth));
249 1 : TGeoTranslation *str3 = new TGeoTranslation(0,0,(fCrossBottomWidth+fFlangeWidth));
250 1 : TGeoTranslation *str4 = new TGeoTranslation(0,0,3*(fCrossBottomWidth+fFlangeWidth));
251 :
252 : // Half Frame Translations
253 1 : TGeoTranslation *halfTrans1 = new TGeoTranslation(0,0,fHalfFrameTrans);
254 1 : TGeoTranslation *halfTrans2 = new TGeoTranslation(0,0,-fHalfFrameTrans);
255 :
256 : // Beams Volume
257 1 : calHalfFrameMO->AddNode(flangeVolume, 1, str1);
258 1 : calHalfFrameMO->AddNode(flangeVolume, 2, str2);
259 1 : calHalfFrameMO->AddNode(flangeVolume, 3, str3);
260 1 : calHalfFrameMO->AddNode(flangeVolume, 4, str4);
261 :
262 1 : calHalfFrameMO->AddNode(ribVolume, 1, str1);
263 1 : calHalfFrameMO->AddNode(ribVolume, 2, str2);
264 1 : calHalfFrameMO->AddNode(ribVolume, 3, str3);
265 1 : calHalfFrameMO->AddNode(ribVolume, 4, str4);
266 :
267 : // Cross Beams
268 1 : calHalfFrameMO->AddNode(subSetCross, 1, origin1);
269 1 : calHalfFrameMO->AddNode(subSetCross, 2, origin2);
270 1 : calHalfFrameMO->AddNode(subSetCross, 3, origin3);
271 : /* // Obsolete for now
272 : calHalfFrameMO->AddNode(subSetCrossTop, 1, origin1);
273 : calHalfFrameMO->AddNode(subSetCrossTop, 2, origin2);
274 : calHalfFrameMO->AddNode(subSetCrossTop, 3, origin3);
275 : */
276 :
277 1 : calHalfFrameMO->AddNode(skin, 1, gGeoIdentity);
278 :
279 1 : calFrameMO->AddNode(calHalfFrameMO, 1, halfTrans1);
280 1 : calFrameMO->AddNode(calHalfFrameMO, 2, halfTrans2);
281 :
282 1 : top->AddNode(calFrameMO,1,gGeoIdentity);
283 : // cout<<"**********************************\nfEndRadius:\t"<<fEndRadius;
284 1 : }
285 :
|