ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
LArGeo::RALEmb Class Reference

#include <RALEmb.h>

Inheritance diagram for LArGeo::RALEmb:
Collaboration diagram for LArGeo::RALEmb:

Classes

class  Clockwork
 

Public Member Functions

 RALEmb ()
 
virtual ~RALEmb ()
 
virtual double GetValue (const std::string &, const int i0=INT_MIN, const int i1=INT_MIN, const int i2=INT_MIN, const int i3=INT_MIN, const int i4=INT_MIN) const override
 

Static Public Member Functions

static void SetInstance (std::unique_ptr< VDetectorParameters >)
 
static const VDetectorParametersGetInstance ()
 

Private Member Functions

 RALEmb (const RALEmb &)
 
RALEmboperator= (const RALEmb &)
 

Private Attributes

Clockworkm_c
 
bool m_oldDB {false}
 
bool m_oldSagging {false}
 
bool m_oldContract {false}
 

Static Private Attributes

static CxxUtils::CachedUniquePtr< VDetectorParameters > s_instance ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 20 of file RALEmb.h.

Constructor & Destructor Documentation

◆ RALEmb() [1/2]

LArGeo::RALEmb::RALEmb ( )

Definition at line 50 of file RALEmb.cxx.

50  :
51  m_c(new Clockwork())
52 {
53  // First, fetch the Athena services.
54  ISvcLocator* svcLocator = Gaudi::svcLocator();
55 
56  IGeoDbTagSvc* geoDbTagSvc{nullptr};
57  StatusCode sc = svcLocator->service("GeoDbTagSvc",geoDbTagSvc);
58  if (sc != StatusCode::SUCCESS) {
59  throw std::runtime_error ("Cannot locate GeoDBTagSvc");
60  }
61 
62  IRDBAccessSvc* pAccessSvc{nullptr};
63  sc = svcLocator->service(geoDbTagSvc->getParamSvcName(),pAccessSvc);
64  if (sc != StatusCode::SUCCESS) {
65  throw std::runtime_error ("Cannot locate " + geoDbTagSvc->getParamSvcName());
66  }
67 
68  std::string detectorKey;
69  std::string detectorNode;
70 
71  if(geoDbTagSvc->getSqliteReader()==nullptr) {
72  // The geometry DB is used
73  IGeoModelSvc* geoModel{nullptr};
74  sc = svcLocator->service ("GeoModelSvc",geoModel);
75  if (sc != StatusCode::SUCCESS) {
76  throw std::runtime_error ("Cannot locate GeoModelSvc");
77  }
78 
79  std::string AtlasVersion = geoModel->atlasVersion();
80  std::string LArVersion = geoModel->LAr_VersionOverride();
81 
82  detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
83  detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
84 
85 
86  if ( LArVersion.empty()) {
87  LArVersion=pAccessSvc->getChildTag("LAr",AtlasVersion,"ATLAS");
88  }
89 
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") {
95  m_oldDB=true;
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;
98  }
99 
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") {
106  m_oldSagging=true;
107  std::cout << " in RALEmb: only old sagging values available" << std::endl;
108  }
109 
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" ) {
123  m_oldContract=true;
124  }
125  }
126 
127 
128  m_c->barrelGeometry = pAccessSvc->getRecordsetPtr("BarrelGeometry",detectorKey, detectorNode);
129  m_c->barrelSagging = pAccessSvc->getRecordsetPtr("BarrelSagging",detectorKey, detectorNode);
130  m_c->barrelAccordionCables = pAccessSvc->getRecordsetPtr("BarrelAccordionCables",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);
134  if (!m_oldDB) m_c->barrelEtaTrans = pAccessSvc->getRecordsetPtr("BarrelEtaTrans",detectorKey,detectorNode);
135 
136  if (!m_oldContract) m_c->coldContraction = pAccessSvc->getRecordsetPtr("ColdContraction",detectorKey,detectorNode);
137 }

◆ ~RALEmb()

LArGeo::RALEmb::~RALEmb ( )
virtual

Definition at line 140 of file RALEmb.cxx.

141 {
142  delete m_c;
143 }

◆ RALEmb() [2/2]

LArGeo::RALEmb::RALEmb ( const RALEmb )
private

Member Function Documentation

◆ GetInstance()

const LArGeo::VDetectorParameters * LArGeo::VDetectorParameters::GetInstance ( )
staticinherited

Definition at line 29 of file VDetectorParameters.cxx.

30 {
31  const VDetectorParameters* p = s_instance.get();
32  if(p==nullptr)
33  std::cerr << "LArGeo::VDetectorParameters::GetInstance was called, but "
34  << "the pointer to the detector-parameter access object is 0."
35  << std::endl;
36 
37  return p;
38 }

◆ GetValue()

double LArGeo::RALEmb::GetValue ( const std::string &  a_name,
const int  i0 = INT_MIN,
const int  i1 = INT_MIN,
const int  i2 = INT_MIN,
const int  i3 = INT_MIN,
const int  i4 = INT_MIN 
) const
overridevirtual

Implements LArGeo::VDetectorParameters.

Definition at line 146 of file RALEmb.cxx.

