#ifndef EEMCDB_h #define EEMCDB_h // $Id: EEmcDb.h,v 1.11 2004/05/15 16:27:01 jwebb Exp $ #include class DbFlavor { public: static const int mx=100; char flavor[mx]; char nameMask[mx]; DbFlavor(){flavor[0]=0; nameMask[0]=0;} }; class StDbManager; class StDbConfigNode; class EEmcDbItem; class EEmcDb : public TObject { unsigned int timeStamp; DbFlavor dbFlavor; int mfirstSecID, mlastSecID, mNSector; #ifndef IN_PANITKIN StDbManager* mgr; StDbConfigNode* nodeHead; #endif int dbg; // dbg level // local fast look-up tables EEmcDbItem *byIndex; //! assess via plain index EEmcDbItem ***byCrate; //! access via crate/chan int mxAdcCrate, mxAdcChan; // local copy of dimensions int nFound; float KsigOverPed; // defines threshold #ifndef IN_PANITKIN void reloadDbConfig(int secID); void reloadDbOthers(int secID); void * getDbTable(int secID, char *nameT); // pull a table out of DB #endif void clearItemArray(); public: EEmcDb(); void setDbg(int i){ dbg=i; } void setThreshold(float x);// defines threshold for ADCsold #ifndef IN_PANITKIN void setPreferredFlavor(char *flavor, char *nameMask); void requestDataBase(unsigned int timeStamp,int sec1=5, int sec2=8, char *dbName="Calibrations_eemc", char *dbVer="Ver2004d"); // get the database tables #endif void readAsciiDataBase(char *fname,int sec1=5, int sec2=8); // get the database from an ascii file const EEmcDbItem* getByIndex(int ikey); ///< returns full DB info for one pixel const EEmcDbItem* getByCrate(int crateID, int channel); // full DB info, crateID counts from 1, channel from 0 const EEmcDbItem* getTile(int sec,char sub, int eta, char type); //ranges: sec=1-12,sub=A-E,eta=1-12,type=T,P-R ; slow method const EEmcDbItem* getByStrip0(int isec, int iuv, int istrip); //ranges: isec=0-11, iuv=0,1 ,istrip=0-287; fast method const EEmcDbItem* getByStrip(int sec, char uv, int strip) //ranges: sec=1-12, uv=U,V ,strip=1-288; slow method {return getByStrip0(sec-1,uv-'U',strip-1);} int getFirstSecID(){ return mfirstSecID;} int getLastSecID(){ return mlastSecID;} void exportAscii(char *fname="fixMe") const; #ifndef IN_PANITKIN int scaleGain(const char* pixel, float factor); friend class EEsmdCalibration; friend class EEmcIsoSmdCal; ClassDef(EEmcDb,1); // EEMC database access #endif }; #endif // $Log: EEmcDb.h,v $ // Revision 1.11 2004/05/15 16:27:01 jwebb // Added getByStrip, getByStrip0 and getTile methods. // // Revision 1.10 2004/04/16 22:33:24 balewski // chanve DB version to Ver2004d // // Revision 1.9 2004/03/23 20:02:32 jwebb // EEmcDb now inherits from TObject (had ClassDef and ClassImp declared // already). Added comments for documentation generator. Added // "friend" class EEsmdCalibration. // // Revision 1.8 2004/02/29 04:04:48 balewski // to match Panitkin // // Revision 1.7 2004/02/26 04:21:43 balewski // reading ASCII dump // // Revision 1.6 2003/12/10 04:42:33 balewski // *** empty log message *** // // Revision 1.5 2003/12/08 22:19:21 zolnie // allowed for gain // // Revision 1.4 2003/12/01 05:01:27 balewski // DB & SMD // // Revision 1.3 2003/11/22 05:35:16 balewski // *** empty log message *** // // Revision 1.2 2003/11/20 22:59:36 balewski // cleanup // // Revision 1.1 2003/11/20 16:08:53 balewski // start //