35{
36
37 SmartIF<IGeoModelSvc> geoModel{svcLocator->service("GeoModelSvc")};
38 if(!geoModel)
39 throw std::runtime_error("CellVolumes error: cannot access GeoModelSvc");
40
41 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service("GeoDbTagSvc")};
42 if(!geoDbTagSvc)
43 throw std::runtime_error("CellVolumes error: cannot access GeoDbTagSvc");
44
45 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
46 if(!rdbAccess)
47 throw std::runtime_error("CellVolumes error: cannot access RDBAccessSvc");
48
49 std::string larKey, larNode;
50 if(geoDbTagSvc->getSqliteReader()==nullptr) {
51 DecodeVersionKey detectorKey = DecodeVersionKey(geoModel,"LAr");
52 larKey = detectorKey.
tag();
53 larNode = detectorKey.
node();
54 }
55
56 IRDBRecordset_ptr cellVolRec = rdbAccess->getRecordsetPtr(
"LArCellVolumes",larKey,larNode);
57 if(cellVolRec->
size()==0) {
58 cellVolRec = rdbAccess->getRecordsetPtr("LArCellVolumes","LArCellVolumes-00");
59 if(cellVolRec->
size()==0) {
60 throw std::runtime_error("CaloCellVolumes error: 0 size of LArCellVolumes recordset");
61 }
62 }
63
64
65 IRDBRecordset_ptr fcalModRec = rdbAccess->getRecordsetPtr(
"FCalMod",larKey,larNode);
66 if(fcalModRec->
size()==0) {
67 fcalModRec = rdbAccess->getRecordsetPtr("FCalMod","FCalMod-00");
68 if(fcalModRec->
size()==0) {
69 throw std::runtime_error("CaloCellVolumes error: 0 size of FCalMod recordset");
70 }
71 }
72
75 }
76
78 if(geoDbTagSvc->getSqliteReader()==nullptr) {
79 std::string LArTag = rdbAccess->getChildTag("LAr",larKey,larNode);
80 if(LArTag.find("H8")!=std::string::npos) {
82 }
83 else if(LArTag.find("H6")!=std::string::npos) {
85 }
86 else if(LArTag.find("G3")!=std::string::npos) {
88 }
89 }
90
91
93
94 int subcalo = rec->getInt("SUBCALO");
95 int posneg = rec->getInt("POSNEG");
96 int sampling = rec->getInt("SAMPLING");
97 int region = rec->getInt("REGION");
98 int eta = rec->getInt(
"ETA");
99 int phi = rec->getInt(
"PHI");
100
101 Identifier channelID;
104 }
105 else {
106 Identifier reg_id =
m_calocell_id->region_id(subcalo, posneg, sampling, region);
108 channelID =
m_calocell_id->cell_id (subcalo, posneg, sampling, region,
eta, phimin);
109 }
110
111 CaloCellVolume cellVol;
113 cellVol.
volume = rec->getDouble(
"VOLUME");
115 }
116
118 throw std::runtime_error("CaloCellVolumes error: 0 volumes have been built!");
119 }
120
122 CaloCellVolume_Compare());
123}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
CaloCellVolumeVector m_cellVolumes
TubeSpacingMap m_fcalTubeSpacings
const CaloCell_ID * m_calocell_id
std::string m_geometryLayout
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
virtual unsigned int size() const =0
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.