13 #include "tables/St_fgtElosCutoff_Table.h"
14 #include "tables/St_fgtSimuParams_Table.h"
15 #include "tables/St_fgtPedestal_Table.h"
16 #include "tables/St_fgtMapping_Table.h"
17 #include "tables/St_fgtGain_Table.h"
18 #include "tables/St_fgtStatus_Table.h"
19 #include "tables/St_fgtAlignment_Table.h"
20 #include "StFgtUtil/geometry/StFgtGeom.h"
30 ) : m_map(NULL), m_rmap(NULL), m_status(NULL), m_pedestal(NULL), m_gain(NULL), m_alignment(NULL)
39 fgtAlignment_st * alignment
40 ) : m_map(map), m_rmap(rmap), m_status(status),
41 m_pedestal(pedestal), m_gain(gain), m_alignment(alignment)
44 virtual void updateTables(
50 fgtElosCutoff_st* mLossTab,
51 fgtSimuParams_st* mSimuParTab,
52 fgtAlignment_st* alignment
58 m_pedestal = pedestal;
61 m_simPar= mSimuParTab;
62 m_alignment = alignment;
71 virtual Int_t getPhysicalCoordinateFromGeoId(
73 Short_t & disc, Short_t & quadrant, Char_t & layer,
74 Double_t & ordinate, Double_t & lowerSpan, Double_t & upperSpan
79 virtual Int_t getPhysicalCoordinateFromGeoName(
80 const std::string & geoName,
81 Short_t & disc, Short_t & quadrant, Char_t & layer,
82 Double_t & ordinate, Double_t & lowerSpan, Double_t & upperSpan
93 virtual Int_t getGeoIdFromElecCoord(
94 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
97 Int_t eId = StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
102 return m_map->Mapping[ eId ];
106 virtual Int_t getElecCoordFromGeoId(
107 Int_t geoId, Int_t& rdo, Int_t& arm, Int_t& apv, Int_t& channel
110 virtual std::string getGeoNameFromElecCoord(
111 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
114 Int_t geoId = getGeoIdFromElecCoord( rdo, arm, apv, channel );
117 return kFgtErrorString;
119 return StFgtGeom::translateGeoIdToGeoName( geoId );
123 virtual Int_t getElecCoordFromGeoName(
124 const std::string & geoName,
125 Int_t& rdo, Int_t& arm, Int_t& apv, Int_t& channel
128 virtual Int_t getPhysCoordFromElecCoord(
129 Int_t rdo, Int_t arm, Int_t apv, Int_t channel,
130 Short_t & disc, Short_t & quadrant, Char_t & layer,
131 Double_t & ordinate, Double_t & lowerSpan, Double_t & upperSpan
134 return StFgtGeom::getPhysicalCoordinate(
135 getGeoIdFromElecCoord( rdo, arm, apv, channel ),
136 disc, quadrant, layer, ordinate, lowerSpan, upperSpan
140 virtual Double_t getPedestalFromGeoId( Int_t geoId );
142 virtual Double_t getPedestalFromElecId( Int_t elecId);
144 virtual Double_t getPedestalFromGeoName(
const std::string & geoName )
146 Int_t geoId = StFgtGeom::translateGeoNameToGeoId( geoName );
151 return getPedestalFromGeoId( geoId );
154 virtual Double_t getPedestalFromElecCoord(
155 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
159 StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
164 return m_pedestal->AdcPedestal[ eId ];
167 virtual Double_t getPedestalSigmaFromGeoId( Int_t geoId );
169 virtual Double_t getPedestalSigmaFromElecId( Int_t elecId );
171 virtual Double_t getPedestalSigmaFromGeoName(
172 const std::string & geoName
175 Int_t geoId = StFgtGeom::translateGeoNameToGeoId( geoName );
180 return getPedestalSigmaFromGeoId( geoId );
183 virtual Double_t getPedestalSigmaFromElecCoord(
184 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
188 StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
193 return m_pedestal->AdcPedestalRMS[ eId ];
196 virtual Char_t getPedestalStatusFromGeoId( Int_t geoId );
198 virtual Char_t getPedestalStatusFromElecId( Int_t elecId );
201 virtual Char_t getPedestalStatusFromGeoName(
202 const std::string & geoName
205 Int_t geoId = StFgtGeom::translateGeoNameToGeoId( geoName );
208 return kFgtErrorChar;
210 return getPedestalStatusFromGeoId( geoId );
213 virtual Char_t getPedestalStatusFromElecCoord(
214 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
218 StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
221 return kFgtErrorChar;
223 return m_pedestal->Status[ eId ];
227 virtual Char_t getStatusFromGeoId( Int_t geoId );
229 virtual Char_t getStatusFromElecId( Int_t elecId );
231 virtual Char_t getStatusFromGeoName(
const std::string & geoName )
233 Int_t geoId = StFgtGeom::translateGeoNameToGeoId( geoName );
236 return kFgtErrorChar;
238 return getStatusFromGeoId( geoId );
241 virtual Char_t getStatusFromElecCoord(
242 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
246 StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
249 return kFgtErrorChar;
251 return m_status->Status[ eId ];
254 virtual Double_t getGainFromGeoId( Int_t geoId );
256 virtual Double_t getGainFromElecId( Int_t elecId );
258 virtual Double_t getGainFromGeoName(
const std::string & geoName )
260 Int_t geoId = StFgtGeom::translateGeoNameToGeoId( geoName );
265 return getGainFromGeoId( geoId );
268 virtual Double_t getGainFromElecCoord(
269 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
273 StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
278 return m_gain->Gain[ eId ];
281 virtual Char_t getGainStatusFromGeoId( Int_t geoId );
283 virtual Char_t getGainStatusFromElecId( Int_t elecId );
285 virtual Char_t getGainStatusFromGeoName(
const std::string & geoName )
287 Int_t geoId = StFgtGeom::translateGeoNameToGeoId( geoName );
290 return kFgtErrorChar;
292 return getGainStatusFromGeoId( geoId );
295 virtual Char_t getGainStatusFromElecCoord(
296 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
300 StFgtGeom::encodeElectronicId( rdo, arm, apv, channel );
303 return kFgtErrorChar;
305 return m_gain->Status[ eId ];
308 virtual Double_t getMapping(
309 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
313 Int_t rdo, Int_t arm, Int_t apv, Int_t channel
317 virtual Double_t getEloss(Int_t bin)
319 return m_eLoss[0].cutoff[bin];
322 virtual Double_t getSimuParam(Int_t bin)
324 return m_simPar[0].param[bin];
327 virtual fgtAlignment_st* getAlignment() {
return m_alignment;}
333 virtual void getStarXYZ(Short_t disc, Short_t quad, Double_t r, Double_t phi, TVector3 &xyz, Int_t opt=1, fgtAlignment_st* par=0);
336 void printFgtDumpCSV1(TString fname,
int myDate,
int myTime);
342 fgtMapping_st * m_map;
343 fgtMapping_st * m_rmap;
347 fgtElosCutoff_st* m_eLoss;
348 fgtSimuParams_st* m_simPar;
349 fgtAlignment_st* m_alignment;
356 inline Int_t StFgtDb::getPhysicalCoordinateFromGeoId(
358 Short_t & disc, Short_t & quadrant, Char_t & layer,
359 Double_t & ordinate, Double_t & lowerSpan, Double_t & upperSpan
362 return StFgtGeom::getPhysicalCoordinate(
363 geoId, disc, quadrant, layer, ordinate, lowerSpan, upperSpan
369 inline Int_t StFgtDb::getPhysicalCoordinateFromGeoName(
370 const std::string & geoName,
371 Short_t & disc, Short_t & quadrant, Char_t & layer,
372 Double_t & ordinate, Double_t & lowerSpan, Double_t & upperSpan
375 return StFgtGeom::getPhysicalCoordinate(
376 geoName, disc, quadrant, layer, ordinate, lowerSpan, upperSpan