Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:50

0001 #ifndef LMFLASERCONFIGDAT_H
0002 #define LMFLASERCONFIGDAT_H
0003 
0004 /*
0005  Last updated by  Giovanni.Organtini@roma1.infn.it 2010
0006  */
0007 
0008 #include "OnlineDB/EcalCondDB/interface/LMFDat.h"
0009 
0010 /**
0011  *   LMF_LASER_CONFIG_DAT interface
0012  */
0013 class LMFLaserConfigDat : public LMFDat {
0014 public:
0015   LMFLaserConfigDat() : LMFDat() {
0016     m_tableName = "LMF_LASER_CONFIG_DAT";
0017     m_className = "LMFLaserConfigDat";
0018     m_keys["WAVELENGTH"] = 0;
0019     m_keys["VFE_GAIN"] = 1;
0020     m_keys["PN_GAIN"] = 2;
0021     m_keys["LSR_POWER"] = 3;
0022     m_keys["LSR_ATTENUATOR"] = 4;
0023     m_keys["LSR_CURRENT"] = 5;
0024     m_keys["LSR_DELAY_1"] = 6;
0025     m_keys["LSR_DELAY_2"] = 7;
0026   }
0027   LMFLaserConfigDat(EcalDBConnection *c) : LMFDat(c) {
0028     m_tableName = "LMF_LASER_CONFIG_DAT";
0029     m_className = "LMFLaserConfigDat";
0030     m_keys["WAVELENGTH"] = 0;
0031     m_keys["VFE_GAIN"] = 1;
0032     m_keys["PN_GAIN"] = 2;
0033     m_keys["LSR_POWER"] = 3;
0034     m_keys["LSR_ATTENUATOR"] = 4;
0035     m_keys["LSR_CURRENT"] = 5;
0036     m_keys["LSR_DELAY_1"] = 6;
0037     m_keys["LSR_DELAY_2"] = 7;
0038   }
0039   ~LMFLaserConfigDat() override {}
0040 
0041   LMFLaserConfigDat &setWavelength(EcalLogicID &id, int w) {
0042     LMFDat::setData(id, "WAVELENGTH", w);
0043     return *this;
0044   }
0045   LMFLaserConfigDat &setVFEGain(EcalLogicID &id, float g) {
0046     LMFDat::setData(id, "VFE_GAIN", g);
0047     return *this;
0048   }
0049   LMFLaserConfigDat &setPNGain(EcalLogicID &id, float g) {
0050     LMFDat::setData(id, "PN_GAIN", g);
0051     return *this;
0052   }
0053   LMFLaserConfigDat &setLSRPower(EcalLogicID &id, float g) {
0054     LMFDat::setData(id, "LSR_POWER", g);
0055     return *this;
0056   }
0057   LMFLaserConfigDat &setLSRAttenuator(EcalLogicID &id, float g) {
0058     LMFDat::setData(id, "LSR_ATTENUATOR", g);
0059     return *this;
0060   }
0061   LMFLaserConfigDat &setLSRCurrent(EcalLogicID &id, float g) {
0062     LMFDat::setData(id, "LSR_CURRENT", g);
0063     return *this;
0064   }
0065   LMFLaserConfigDat &setLSRDelay1(EcalLogicID &id, float g) {
0066     LMFDat::setData(id, "LSR_DELAY_1", g);
0067     return *this;
0068   }
0069   LMFLaserConfigDat &setLSRDelay2(EcalLogicID &id, float g) {
0070     LMFDat::setData(id, "LSR_DELAY_2", g);
0071     return *this;
0072   }
0073   LMFLaserConfigDat &setData(
0074       EcalLogicID &id, float w, float g, float pnga, float p, float a, float c, float d1, float d2) {
0075     LMFDat::setData(id, "WAVELENGTH", w);
0076     LMFDat::setData(id, "VFE_GAIN", g);
0077     LMFDat::setData(id, "PN_GAIN", pnga);
0078     LMFDat::setData(id, "LSR_POWER", p);
0079     LMFDat::setData(id, "LSR_ATTENUATOR", a);
0080     LMFDat::setData(id, "LSR_CURRENT", c);
0081     LMFDat::setData(id, "LSR_DELAY_1", d1);
0082     LMFDat::setData(id, "LSR_DELAY_2", d2);
0083     return *this;
0084   }
0085   LMFLaserConfigDat &setData(EcalLogicID &id, const std::vector<float> &v) {
0086     LMFDat::setData(id, v);
0087     return *this;
0088   }
0089 
0090   float getWavelength(int id) { return getData(id, "WAVELENGTH"); }
0091   float getVFEGain(int id) { return getData(id, "VFE_GAIN"); }
0092   float getPNGain(int id) { return getData(id, "PN_GAIN"); }
0093   float getLSRPower(int id) { return getData(id, "LSR_POWER"); }
0094   float getLSRAttenuator(int id) { return getData(id, "LSR_ATTENUATOR"); }
0095   float getLSRCurrent(int id) { return getData(id, "LSR_CURRENT"); }
0096   float getLSRDelay1(int id) { return getData(id, "LSR_DELAY_1"); }
0097   float getLSRDelay2(int id) { return getData(id, "LSR_DELAY_2"); }
0098 
0099   float getWavelength(EcalLogicID &id) { return getData(id, "WAVELENGTH"); }
0100   float getVFEGain(EcalLogicID &id) { return getData(id, "VFE_GAIN"); }
0101   float getPNGain(EcalLogicID &id) { return getData(id, "PN_GAIN"); }
0102   float getLSRPower(EcalLogicID &id) { return getData(id, "LSR_POWER"); }
0103   float getLSRAttenuator(EcalLogicID &id) { return getData(id, "LSR_ATTENUATOR"); }
0104   float getLSRCurrent(EcalLogicID &id) { return getData(id, "LSR_CURRENT"); }
0105   float getLSRDelay1(EcalLogicID &id) { return getData(id, "LSR_DELAY_1"); }
0106   float getLSRDelay2(EcalLogicID &id) { return getData(id, "LSR_DELAY_2"); }
0107 
0108 private:
0109 };
0110 
0111 #endif