152 {
153 
154  std::ostringstream A0STR;
155  A0STR << "_" << a0;
156  const std::string A0 = A0STR.str();
157 
158  if ( a_name == "LArEMBnoOFPhysPhiCell" ) return (*m_c->barrelGeometry)[0]->getInt("NCELMX");
159 // GU 7-oct-05 phifirst is stored in radians not in degre
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;
199  else return 154.8*CLHEP::cm;
200  }
201  if ( a_name == "LArEMBDeltaRS12" ) {
202  if (!m_oldDB) return (*m_c->barrelGeometry)[0]->getDouble("DELTARS12")*CLHEP::cm;
203  else return 0.11*CLHEP::cm;
204  }
205  if ( a_name == "LArEMBphiMaxBarrel" ) {
206  if (!m_oldDB) return (*m_c->barrelGeometry)[0]->getDouble("PHIMAXBARREL");
207  else return 360.;
208  }
209  if ( a_name == "LArEMBG10FrontDeltaZ" ) {
210  if (!m_oldDB) return (*m_c->barrelGeometry)[0]->getDouble("G10FRONTDELTAZ")*CLHEP::cm;
211  else return 309.4*CLHEP::cm;
212  }
213 
214  //
215 
216 
217  // 2) FROM ASAG structure
218 
219 
220  if ( a_name == "LArEMBSaggingAmplitude" ) {
221  return (*m_c->barrelSagging)[0]->getDouble("SAG"+A0)*CLHEP::cm;
222  }
223  if ( a_name == "LArEMBSaggingAmplitude2" ) {
224  if (!m_oldSagging) return (*m_c->barrelSagging)[0]->getDouble("SAG"+A0+"_X")*CLHEP::cm;
225  else return 0;
226  }
227 
228 
229 
230  //
231 
232  // 3) FROM ACCA ( electronics cables)
233 
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;
241 
242 
243  // 4) FROM (*C->BARRELMOTHERBOARDS) ( electronics mother_boards)
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;
251 
252  //
253 
254  // 5) FROM ACCO ( Longitudinal Barrel Parameters)
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;
258  else return 0.4*CLHEP::cm;
259  }
260 
261  //
262 
263  // 6) FROM COPG ( PreSampler Barrel Parameters)
264  if ( a_name == "LArEMBarrelRmin" ) return (*m_c->presamplerGeometry)[0]->getDouble("RMIN")*CLHEP::cm;
265 
266  // 7) FROM BarrelEtaTrans
267  if ( a_name == "LArEMBEtaTrans" ) {
268  if (!m_oldDB) return (*m_c->barrelEtaTrans)[a0]->getDouble("ETATRANS");
269  else return 0.8;
270  }
271 
272  // 8) FROM ColdContraction
273  if (!m_oldContract) {
274  if (a_name == "LArEMBAbsorberContraction") return (*m_c->coldContraction)[0]->getDouble("ABSORBERCONTRACTION");
275  }
276  else {
277  if (a_name == "LArEMBAbsorberContraction") return 0.997;
278  }
279 
280  // We didn't find a match.
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());
284 
285  // Unreached.
286 }

◆ operator=()

RALEmb& LArGeo::RALEmb::operator= ( const RALEmb )
private

◆ SetInstance()

void LArGeo::VDetectorParameters::SetInstance ( std::unique_ptr< VDetectorParameters p)
staticinherited

Definition at line 24 of file VDetectorParameters.cxx.

25 {
26  s_instance.set (std::move (p));
27 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

CxxUtils::CachedUniquePtr<VDetectorParameters> s_instance LArGeo::VDetectorParameters::ATLAS_THREAD_SAFE
staticprivateinherited

Definition at line 64 of file VDetectorParameters.h.

◆ m_c

Clockwork* LArGeo::RALEmb::m_c
private

Definition at line 38 of file RALEmb.h.

◆ m_oldContract

bool LArGeo::RALEmb::m_oldContract {false}
private

Definition at line 41 of file RALEmb.h.

◆ m_oldDB

bool LArGeo::RALEmb::m_oldDB {false}
private

Definition at line 39 of file RALEmb.h.

◆ m_oldSagging

bool LArGeo::RALEmb::m_oldSagging {false}
private

Definition at line 40 of file RALEmb.h.


The documentation for this class was generated from the following files:
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
IGeoModelSvc
Definition: IGeoModelSvc.h:17
LArGeo::RALEmb::Clockwork::barrelLongDiv
IRDBRecordset_ptr barrelLongDiv
Definition: RALEmb.cxx:43
cm3
#define cm3
deg
#define deg
Definition: SbPolyhedron.cxx:17
LArGeo::RALEmb::m_c
Clockwork * m_c
Definition: RALEmb.h:37
LArGeo::RALEmb::Clockwork::presamplerGeometry
IRDBRecordset_ptr presamplerGeometry
Definition: RALEmb.cxx:44
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArGeo::VDetectorParameters::VDetectorParameters
VDetectorParameters()
Definition: VDetectorParameters.h:61
LArGeo::RALEmb::m_oldContract
bool m_oldContract
Definition: RALEmb.h:41
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArGeo::RALEmb::Clockwork::barrelGeometry
IRDBRecordset_ptr barrelGeometry
Definition: RALEmb.cxx:39
LArGeo::RALEmb::Clockwork::barrelSagging
IRDBRecordset_ptr barrelSagging
Definition: RALEmb.cxx:40
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
a0
double a0
Definition: globals.cxx:27
LArGeo::RALEmb::m_oldSagging
bool m_oldSagging
Definition: RALEmb.h:40
LArGeo::RALEmb::Clockwork::barrelEtaTrans
IRDBRecordset_ptr barrelEtaTrans
Definition: RALEmb.cxx:45
LArGeo::RALEmb::Clockwork::barrelMotherboards
IRDBRecordset_ptr barrelMotherboards
Definition: RALEmb.cxx:42
LArGeo::RALEmb::Clockwork::barrelAccordionCables
IRDBRecordset_ptr barrelAccordionCables
Definition: RALEmb.cxx:41
LArGeo::RALEmb::m_oldDB
bool m_oldDB
Definition: RALEmb.h:39
LArGeo::RALEmb::Clockwork::coldContraction
IRDBRecordset_ptr coldContraction
Definition: RALEmb.cxx:46