79 ISvcLocator *svcLocator = Gaudi::svcLocator();
83 log <<
MSG::DEBUG <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" <<
endmsg;
87 log <<
MSG::DEBUG <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" <<
endmsg;
91 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
92 throw std::runtime_error(
"Error in HECWheelConstruction, cannot access DetectorStore");
97 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS"))) {
98 throw std::runtime_error(
"Error in HECWheelConstruction, cannot access Material Manager");
101 const GeoMaterial *
LAr = materialManager->
getMaterial(
"std::LiquidArgon");
102 if (!
LAr)
throw std::runtime_error(
"Error in HECWheelConstruction, std::LiquidArgon is not found.");
104 const GeoMaterial *Iron = materialManager->
getMaterial(
"std::Iron");
105 if (!Iron)
throw std::runtime_error(
"Error in HECWheelConstruction, std::Iron is not found.");
111 sc=svcLocator->service(
"RDBAccessSvc",pAccessSvc);
112 if (
sc != StatusCode::SUCCESS) {
113 throw std::runtime_error (
"Cannot locate RDBAccessSvc!!");
118 sc = svcLocator->service (
"GeoModelSvc",geoModel);
119 if (
sc != StatusCode::SUCCESS) {
120 throw std::runtime_error (
"Cannot locate GeoModelSvc!!");
126 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
127 std::string detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
130 if(hadronicEndcap->size()>0)
131 log <<
MSG::DEBUG <<
"Using numbers from HadronicEndcap tag: " << hadronicEndcap->tagName() <<
endmsg;
133 throw std::runtime_error(
"Error in HECConstruction: hadronicEendcap not found");
136 if(hecLongitudinalBlock->size()>0)
137 log <<
MSG::DEBUG <<
"Using numbers from HecLongitudinalBlock tag: " << hecLongitudinalBlock->tagName() <<
endmsg;
139 throw std::runtime_error(
"Error in HECConstruction: hecLongitudinalBlock not found");
142 if(coldContraction->size()>0)
143 log <<
MSG::DEBUG <<
"Numbers from ColdContraction db (not used yet) tag: " << coldContraction->tagName() <<
endmsg;
145 throw std::runtime_error(
"Error in HECConstruction: ColdContraction not found");
155 double shrinkCold = 1.0;
157 int moduleNumber = (*hadronicEndcap)[0]->getInt(
"NSCT");
158 double drModOverlap = shrinkCold * (*hadronicEndcap)[0]->getDouble(
"DRMODOVERLAP")*
cm;
159 double rOuter = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMX")*
cm;
160 if (rOuter<2100.*
mm) rOuter = shrinkCold * 2130*
mm;
162 double rInner1 = shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"BLRMN")*
cm;
163 double rInner2 = shrinkCold * (*hecLongitudinalBlock)[1]->getDouble(
"BLRMN")*
cm;
164 double firstFrontAbsThickness= shrinkCold * (*hecLongitudinalBlock)[0]->getDouble(
"PLATE0")*
cm;
165 double firstRearAbsThickness = shrinkCold * (*hecLongitudinalBlock)[3]->getDouble(
"PLATE0")*
cm;
166 double frontAbsThickness = shrinkCold * (*hadronicEndcap)[0]->getDouble(
"PLATE_0")*
cm;
167 double rearAbsThickness = shrinkCold * (*hadronicEndcap)[0]->getDouble(
"PLATE_1")*
cm;
168 double gapSize = shrinkCold * (*hadronicEndcap)[0]->getDouble(
"LARG")*
cm;
170 for (
int id=0;
id<7;
id++) gapNumber[
id] = (
int) (*hecLongitudinalBlock)[
id]->getDouble(
"BLMOD");
175 depthSize[0] = firstFrontAbsThickness + gapNumber[0]*(frontAbsThickness+gapSize);
176 depthSize[1] = gapNumber[1]*(frontAbsThickness+gapSize);
177 depthSize[2] = gapNumber[2]*(frontAbsThickness+gapSize);
178 depthSize[3] = firstRearAbsThickness + gapNumber[3]*(rearAbsThickness+gapSize);
179 depthSize[4] = gapNumber[4]*(rearAbsThickness+gapSize);
180 depthSize[5] = gapNumber[5]*(rearAbsThickness+gapSize);
181 depthSize[6] = gapNumber[6]*(rearAbsThickness+gapSize);
185 double g4allow = shrinkCold * 0.2*
mm;
186 double zCoordinate[4];
188 zCoordinate[0] = shrinkCold * 0.0*
cm;
189 zCoordinate[1] = depthSize[0];
190 zCoordinate[2] = depthSize[0] + g4allow;
191 zCoordinate[3] = depthSize[0] + depthSize[1] + depthSize[2] + g4allow;
194 zCoordinate[0] = shrinkCold * 0.0*
cm;
195 zCoordinate[1] = depthSize[3] + depthSize[4] + depthSize[5] + depthSize[6] + g4allow;
203 double modulePhistart = 264.375*
deg;
204 double moduleDeltaPhi = 2*
M_PI/moduleNumber;
214 GeoPcon* solidHECWheel =
new GeoPcon(0., 2.*
M_PI);
215 for (
int i=0;
i< nZplane;
i++)
217 double innerRadius = rInner2;
219 solidHECWheel->addPlane(zCoordinate[
i],innerRadius-drModOverlap,rOuter);
221 std::string hecFrontName =
"LAr::HEC::LiquidArgon";
222 const GeoLogVol* logicHECWheel =
new GeoLogVol(hecFrontName, solidHECWheel ,
LAr);
223 GeoIntrusivePtr<GeoFullPhysVol> physiHECWheel{
new GeoFullPhysVol(logicHECWheel)};
234 PVLink moduleEnvelope = HECModule.GetEnvelope();
242 GeoSerialIdentifier *sIF =
new GeoSerialIdentifier(0);
243 GeoGenfun::Variable
Index;
246 GeoGenfun::GENFUNCTION ModuleRotationAngle = -modulePhistart + moduleDeltaPhi*
Index;
247 GeoXF::TRANSFUNCTION
t = GeoXF::Pow(RotateZ3D(1.0),ModuleRotationAngle);
248 GeoSerialTransformer *sTF =
new GeoSerialTransformer (moduleEnvelope,&
t,moduleNumber);
249 physiHECWheel->add(sIF);
250 physiHECWheel->add(sTF);
253 GeoGenfun::GENFUNCTION ModuleRotationAngle1 = -modulePhistart+180*
deg-moduleDeltaPhi - moduleDeltaPhi*
Index;
254 GeoXF::TRANSFUNCTION
t1 = GeoXF::Pow(RotateZ3D(1.0),ModuleRotationAngle1);
255 GeoSerialTransformer *sTF1 =
new GeoSerialTransformer (moduleEnvelope,&
t1,moduleNumber);
256 physiHECWheel->add(sIF);
257 physiHECWheel->add(sTF1);
265 HECClamp.AddClamps(physiHECWheel);
268 return physiHECWheel;