19 #include "GeoModelKernel/GeoElement.h"
20 #include "GeoModelKernel/GeoMaterial.h"
21 #include "GeoModelKernel/GeoFullPhysVol.h"
22 #include "GeoModelKernel/GeoPhysVol.h"
23 #include "GeoModelKernel/GeoVPhysVol.h"
24 #include "GeoModelKernel/GeoLogVol.h"
25 #include "GeoModelKernel/GeoPcon.h"
26 #include "GeoModelKernel/GeoTubs.h"
27 #include "GeoModelKernel/GeoNameTag.h"
28 #include "GeoModelKernel/GeoTransform.h"
29 #include "GeoModelKernel/GeoAlignableTransform.h"
30 #include "GeoModelKernel/GeoIdentifierTag.h"
31 #include "GeoModelKernel/GeoSerialTransformer.h"
32 #include "GeoModelKernel/GeoSerialIdentifier.h"
33 #include "GeoModelKernel/GeoXF.h"
34 #include "GeoModelKernel/GeoDefinitions.h"
35 #include "GeoGenericFunctions/Variable.h"
38 #include "GaudiKernel/MsgStream.h"
39 #include "GaudiKernel/Bootstrap.h"
40 #include "GaudiKernel/SystemOfUnits.h"
56 using GeoTrf::RotateZ3D;
57 using GeoTrf::Translate3D;
58 using GeoTrf::TranslateZ3D;
82 ISvcLocator *svcLocator = Gaudi::svcLocator();
89 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
90 throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), cannot access DetectorStore");
96 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS"))) {
97 throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), cannot access Material Manager");
99 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
100 if (!
LAr)
throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), std::LiquidArgon is not found.");
101 const GeoMaterial *Iron = materialManager->
getMaterial(
"std::Iron");
102 if (!Iron)
throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), std::Iron is not found.");
107 sc=svcLocator->service(
"RDBAccessSvc",pAccessSvc);
108 if (
sc != StatusCode::SUCCESS) {
109 throw std::runtime_error (
"Cannot locate RDBAccessSvc!!");
113 sc = svcLocator->service (
"GeoModelSvc",geoModel);
114 if (
sc != StatusCode::SUCCESS) {
115 throw std::runtime_error (
"Cannot locate GeoModelSvc!!");
121 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
122 std::string detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
141 double shrinkCold = 1.0;
143 int moduleNumber = (*hadronicEndcap)[0]->getInt(
"NSCT");
144 double moduleRouter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMX")*
cm;
145 double modulePhistart = 264.375*
deg;
146 double rOuter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMX")*
cm;
147 double moduleDeltaPhi = 2*
M_PI/moduleNumber;
148 m_moduleNumber = moduleNumber;
149 m_moduleRouter = moduleRouter;
150 m_modulePhistart= modulePhistart;
152 m_moduleDeltaPhi= moduleDeltaPhi ;
154 std::string clampName =
"LAr::HEC::Clamp";
155 std::string larName =
"LAr::HEC::Clamp::LiquidArgon";
156 double g4allow = 0.01 *
mm;
157 double extThick = shrinkCold * 37.*
mm;
158 double extLength = shrinkCold * 84.*
mm;
159 double clampWidth = shrinkCold * 147.0 *
mm;
160 double clampThick = shrinkCold * 50.*
mm;
161 double notchLevel = shrinkCold * 25.*
mm;
162 double notchHeight = shrinkCold * 15.*
mm;
164 double notchWidth = shrinkCold * 20.*
mm;
165 double slotWidth = shrinkCold * 20.*
mm;
166 double clampLength = shrinkCold * 815.*
mm;
167 double clampAngle = 2.* asin(clampWidth/(2.*(moduleRouter+clampThick/2.)));
168 double slotAngle = 2.* asin(notchWidth/(2.*(moduleRouter+clampThick/2.)));
170 std::vector<double> notchLocation;
176 notchLocation.push_back(shrinkCold * 200.*
mm);
177 notchLocation.push_back(shrinkCold * 468.*
mm);
178 notchLocation.push_back(shrinkCold * 736.*
mm);
184 notchLocation.push_back(shrinkCold * 201.*
mm);
185 notchLocation.push_back(shrinkCold * 469.*
mm);
186 notchLocation.push_back(shrinkCold * 737.*
mm);
187 clampWidth = shrinkCold * 148.5 *
mm;
188 clampThick = shrinkCold * 98.*
mm;
189 clampLength = shrinkCold * 815.*
mm;
196 notchLocation.push_back(shrinkCold * 363.0*
mm);
197 notchLocation.push_back(shrinkCold * 831.0*
mm);
198 clampLength = shrinkCold * 960.*
mm;
203 notchLocation.push_back(shrinkCold * 364.*
mm);
204 notchLocation.push_back(shrinkCold * 832.*
mm);
205 clampWidth = shrinkCold * 148.5 *
mm;
206 clampThick = shrinkCold * 98.*
mm;
207 clampLength = shrinkCold * 960.*
mm;
208 extLength = shrinkCold * 132.*
mm;
210 notchWidth = shrinkCold * 16.*
mm;
211 notchHeight = shrinkCold * 16.*
mm;
212 notchLevel = shrinkCold * 0.*
mm;
220 std::array<GeoIntrusivePtr<GeoTubs>, 3> clampExt;
221 std::array<GeoIntrusivePtr<GeoLogVol>, 3> logExt;
222 std::array<GeoIntrusivePtr<GeoPhysVol>, 3> physExt;
224 GeoIntrusivePtr<GeoTubs> Notch{
new GeoTubs(moduleRouter+notchLevel+g4allow, moduleRouter+notchLevel+notchHeight-g4allow,
226 modulePhistart-(clampAngle/2.) , clampAngle)};
227 GeoIntrusivePtr<GeoLogVol> logNotch {
new GeoLogVol(larName, Notch,
LAr)};
228 GeoIntrusivePtr<GeoPhysVol> physiNotch{
new GeoPhysVol(logNotch)};
230 GeoIntrusivePtr<GeoTubs> Slot {
new GeoTubs(moduleRouter+g4allow, moduleRouter+notchLevel-g4allow, slotWidth/2. ,
231 modulePhistart-(slotAngle/2.) , slotAngle)};
232 GeoIntrusivePtr<GeoLogVol> logSlot{
new GeoLogVol(larName, Slot,
LAr)};
233 GeoIntrusivePtr<GeoPhysVol> physiSlot{
new GeoPhysVol(logSlot)};
237 GeoIntrusivePtr<GeoTubs> clampBar{};
238 GeoIntrusivePtr<GeoLogVol> logClamp{};
239 GeoIntrusivePtr<GeoPhysVol> physClamp{};
242 clampBar =
new GeoTubs(moduleRouter, moduleRouter+clampThick, clampLength/2. ,
243 modulePhistart-(clampAngle/2.) , clampAngle);
244 logClamp =
new GeoLogVol(clampName, clampBar, Iron);
245 physClamp=
new GeoPhysVol(logClamp);
251 clampBar =
new GeoTubs(moduleRouter, moduleRouter+clampThick, clampLength/2. ,
252 modulePhistart-(clampAngle/2.) , clampAngle);
253 logClamp =
new GeoLogVol(larName, clampBar,
LAr);
254 physClamp=
new GeoPhysVol(logClamp);
257 clampExt[0] =
new GeoTubs(moduleRouter+g4allow, moduleRouter+clampThick-extThick,
258 clampLength/2. , modulePhistart-(clampAngle/2.), clampAngle);
259 clampExt[1] =
new GeoTubs(moduleRouter+clampThick-extThick+g4allow, moduleRouter+clampThick-g4allow,
260 clampLength/2. , modulePhistart, clampAngle/2.);
261 clampExt[2] =
new GeoTubs(moduleRouter+clampThick-extThick+g4allow, moduleRouter+clampThick-g4allow,
262 extLength/2. , modulePhistart, clampAngle/2.);
267 for (
int iext=0; iext<3; iext++){
269 logExt[iext] =
new GeoLogVol(clampName, clampExt[iext], Iron);
270 physExt[iext]=
new GeoPhysVol(logExt[iext]);
274 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
276 physExt[0]->add(
new GeoIdentifierTag(
i) );
277 physExt[0]->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
278 physExt[0]->add( physiNotch );
280 physExt[0]->add(
new GeoIdentifierTag(
i) );
281 physExt[0]->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
282 physExt[0]->add( physiSlot );
288 if (iext==1 && !left) physClamp->add(
new GeoTransform(RotateZ3D(-clampAngle/2.)));
289 else if(iext==2 && left) physClamp->add(
new GeoTransform(TranslateZ3D((clampLength-extLength)/2.)
290 *RotateZ3D(-clampAngle/2.)));
291 else if(iext==2) physClamp->add(
new GeoTransform(TranslateZ3D((clampLength-extLength)/2.)
294 if (left) physClamp->add(
new GeoIdentifierTag(16) );
295 else physClamp->add(
new GeoIdentifierTag(32) );
298 physClamp->add(physExt[iext]);
306 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
309 physClamp->add(
new GeoIdentifierTag(
i) );
310 physClamp->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
311 physClamp->add( physiNotch );
317 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
320 physClamp->add(
new GeoIdentifierTag(
i) );
321 physClamp->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
322 physClamp->add( physiSlot );
340 double shrinkCold = 1.0 ;
342 std::string clampName =
"LAr::HEC::Clamp";
343 std::string larName =
"LAr::HEC::Clamp::LiquidArgon";
345 double clampLength = shrinkCold * 815.*
mm;
346 double railLength = shrinkCold * 815.*
mm;
347 double railOffset = shrinkCold * 0.*
mm;
349 clampLength = shrinkCold * 960.*
mm;
350 railLength = shrinkCold * 960.*
mm;
351 railOffset = shrinkCold * 0.*
mm;
354 GeoIntrusivePtr<GeoVPhysVol> clampingBar = GetClampingBar(
false,
false);
355 GeoIntrusivePtr<GeoVPhysVol> clampingRailR = GetClampingBar(
true,
false);
356 GeoIntrusivePtr<GeoVPhysVol> clampingRailL = GetClampingBar(
true,
true);
363 GeoIntrusivePtr<GeoTransform>
xt{
new GeoTransform(TranslateZ3D(clampLength/2.))};
364 physiHECWheel->add(
xt);
366 GeoIntrusivePtr<GeoSerialIdentifier> sIC{
new GeoSerialIdentifier(0)};
367 GeoGenfun::Variable IndexC;
371 GeoGenfun::GENFUNCTION ModuleRotationAngleC = -m_modulePhistart+m_moduleDeltaPhi + m_moduleDeltaPhi*IndexC;
372 GeoXF::TRANSFUNCTION tC = GeoXF::Pow(RotateZ3D(1.0),ModuleRotationAngleC);
373 GeoIntrusivePtr<GeoSerialTransformer> sTC{
new GeoSerialTransformer (clampingBar,&tC,((m_moduleNumber/2)-1))};
374 physiHECWheel->add(sIC);
375 physiHECWheel->add(sTC);
379 GeoGenfun::GENFUNCTION ModuleRotationAngleC = -m_modulePhistart-m_moduleDeltaPhi+180*
deg - m_moduleDeltaPhi*IndexC;
380 GeoXF::TRANSFUNCTION tC = GeoXF::Pow(RotateZ3D(1.0),ModuleRotationAngleC);
381 GeoIntrusivePtr<GeoSerialTransformer> sTC{
new GeoSerialTransformer (clampingBar,&tC,((m_moduleNumber/2)-1))};
382 physiHECWheel->add(sIC);
383 physiHECWheel->add(sTC);
387 physiHECWheel->add(
new GeoTransform(TranslateZ3D(railLength/2.-railOffset)*RotateZ3D(-m_modulePhistart-(180.*
deg))));
393 GeoSerialIdentifier *sIR =
new GeoSerialIdentifier(31);
394 physiHECWheel->add(sIR);
396 physiHECWheel->add(clampingRailL);
399 physiHECWheel->add(
xt);
400 GeoGenfun::Variable IndexC2;
404 GeoGenfun::GENFUNCTION ModuleRotationAngleC2 = -m_modulePhistart+m_moduleDeltaPhi-(180.*
deg) + m_moduleDeltaPhi*IndexC2;
405 GeoXF::TRANSFUNCTION tC2 = GeoXF::Pow(RotateZ3D(1.0),ModuleRotationAngleC2);
406 GeoIntrusivePtr<GeoSerialTransformer> sTC2{
new GeoSerialTransformer (clampingBar,&tC2,((m_moduleNumber/2)-1))};
407 physiHECWheel->add(sTC2);
411 GeoGenfun::GENFUNCTION ModuleRotationAngleC2 = -m_modulePhistart-m_moduleDeltaPhi - m_moduleDeltaPhi*IndexC2;
412 GeoXF::TRANSFUNCTION tC2 = GeoXF::Pow(RotateZ3D(1.0),ModuleRotationAngleC2);
413 GeoIntrusivePtr<GeoSerialTransformer> sTC2{
new GeoSerialTransformer (clampingBar,&tC2,((m_moduleNumber/2)-1))};
414 physiHECWheel->add(sTC2);
417 physiHECWheel->add(
new GeoTransform(TranslateZ3D(railLength/2.)*RotateZ3D(-m_modulePhistart)));
420 GeoSerialIdentifier *sIR =
new GeoSerialIdentifier(15);
421 physiHECWheel->add(sIR);
423 physiHECWheel->add(clampingRailR);