1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 #include <TVirtualMC.h>
17 #include <TGeoManager.h>
18 #include <TGeoVolume.h>
19 #include <TGeoMedium.h>
20 #include <TGeoMatrix.h>
21 #include <TGeoVolume.h>
25 #include <TGeoCompositeShape.h>
28 #include "AliEMCALSpaceFrame.h"
33 ClassImp(AliEMCALSpaceFrame)
35 //_____________________________________________________________________________
36 AliEMCALSpaceFrame::AliEMCALSpaceFrame()
37 : TNamed("EMCALSpaceFrame","Steel Space Frame that supports EMCAL"),
50 fCrossBottomWidth(0.),
52 fCrossBottomHeight(0.),
53 fCrossBottomRadThick(0.),
54 fCrossBeamArcLength(0.),
55 fCrossBottomStartRadius(0.),
57 fCrossTopRadThick(0.),
61 fEndBeamBeginRadius(0)
63 // default constructor for EMCAL Space Frame
64 //initialize parameters
67 fTotalHalfWidth = 152.3; // Half Width of a Half Frame
68 // (CalFrame comes in 2 sections)
73 fHalfFrameTrans = fTotalHalfWidth+57.2/2.; // Half Frame Connector is 57.2cm wide,
74 // Supermodule is 340cm wide
75 // Sources: HALF-FRAME-CONNECTOR-27E226A.pdf
80 fCrossBottomHeight = 15.2;
81 fCrossBottomRadThick = 1.5;
82 fCrossTopHeight = 1.5;
83 fCrossTopRadThick = 35./2.;
85 fTotalPhi = fEndPhi - fBeginPhi;
86 fFlangeHeight = fBeginRadius + 3.;
87 fRibHeight = fFlangeHeight + 35;
88 fCrossBottomWidth = 0.5/(Double_t)fNumSubSets * (2.*fTotalHalfWidth - 8. * fFlangeWidth);
89 fCrossTopWidth = fCrossBottomWidth; // fCrossBottomWidth + fFlangeWidth - fRibWidth;
90 // for future release pending
91 // overlap correction - new TGeoVolume creation
93 fCrossBeamArcLength = (112.62597)/(fNumCross-1)-.001; // To account for shape of TGeoBBox
94 fCrossBottomStartRadius = fBeginRadius + fCrossBottomRadThick;
95 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 fEndRadius = fRibHeight+1.15;
100 fEndBeamRadThick = fCrossBottomRadThick+fCrossTopRadThick;
101 fEndBeamBeginRadius = fBeginRadius + fEndBeamRadThick;
104 //_____________________________________________________________________________
105 AliEMCALSpaceFrame::AliEMCALSpaceFrame(const AliEMCALSpaceFrame &frame)
106 : TNamed(frame.GetName(),frame.GetTitle()),
107 fNumCross(frame.fNumCross),
108 fNumSubSets(frame.fNumSubSets),
109 fTotalHalfWidth(frame.fTotalHalfWidth),
110 fBeginPhi(frame.fBeginPhi),
111 fEndPhi(frame.fEndPhi),
112 fTotalPhi(frame.fTotalPhi),
113 fBeginRadius(frame.fBeginRadius),
114 fHalfFrameTrans(frame.fHalfFrameTrans),
115 fFlangeHeight(frame.fFlangeHeight),
116 fFlangeWidth(frame.fFlangeWidth),
117 fRibHeight(frame.fRibHeight),
118 fRibWidth(frame.fRibWidth),
119 fCrossBottomWidth(frame.fCrossBottomWidth),
120 fCrossTopWidth(frame.fCrossTopWidth),
121 fCrossBottomHeight(frame.fCrossBottomHeight),
122 fCrossBottomRadThick(frame.fCrossBottomRadThick),
123 fCrossBeamArcLength(frame.fCrossBeamArcLength),
124 fCrossBottomStartRadius(frame.fCrossBottomStartRadius),
125 fCrossTopHeight(frame.fCrossTopHeight),
126 fCrossTopRadThick(frame.fCrossTopRadThick),
127 fCrossTopStart(frame.fCrossTopStart),
128 fEndRadius(frame.fEndRadius),
129 fEndBeamRadThick(frame.fEndBeamRadThick),
130 fEndBeamBeginRadius(frame.fEndBeamBeginRadius)
132 // copy constructor for EMCAL Space Frame
136 //_____________________________________________________________________________
137 void AliEMCALSpaceFrame::CreateGeometry()
139 AliDebug(1,"Create CalFrame Geometry");
140 //////////////////////////////////////Setup/////////////////////////////////////////
141 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
142 TGeoMedium *steel = gGeoManager->GetMedium("EMCAL_S steel$");
143 TGeoMedium *air = gGeoManager->GetMedium("EMCAL_Air$");
146 //////////////////////////////////// Volumes ///////////////////////////////////////
147 TGeoVolume *calFrameMO =
148 gGeoManager->MakeTubs("CalFrame", air, fBeginRadius-2.1,fEndRadius,
149 fTotalHalfWidth*3,fBeginPhi-3,fEndPhi+3); // Mother Volume
151 calFrameMO->SetVisibility(kFALSE);
153 // Half Frame Mother Volume
154 TGeoVolume *calHalfFrameMO =
155 gGeoManager->MakeTubs("HalfFrame", air, fBeginRadius-2,fEndRadius,
156 fTotalHalfWidth,fBeginPhi-2.9,fEndPhi+2.9);
158 calHalfFrameMO->SetVisibility(kFALSE);
160 TGeoVolume *endBeams =
161 gGeoManager->MakeBox("End Beams", steel, fEndBeamRadThick, fCrossTopHeight, fTotalHalfWidth); // End Beams
164 gGeoManager->MakeTubs("skin", steel, fRibHeight+0.15, fEndRadius,
165 fTotalHalfWidth, fBeginPhi, fEndPhi);// back frame
167 TGeoVolume *flangeVolume =
168 gGeoManager->MakeTubs("supportBottom", steel, fBeginRadius, fFlangeHeight,
169 fFlangeWidth, fBeginPhi, fEndPhi); // FlangeVolume Beams
171 TGeoVolume *ribVolume =
172 gGeoManager->MakeTubs("RibVolume", steel, fFlangeHeight, fRibHeight, fRibWidth, fBeginPhi, fEndPhi);
174 TGeoVolume *subSetCross =
175 gGeoManager->MakeTubs("subSetCross", air, fBeginRadius-1, fBeginRadius+2*fCrossBottomRadThick+
176 2*fCrossTopRadThick+0.15, fCrossBottomWidth, fBeginPhi, fEndPhi); // Cross Beam Containers
177 subSetCross->SetVisibility(kFALSE);
178 /* // Obsolete for now
179 TGeoVolume *subSetCrossTop =
180 gGeoManager->MakeTubs("SubSetCrossTop", air, fBeginRadius+2*fCrossBottomRadThick-1, fBeginRadius+2*fCrossBottomRadThick+
181 2*fCrossTopRadThick+1, fCrossTopWidth, fBeginPhi, fEndPhi); // Cross
182 subSetCrossTop->SetVisibility(kFALSE);
184 TGeoVolume *crossBottomBeams =
185 gGeoManager->MakeBox("crossBottom", steel, fCrossBottomRadThick, fCrossBottomHeight, fCrossBottomWidth); // Cross Beams
187 TGeoVolume *crossTopBeams =
188 gGeoManager->MakeBox("crossTop", steel, fCrossTopRadThick, fCrossTopHeight, fCrossTopWidth); // Cross Beams
190 TGeoTranslation *trTEST = new TGeoTranslation();
191 TGeoRotation *rotTEST = new TGeoRotation();
193 Double_t conv = TMath::Pi()/180.;
194 Double_t radAngle = 0;
195 Double_t endBeamParam=.4;
196 //cout<<"\nfCrossBottomStartRadius: "<<fCrossBottomStartRadius<<"\n";
198 for(Int_t i = 0; i < fNumCross; i++){
200 Double_t loopPhi = fBeginPhi + 1.8;
202 // Cross Bottom Beams
204 radAngle = (loopPhi + i*fCrossBeamArcLength)*conv;
206 rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
207 trTEST->SetTranslation(cos(radAngle)*fCrossBottomStartRadius, sin(radAngle)*fCrossBottomStartRadius,0);
209 TGeoCombiTrans *combo = new TGeoCombiTrans(*trTEST, *rotTEST); // TGeoTranslation &tr, const TGeoRotation &rot);
210 combo->RegisterYourself();
211 crossBottomBeams->SetVisibility(1);
212 subSetCross->AddNode(crossBottomBeams, i+1, combo);
213 if (i != 0 && i!=fNumCross-1){
214 // Cross Bottom Beams
215 rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
216 trTEST->SetTranslation(cos(radAngle)*fCrossTopStart, sin(radAngle)*fCrossTopStart,0);
217 crossTopBeams->SetVisibility(1);
218 subSetCross->AddNode(crossTopBeams, i+1, new TGeoCombiTrans(*trTEST, *rotTEST));
223 rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
224 trTEST->SetTranslation(cos((77-endBeamParam)*conv)*(fEndBeamBeginRadius), sin((77-endBeamParam)*conv)*(fEndBeamBeginRadius),0);
225 endBeams->SetVisibility(1);
226 calHalfFrameMO->AddNode(endBeams, 1, new TGeoCombiTrans(*trTEST, *rotTEST));
229 rotTEST->SetAngles(193.03, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
230 trTEST->SetTranslation(cos((193.03+endBeamParam)*conv)*(fEndBeamBeginRadius)/*more duct tape*/, sin((193.03+endBeamParam)*conv)*(fEndBeamBeginRadius),0);
231 endBeams->SetVisibility(1);
232 calHalfFrameMO->AddNode(endBeams, 2, new TGeoCombiTrans(*trTEST, *rotTEST));
240 TGeoTranslation *origin1 = new TGeoTranslation(0,0,0); // Equivalent to gGeoIdentity
241 TGeoTranslation *origin2 = new TGeoTranslation(0,0,2*(fCrossBottomWidth+fFlangeWidth));
242 TGeoTranslation *origin3 = new TGeoTranslation(0,0,-2*(fCrossBottomWidth+fFlangeWidth));
244 // FlangeVolume translations
245 TGeoTranslation *str1 = new TGeoTranslation(0,0,-3*(fCrossBottomWidth+fFlangeWidth));
246 TGeoTranslation *str2 = new TGeoTranslation(0,0,-(fCrossBottomWidth+fFlangeWidth));
247 TGeoTranslation *str3 = new TGeoTranslation(0,0,(fCrossBottomWidth+fFlangeWidth));
248 TGeoTranslation *str4 = new TGeoTranslation(0,0,3*(fCrossBottomWidth+fFlangeWidth));
250 // Half Frame Translations
251 TGeoTranslation *halfTrans1 = new TGeoTranslation(0,0,fHalfFrameTrans);
252 TGeoTranslation *halfTrans2 = new TGeoTranslation(0,0,-fHalfFrameTrans);
255 calHalfFrameMO->AddNode(flangeVolume, 1, str1);
256 calHalfFrameMO->AddNode(flangeVolume, 2, str2);
257 calHalfFrameMO->AddNode(flangeVolume, 3, str3);
258 calHalfFrameMO->AddNode(flangeVolume, 4, str4);
260 calHalfFrameMO->AddNode(ribVolume, 1, str1);
261 calHalfFrameMO->AddNode(ribVolume, 2, str2);
262 calHalfFrameMO->AddNode(ribVolume, 3, str3);
263 calHalfFrameMO->AddNode(ribVolume, 4, str4);
266 calHalfFrameMO->AddNode(subSetCross, 1, origin1);
267 calHalfFrameMO->AddNode(subSetCross, 2, origin2);
268 calHalfFrameMO->AddNode(subSetCross, 3, origin3);
269 /* // Obsolete for now
270 calHalfFrameMO->AddNode(subSetCrossTop, 1, origin1);
271 calHalfFrameMO->AddNode(subSetCrossTop, 2, origin2);
272 calHalfFrameMO->AddNode(subSetCrossTop, 3, origin3);
275 calHalfFrameMO->AddNode(skin, 1, gGeoIdentity);
277 calFrameMO->AddNode(calHalfFrameMO, 1, halfTrans1);
278 calFrameMO->AddNode(calHalfFrameMO, 2, halfTrans2);
280 top->AddNode(calFrameMO,1,gGeoIdentity);
281 // cout<<"**********************************\nfEndRadius:\t"<<fEndRadius;