|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "GaudiKernel/ISvcLocator.h"
10 #include "GaudiKernel/SmartIF.h"
26 {
return a.channelID <
b.channelID; }
28 {
return a.channelID <
b; }
34 : m_calocell_id(calocell_id)
37 SmartIF<IGeoModelSvc> geoModel{svcLocator->service(
"GeoModelSvc")};
39 throw std::runtime_error(
"CellVolumes error: cannot access GeoModelSvc");
41 SmartIF<IGeoDbTagSvc> geoDbTagSvc{svcLocator->service(
"GeoDbTagSvc")};
43 throw std::runtime_error(
"CellVolumes error: cannot access GeoDbTagSvc");
45 SmartIF<IRDBAccessSvc> rdbAccess{svcLocator->service(geoDbTagSvc->getParamSvcName())};
47 throw std::runtime_error(
"CellVolumes error: cannot access RDBAccessSvc");
49 std::string larKey, larNode;
50 if(geoDbTagSvc->getSqliteReader()==
nullptr) {
52 larKey = detectorKey.
tag();
53 larNode = detectorKey.
node();
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");
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");
78 if(geoDbTagSvc->getSqliteReader()==
nullptr) {
79 std::string LArTag = rdbAccess->getChildTag(
"LAr",larKey,larNode);
80 if(LArTag.find(
"H8")!=std::string::npos) {
83 else if(LArTag.find(
"H6")!=std::string::npos) {
86 else if(LArTag.find(
"G3")!=std::string::npos) {
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");
113 cellVol.
volume = rec->getDouble(
"VOLUME");
118 throw std::runtime_error(
"CaloCellVolumes error: 0 volumes have been built!");
156 CaloCellVolumeVector::const_iterator
it =
167 std::cerr <<
"CaloCellVolumes::print(). No cell volumes..." << std::endl;
170 std::cout <<
"CaloCellVolumes::print(). Number of volumes found: "
176 std::cout <<
" ==> vol= " << vol.volume <<
" mm3" << std::endl;
185 throw std::runtime_error(
"CaloCellVolumes::getFcalTubeSpacing error: wrong sampling provided");
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
Scalar phi() const
phi method
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
Scalar eta() const
pseudorapidity method
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloCellVolumes(ISvcLocator *svcLocator, const CaloCell_ID *calocell_id)
Identifier region_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy) const
Make a region ID from constituting fields and subCalo index; for (Mini)FCAL and Tiles,...
const std::string & node() const
Return the version node.
CaloCellVolumeVector m_cellVolumes
Definition of the abstract IRDBAccessSvc interface.
TubeSpacingMap m_fcalTubeSpacings
bool is_fcal(const Identifier id) const
test if the id belongs to the FCAL - true also for MiniFCAL
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
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.
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
Helper class for offline cell identifiers.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
double getFcalTubeSpacing(int sampling)
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
void print(Identifier id, const IdContext *context=0) const
Expanded print out of any identifier.
Definition of the abstract IRDBRecord interface.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
bool operator()(const CaloCellVolume &a, const CaloCellVolume &b)
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
const CaloCell_ID * m_calocell_id
Definition of the abstract IRDBRecordset interface.
double CellVolume(Identifier cell_id)
std::string m_geometryLayout