31 #include "GeoModelKernel/GeoElement.h"
32 #include "GeoModelKernel/GeoMaterial.h"
33 #include "GeoModelKernel/GeoFullPhysVol.h"
34 #include "GeoModelKernel/GeoPhysVol.h"
35 #include "GeoModelKernel/GeoVPhysVol.h"
36 #include "GeoModelKernel/GeoLogVol.h"
37 #include "GeoModelKernel/GeoPcon.h"
38 #include "GeoModelKernel/GeoTubs.h"
39 #include "GeoModelKernel/GeoNameTag.h"
40 #include "GeoModelKernel/GeoTransform.h"
41 #include "GeoModelKernel/GeoAlignableTransform.h"
42 #include "GeoModelKernel/GeoIdentifierTag.h"
43 #include "GeoModelKernel/GeoSerialTransformer.h"
44 #include "GeoModelKernel/GeoSerialIdentifier.h"
45 #include "GeoModelKernel/GeoXF.h"
46 #include "GeoModelKernel/GeoDefinitions.h"
47 #include "GeoGenericFunctions/Variable.h"
52 #include "GaudiKernel/MsgStream.h"
53 #include "GaudiKernel/Bootstrap.h"
54 #include "GaudiKernel/SystemOfUnits.h"
72 using GeoTrf::Translate3D;
90 m_posZSide = posZSide;
92 if(m_physiHEC)
return m_physiHEC->clone();
96 ISvcLocator *svcLocator = Gaudi::svcLocator();
109 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
110 throw std::runtime_error(
"Error in HEC2WheelConstruction, cannot access DetectorStore");
114 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS"))) {
115 throw std::runtime_error(
"Error in HEC2WheelConstruction, cannot access Material Manager");
120 sc=svcLocator->service(
"RDBAccessSvc",pAccessSvc);
121 if (
sc != StatusCode::SUCCESS) {
122 throw std::runtime_error (
"Cannot locate RDBAccessSvc!!");
126 sc = svcLocator->service (
"GeoModelSvc",geoModel);
127 if (
sc != StatusCode::SUCCESS) {
128 throw std::runtime_error (
"Cannot locate GeoModelSvc!!");
133 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
134 std::string detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
137 if(hadronicEndcap->size()>0)
138 log <<
MSG::ALWAYS <<
"Using numbers from HadronicEndcap tag: " << hadronicEndcap->tagName() <<
endmsg;
140 throw std::runtime_error(
"Error in HECConstruction: hadronicEendcap not found");
143 if(hecLongitudinalBlock->size()>0)
144 log <<
MSG::ALWAYS <<
"Using numbers from HecLongitudinalBlock tag: " << hecLongitudinalBlock->tagName() <<
endmsg;
146 throw std::runtime_error(
"Error in HECConstruction: hecLongitudinalBlock not found");
149 if (larPosition->size()==0 ) {
150 larPosition = pAccessSvc->
getRecordsetPtr(
"LArPosition",
"LArPosition-00");
151 if (larPosition->size()==0 ) {
152 throw std::runtime_error(
"Error, no lar position table in database!");
157 double shrinkCold = 1.0 ;
159 double rInner1 = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMN")*
cm;
160 double rInner2 = shrinkCold * (*hecLongitudinalBlock)[1]->getDouble(
"BLRMN")*
cm;
161 double rOuter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMX")*
cm;
162 double wheelGap = shrinkCold * (*hadronicEndcap)[0]->getDouble(
"GAPWHL")*
cm;
165 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
166 if (!
LAr)
throw std::runtime_error(
"Error in HEC2WheelConstruction, std::LiquidArgon is not found.");
169 const GeoLogVol* logicHEC;
170 GeoIntrusivePtr<GeoFullPhysVol> physiHEC;
176 if (rOuter<2100.*
mm) rOuter = shrinkCold *2130*
mm;
179 double HEC1length = shrinkCold * 816.5*
mm;
180 double HEC2length = shrinkCold * 961.0*
mm;
181 double TotalWarmHEC = HEC1length + wheelGap + HEC2length ;
182 double TotalHECLength = TotalWarmHEC;
184 double zCoordinate[4];
185 zCoordinate[0]=shrinkCold * 0.0*
cm;
186 zCoordinate[1]=shrinkCold * 28.05*
cm;
187 zCoordinate[2]=shrinkCold * 28.051*
cm;
188 zCoordinate[3]=shrinkCold * (181.9*
cm+4.0*
mm);
191 solidHEC =
new GeoPcon(0., 2.*
M_PI);
192 for (
int i=0;
i< 4;
i++)
194 if (
i<2) solidHEC->addPlane(zCoordinate[
i],rInner1 - shrinkCold*1.*
mm,rOuter);
195 else solidHEC->addPlane(zCoordinate[
i],rInner2 - shrinkCold*1.*
mm,rOuter);
198 std::string hecName =
"LAr::HEC::Mother";
199 logicHEC =
new GeoLogVol(hecName, solidHEC ,
LAr);
200 physiHEC =
new GeoFullPhysVol(logicHEC);
206 GeoAlignableTransform *xfHec1 =
new GeoAlignableTransform(xfPosHec1);
208 std::string
tag1 = m_posZSide? std::string(
"HEC1_POS") : std::string(
"HEC1_NEG");
211 GeoIntrusivePtr<GeoFullPhysVol> EnvelopeF = theFrontHEC.
GetEnvelope();
215 if(!
sc.isSuccess())
throw std::runtime_error ((std::string(
"Cannot store")+
tag1).c_str());
219 if(!
sc.isSuccess())
throw std::runtime_error ((std::string(
"Cannot store")+
tag1).c_str());
221 physiHEC->add(xfHec1);
222 physiHEC->add(
new GeoIdentifierTag(0));
223 physiHEC->add(EnvelopeF);
227 double Zpos = TotalHECLength - HEC2length ;
232 GeoAlignableTransform *xfHec2 =
new GeoAlignableTransform(xfPosHec2);
234 std::string
tag2 = m_posZSide? std::string(
"HEC2_POS") : std::string(
"HEC2_NEG");
237 GeoIntrusivePtr<GeoFullPhysVol> EnvelopeR = theRearHEC.
GetEnvelope();
241 if(!
sc.isSuccess())
throw std::runtime_error ((std::string(
"Cannot store")+
tag2).c_str());
245 if(!
sc.isSuccess())
throw std::runtime_error ((std::string(
"Cannot store")+
tag2).c_str());
247 physiHEC->add(xfHec2);
248 physiHEC->add(
new GeoIdentifierTag(1));
249 physiHEC->add(EnvelopeR);