15 #include "St_base/StMessMgr.h"
16 #include "StChain/StMaker.h"
18 #include "tables/St_fmsDetectorPosition_Table.h"
20 namespace FMSCluster {
29 StMaker* chain = StMaker::GetChain();
31 fmsDbMaker =
static_cast<StFmsDbMaker*
>(chain->GetMaker(
"fmsDb"));
36 LOG_ERROR <<
"StFmsGeometry unable to locate an StFmsDbMaker - "
37 <<
"geometry will not be initialised!" << endm;
44 for (
int i(0); i < nDetectors; ++i) {
48 mPositions.insert(std::make_pair(dbgeom[i].detectorId, &dbgeom[i]));
56 const fmsDetectorPosition_st* geometry =
find(detectorId);
58 return geometry->xoffset;
64 const fmsDetectorPosition_st* geometry =
find(detectorId);
66 return geometry->yoffset;
72 const fmsDetectorPosition_st* geometry =
find(detectorId);
74 return geometry->zoffset;
83 const fmsDetectorPosition_st* geometry =
find(detectorId);
84 std::vector<Float_t> widths(2, 0.);
86 widths.at(0) = geometry->xwidth;
87 widths.at(1) = geometry->ywidth;
93 const fmsDetectorPosition_st* positions(NULL);
94 Table::const_iterator entry =
mPositions.find(detectorId);
96 positions = entry->second;
102 Int_t detectorId)
const {
103 TVector3 global(0., 0., 0.);
104 const fmsDetectorPosition_st* detector =
find(detectorId);
112 global.SetX(detector->xoffset - x);
114 global.SetX(detector->xoffset + x);
121 global.SetY(y - detector->yoffset);
122 global.SetZ(detector->zoffset);
128 Int_t detectorId)
const {
129 const fmsDetectorPosition_st* detector =
find(detectorId);
134 row * detector->ywidth, detectorId);
136 return TVector3(0., 0., 0.);
140 switch (detectorId) {
Bool_t initialize(StFmsDbMaker *fmsDbMaker)
fmsDetectorPosition_st * DetectorPosition()
getting the whole table
Declaration of StFmsGeometry, an FMS database geometry interface.
Table mPositions
Detector ID: position information pairs.
static Bool_t isNorth(Int_t detectorId)
Float_t yOffset(Int_t detectorId) const
const fmsDetectorPosition_st * find(Int_t detectorId) const
Float_t z(Int_t detectorId) const
TVector3 localToGlobalCoordinates(Double_t x, Double_t y, Int_t detectorId) const
std::vector< Float_t > towerWidths(Int_t detectorId) const
TVector3 columnRowToGlobalCoordinates(Double_t column, Double_t row, Int_t detectorId) const
Int_t maxDetectorId()
Utility functions related to FMS ChannelGeometry.
Float_t xOffset(Int_t detectorId) const