78{
79
80 ISvcLocator *svcLocator = Gaudi::svcLocator();
81
83 log << MSG::DEBUG <<
" In HECClampConstruction " <<
endmsg;
84
85
86 SmartIF<StoreGateSvc>
detStore{svcLocator->service(
"DetectorStore")};
88 throw std::runtime_error("Error in HECModuleConstruction(ClampBar), cannot access DetectorStore");
89 }
90
91
92
93 StoredMaterialManager* materialManager = nullptr;
94 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS"))) {
95 throw std::runtime_error("Error in HECModuleConstruction(ClampBar), cannot access Material Manager");
96 }
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.");
101
102
103 SmartIF<IRDBAccessSvc> pAccessSvc{svcLocator->service("RDBAccessSvc")};
104 if(!pAccessSvc.isValid()) {
105 throw std::runtime_error ("Cannot locate RDBAccessSvc!!");
106 }
107
108 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
109 if(!geoModel.isValid()) {
110 throw std::runtime_error ("Cannot locate GeoModelSvc!!");
111 }
112
114 std::string LArVersion = geoModel->LAr_VersionOverride();
115
116 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
117 std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
118
119 IRDBRecordset_ptr hecLongitudinalBlock = pAccessSvc->getRecordsetPtr(
"HecLongitudinalBlock",detectorKey, detectorNode);
120 IRDBRecordset_ptr hadronicEndcap = pAccessSvc->getRecordsetPtr(
"HadronicEndcap",detectorKey, detectorNode);
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136 double shrinkCold = 1.0;
137
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;
148
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;
158
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.)));
164
165 std::vector<double> notchLocation;
167 if (!rail){
168
169
170
171 notchLocation.push_back(shrinkCold * 200.*mm);
172 notchLocation.push_back(shrinkCold * 468.*mm);
173 notchLocation.push_back(shrinkCold * 736.*mm);
174 }
175 else {
176
177
178
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;
185 }
186 }
187 else {
188 if (!rail){
189
190
191 notchLocation.push_back(shrinkCold * 363.0*mm);
192 notchLocation.push_back(shrinkCold * 831.0*mm);
193 clampLength = shrinkCold * 960.*
mm;
194 }
195 else {
196
197
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;
204 }
205 notchWidth = shrinkCold * 16.*
mm;
206 notchHeight = shrinkCold * 16.*
mm;
207 notchLevel = shrinkCold * 0.*
mm;
208 }
209
210
211
212
213
214
215 std::array<GeoIntrusivePtr<GeoTubs>, 3> clampExt;
216 std::array<GeoIntrusivePtr<GeoLogVol>, 3> logExt;
217 std::array<GeoIntrusivePtr<GeoPhysVol>, 3> physExt;
218
219 GeoIntrusivePtr<GeoTubs> Notch{new GeoTubs(moduleRouter+notchLevel+g4allow, moduleRouter+notchLevel+notchHeight-g4allow,
220 notchWidth/2.,
221 modulePhistart-(clampAngle/2.) , clampAngle)};
222 GeoIntrusivePtr<GeoLogVol> logNotch {new GeoLogVol(larName, Notch, LAr)};
223 GeoIntrusivePtr<GeoPhysVol> physiNotch{new GeoPhysVol(logNotch)};
224
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)};
229
230
231
232 GeoIntrusivePtr<GeoTubs> clampBar{};
233 GeoIntrusivePtr<GeoLogVol> logClamp{};
234 GeoIntrusivePtr<GeoPhysVol> physClamp{};
235
236 if(!rail){
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);
241 }
242 else{
243
244
245
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);
250
251
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.);
258
259
260
261
262 for (int iext=0; iext<3; iext++){
263
264 logExt[iext] = new GeoLogVol(clampName, clampExt[iext], Iron);
265 physExt[iext]= new GeoPhysVol(logExt[iext]);
266
267
268 if (iext==0) {
269 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
270 {
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 );
278 }
279 }
280 }
281
282
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.)
287 *RotateZ3D( 0.)));
288
289 if (left) physClamp->add( new GeoIdentifierTag(16) );
290 else physClamp->add( new GeoIdentifierTag(32) );
291
292
293 physClamp->add(physExt[iext]);
294
295 }
296
297
298 }
299
300
301 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
302 {
303 if(!rail){
304 physClamp->add( new GeoIdentifierTag(i) );
305 physClamp->add( new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[i])) );
306 physClamp->add( physiNotch );
307 }
308 }
309
311 {
312 for (
unsigned int i = 0;
i < notchLocation.size();
i++ )
313 {
314 if(!rail){
315 physClamp->add( new GeoIdentifierTag(i) );
316 physClamp->add( new GeoTransform(Translate3D(0,0,-clampLength/2.+notchLocation[i])) );
317 physClamp->add( physiSlot );
318 }
319 }
320
321 }
322
323
324 return physClamp;
325}
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
virtual const GeoMaterial * getMaterial(const std::string &name)=0
IMessageSvc * getMessageSvc(bool quiet=false)