#ifndef FIN_FndFeeMap #define FIN_FndFeeMap #include "TObject.h" #include "msql.h" const Int_t TOF_ADC_NMODULE = 9; // Number of ADC modules for Tof const Int_t TOF_ADC_NCHANNEL = 64; // Number of ADC channels/module for Tof const Int_t TOF_TDC_NMODULE = 6; // Number of TDC modules for Tof const Int_t TOF_TDC_NCHANNEL = 96; // Number of TDC channels/module for Tof const Int_t SIL_NCRAMS = 54; // Number of CRAMS for Silicon detectors const Int_t LMD_ADC_NMODULE = 9; // Number of ADC modules for Lmd const Int_t LMD_ADC_NCHANNEL = 64; // Number of ADC channels/module for Lmd const Int_t LMD_TDC_NMODULE = 6; // Number of TDC modules for Lmd const Int_t LMD_TDC_NCHANNEL = 96; // Number of TDC channels/module for Lmd const Int_t STB_NCRATE = 2; // Number of TDC crates for Stb const Int_t STB_NMODULE = 21; // Number of TDC modules/crate for Stb const Int_t STB_NCHANNEL = 96; // Number of TDC channels/module for Stb //_____________________________________________________________________ // // TFndFeeMap // // The FINUDA Database mapper: this class describes all the // tables contained in the mSQL database useful for the Front // End Electronics mapping in order to define the real detector channel // associated to a given electronic channel class TFndFeeMap : public TObject { private: Int_t isthere; // Is there a link to the database? char *query; // Query syntax; m_result *tof_res_ptr; // Pointer to TOF query Result m_row tof_row; // Pointer to TOF Row Int_t tof_n_rows; // Number of Rows from the TOF Query Int_t tof_n_fields; // Number of Fields in each Row Int_t tof_adc_tab[2][TOF_ADC_NMODULE][TOF_ADC_NCHANNEL]; // Slab number, L/R flag for ADC Int_t tof_tdc_tab[2][TOF_TDC_NMODULE][TOF_TDC_NCHANNEL]; // Slab number, L/R flag for TDC m_result *sil_res_ptr; // Pointer to SIL query Result m_row sil_row; // Pointer to SIL Row Int_t sil_n_rows; // Number of Rows from the SIL Query Int_t sil_n_fields; // Number of Fields in each Row Int_t sil_mod_tab[SIL_NCRAMS]; // Module number Int_t sil_sec_tab[SIL_NCRAMS]; // Section number m_result *lmd_res_ptr; // Pointer to LMD query Result m_row lmd_row; // Pointer to LMD Row Int_t lmd_n_rows; // Number of Rows from the LMD Query Int_t lmd_n_fields; // Number of Fields in each Row Int_t lmd_adc_tab[3][LMD_ADC_NMODULE][LMD_ADC_NCHANNEL]; // DC and Wire number, L/R flag for ADC Int_t lmd_tdc_tab[3][LMD_TDC_NMODULE][LMD_TDC_NCHANNEL]; // DC and Wire number, L/R flag for TDC m_result *stb_res_ptr; // Pointer to STB query Result m_row stb_row; // Pointer to STB Row Int_t stb_n_rows; // Number of Rows from the STB Query Int_t stb_n_fields; // Number of Fields in each Row Int_t stb_tdc_tab[2][STB_NCRATE][STB_NMODULE][STB_NCHANNEL]; // Tube and PatchPanel numbers for TDC static const Int_t SIL_NSTRPS = 1024; // Number of STRIPS for Silicon detectors m_result *sil_spy_ptr; // Pointer to SIL query Result m_row sil_spy_row; // Pointer to SIL Row Int_t sil_spy_n_rows; // Number of Rows from the SIL Query Int_t sil_spy_n_fields; // Number of Fields in each Row Int_t sil_spy_tab[SIL_NCRAMS][SIL_NSTRPS]; // Spy channels public: TFndFeeMap(); // Default constructor (if no link) TFndFeeMap(char *host); // Constructor ~TFndFeeMap(); // Destructor Int_t IsThere() {return isthere;} // Is there a database link? Int_t GetTofAdcSlb(Int_t chan); // Get Slab number for ADC hit Int_t GetTofAdcSide(Int_t chan); // Get Side (F/R) for ADC hit Int_t GetTofTdcSlb(Int_t chan); // Get Slab number for TDC hit Int_t GetTofTdcSide(Int_t chan); // Get Side (F/R) for TDC hit Int_t GetSilModule(Int_t chan); // Get ISM/OSM Module number Int_t GetSilSection(Int_t chan); // Get ISM/OSM Section number Int_t GetLmdAdcDch(Int_t, Int_t); // Get DC number for ADC hit Int_t GetLmdAdcWire(Int_t, Int_t); // Get Wire number for ADC hit Int_t GetLmdTdcDch(Int_t, Int_t); // Get DC number for TDC hit Int_t GetLmdTdcWire(Int_t, Int_t); // Get Wire number for TDC hit Int_t GetLmdAdcSide(Int_t, Int_t); // Get Side (F/R) for ADC hit Int_t GetLmdTdcSide(Int_t, Int_t); // Get Side (F/R) for TDC hit Int_t GetStbWire(Int_t, Int_t, Int_t); // Get STB wire number Int_t GetStbPatchPanel(Int_t, Int_t, Int_t); // Get STB patchpanel number Int_t IsSilSpy(Int_t hybrid,Int_t strip); // Is a spy? void Print(); // Print Database Map friend class TFndRdt; ClassDef(TFndFeeMap,3) // The Database mapper }; #endif