StFms  0.0.0
FMS software in the STAR framework
StFmsDbMaker.h
Go to the documentation of this file.
1 /***************************************************************************
2  * $Id: StFmsDbMaker.h,v 1.2 2010/01/11 20:35:30 jgma Exp $
3  * \author: akio ogawa
4  ***************************************************************************
5  *
6  * Description: FMS DB access Maker
7  * Please visit http://drupal.star.bnl.gov/STAR/subsys/fms/database/stfmsdbmaker for more information
8  *
9  ***************************************************************************
10  *
11  * $Log: StFmsDbMaker.h,v $
12  * Revision 1.2 2010/01/11 20:35:30 jgma
13  * Added reversed map and some other minor updates
14  *
15  * Revision 1.1 2009/10/28 16:11:15 jgma
16  * This is the first check in of the code.
17  *
18  **************************************************************************/
19 
20 
21 
22 #ifndef STFMSDBMAKER_H
23 #define STFMSDBMAKER_H
24 
25 #ifndef StMaker_H
26 #include "StMaker.h"
27 #endif
28 #include "StThreeVectorF.hh"
29 
30 struct fmsDetectorPosition_st;
31 struct fmsChannelGeometry_st;
32 struct fmsMap_st;
33 struct fmsPatchPanelMap_st;
34 struct fmsQTMap_st;
35 struct fmsGain_st;
36 struct fmsGainCorrection_st;
37 
38 class StFmsDbMaker : public StMaker {
39  public:
40  StFmsDbMaker(const Char_t *name="fmsDb");
41  virtual ~StFmsDbMaker();
42  virtual Int_t Init();
43  virtual Int_t InitRun(Int_t runNumber);
44  virtual Int_t Make();
45  virtual Int_t Finish();
46  virtual void Clear(const Char_t *opt);
47 
48  void setDebug(Int_t debug);
49 
51  fmsChannelGeometry_st* ChannelGeometry();
52  fmsDetectorPosition_st* DetectorPosition();
53  fmsMap_st* Map();
54  fmsPatchPanelMap_st* PatchPanelMap();
55  fmsQTMap_st* QTMap();
56  fmsGain_st* Gain();
57  fmsGainCorrection_st* GainCorrection();
58 
60  Int_t maxDetectorId();
61  Int_t detectorId(Int_t ew, Int_t ns, Int_t type);
62  Int_t eastWest(Int_t detectorId);
63  Int_t northSouth(Int_t detectorId);
64  Int_t type(Int_t detectorId);
65  Int_t nRow(Int_t detectorId);
66  Int_t nColumn(Int_t detectorId);
67  Int_t maxChannel(Int_t detectorId);
68  Int_t getRowNumber(Int_t detectorId, Int_t ch);
69  Int_t getColumnNumber(Int_t detectorId, Int_t ch);
70  Int_t getChannelNumber(Int_t detectorId, Int_t row, Int_t column);
71 
73  StThreeVectorF getDetectorOffset(Int_t detectorId);
74  Float_t getXWidth(Int_t detectorId);
75  Float_t getYWidth(Int_t detectorId);
76  StThreeVectorF getStarXYZ(Int_t detectorId,Float_t FmsX, Float_t FmsY);
77  Float_t getPhi(Int_t detectorId,Float_t FmsX, Float_t FmsY);
78  Float_t getEta(Int_t detectorId,Float_t FmsX, Float_t FmsY, Float_t Vertex);
79 
81  Int_t maxMap();
82  void getMap(Int_t detectorId, Int_t ch, Int_t* qtCrate, Int_t* qtSlot, Int_t* qtChannel);
83  void getReverseMap(Int_t qtCrate, Int_t qtSlot, Int_t qtChannel, Int_t* detectorId, Int_t* ch);
84 
86  Int_t maxModule();
87 
89  Int_t maxNS();
90 
92  Int_t maxGain();
93  Int_t maxGainCorrection();
94  Float_t getGain(Int_t detectorId, Int_t ch);
95  Float_t getGainCorrection(Int_t detectorId, Int_t ch);
96 
98  void dumpFmsChannelGeometry(const Char_t* filename="dumpFmsChannelGeometry.txt");
99  void dumpFmsDetectorPosition(const Char_t* filename="dumpFmsDetectorPosition.txt");
100  void dumpFmsMap (const Char_t* filename="dumpFmsMap.txt");
101  void dumpFmsPatchPanelMap (const Char_t* filename="dumpFmsPatchPanelMap.txt");
102  void dumpFmsQTMap (const Char_t* filename="dumpFmsQTMap.txt");
103  void dumpFmsGain (const Char_t* filename="dumpFmsGain.txt");
104  void dumpFmsGainCorrection (const Char_t* filename="dumpFmsGainCorrection.txt");
105 
106  private:
107  void deleteArrays();
108  Int_t mDebug;
109 
110  fmsChannelGeometry_st *mChannelGeometry;
112 
113  fmsDetectorPosition_st *mDetectorPosition;
114 
115  fmsMap_st *mMap;
116  fmsMap_st **mmMap;
117  Int_t mMaxMap;
118  enum {mMaxCrate=8, mMaxSlot=17, mMaxCh=32};
121 
122  fmsPatchPanelMap_st *mPatchPanelMap;
123  Int_t mMaxModule;
124 
125  fmsQTMap_st *mQTMap;
126  Int_t mMaxNS;
127 
128  fmsGain_st *mGain;
129  fmsGain_st **mmGain;
130  Int_t mMaxGain;
131 
132  fmsGainCorrection_st *mGainCorrection;
133  fmsGainCorrection_st **mmGainCorrection;
135 
136 
137  virtual const Char_t *GetCVS() const {static const Char_t cvs[]="Tag $Name:"__DATE__" "__TIME__ ; return cvs;}
138  ClassDef(StFmsDbMaker,1) //StAF chain virtual base class for Makers
139 };
140 
143 #endif
144 
145 
StFmsDbMaker(const Char_t *name="fmsDb")
void getReverseMap(Int_t qtCrate, Int_t qtSlot, Int_t qtChannel, Int_t *detectorId, Int_t *ch)
fmsQTMap_st * QTMap()
fmsMap_st * Map()
virtual void Clear(const Char_t *opt)
Int_t mReverseMapDetectorId[mMaxCrate][mMaxSlot][mMaxCh]
Definition: StFmsDbMaker.h:119
Int_t mMaxModule
patch panel map
Definition: StFmsDbMaker.h:123
Int_t nColumn(Int_t detectorId)
number of rows
virtual Int_t InitRun(Int_t runNumber)
fmsDetectorPosition_st * DetectorPosition()
getting the whole table
void dumpFmsGain(const Char_t *filename="dumpFmsGain.txt")
fmsGainCorrection_st ** mmGainCorrection
gain correction table
Definition: StFmsDbMaker.h:133
void dumpFmsMap(const Char_t *filename="dumpFmsMap.txt")
Int_t maxChannel(Int_t detectorId)
number of column
Int_t maxGainCorrection()
fmsGainCorrection_st * mGainCorrection
Definition: StFmsDbMaker.h:132
StThreeVectorF getDetectorOffset(Int_t detectorId)
get the channel number
Int_t maxNS()
fmsQTMap related
Int_t getChannelNumber(Int_t detectorId, Int_t row, Int_t column)
get the column number for the channel
Int_t detectorId(Int_t ew, Int_t ns, Int_t type)
maximum value of detector Id
Int_t getColumnNumber(Int_t detectorId, Int_t ch)
get the row number for the channel
Float_t getGainCorrection(Int_t detectorId, Int_t ch)
get the gain for the channel
Int_t maxGain()
fmsGain/GainCorrection related
void setDebug(Int_t debug)
debug mode, 0 for minimal message, >0 for more debug messages
Int_t type(Int_t detectorId)
north or south side
void dumpFmsGainCorrection(const Char_t *filename="dumpFmsGainCorrection.txt")
fmsPatchPanelMap_st * mPatchPanelMap
Definition: StFmsDbMaker.h:122
fmsMap_st * mMap
position (in STAR frame) of each detector
Definition: StFmsDbMaker.h:115
Int_t maxModule()
fmsPatchPanelMap related
Int_t mMaxGainCorrection
Definition: StFmsDbMaker.h:134
virtual ~StFmsDbMaker()
void dumpFmsPatchPanelMap(const Char_t *filename="dumpFmsPatchPanelMap.txt")
fmsMap_st ** mmMap
detector map
Definition: StFmsDbMaker.h:116
fmsChannelGeometry_st * ChannelGeometry()
getting the whole table
R__EXTERN StFmsDbMaker * gStFmsDbMaker
Global pointners:
Definition: StFmsDbMaker.h:142
void deleteArrays()
fmsDetectorPosition_st * mDetectorPosition
max detector Id
Definition: StFmsDbMaker.h:113
fmsChannelGeometry_st * mChannelGeometry
>0 dump tables to text files
Definition: StFmsDbMaker.h:110
fmsPatchPanelMap_st * PatchPanelMap()
fmsGainCorrection_st * GainCorrection()
Int_t getRowNumber(Int_t detectorId, Int_t ch)
maximum number of channels
Float_t getYWidth(Int_t detectorId)
get the X width of the cell
fmsGain_st ** mmGain
gain table
Definition: StFmsDbMaker.h:129
virtual Int_t Init()
Float_t getEta(Int_t detectorId, Float_t FmsX, Float_t FmsY, Float_t Vertex)
get the STAR frame phi angle
Int_t mReverseMapChannel[mMaxCrate][mMaxSlot][mMaxCh]
Definition: StFmsDbMaker.h:120
Int_t nRow(Int_t detectorId)
type of the detector
virtual Int_t Make()
Float_t getPhi(Int_t detectorId, Float_t FmsX, Float_t FmsY)
get the STAR frame coordinates
Float_t getGain(Int_t detectorId, Int_t ch)
void dumpFmsChannelGeometry(const Char_t *filename="dumpFmsChannelGeometry.txt")
get the gain correction for the channel
Int_t maxMap()
get the STAR frame pseudo rapidity assuming vertex is at (0,0,0)
void dumpFmsDetectorPosition(const Char_t *filename="dumpFmsDetectorPosition.txt")
void dumpFmsQTMap(const Char_t *filename="dumpFmsQTMap.txt")
Int_t mMaxNS
Qt map.
Definition: StFmsDbMaker.h:126
fmsGain_st * Gain()
Int_t northSouth(Int_t detectorId)
east or west to the STAR IP
virtual const Char_t * GetCVS() const
Definition: StFmsDbMaker.h:137
Int_t eastWest(Int_t detectorId)
convert to detector Id
fmsGain_st * mGain
Definition: StFmsDbMaker.h:128
Int_t maxDetectorId()
Utility functions related to FMS ChannelGeometry.
void getMap(Int_t detectorId, Int_t ch, Int_t *qtCrate, Int_t *qtSlot, Int_t *qtChannel)
Int_t mMaxDetectorId
channel configuration for each detector
Definition: StFmsDbMaker.h:111
Float_t getXWidth(Int_t detectorId)
get the offset of the detector
fmsQTMap_st * mQTMap
Definition: StFmsDbMaker.h:125
StThreeVectorF getStarXYZ(Int_t detectorId, Float_t FmsX, Float_t FmsY)
get the Y width of the cell
virtual Int_t Finish()