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"
32 ClassImp(AliEMCALSpaceFrame)
34 //_____________________________________________________________________________
35 AliEMCALSpaceFrame::AliEMCALSpaceFrame()
36 : TNamed("EMCALSpaceFrame","Steel Space Frame that supports EMCAL"),
49 fCrossBottomWidth(0.),
51 fCrossBottomHeight(0.),
52 fCrossBottomRadThick(0.),
53 fCrossBeamArcLength(0.),
54 fCrossBottomStartRadius(0.),
56 fCrossTopRadThick(0.),
60 fEndBeamBeginRadius(0)
62 // default constructor for EMCAL Space Frame
63 //initialize parameters
66 fTotalHalfWidth = 152.3; // Half Width of a Half Frame
67 // (CalFrame comes in 2 sections)
72 fHalfFrameTrans = fTotalHalfWidth+57.2/2.; // Half Frame Connector is 57.2cm wide,
73 // Supermodule is 340cm wide
74 // Sources: HALF-FRAME-CONNECTOR-27E226A.pdf
79 fCrossBottomHeight = 15.2;
80 fCrossBottomRadThick = 1.5;
81 fCrossTopHeight = 1.5;
82 fCrossTopRadThick = 35./2.;
84 fTotalPhi = fEndPhi - fBeginPhi;
85 fFlangeHeight = fBeginRadius + 3.;
86 fRibHeight = fFlangeHeight + 35;
87 fCrossBottomWidth = 0.5/(Double_t)fNumSubSets * (2.*fTotalHalfWidth - 8. * fFlangeWidth);
88 fCrossTopWidth = fCrossBottomWidth; // fCrossBottomWidth + fFlangeWidth - fRibWidth;
89 // for future release pending
90 // overlap correction - new TGeoVolume creation
92 fCrossBeamArcLength = (112.62597)/(fNumCross-1)-.001; // To account for shape of TGeoBBox
93 fCrossBottomStartRadius = fBeginRadius + fCrossBottomRadThick;
94 fCrossTopStart = fBeginRadius + 2.*fCrossBottomRadThick + fCrossTopRadThick+0.015; // 0.015 is a
95 // bubblegum and duct tape
96 // fix for an overlap problem
97 // will be worked out in future releases
98 fEndRadius = fRibHeight+1.15;
99 fEndBeamRadThick = fCrossBottomRadThick+fCrossTopRadThick;
100 fEndBeamBeginRadius = fBeginRadius + fEndBeamRadThick;
103 //_____________________________________________________________________________
104 AliEMCALSpaceFrame::AliEMCALSpaceFrame(const AliEMCALSpaceFrame &frame)
105 : TNamed(frame.GetName(),frame.GetTitle()),
106 fNumCross(frame.fNumCross),
107 fNumSubSets(frame.fNumSubSets),
108 fTotalHalfWidth(frame.fTotalHalfWidth),
109 fBeginPhi(frame.fBeginPhi),
110 fEndPhi(frame.fEndPhi),
111 fTotalPhi(frame.fTotalPhi),
112 fBeginRadius(frame.fBeginRadius),
113 fHalfFrameTrans(frame.fHalfFrameTrans),
114 fFlangeHeight(frame.fFlangeHeight),
115 fFlangeWidth(frame.fFlangeWidth),
116 fRibHeight(frame.fRibHeight),
117 fRibWidth(frame.fRibWidth),
118 fCrossBottomWidth(frame.fCrossBottomWidth),
119 fCrossTopWidth(frame.fCrossTopWidth),
120 fCrossBottomHeight(frame.fCrossBottomHeight),
121 fCrossBottomRadThick(frame.fCrossBottomRadThick),
122 fCrossBeamArcLength(frame.fCrossBeamArcLength),
123 fCrossBottomStartRadius(frame.fCrossBottomStartRadius),
124 fCrossTopHeight(frame.fCrossTopHeight),
125 fCrossTopRadThick(frame.fCrossTopRadThick),
126 fCrossTopStart(frame.fCrossTopStart),
127 fEndRadius(frame.fEndRadius),
128 fEndBeamRadThick(frame.fEndBeamRadThick),
129 fEndBeamBeginRadius(frame.fEndBeamBeginRadius)
131 // copy constructor for EMCAL Space Frame
135 //_____________________________________________________________________________
136 void AliEMCALSpaceFrame::CreateGeometry()
138 AliDebug(1,"Create CalFrame Geometry");
139 //////////////////////////////////////Setup/////////////////////////////////////////
140 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
141 TGeoMedium *steel = gGeoManager->GetMedium("EMCAL_S steel$");
142 TGeoMedium *air = gGeoManager->GetMedium("EMCAL_Air$");
145 //////////////////////////////////// Volumes ///////////////////////////////////////
146 TGeoVolume *calFrameMO =
147 gGeoManager->MakeTubs("CalFrame", air, fBeginRadius-2.1,fEndRadius,
148 fTotalHalfWidth*3,fBeginPhi-3,fEndPhi+3); // Mother Volume
150 calFrameMO->SetVisibility(kFALSE);
152 // Half Frame Mother Volume
153 TGeoVolume *calHalfFrameMO =
154 gGeoManager->MakeTubs("HalfFrame", air, fBeginRadius-2,fEndRadius,
155 fTotalHalfWidth,fBeginPhi-2.9,fEndPhi+2.9);
157 calHalfFrameMO->SetVisibility(kFALSE);
159 TGeoVolume *endBeams =
160 gGeoManager->MakeBox("End Beams", steel, fEndBeamRadThick, fCrossTopHeight, fTotalHalfWidth); // End Beams
163 gGeoManager->MakeTubs("skin", steel, fRibHeight+0.15, fEndRadius,
164 fTotalHalfWidth, fBeginPhi, fEndPhi);// back frame
166 TGeoVolume *flangeVolume =
167 gGeoManager->MakeTubs("supportBottom", steel, fBeginRadius, fFlangeHeight,
168 fFlangeWidth, fBeginPhi, fEndPhi); // FlangeVolume Beams
170 TGeoVolume *ribVolume =
171 gGeoManager->MakeTubs("RibVolume", steel, fFlangeHeight, fRibHeight, fRibWidth, fBeginPhi, fEndPhi);
173 TGeoVolume *subSetCross =
174 gGeoManager->MakeTubs("subSetCross", air, fBeginRadius-1, fBeginRadius+2*fCrossBottomRadThick+
175 2*fCrossTopRadThick+0.15, fCrossBottomWidth, fBeginPhi, fEndPhi); // Cross Beam Containers
176 subSetCross->SetVisibility(kFALSE);
177 /* // Obsolete for now
178 TGeoVolume *subSetCrossTop =
179 gGeoManager->MakeTubs("SubSetCrossTop", air, fBeginRadius+2*fCrossBottomRadThick-1, fBeginRadius+2*fCrossBottomRadThick+
180 2*fCrossTopRadThick+1, fCrossTopWidth, fBeginPhi, fEndPhi); // Cross
181 subSetCrossTop->SetVisibility(kFALSE);
183 TGeoVolume *crossBottomBeams =
184 gGeoManager->MakeBox("crossBottom", steel, fCrossBottomRadThick, fCrossBottomHeight, fCrossBottomWidth); // Cross Beams
186 TGeoVolume *crossTopBeams =
187 gGeoManager->MakeBox("crossTop", steel, fCrossTopRadThick, fCrossTopHeight, fCrossTopWidth); // Cross Beams
189 TGeoTranslation *trTEST = new TGeoTranslation();
190 TGeoRotation *rotTEST = new TGeoRotation();
192 Double_t conv = TMath::Pi()/180.;
193 Double_t radAngle = 0;
194 Double_t endBeamParam=.4;
195 //cout<<"\nfCrossBottomStartRadius: "<<fCrossBottomStartRadius<<"\n";
197 for(Int_t i = 0; i < fNumCross; i++){
199 Double_t loopPhi = fBeginPhi + 1.8;
201 // Cross Bottom Beams
203 radAngle = (loopPhi + i*fCrossBeamArcLength)*conv;
205 rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
206 trTEST->SetTranslation(cos(radAngle)*fCrossBottomStartRadius, sin(radAngle)*fCrossBottomStartRadius,0);
208 TGeoCombiTrans *combo = new TGeoCombiTrans(*trTEST, *rotTEST); // TGeoTranslation &tr, const TGeoRotation &rot);
209 combo->RegisterYourself();
210 crossBottomBeams->SetVisibility(1);
211 subSetCross->AddNode(crossBottomBeams, i+1, combo);
212 if (i != 0 && i!=fNumCross-1){
213 // Cross Bottom Beams
214 rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
215 trTEST->SetTranslation(cos(radAngle)*fCrossTopStart, sin(radAngle)*fCrossTopStart,0);
216 crossTopBeams->SetVisibility(1);
217 subSetCross->AddNode(crossTopBeams, i+1, new TGeoCombiTrans(*trTEST, *rotTEST));
222 rotTEST->SetAngles(fBeginPhi + i*fCrossBeamArcLength, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
223 trTEST->SetTranslation(cos((77-endBeamParam)*conv)*(fEndBeamBeginRadius), sin((77-endBeamParam)*conv)*(fEndBeamBeginRadius),0);
224 endBeams->SetVisibility(1);
225 calHalfFrameMO->AddNode(endBeams, 1, new TGeoCombiTrans(*trTEST, *rotTEST));
228 rotTEST->SetAngles(193.03, 0, 0); // SetTranslation(Double_t dx, Double_t dy, Double_t dz);
229 trTEST->SetTranslation(cos((193.03+endBeamParam)*conv)*(fEndBeamBeginRadius)/*more duct tape*/, sin((193.03+endBeamParam)*conv)*(fEndBeamBeginRadius),0);
230 endBeams->SetVisibility(1);
231 calHalfFrameMO->AddNode(endBeams, 2, new TGeoCombiTrans(*trTEST, *rotTEST));
239 TGeoTranslation *origin1 = new TGeoTranslation(0,0,0); // Equivalent to gGeoIdentity
240 TGeoTranslation *origin2 = new TGeoTranslation(0,0,2*(fCrossBottomWidth+fFlangeWidth));
241 TGeoTranslation *origin3 = new TGeoTranslation(0,0,-2*(fCrossBottomWidth+fFlangeWidth));
243 // FlangeVolume translations
244 TGeoTranslation *str1 = new TGeoTranslation(0,0,-3*(fCrossBottomWidth+fFlangeWidth));
245 TGeoTranslation *str2 = new TGeoTranslation(0,0,-(fCrossBottomWidth+fFlangeWidth));
246 TGeoTranslation *str3 = new TGeoTranslation(0,0,(fCrossBottomWidth+fFlangeWidth));
247 TGeoTranslation *str4 = new TGeoTranslation(0,0,3*(fCrossBottomWidth+fFlangeWidth));
249 // Half Frame Translations
250 TGeoTranslation *halfTrans1 = new TGeoTranslation(0,0,fHalfFrameTrans);
251 TGeoTranslation *halfTrans2 = new TGeoTranslation(0,0,-fHalfFrameTrans);
254 calHalfFrameMO->AddNode(flangeVolume, 1, str1);
255 calHalfFrameMO->AddNode(flangeVolume, 2, str2);
256 calHalfFrameMO->AddNode(flangeVolume, 3, str3);
257 calHalfFrameMO->AddNode(flangeVolume, 4, str4);
259 calHalfFrameMO->AddNode(ribVolume, 1, str1);
260 calHalfFrameMO->AddNode(ribVolume, 2, str2);
261 calHalfFrameMO->AddNode(ribVolume, 3, str3);
262 calHalfFrameMO->AddNode(ribVolume, 4, str4);
265 calHalfFrameMO->AddNode(subSetCross, 1, origin1);
266 calHalfFrameMO->AddNode(subSetCross, 2, origin2);
267 calHalfFrameMO->AddNode(subSetCross, 3, origin3);
268 /* // Obsolete for now
269 calHalfFrameMO->AddNode(subSetCrossTop, 1, origin1);
270 calHalfFrameMO->AddNode(subSetCrossTop, 2, origin2);
271 calHalfFrameMO->AddNode(subSetCrossTop, 3, origin3);
274 calHalfFrameMO->AddNode(skin, 1, gGeoIdentity);
276 calFrameMO->AddNode(calHalfFrameMO, 1, halfTrans1);
277 calFrameMO->AddNode(calHalfFrameMO, 2, halfTrans2);
279 top->AddNode(calFrameMO,1,gGeoIdentity);
280 // cout<<"**********************************\nfEndRadius:\t"<<fEndRadius;