ATLAS Offline Software
Loading...
Searching...
No Matches
EMBBasicReadoutNumbers.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "GaudiKernel/MsgStream.h"
6#include "GaudiKernel/Bootstrap.h"
7#include "GaudiKernel/ISvcLocator.h"
8#include "GaudiKernel/SystemOfUnits.h"
9
13
14
19
21{
22 // The EMB gets and managers certain arrays needed to build descriptors. Here is that:
23 ISvcLocator *svcLocator = Gaudi::svcLocator();
24
25 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
26 if(!geoModel.isValid())
27 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoModelSvc");
28
29 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
30 if(!geoDbTagSvc.isValid())
31 throw std::runtime_error("Error in HECDetectorManager, cannot access GeoDbTagSvc");
32
33 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
34 if(!rdbAccess.isValid())
35 throw std::runtime_error("Error in HECDetectorManager, cannot access RDBAccessSvc");
36
37 std::string larKey, larNode;
38 if(geoDbTagSvc->getSqliteReader()==nullptr) {
39 DecodeVersionKey larVersionKey(geoModel, "LAr");
40 larKey = larVersionKey.tag();
41 larNode = larVersionKey.node();
42 }
43
44 IRDBRecordset_ptr barrelLongDiv = rdbAccess->getRecordsetPtr("BarrelLongDiv", larKey, larNode);
45 if (barrelLongDiv->size()==0) throw std::runtime_error("Error getting BarrelLongDiv table");
46
47 IRDBRecordset_ptr barrelGeometry = rdbAccess->getRecordsetPtr("BarrelGeometry", larKey, larNode);
48 if (barrelGeometry->size()==0) throw std::runtime_error("Error getting BarrelGeometry table");
49
50 IRDBRecordset_ptr presamplerGeometry = rdbAccess->getRecordsetPtr("PresamplerGeometry", larKey, larNode);
51 if (presamplerGeometry->size()==0) throw std::runtime_error("Error getting PresamplerGeometry table");
52
53 IRDBRecordset_ptr embSampSep = rdbAccess->getRecordsetPtr("EMBSampSep", larKey, larNode);
54 if (embSampSep->size()==0) {
55 embSampSep = rdbAccess->getRecordsetPtr("EMBSampSep", "EMBSampSep-00");
56 if (embSampSep->size()==0) {
57 throw std::runtime_error("Error getting EMBSampSep table");
58 }
59 }
60
61 m_presamplerRadius = (*presamplerGeometry)[0]->getDouble("RACTIVE")*Gaudi::Units::cm;
62 m_rInAc = (*barrelGeometry)[0]->getDouble("RIN_AC")*Gaudi::Units::cm;
63 m_rOutAc = (*barrelGeometry)[0]->getDouble("ROUT_AC")*Gaudi::Units::cm;
64 for (int i=0;i<8;i++) m_EE.push_back((*barrelLongDiv)[0]->getDouble("EE",i));
65 for (int i=0;i<8;i++) m_RMX12.push_back((*barrelLongDiv)[0]->getDouble("RMX12",i)*Gaudi::Units::cm);
66 for (int i=0;i<53;i++) m_RMX23.push_back((*barrelLongDiv)[0]->getDouble("RMX23",i)*Gaudi::Units::cm);
67
68 int sampSepSize = embSampSep->size();
69 m_EMBSamplingSepInnerRMax.resize(sampSepSize,0.0);
70 for (int i{0}; i<sampSepSize; ++i) {
71 m_EMBSamplingSepInnerRMax.at((*embSampSep)[i]->getInt("IND"))=(*embSampSep)[i]->getDouble("RMAX");
72 }
73}
74
76= default;
77
78
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
std::vector< double > m_EE
~EMBBasicReadoutNumbers()
Destructor.
std::vector< double > m_RMX12
std::vector< double > m_RMX23
std::vector< double > m_EMBSamplingSepInnerRMax
virtual unsigned int size() const =0