9 #ifndef _ST_GMT_GEOM_H_
10 #define _ST_GMT_GEOM_H_
19 #include "StRoot/StGmtUtil/StGmtConsts.h"
33 static Double_t getModuleZ(
int iModule = -999);
36 static Double_t getModulePhi(
int iModule = -999);
38 static Int_t getNaiveMapping(Int_t idx) {
return mNaiveMapping[ idx ]; }
46 static Int_t encodeGeoId(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
48 static Int_t decodeGeoId(Int_t geoId, Short_t &module, Int_t &layer, Short_t &strip);
52 static std::string encodeGeoName(Int_t module = -999, Char_t layer = -120, Int_t strip = -999);
54 static Int_t decodeGeoName(
const std::string &geoName, Short_t &module, Int_t &layer, Short_t &strip);
55 static std::string translateGeoIdToGeoName(Int_t geoId = -999);
61 static Int_t getPhysicalCoordinate(Int_t geoId, Short_t &module, Int_t &layer);
69 static Int_t getPhysicalCoordinate(
const std::string &geoName, Short_t &module, Int_t &layer);
74 static Int_t getGlobalPhysicalCoordinate(Int_t geoId, Short_t &module, Int_t &layer);
80 static Int_t getGlobalPhysicalCoordinate(
const std::string &geoName, Short_t &module, Int_t &layer);
82 static Int_t getCoordNumFromElecCoord(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
83 static Double_t getPositionFromElecCoord(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
98 static Int_t encodeElectronicId(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
100 static Int_t decodeElectronicId(Int_t elecId, Int_t &rdo, Int_t &arm, Int_t &apv, Int_t &channel);
101 static Int_t getElectIdFromElecCoord(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t ch = -999) {
return encodeElectronicId(rdo,arm,apv,ch); }
102 static Int_t getElecCoordFromElectId(Int_t eID, Int_t& rdo, Int_t& arm, Int_t& apv, Int_t& ch) {
return decodeElectronicId(eID,rdo,arm,apv,ch); }
104 static Short_t getModuleIdFromElecCoord(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999);
107 static Char_t getOctant(Char_t layer = -120, Int_t strip = -999);
110 static Char_t getOctant(Int_t apv = -999);
114 static Int_t getOctant(Double_t phi = 0.);
116 static Int_t getNaiveGeoIdFromElecCoord(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
117 static Int_t getNaiveElecCoordFromGeoId(Int_t geoId, Int_t& rdo, Int_t& arm, Int_t& apv, Int_t& channel);
118 static std::string getNaiveGeoNameFromElecCoord(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
119 static Int_t getNaivePhysCoordFromElecCoord(Int_t rdo, Int_t arm, Int_t apv, Int_t channel, Short_t &module, Char_t &layer);
125 static Double_t getNaiveMapping(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
126 static bool isNaiveR(Int_t rdo = -999, Int_t arm = -999, Int_t apv = -999, Int_t channel = -999);
134 static double sFirst() {
return kGmtSfirst; }
135 static double sLast() {
return kGmtSlast; }
136 static double pFirst() {
return kGmtPfirst; }
137 static double pLast() {
return kGmtPlast; }
141 static double xStrip_pitch() {
return kGmtXPitch; }
142 static double yStrip_pitch() {
return kGmtYPitch; }
158 static bool inModule( TVector3 rLab );
165 static int rad2LocalStripId(
double rad = 0.,
double phi = 0.,
double *binFrac=0 );
166 static int phi2LocalStripId(
double rad = 0.,
double phi = 0.,
double *binFrac=0 );
199 friend class StGmtDbFileMaker;
204 static double mHalfPi;
213 static Int_t mNaiveMapping[ kGmtNumStripsPerModule ];
216 static Bool_t mReverseNaiveMappingValid;
217 static Int_t mReverseNaiveMapping[ kGmtNumStripsPerModule ];
218 static void makeReverseNaiveMappingValid();
225 static Int_t computeGlobalPhysicalCoordinate(Int_t &layer, Short_t &strip);
230 inline Int_t StGmtGeom::getOctant( Double_t phi ) {
231 double phiDeg= 75 - ((phi*180)/mPi);
232 while ( phiDeg < 0 ) phiDeg+=360;
233 while ( phiDeg > 360 ) phiDeg-=360;