File indexing completed on 2024-04-06 12:22:56
0001 #ifndef ODLASERCONFIG_H
0002 #define ODLASERCONFIG_H
0003
0004 #include <map>
0005 #include <stdexcept>
0006 #include "OnlineDB/Oracle/interface/Oracle.h"
0007 #include "OnlineDB/EcalCondDB/interface/IODConfig.h"
0008 #define USE_NORM 1
0009 #define USE_CHUN 2
0010 #define USE_BUFF 3
0011
0012
0013 #define BUFSIZE 200;
0014
0015 class ODLaserConfig : public IODConfig {
0016 public:
0017 friend class EcalCondDBInterface;
0018 ODLaserConfig();
0019 ~ODLaserConfig() override;
0020
0021
0022 inline std::string getTable() override { return "ECAL_Laser_CONFIGURATION"; }
0023
0024 inline void setId(int id) { m_ID = id; }
0025 inline int getId() const { return m_ID; }
0026 inline void setSize(unsigned int id) { m_size = id; }
0027 inline unsigned int getSize() const { return m_size; }
0028
0029 inline void setDebug(int x) { m_debug = x; }
0030 inline int getDebug() const { return m_debug; }
0031 inline void setDummy(int x) { m_dummy = x; }
0032 inline int getDummy() const { return m_dummy; }
0033
0034 inline void setMatacqBaseAddress(int x) { m_mq_base = x; }
0035 inline int getMatacqBaseAddress() const { return m_mq_base; }
0036 inline void setMatacqNone(int x) { m_mq_none = x; }
0037 inline int getMatacqNone() const { return m_mq_none; }
0038 inline void setMatacqMode(std::string x) { m_mode = x; }
0039 inline std::string getMatacqMode() const { return m_mode; }
0040 inline void setChannelMask(int x) { m_chan_mask = x; }
0041 inline int getChannelMask() const { return m_chan_mask; }
0042 inline void setMaxSamplesForDaq(std::string x) { m_samples = x; }
0043 inline std::string getMaxSamplesForDaq() const { return m_samples; }
0044 inline void setMatacqFedId(int x) { m_mq_fed = x; }
0045 inline int getMatacqFedId() const { return m_mq_fed; }
0046 inline void setPedestalFile(std::string x) { m_ped_file = x; }
0047 inline std::string getPedestalFile() const { return m_ped_file; }
0048 inline void setUseBuffer(int x) { m_use_buffer = x; }
0049 inline int getUseBuffer() const { return m_use_buffer; }
0050 inline void setPostTrig(int x) { m_post_trig = x; }
0051 inline int getPostTrig() const { return m_post_trig; }
0052 inline void setFPMode(int x) { m_fp_mode = x; }
0053 inline int getFPMode() const { return m_fp_mode; }
0054 inline void setHalModuleFile(std::string x) { m_hal_mod_file = x; }
0055 inline std::string getHalModuleFile() const { return m_hal_mod_file; }
0056 inline void setMatacqVernierMax(int x) { m_matacq_vernier_max = x; }
0057 inline int getMatacqVernierMax() { return m_matacq_vernier_max; }
0058 inline void setMatacqVernierMin(int x) { m_matacq_vernier_min = x; }
0059 inline int getMatacqVernierMin() { return m_matacq_vernier_min; }
0060
0061 inline void setHalAddressTableFile(std::string x) { m_hal_add_file = x; }
0062 inline std::string getHalAddressTableFile() const { return m_hal_add_file; }
0063
0064 inline void setHalStaticTableFile(std::string x) { m_hal_tab_file = x; }
0065 inline std::string getHalStaticTableFile() const { return m_hal_tab_file; }
0066
0067 inline void setMatacqSerialNumber(std::string x) { m_serial = x; }
0068 inline std::string getMatacqSerialNumber() const { return m_serial; }
0069
0070 inline void setPedestalRunEventCount(int x) { m_ped_count = x; }
0071 inline int getPedestalRunEventCount() const { return m_ped_count; }
0072
0073 inline void setRawDataMode(int x) { m_raw_mode = x; }
0074 inline int getRawDataMode() const { return m_raw_mode; }
0075
0076 inline void setMatacqAcquisitionMode(std::string x) { m_aqmode = x; }
0077 inline std::string getMatacqAcquisitionMode() const { return m_aqmode; }
0078
0079 inline void setLocalOutputFile(std::string x) { m_mq_file = x; }
0080 inline std::string getLocalOutputFile() const { return m_mq_file; }
0081
0082
0083 inline void setEMTCNone(int x) { m_emtc_1 = x; }
0084 inline int getEMTCNone() const { return m_emtc_1; }
0085 inline void setWTE2LaserDelay(int x) { m_emtc_2 = x; }
0086 inline int getWTE2LaserDelay() const { return m_emtc_2; }
0087 inline void setLaserPhase(int x) { m_emtc_3 = x; }
0088 inline int getLaserPhase() const { return m_emtc_3; }
0089 inline void setEMTCTTCIn(int x) { m_emtc_4 = x; }
0090 inline int getEMTCTTCIn() const { return m_emtc_4; }
0091 inline void setEMTCSlotId(int x) { m_emtc_5 = x; }
0092 inline int getEMTCSlotId() const { return m_emtc_5; }
0093
0094
0095
0096
0097
0098 inline void setWaveLength(int x) { m_wave = x; }
0099 inline int getWaveLength() const { return m_wave; }
0100
0101 inline void setPower(int x) { m_power = x; }
0102 inline int getPower() const { return m_power; }
0103
0104 inline void setOpticalSwitch(int x) { m_switch = x; }
0105 inline int getOpticalSwitch() const { return m_switch; }
0106
0107 inline void setFilter(int x) { m_filter = x; }
0108 inline int getFilter() const { return m_filter; }
0109
0110 inline void setLaserControlOn(int x) { m_on = x; }
0111 inline int getLaserControlOn() const { return m_on; }
0112
0113 inline void setLaserControlHost(std::string x) { m_laserhost = x; }
0114 inline std::string getLaserControlHost() const { return m_laserhost; }
0115
0116 inline void setLaserControlPort(int x) { m_laserport = x; }
0117 inline int getLaserControlPort() const { return m_laserport; }
0118
0119 inline void setLaserTag(std::string x) { m_laser_tag = x; }
0120 inline std::string getLaserTag() const { return m_laser_tag; }
0121
0122
0123
0124 inline void setWTE2LedDelay(int x) { m_wte_2_led_delay = x; }
0125 inline int getWTE2LedDelay() const { return m_wte_2_led_delay; }
0126
0127 inline void setLed1ON(int x) { m_led1_on = x; }
0128 inline int getLed1ON() const { return m_led1_on; }
0129
0130 inline void setLed2ON(int x) { m_led2_on = x; }
0131 inline int getLed2ON() const { return m_led2_on; }
0132
0133 inline void setLed3ON(int x) { m_led3_on = x; }
0134 inline int getLed3ON() const { return m_led3_on; }
0135
0136 inline void setLed4ON(int x) { m_led4_on = x; }
0137 inline int getLed4ON() const { return m_led4_on; }
0138
0139 inline void setVinj(int x) { m_vinj = x; }
0140 inline int getVinj() const { return m_vinj; }
0141
0142 inline void setOrangeLedMonAmpl(int x) { m_orange_led_mon_ampl = x; }
0143 inline int getOrangeLedMonAmpl() const { return m_orange_led_mon_ampl; }
0144
0145 inline void setBlueLedMonAmpl(int x) { m_blue_led_mon_ampl = x; }
0146 inline int getBlueLedMonAmpl() const { return m_blue_led_mon_ampl; }
0147
0148 inline void setTrigLogFile(std::string x) { m_trig_log_file = x; }
0149 inline std::string getTrigLogFile() const { return m_trig_log_file; }
0150
0151 inline void setLedControlON(int x) { m_led_control_on = x; }
0152 inline int getLedControlON() const { return m_led_control_on; }
0153
0154 inline void setLedControlHost(std::string x) { m_led_control_host = x; }
0155 inline std::string getLedControlHost() const { return m_led_control_host; }
0156
0157 inline void setLedControlPort(int x) { m_led_control_port = x; }
0158 inline int getLedControlPort() const { return m_led_control_port; }
0159
0160 inline void setIRLaserPower(int x) { m_ir_laser_power = x; }
0161 inline int getIRLaserPower() const { return m_ir_laser_power; }
0162
0163 inline void setGreenLaserPower(int x) { m_green_laser_power = x; }
0164 inline int getGreenLaserPower() const { return m_green_laser_power; }
0165
0166 inline void setRedLaserPower(int x) { m_red_laser_power = x; }
0167 inline int getRedLaserPower() const { return m_red_laser_power; }
0168
0169 inline void setBlueLaserLogAttenuator(int x) { m_blue_laser_log_attenuator = x; }
0170 inline int getBlueLaserLogAttenuator() const { return m_blue_laser_log_attenuator; }
0171
0172 inline void setIRLaserLogAttenuator(int x) { m_ir_laser_log_attenuator = x; }
0173 inline int getIRLaserLogAttenuator() const { return m_ir_laser_log_attenuator; }
0174
0175 inline void setGreenLaserLogAttenuator(int x) { m_green_laser_log_attenuator = x; }
0176 inline int getGreenLaserLogAttenuator() const { return m_green_laser_log_attenuator; }
0177
0178 inline void setRedLaserLogAttenuator(int x) { m_red_laser_log_attenuator = x; }
0179 inline int getRedLaserLogAttenuator() const { return m_red_laser_log_attenuator; }
0180
0181 inline void setLaserConfigFile(std::string x) { m_laser_config_file = x; }
0182 inline std::string getLaserConfigFile() const { return m_laser_config_file; }
0183
0184 inline void setLaserClob(unsigned char* x) { m_laser_clob = x; }
0185 inline unsigned char* getLaserClob() const { return m_laser_clob; }
0186
0187 void setParameters(const std::map<std::string, std::string>& my_keys_map);
0188
0189 int fetchNextId() noexcept(false);
0190
0191 private:
0192 void prepareWrite() noexcept(false) override;
0193 void writeDB() noexcept(false);
0194 void clear();
0195 void fetchData(ODLaserConfig* result) noexcept(false);
0196 int fetchID() noexcept(false);
0197
0198
0199 int m_ID;
0200
0201
0202 int m_dummy;
0203 int m_debug;
0204 int m_mq_base;
0205 int m_mq_none;
0206 std::string m_mode;
0207 int m_chan_mask;
0208 std::string m_samples;
0209 int m_mq_fed;
0210 std::string m_ped_file;
0211 int m_use_buffer;
0212 int m_post_trig;
0213 int m_fp_mode;
0214 std::string m_hal_mod_file;
0215 std::string m_hal_add_file;
0216 std::string m_hal_tab_file;
0217 std::string m_serial;
0218 int m_ped_count;
0219 int m_raw_mode;
0220 std::string m_aqmode;
0221 std::string m_mq_file;
0222 int m_matacq_vernier_min;
0223 int m_matacq_vernier_max;
0224
0225
0226 int m_emtc_1;
0227 int m_emtc_2;
0228 int m_emtc_3;
0229 int m_emtc_4;
0230 int m_emtc_5;
0231
0232
0233 int m_wave;
0234 int m_power;
0235 int m_switch;
0236 int m_filter;
0237 int m_on;
0238 std::string m_laserhost;
0239 int m_laserport;
0240
0241 std::string m_laser_tag;
0242
0243
0244 int m_wte_2_led_delay;
0245 int m_led1_on;
0246 int m_led2_on;
0247 int m_led3_on;
0248 int m_led4_on;
0249 int m_vinj;
0250 int m_orange_led_mon_ampl;
0251 int m_blue_led_mon_ampl;
0252 std::string m_trig_log_file;
0253 int m_led_control_on;
0254 std::string m_led_control_host;
0255 int m_led_control_port;
0256 int m_ir_laser_power;
0257 int m_green_laser_power;
0258 int m_red_laser_power;
0259 int m_blue_laser_log_attenuator;
0260 int m_ir_laser_log_attenuator;
0261 int m_green_laser_log_attenuator;
0262 int m_red_laser_log_attenuator;
0263 std::string m_laser_config_file;
0264 unsigned char* m_laser_clob;
0265 unsigned int m_size;
0266 };
0267
0268 #endif