80 ISvcLocator *svcLocator = Gaudi::svcLocator();
86 SmartIF<StoreGateSvc>
detStore{svcLocator->service(
"DetectorStore")};
88 throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), cannot access DetectorStore");
94 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS"))) {
95 throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), cannot access Material Manager");
97 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
98 if (!
LAr)
throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), std::LiquidArgon is not found.");
99 const GeoMaterial *Iron = materialManager->
getMaterial(
"std::Iron");
100 if (!Iron)
throw std::runtime_error(
"Error in HECModuleConstruction(ClampBar), std::Iron is not found.");
103 SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service(
"RDBAccessSvc")};
104 if(!pAccessSvc.isValid()) {
105 throw std::runtime_error (
"Cannot locate RDBAccessSvc!!");
108 SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc")};
109 if(!geoModel.isValid()) {
110 throw std::runtime_error (
"Cannot locate GeoModelSvc!!");
114 std::string LArVersion = geoModel->LAr_VersionOverride();
116 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
117 std::string detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
119 IRDBRecordset_ptr hecLongitudinalBlock = pAccessSvc->getRecordsetPtr(
"HecLongitudinalBlock",detectorKey, detectorNode);
120 IRDBRecordset_ptr hadronicEndcap = pAccessSvc->getRecordsetPtr(
"HadronicEndcap",detectorKey, detectorNode);
136 double shrinkCold = 1.0;
138 int moduleNumber = (*hadronicEndcap)[0]->getInt(
"NSCT");
139 double moduleRouter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMX")*
cm;
140 double modulePhistart = 264.375*
deg;
141 double rOuter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMX")*
cm;
142 double moduleDeltaPhi = 2*
M_PI/moduleNumber;
149 std::string clampName =
"LAr::HEC::Clamp";
150 std::string larName =
"LAr::HEC::Clamp::LiquidArgon";
151 double g4allow = 0.01 *
mm;
152 double extThick = shrinkCold * 37.*
mm;
153 double extLength = shrinkCold * 84.*
mm;
154 double clampWidth = shrinkCold * 147.0 *
mm;
155 double clampThick = shrinkCold * 50.*
mm;
156 double notchLevel = shrinkCold * 25.*
mm;
157 double notchHeight = shrinkCold * 15.*
mm;
159 double notchWidth = shrinkCold * 20.*
mm;
160 double slotWidth = shrinkCold * 20.*
mm;
161 double clampLength = shrinkCold * 815.*
mm;
162 double clampAngle = 2.* asin(clampWidth/(2.*(moduleRouter+clampThick/2.)));
163 double slotAngle = 2.* asin(notchWidth/(2.*(moduleRouter+clampThick/2.)));
165 std::vector<double> notchLocation;
171 notchLocation.push_back(shrinkCold * 200.*
mm);
172 notchLocation.push_back(shrinkCold * 468.*
mm);
173 notchLocation.push_back(shrinkCold * 736.*
mm);
179 notchLocation.push_back(shrinkCold * 201.*
mm);
180 notchLocation.push_back(shrinkCold * 469.*
mm);
181 notchLocation.push_back(shrinkCold * 737.*
mm);
182 clampWidth = shrinkCold * 148.5 *
mm;
183 clampThick = shrinkCold * 98.*
mm;
184 clampLength = shrinkCold * 815.*
mm;
191 notchLocation.push_back(shrinkCold * 363.0*
mm);
192 notchLocation.push_back(shrinkCold * 831.0*
mm);
193 clampLength = shrinkCold * 960.*
mm;
198 notchLocation.push_back(shrinkCold * 364.*
mm);
199 notchLocation.push_back(shrinkCold * 832.*
mm);
200 clampWidth = shrinkCold * 148.5 *
mm;
201 clampThick = shrinkCold * 98.*
mm;
202 clampLength = shrinkCold * 960.*
mm;
203 extLength = shrinkCold * 132.*
mm;
205 notchWidth = shrinkCold * 16.*
mm;
206 notchHeight = shrinkCold * 16.*
mm;
207 notchLevel = shrinkCold * 0.*
mm;
215 std::array<GeoIntrusivePtr<GeoTubs>, 3> clampExt;
216 std::array<GeoIntrusivePtr<GeoLogVol>, 3> logExt;
217 std::array<GeoIntrusivePtr<GeoPhysVol>, 3> physExt;
219 GeoIntrusivePtr<GeoTubs> Notch{
new GeoTubs(moduleRouter+notchLevel+g4allow, moduleRouter+notchLevel+notchHeight-g4allow,
221 modulePhistart-(clampAngle/2.) , clampAngle)};
222 GeoIntrusivePtr<GeoLogVol> logNotch {
new GeoLogVol(larName, Notch,
LAr)};
223 GeoIntrusivePtr<GeoPhysVol> physiNotch{
new GeoPhysVol(logNotch)};
225 GeoIntrusivePtr<GeoTubs> Slot {
new GeoTubs(moduleRouter+g4allow, moduleRouter+notchLevel-g4allow, slotWidth/2. ,
226 modulePhistart-(slotAngle/2.) , slotAngle)};
227 GeoIntrusivePtr<GeoLogVol> logSlot{
new GeoLogVol(larName, Slot,
LAr)};
228 GeoIntrusivePtr<GeoPhysVol> physiSlot{
new GeoPhysVol(logSlot)};
232 GeoIntrusivePtr<GeoTubs> clampBar{};
233 GeoIntrusivePtr<GeoLogVol> logClamp{};
234 GeoIntrusivePtr<GeoPhysVol> physClamp{};
237 clampBar =
new GeoTubs(moduleRouter, moduleRouter+clampThick, clampLength/2. ,
238 modulePhistart-(clampAngle/2.) , clampAngle);
239 logClamp =
new GeoLogVol(clampName, clampBar, Iron);
240 physClamp=
new GeoPhysVol(logClamp);
246 clampBar =
new GeoTubs(moduleRouter, moduleRouter+clampThick, clampLength/2. ,
247 modulePhistart-(clampAngle/2.) , clampAngle);
248 logClamp =
new GeoLogVol(larName, clampBar,
LAr);
249 physClamp=
new GeoPhysVol(logClamp);
252 clampExt[0] =
new GeoTubs(moduleRouter+g4allow, moduleRouter+clampThick-extThick,
253 clampLength/2. , modulePhistart-(clampAngle/2.), clampAngle);
254 clampExt[1] =
new GeoTubs(moduleRouter+clampThick-extThick+g4allow, moduleRouter+clampThick-g4allow,
255 clampLength/2. , modulePhistart, clampAngle/2.);
256 clampExt[2] =
new GeoTubs(moduleRouter+clampThick-extThick+g4allow, moduleRouter+clampThick-g4allow,
257 extLength/2. , modulePhistart, clampAngle/2.);
262 for (
int iext=0; iext<3; iext++){
264 logExt[iext] =
new GeoLogVol(clampName, clampExt[iext], Iron);
265 physExt[iext]=
new GeoPhysVol(logExt[iext]);
269 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
271 physExt[0]->add(
new GeoIdentifierTag(
i) );
272 physExt[0]->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
273 physExt[0]->add( physiNotch );
275 physExt[0]->add(
new GeoIdentifierTag(
i) );
276 physExt[0]->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
277 physExt[0]->add( physiSlot );
283 if (iext==1 && !left) physClamp->add(
new GeoTransform(RotateZ3D(-clampAngle/2.)));
284 else if(iext==2 && left) physClamp->add(
new GeoTransform(TranslateZ3D((clampLength-extLength)/2.)
285 *RotateZ3D(-clampAngle/2.)));
286 else if(iext==2) physClamp->add(
new GeoTransform(TranslateZ3D((clampLength-extLength)/2.)
289 if (left) physClamp->add(
new GeoIdentifierTag(16) );
290 else physClamp->add(
new GeoIdentifierTag(32) );
293 physClamp->add(physExt[iext]);
301 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
304 physClamp->add(
new GeoIdentifierTag(
i) );
305 physClamp->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
306 physClamp->add( physiNotch );
312 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
315 physClamp->add(
new GeoIdentifierTag(
i) );
316 physClamp->add(
new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[
i])) );
317 physClamp->add( physiSlot );