00001 #include "OnlineDB/EcalCondDB/interface/LMFPrimDat.h" 00002 00003 LMFPrimDat::LMFPrimDat() : LMFColoredTable() { 00004 init(); 00005 } 00006 00007 LMFPrimDat::LMFPrimDat(oracle::occi::Environment* env, 00008 oracle::occi::Connection* conn) : 00009 LMFColoredTable(env, conn) { 00010 init(); 00011 } 00012 00013 LMFPrimDat::LMFPrimDat(EcalDBConnection *c) : LMFColoredTable(c) { 00014 init(); 00015 } 00016 00017 LMFPrimDat::LMFPrimDat(std::string color, std::string system) : 00018 LMFColoredTable() { 00019 init(); 00020 setColor(color); 00021 setSystem(system); 00022 } 00023 00024 LMFPrimDat::LMFPrimDat(int color, std::string system) : 00025 LMFColoredTable() { 00026 init(); 00027 setColor(color); 00028 setSystem(system); 00029 } 00030 00031 LMFPrimDat::LMFPrimDat(oracle::occi::Environment* env, 00032 oracle::occi::Connection* conn, 00033 std::string color, std::string system) : 00034 LMFColoredTable(env, conn) { 00035 init(); 00036 setColor(color); 00037 setSystem(system); 00038 } 00039 00040 LMFPrimDat::LMFPrimDat(oracle::occi::Environment* env, 00041 oracle::occi::Connection* conn, 00042 int color, std::string system) : 00043 LMFColoredTable(env, conn) { 00044 init(); 00045 setColor(color); 00046 setSystem(system); 00047 } 00048 00049 LMFPrimDat::LMFPrimDat(EcalDBConnection *c, std::string color, 00050 std::string system) : LMFColoredTable(c) { 00051 init(); 00052 setColor(color); 00053 setSystem(system); 00054 } 00055 00056 LMFPrimDat::LMFPrimDat(EcalDBConnection *c, int color, 00057 std::string system) : LMFColoredTable(c) { 00058 init(); 00059 setColor(color); 00060 setSystem(system); 00061 } 00062 00063 void LMFPrimDat::init() { 00064 m_className = "LMFPrimDat"; 00065 m_keys["FLAG"] = 0; 00066 m_keys["MEAN"] = 1; 00067 m_keys["RMS"] = 2; 00068 m_keys["M3"] = 3; 00069 m_keys["APDAMEAN"] = 4; 00070 m_keys["APDARMS"] = 5; 00071 m_keys["APDAM3"] = 6; 00072 m_keys["APDBMEAN"] = 7; 00073 m_keys["APDBRMS"] = 8; 00074 m_keys["APDBM3"] = 9; 00075 m_keys["APDPNMEAN"] = 10; 00076 m_keys["APDPNRMS"] = 11; 00077 m_keys["APDPNM3"] = 12; 00078 m_keys["ALPHA"] = 13; 00079 m_keys["BETA"] = 14; 00080 m_keys["SHAPECORR"] = 15; 00081 m_keys["VMIN"] = 16; 00082 m_keys["VMAX"] = 17; 00083 for (unsigned int i = 0; i < m_keys.size(); i++) { 00084 m_type.push_back("NUMBER"); 00085 } 00086 m_system = 0; 00087 m_color = 0; 00088 } 00089 00090 bool LMFPrimDat::isValid() { 00091 bool ret = true; 00092 if ((getSystem() != "LASER") && (getSystem() != "LED")) { 00093 m_Error += " System name not properly set [" + getSystem() + "]"; 00094 ret = false; 00095 } 00096 if ((getSystem() == "LASER") && 00097 (getColor() != "BLUE") && (getColor() != "IR")) { 00098 m_Error += " Color not properly set [" + getColor() + "]"; 00099 ret = false; 00100 } 00101 if ((getSystem() == "LED") && 00102 (getColor() != "BLUE") && (getColor() != "ORANGE")) { 00103 m_Error += " Color not properly set [" + getColor() + "]"; 00104 ret = false; 00105 } 00106 return ret; 00107 } 00108 00109 LMFPrimDat& LMFPrimDat::setMean(EcalLogicID &id, float v) { 00110 LMFDat::setData(id, "MEAN", v); 00111 return *this; 00112 } 00113 00114 LMFPrimDat& LMFPrimDat::setRMS(EcalLogicID &id, float v) { 00115 LMFDat::setData(id, "RMS", v); 00116 return *this; 00117 } 00118 00119 LMFPrimDat& LMFPrimDat::setM3(EcalLogicID &id, float v) { 00120 LMFDat::setData(id, "M3", v); 00121 return *this; 00122 } 00123 00124 LMFPrimDat& LMFPrimDat::setPN(EcalLogicID &id, float mean, float rms, 00125 float m3) { 00126 setMean(id, mean); 00127 setRMS(id, rms); 00128 setM3(id, m3); 00129 return *this; 00130 } 00131 00132 LMFPrimDat& LMFPrimDat::setAPDoverAM3(EcalLogicID &id, float v) { 00133 LMFDat::setData(id, "APDAM3", v); 00134 return *this; 00135 } 00136 00137 LMFPrimDat& LMFPrimDat::setAPDoverAMean(EcalLogicID &id, float v) { 00138 LMFDat::setData(id, "APDAMEAN", v); 00139 return *this; 00140 } 00141 00142 LMFPrimDat& LMFPrimDat::setAPDoverARMS(EcalLogicID &id, float v) { 00143 LMFDat::setData(id, "APDARMS", v); 00144 return *this; 00145 } 00146 00147 LMFPrimDat& LMFPrimDat::setAPDoverA(EcalLogicID &id, 00148 float mean, float rms, float m3) { 00149 setAPDoverAMean(id, mean); 00150 setAPDoverARMS(id, rms); 00151 setAPDoverAM3(id, m3); 00152 return *this; 00153 } 00154 00155 LMFPrimDat& LMFPrimDat::setAPDoverBM3(EcalLogicID &id, float v) { 00156 LMFDat::setData(id, "APDBM3", v); 00157 return *this; 00158 } 00159 00160 LMFPrimDat& LMFPrimDat::setAPDoverBMean(EcalLogicID &id, float v) { 00161 LMFDat::setData(id, "APDBMEAN", v); 00162 return *this; 00163 } 00164 00165 LMFPrimDat& LMFPrimDat::setAPDoverBRMS(EcalLogicID &id, float v) { 00166 LMFDat::setData(id, "APDBRMS", v); 00167 return *this; 00168 } 00169 00170 LMFPrimDat& LMFPrimDat::setAPDoverB(EcalLogicID &id, 00171 float mean, float rms, float m3) { 00172 setAPDoverBMean(id, mean); 00173 setAPDoverBRMS(id, rms); 00174 setAPDoverBM3(id, m3); 00175 return *this; 00176 } 00177 00178 LMFPrimDat& LMFPrimDat::setAPDoverPnM3(EcalLogicID &id, float v) { 00179 LMFDat::setData(id, "APDPNM3", v); 00180 return *this; 00181 } 00182 00183 LMFPrimDat& LMFPrimDat::setAPDoverPnMean(EcalLogicID &id, float v) { 00184 LMFDat::setData(id, "APDPNMEAN", v); 00185 return *this; 00186 } 00187 00188 LMFPrimDat& LMFPrimDat::setAPDoverPnRMS(EcalLogicID &id, float v) { 00189 LMFDat::setData(id, "APDPNRMS", v); 00190 return *this; 00191 } 00192 00193 LMFPrimDat& LMFPrimDat::setAPDoverPn(EcalLogicID &id, 00194 float mean, float rms, float m3) { 00195 setAPDoverPnMean(id, mean); 00196 setAPDoverPnRMS(id, rms); 00197 setAPDoverPnM3(id, m3); 00198 return *this; 00199 } 00200 00201 LMFPrimDat& LMFPrimDat::setFlag(EcalLogicID &id, int v) { 00202 LMFDat::setData(id, "FLAG", v); 00203 return *this; 00204 } 00205 00206 LMFPrimDat& LMFPrimDat::setAlpha(EcalLogicID &id, float v) { 00207 LMFDat::setData(id, "ALPHA", v); 00208 return *this; 00209 } 00210 00211 LMFPrimDat& LMFPrimDat::setBeta(EcalLogicID &id, float v) { 00212 LMFDat::setData(id, "BETA", v); 00213 return *this; 00214 } 00215 00216 LMFPrimDat& LMFPrimDat::setShapeCorr(EcalLogicID &id, float v) { 00217 LMFDat::setData(id, "SHAPECORR", v); 00218 return *this; 00219 } 00220 00221 float LMFPrimDat::getMean(EcalLogicID &id) { 00222 return getData(id, "MEAN"); 00223 } 00224 00225 float LMFPrimDat::getRMS(EcalLogicID &id) { 00226 return getData(id, "RMS"); 00227 } 00228 00229 float LMFPrimDat::getM3(EcalLogicID &id) { 00230 return getData(id, "M3"); 00231 } 00232 00233 float LMFPrimDat::getAPDoverAM3(EcalLogicID &id) { 00234 return getData(id, "APDAM3"); 00235 } 00236 00237 float LMFPrimDat::getAPDoverAMean(EcalLogicID &id) { 00238 return getData(id, "APDAMEAN"); 00239 } 00240 00241 float LMFPrimDat::getAPDoverARMS(EcalLogicID &id) { 00242 return getData(id, "APDARMS"); 00243 } 00244 00245 float LMFPrimDat::getAPDoverBM3(EcalLogicID &id) { 00246 return getData(id, "APDBM3"); 00247 } 00248 00249 float LMFPrimDat::getAPDoverPnMean(EcalLogicID &id) { 00250 return getData(id, "APDPNMEAN"); 00251 } 00252 00253 float LMFPrimDat::getAPDoverPnRMS(EcalLogicID &id) { 00254 return getData(id, "APDPNRMS"); 00255 } 00256 00257 float LMFPrimDat::getAPDoverPnM3(EcalLogicID &id) { 00258 return getData(id, "APDPNM3"); 00259 } 00260 00261 float LMFPrimDat::getAPDoverBMean(EcalLogicID &id) { 00262 return getData(id, "APDBMEAN"); 00263 } 00264 00265 float LMFPrimDat::getAPDoverBRMS(EcalLogicID &id) { 00266 return getData(id, "APDBRMS"); 00267 } 00268 00269 float LMFPrimDat::getAlpha(EcalLogicID &id) { 00270 return getData(id, "ALPHA"); 00271 } 00272 00273 float LMFPrimDat::getBeta(EcalLogicID &id) { 00274 return getData(id, "BETA"); 00275 } 00276 00277 float LMFPrimDat::getShapeCorr(EcalLogicID &id) { 00278 return getData(id, "SHAPECORR"); 00279 } 00280 00281 int LMFPrimDat::getFlag(EcalLogicID &id) { 00282 return getData(id, "FLAG"); 00283 } 00284 00285 float LMFPrimDat::getMean(int id) { 00286 return getData(id, "MEAN"); 00287 } 00288 00289 float LMFPrimDat::getRMS(int id) { 00290 return getData(id, "RMS"); 00291 } 00292 00293 float LMFPrimDat::getM3(int id) { 00294 return getData(id, "M3"); 00295 } 00296 00297 float LMFPrimDat::getAPDoverAM3(int id) { 00298 return getData(id, "APDAM3"); 00299 } 00300 00301 float LMFPrimDat::getAPDoverAMean(int id) { 00302 return getData(id, "APDAMEAN"); 00303 } 00304 00305 float LMFPrimDat::getAPDoverARMS(int id) { 00306 return getData(id, "APDARMS"); 00307 } 00308 00309 float LMFPrimDat::getAPDoverBM3(int id) { 00310 return getData(id, "APDBM3"); 00311 } 00312 00313 float LMFPrimDat::getAPDoverPnMean(int id) { 00314 return getData(id, "APDPNMEAN"); 00315 } 00316 00317 float LMFPrimDat::getAPDoverPnRMS(int id) { 00318 return getData(id, "APDPNRMS"); 00319 } 00320 00321 float LMFPrimDat::getAPDoverPnM3(int id) { 00322 return getData(id, "APDPNM3"); 00323 } 00324 00325 float LMFPrimDat::getAPDoverBMean(int id) { 00326 return getData(id, "APDBMEAN"); 00327 } 00328 00329 float LMFPrimDat::getAPDoverBRMS(int id) { 00330 return getData(id, "APDBRMS"); 00331 } 00332 00333 float LMFPrimDat::getAlpha(int id) { 00334 return getData(id, "ALPHA"); 00335 } 00336 00337 float LMFPrimDat::getBeta(int id) { 00338 return getData(id, "BETA"); 00339 } 00340 00341 float LMFPrimDat::getShapeCorr(int id) { 00342 return getData(id, "SHAPECORR"); 00343 } 00344 00345 int LMFPrimDat::getFlag(int id) { 00346 return getData(id, "FLAG"); 00347 } 00348