14 #include "GaudiKernel/Bootstrap.h"
15 #include "GaudiKernel/ISvcLocator.h"
18 #include "CLHEP/Units/PhysicalConstants.h"
54 ISvcLocator* svcLocator = Gaudi::svcLocator();
57 StatusCode sc = svcLocator->service(
"GeoDbTagSvc",geoDbTagSvc);
58 if (
sc != StatusCode::SUCCESS) {
59 throw std::runtime_error (
"Cannot locate GeoDBTagSvc");
63 sc = svcLocator->service(geoDbTagSvc->getParamSvcName(),pAccessSvc);
64 if (
sc != StatusCode::SUCCESS) {
65 throw std::runtime_error (
"Cannot locate " + geoDbTagSvc->getParamSvcName());
68 std::string detectorKey;
69 std::string detectorNode;
71 if(geoDbTagSvc->getSqliteReader()==
nullptr) {
74 sc = svcLocator->service (
"GeoModelSvc",geoModel);
75 if (
sc != StatusCode::SUCCESS) {
76 throw std::runtime_error (
"Cannot locate GeoModelSvc");
80 std::string LArVersion = geoModel->LAr_VersionOverride();
82 detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
83 detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
86 if ( LArVersion.empty()) {
87 LArVersion=pAccessSvc->getChildTag(
"LAr",
AtlasVersion,
"ATLAS");
90 if (LArVersion ==
"LAr-00" || LArVersion ==
"LAr-01" ||
91 LArVersion ==
"LAr-Rome-Initial-00" ||
92 LArVersion ==
"LAr-H6-00" ||
93 LArVersion ==
"LAr-Commissioning-00" ||
94 LArVersion ==
"LAr-G3-00") {
96 std::cout <<
" in RALEmb: old database tag used, some values are hard coded" << std::endl;
97 std::cout <<
" Non projectivity of lead transition will not be simulated " << std::endl;
100 if (LArVersion ==
"LAr-00" || LArVersion ==
"LAr-01" || LArVersion ==
"LAr-02" ||
101 LArVersion ==
"LAr-Rome-Initial-00" ||
102 LArVersion ==
"LAr-H8-00" ||
103 LArVersion ==
"LAr-H6-00" ||
104 LArVersion ==
"LAr-Commissioning-00" ||
105 LArVersion ==
"LAr-G3-00") {
107 std::cout <<
" in RALEmb: only old sagging values available" << std::endl;
110 if (LArVersion ==
"LAr-00" || LArVersion ==
"LAr-01" || LArVersion ==
"LAr-02" ||
111 LArVersion ==
"LAr-03" || LArVersion ==
"LAr-04" ||
112 LArVersion ==
"LAr-Rome-Initial-00" ||
113 LArVersion ==
"LAr-H8-00" ||
114 LArVersion ==
"LAr-H6-00" ||
115 LArVersion ==
"LAr-Commissioning-00" ||
116 LArVersion ==
"LAr-Commissioning-01" ||
117 LArVersion ==
"LAr-G3-00" ||
118 LArVersion ==
"LAr-02-Align-00" ||
119 LArVersion ==
"LAr-02-Align-01" ||
120 LArVersion ==
"LAr-H6-2002-00" ||
121 LArVersion ==
"LAr-H6-2003-00" ||
122 LArVersion ==
"LAr-TBEC-00" ) {
128 m_c->
barrelGeometry = pAccessSvc->getRecordsetPtr(
"BarrelGeometry",detectorKey, detectorNode);
129 m_c->
barrelSagging = pAccessSvc->getRecordsetPtr(
"BarrelSagging",detectorKey, detectorNode);
131 m_c->
barrelMotherboards = pAccessSvc->getRecordsetPtr(
"BarrelMotherboards",detectorKey, detectorNode);
132 m_c->
barrelLongDiv = pAccessSvc->getRecordsetPtr(
"BarrelLongDiv",detectorKey, detectorNode);
133 m_c->
presamplerGeometry = pAccessSvc->getRecordsetPtr(
"PresamplerGeometry",detectorKey, detectorNode);
154 std::ostringstream A0STR;
156 const std::string A0 = A0STR.str();
158 if ( a_name ==
"LArEMBnoOFPhysPhiCell" )
return (*m_c->barrelGeometry)[0]->getInt(
"NCELMX");
160 if ( a_name ==
"LArEMBAbsPhiFirst" )
return (*m_c->barrelGeometry)[0]->getDouble(
"PHIFIRST");
161 if ( a_name ==
"LArEMBPhiGapWidth" )
return (*m_c->barrelGeometry)[0]->getDouble(
"PHIGAP")*
CLHEP::cm;
162 if ( a_name ==
"LArEMBPhiGapAperture" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ALFA")*
CLHEP::deg;
163 if ( a_name ==
"LArEMBMotherRmin" )
return (*m_c->barrelGeometry)[0]->getDouble(
"RMIN")*
CLHEP::cm;
164 if ( a_name ==
"LArEMBMotherRmax" )
return (*m_c->barrelGeometry)[0]->getDouble(
"RMAX")*
CLHEP::cm;
165 if ( a_name ==
"LArEMBFiducialRmax" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ROUT_AC")*
CLHEP::cm;
166 if ( a_name ==
"LArEMBMotherZmin" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ZMIN")*
CLHEP::cm;
167 if ( a_name ==
"LArEMBMotherZmax" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ZMAX")*
CLHEP::cm;
168 if ( a_name ==
"LArEMBnoOFAccZigs" )
return (*m_c->barrelGeometry)[0]->getInt(
"NBRT");
169 if ( a_name ==
"LArEMBnoOFAccSamps" )
return (*m_c->barrelGeometry)[0]->getInt(
"NSTAMX");
170 if ( a_name ==
"LArEMBInnerElectronics" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XEL1")*
CLHEP::cm;
171 if ( a_name ==
"LArEMBLArGapTail" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XTAL")*
CLHEP::cm;
172 if ( a_name ==
"LArEMBG10SupportBarsIn" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XG10")*
CLHEP::cm;
173 if ( a_name ==
"LArEMBG10SupportBarsOut" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XGSB")*
CLHEP::cm;
174 if ( a_name ==
"LArEMBZmin" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ZMIN")*
CLHEP::cm;
175 if ( a_name ==
"LArEMBZmax" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ZMAX")*
CLHEP::cm;
176 if ( a_name ==
"LArEMBAccTrackMin" )
return (*m_c->barrelGeometry)[0]->getDouble(
"RHOMIN")*
CLHEP::cm;
177 if ( a_name ==
"LArEMBRadiusInnerAccordion" )
return (*m_c->barrelGeometry)[0]->getDouble(
"RIN_AC")*
CLHEP::cm;
178 if ( a_name ==
"LArEMBRadiusOuterAccordion" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ROUT_AC")*
CLHEP::cm;
179 if ( a_name ==
"LArEMBMaxEtaAcceptance" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ETACUT");
180 if ( a_name ==
"LArEMBThickEtaAcceptance" )
return (*m_c->barrelGeometry)[0]->getDouble(
"ETACU1");
181 if ( a_name ==
"LArEMBRadiusAtCurvature" )
return (*m_c->barrelGeometry)[0]->getDouble(
"RHOCEN"+A0)*
CLHEP::cm;
182 if ( a_name ==
"LArEMBPhiAtCurvature" )
return (*m_c->barrelGeometry)[0]->getDouble(
"PHICEN"+A0)*
CLHEP::deg;
183 if ( a_name ==
"LArEMBDeltaZigAngle" )
return (*m_c->barrelGeometry)[0]->getDouble(
"DELTA"+A0)*
CLHEP::deg;
184 if ( a_name ==
"LArEMBNeutFiberRadius" )
return (*m_c->barrelGeometry)[0]->getDouble(
"RINT")*
CLHEP::cm;
185 if ( a_name ==
"LArEMBLeadTipThickFront" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XTIP_PB")*
CLHEP::cm;
186 if ( a_name ==
"LArEMBLeadTipThickEnd" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XTIP_PC")*
CLHEP::cm;
187 if ( a_name ==
"LArEMBG10TipThickFront" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XTIP_GT")*
CLHEP::cm;
188 if ( a_name ==
"LArEMBG10TipThickEnd" )
return (*m_c->barrelGeometry)[0]->getDouble(
"XTIP_GS")*
CLHEP::cm;
189 if ( a_name ==
"LArEMBThinAbsGlue" )
return (*m_c->barrelGeometry)[0]->getDouble(
"TGGL")*
CLHEP::cm;
190 if ( a_name ==
"LArEMBThinAbsIron" )
return (*m_c->barrelGeometry)[0]->getDouble(
"TGFE")*
CLHEP::cm;
191 if ( a_name ==
"LArEMBThinAbsLead" )
return (*m_c->barrelGeometry)[0]->getDouble(
"TGPB")*
CLHEP::cm;
192 if ( a_name ==
"LArEMBThickAbsGlue" )
return (*m_c->barrelGeometry)[0]->getDouble(
"THGL")*
CLHEP::cm;
193 if ( a_name ==
"LArEMBThickAbsIron" )
return (*m_c->barrelGeometry)[0]->getDouble(
"THFE")*
CLHEP::cm;
194 if ( a_name ==
"LArEMBThickAbsLead" )
return (*m_c->barrelGeometry)[0]->getDouble(
"THPB")*
CLHEP::cm;
195 if ( a_name ==
"LArEMBThickElecCopper" )
return (*m_c->barrelGeometry)[0]->getDouble(
"THCU")*
CLHEP::cm;
196 if ( a_name ==
"LArEMBThickElecKapton" )
return (*m_c->barrelGeometry)[0]->getDouble(
"THFG")*
CLHEP::cm;
197 if ( a_name ==
"LArEMBRminHighZ" ) {
198 if (!m_oldDB)
return (*m_c->barrelGeometry)[0]->getDouble(
"RMINHIGHZ")*
CLHEP::cm;
201 if ( a_name ==
"LArEMBDeltaRS12" ) {
202 if (!m_oldDB)
return (*m_c->barrelGeometry)[0]->getDouble(
"DELTARS12")*
CLHEP::cm;
205 if ( a_name ==
"LArEMBphiMaxBarrel" ) {
206 if (!m_oldDB)
return (*m_c->barrelGeometry)[0]->getDouble(
"PHIMAXBARREL");
209 if ( a_name ==
"LArEMBG10FrontDeltaZ" ) {
210 if (!m_oldDB)
return (*m_c->barrelGeometry)[0]->getDouble(
"G10FRONTDELTAZ")*
CLHEP::cm;
220 if ( a_name ==
"LArEMBSaggingAmplitude" ) {
221 return (*m_c->barrelSagging)[0]->getDouble(
"SAG"+A0)*
CLHEP::cm;
223 if ( a_name ==
"LArEMBSaggingAmplitude2" ) {
224 if (!m_oldSagging)
return (*m_c->barrelSagging)[0]->getDouble(
"SAG"+A0+
"_X")*
CLHEP::cm;
234 if ( a_name ==
"LArEMBmasspercentCu" )
return (*m_c->barrelAccordionCables)[0]->getDouble(
"PERCU");
235 if ( a_name ==
"LArEMBmasspercentKap" )
return (*m_c->barrelAccordionCables)[0]->getDouble(
"PERKAP");
236 if ( a_name ==
"LArEMBCablethickat0" )
return (*m_c->barrelAccordionCables)[0]->getDouble(
"THICKIN")*
CLHEP::cm;
237 if ( a_name ==
"LArEMBthickincrfac" )
return (*m_c->barrelAccordionCables)[0]->getDouble(
"THICKFAC")*
CLHEP::cm;
238 if ( a_name ==
"LArEMBCableEtaheight" )
return (*m_c->barrelAccordionCables)[0]->getDouble(
"HEIGHT")*
CLHEP::cm;
239 if ( a_name ==
"LArEMBnoOFcableBundle" )
return (*m_c->barrelAccordionCables)[0]->getInt(
"ACCORCAB");
240 if ( a_name ==
"LArEMBCablclearfrPS" )
return (*m_c->barrelAccordionCables)[0]->getDouble(
"CLEARANCE")*
CLHEP::cm;
244 if ( a_name ==
"LArEMBEpoxyVolumicMass" )
return (*m_c->barrelMotherboards)[0]->getDouble(
"DG10")*(
CLHEP::g/
CLHEP::cm3);
245 if ( a_name ==
"LArEMBCuThickness" )
return (*m_c->barrelMotherboards)[0]->getDouble(
"THICU")*
CLHEP::cm;
246 if ( a_name ==
"LArEMBG10Thickness" )
return (*m_c->barrelMotherboards)[0]->getDouble(
"THIG10")*
CLHEP::cm;
247 if ( a_name ==
"LArEMBMoBoTchickness" )
return (*m_c->barrelMotherboards)[0]->getDouble(
"THIMB")*
CLHEP::cm;
248 if ( a_name ==
"LArEMBMoBoHeight" )
return (*m_c->barrelMotherboards)[0]->getDouble(
"HEIGHTMB")*
CLHEP::cm;
249 if ( a_name ==
"LArEMBnoOFmothboard" )
return (*m_c->barrelMotherboards)[0]->getInt(
"MOTHBOAR");
250 if ( a_name ==
"LArEMBMoBoclearfrPS" )
return (*m_c->barrelMotherboards)[0]->getDouble(
"CLEARANCE")*
CLHEP::cm;
255 if ( a_name ==
"LArEMBfiducialMothZmax" )
return (*m_c->barrelLongDiv)[0]->getDouble(
"ZMAXACT")*
CLHEP::cm;
256 if ( a_name ==
"LArEMBfiducialMothZmin" ) {
257 if (!m_oldDB)
return (*m_c->barrelLongDiv)[0]->getDouble(
"ZMINACT")*
CLHEP::cm;
264 if ( a_name ==
"LArEMBarrelRmin" )
return (*m_c->presamplerGeometry)[0]->getDouble(
"RMIN")*
CLHEP::cm;
267 if ( a_name ==
"LArEMBEtaTrans" ) {
268 if (!m_oldDB)
return (*m_c->barrelEtaTrans)[
a0]->getDouble(
"ETATRANS");
273 if (!m_oldContract) {
274 if (a_name ==
"LArEMBAbsorberContraction")
return (*m_c->coldContraction)[0]->getDouble(
"ABSORBERCONTRACTION");
277 if (a_name ==
"LArEMBAbsorberContraction")
return 0.997;
281 std::string errMessage =
"RALEmb::GetValue: could not find a match for the key '" + a_name;
282 std::cerr << errMessage << std::endl;
283 throw std::runtime_error (errMessage.c_str());