File indexing completed on 2024-04-06 12:02:56
0001 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
0002 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
0003 #include "OnlineDB/EcalCondDB/interface/RunIOV.h"
0004
0005 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0006
0007 #include "CondTools/Ecal/interface/EcalErrorDictionary.h"
0008
0009 #include "CondTools/Ecal/interface/EcalErrorMask.h"
0010
0011 #include <iostream>
0012
0013 void EcalErrorMask::readDB(EcalCondDBInterface* eConn, RunIOV* runIOV) noexcept(false) {
0014 if (eConn) {
0015 RunIOV validIOV;
0016 RunTag runTag = runIOV->getRunTag();
0017
0018 std::string location = runTag.getLocationDef().getLocation();
0019
0020 std::cout << std::endl;
0021 std::cout << " RunCrystalErrorsDat: ";
0022 try {
0023 eConn->fetchValidDataSet(&mapCrystalErrors_, &validIOV, location, runIOV->getRunNumber());
0024 std::cout << "found" << std::endl;
0025 } catch (std::runtime_error& e) {
0026 std::cout << "not found" << std::endl;
0027 throw(std::runtime_error(e.what()));
0028 }
0029
0030
0031 runNb_ = validIOV.getRunNumber();
0032
0033 std::cout << " RunTTErrorsDat: ";
0034 try {
0035 eConn->fetchValidDataSet(&mapTTErrors_, &validIOV, location, runIOV->getRunNumber());
0036 std::cout << "found" << std::endl;
0037 } catch (std::runtime_error& e) {
0038 std::cout << "not found" << std::endl;
0039 }
0040 std::cout << " RunPNErrorsDat: ";
0041 try {
0042 eConn->fetchValidDataSet(&mapPNErrors_, &validIOV, location, runIOV->getRunNumber());
0043 std::cout << "found" << std::endl;
0044 } catch (std::runtime_error& e) {
0045 std::cout << "not found" << std::endl;
0046 }
0047 std::cout << " RunMemChErrorsDat: ";
0048 try {
0049 eConn->fetchValidDataSet(&mapMemChErrors_, &validIOV, location, runIOV->getRunNumber());
0050 std::cout << "found" << std::endl;
0051 } catch (std::runtime_error& e) {
0052 std::cout << "not found" << std::endl;
0053 }
0054 std::cout << " RunMemTTErrorsDat: ";
0055 try {
0056 eConn->fetchValidDataSet(&mapMemTTErrors_, &validIOV, location, runIOV->getRunNumber());
0057 std::cout << "found" << std::endl;
0058 } catch (std::runtime_error& e) {
0059 std::cout << "not found" << std::endl;
0060 }
0061
0062 std::cout << std::endl;
0063 }
0064 }
0065
0066 void EcalErrorMask::fetchDataSet(std::map<EcalLogicID, RunCrystalErrorsDat>* fillMap) {
0067 fillMap->clear();
0068 *fillMap = mapCrystalErrors_;
0069 return;
0070 }
0071
0072 void EcalErrorMask::fetchDataSet(std::map<EcalLogicID, RunTTErrorsDat>* fillMap) {
0073 fillMap->clear();
0074 *fillMap = mapTTErrors_;
0075 return;
0076 }
0077
0078 void EcalErrorMask::fetchDataSet(std::map<EcalLogicID, RunPNErrorsDat>* fillMap) {
0079 fillMap->clear();
0080 *fillMap = mapPNErrors_;
0081 return;
0082 }
0083
0084 void EcalErrorMask::fetchDataSet(std::map<EcalLogicID, RunMemChErrorsDat>* fillMap) {
0085 fillMap->clear();
0086 *fillMap = mapMemChErrors_;
0087 return;
0088 }
0089
0090 void EcalErrorMask::fetchDataSet(std::map<EcalLogicID, RunMemTTErrorsDat>* fillMap) {
0091 fillMap->clear();
0092 *fillMap = mapMemTTErrors_;
0093 return;
0094 }