11 #ifndef STAR_StEEmcDb_H
12 #define STAR_StEEmcDb_H
21 class eemcDbADCconf_st;
22 class eemcDbPMTcal_st;
23 class eemcDbPMTname_st;
24 class eemcDbPIXcal_st;
25 class eemcDbPMTped_st;
26 class eemcDbPMTstat_st;
32 #include "StEEmcUtil/EEfeeRaw/EEdims.h"
36 static const int mx=100;
39 DbFlavor(){flavor[0]=0; nameMask[0]=0;}
45 int mfirstSecID, mlastSecID;
47 void clearItemArray();
48 void requestDataBase(
StMaker *anyMaker);
49 int optimizeMapping(
int isec);
50 void optimizeOthers(
int isec);
51 void optimizeFibers();
55 eemcDbADCconf_st **mDbADCconf;
56 eemcDbPMTcal_st **mDbPMTcal ;
57 eemcDbPMTname_st **mDbPMTname ;
58 eemcDbPIXcal_st **mDbPIXcal ;
59 eemcDbPMTped_st **mDbPMTped ;
60 eemcDbPMTstat_st **mDbPMTstat ;
61 kretDbBlobS_st *mDbFiberConfBlob;
66 const EEmcDbItem *byStrip[MaxSectors][MaxSmdPlains][MaxSmdStrips];
76 template <
class St_T,
class T_st>
void getTable(
TDataSet *eedb,
int secID, TString tabName, TString mask, T_st **outTab);
78 const EEmcDbItem* getStrip(
int sec,
char uv,
int strip)
const;
84 int nChGain, mxChGain;
85 void changeGainsAction(
const char *fname);
88 int nChMask, mxChMask;
89 void changeMaskAction(
const char *fname);
95 int getFirstSector()
const {
return mfirstSecID;}
96 int getLastSector()
const {
return mlastSecID;}
98 void setThreshold(
float x);
100 void setAsciiDatabase (
const Char_t *dbfile );
101 void changeGains(
char *fname);
102 void changeMask(
char *fname);
104 void setFiberOff(
int icr);
105 const int getNFiber()
const {
return nFiber;}
107 void exportAscii(
const char *fname=
"eemcDbDump.dat")
const;
108 void print()
const {exportAscii();}
110 const EEmcDbItem* getByCrate(
int crateID,
int channel)
const;
112 const EEmcDbItem* getByStrip0(
int isec,
int iuv,
int istrip)
const;
114 const EEmcDbItem* getByStrip(
int sec,
char uv,
int strip)
const
115 {
return getByStrip0(sec-1,uv-
'U',strip-1);}
117 const EEmcDbItem* getTile(
int sec,
char sub,
int eta,
char type)
const;
119 const EEmcDbItem* getT(
int sec,
char sub,
int eta)
const {
return getTile(sec,sub,eta,
'T');}
121 const EEmcDbItem* getP(
int sec,
char sub,
int eta)
const {
return getTile(sec,sub,eta,
'P');}
122 const EEmcDbItem* getQ(
int sec,
char sub,
int eta)
const {
return getTile(sec,sub,eta,
'Q');}
123 const EEmcDbItem* getR(
int sec,
char sub,
int eta)
const {
return getTile(sec,sub,eta,
'R');}
124 const EEmcDbItem* getU(
int sec,
int strip)
const {
return getStrip(sec,
'U',strip);}
125 const EEmcDbItem* getV(
int sec,
int strip)
const {
return getStrip(sec,
'V',strip);}
133 void setPreferredFlavor(
const char *flavor,
const char *tableNameMask);
134 void setPreferedFlavor(
const char *flavor,
const char *tableNameMask){
135 setPreferredFlavor( flavor, tableNameMask);
138 int getFirstSecID()
const {
return mfirstSecID;}
139 int getLastSecID()
const {
return mlastSecID;}
140 void setDBname(TString name){ dbName=name;}
142 int valid()
const {
return nFound;}
143 float getKsigOverPed()
const {
return KsigOverPed;}
145 StEEmcDb(
const Char_t *name =
"StEEmcDb");
const EEmcDbItem * getByIndex(int ikey) const
returns full DB info for one pixel
const EEmcDbItem * StBarrelIndex2Item(int StDetId, int Bmod, int Beta, int Bsub) const
void loadTables(StMaker *anyMaker)
to access STAR-DB
void setSectors(int, int)
limit the range of sectors for speed