43 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"Started GetNewObjects!!!";
45 unsigned int max_since = 0;
47 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"max_since : " << max_since;
48 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"retrieved last payload ";
51 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"Retrieving run list from ONLINE DB ... ";
53 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"Making connection...";
83 if (min_run < max_since) {
84 min_run = max_since + 1;
91 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
97 std::vector<RunIOV> run_vec = my_list.
getRuns();
98 size_t num_runs = run_vec.size();
100 std::cout <<
"number of runs is : " << num_runs << std::endl;
102 std::vector<EcalLogicID> my_EcalLogicId;
103 std::vector<EcalLogicID> my_EcalLogicId_EE;
105 unsigned int irun = 0;
108 "ECAL_crystal_number_fedccuxt", 610, 650, 1, 100, 0, 100,
"EB_crystal_number", 123);
111 "ECAL_crystal_number_fedccuxt", 600, 700, 1, 100, 0, 100,
"EE_crystal_number", 123);
113 for (
size_t kr = 0; kr < run_vec.size(); kr++) {
114 std::cout <<
"here we are in run " << kr << std::endl;
115 irun =
static_cast<unsigned int>(run_vec[kr].getRunNumber());
117 std::cout <<
" **************** " << std::endl;
118 std::cout <<
" **************** " << std::endl;
119 std::cout <<
" run= " << irun << std::endl;
122 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
126 int the_config_version = 0;
128 std::map<EcalLogicID, RunTPGConfigDat>::const_iterator it;
142 std::cout <<
" run= " << irun <<
" tag " << the_config_tag <<
" version=" << the_config_version << std::endl;
147 std::cout <<
"the tag is different from last transferred run ... retrieving last config set from DB" 156 std::cout <<
" before fetch config set" << std::endl;
158 std::cout <<
" after fetch config set" << std::endl;
161 int badxtId = fe_main_info.
getBxtId();
163 if (badxtId !=
m_i_badXT && badxtId != 0) {
165 fe_badXt_info.
setId(badxtId);
167 std::vector<FEConfigBadXTDat> dataset_TpgBadXT;
175 typedef std::vector<FEConfigBadXTDat>::const_iterator CIfeped;
180 for (CIfeped
p = dataset_TpgBadXT.begin();
p != dataset_TpgBadXT.end();
p++) {
185 int tt_id = rd_badXt.
getTTId();
186 int xt_id = rd_badXt.
getXTId();
189 if (fed_id >= 610 && fed_id <= 645) {
194 sm_num = fed_id - 609 + 18;
196 sm_num = fed_id - 627;
201 for (
size_t ixt = 0; ixt < my_EcalLogicId.size(); ixt++) {
202 if (my_EcalLogicId[ixt].getID1() == fed_id && my_EcalLogicId[ixt].getID2() == tt_id &&
203 my_EcalLogicId[ixt].getID3() == xt_id) {
205 int ecid = my_EcalLogicId[ixt].getLogicID();
206 xt_num = (ecid) - (101100 + sm_num) * 10000;
210 std::cout <<
" masking crystal " << sm_num <<
"/" << xt_num <<
" from fed/tt/xt" << fed_id <<
"/" 211 << tt_id <<
"/" << xt_id << std::endl;
212 if (sm_num == 0 && xt_num == 0) {
213 std::cout <<
" ERROR FOR crystal from fed/tt/xt" << fed_id <<
"/" << tt_id <<
"/" << xt_id
227 for (
size_t ixt = 0; ixt < my_EcalLogicId_EE.size(); ixt++) {
228 if (my_EcalLogicId_EE[ixt].getID1() == fed_id && my_EcalLogicId_EE[ixt].getID2() == tt_id &&
229 my_EcalLogicId_EE[ixt].getID3() == xt_id) {
230 long ecid = (long)my_EcalLogicId_EE[ixt].getLogicID();
232 y = ecid - ((long)(ecid / 1000)) * 1000;
233 x = (ecid -
y) / 1000;
234 x =
x - ((long)(x / 1000)) * 1000;
235 z = (ecid -
y -
x * 1000) / 1000000 - 2010;
243 if (x == 0 && y == 0 && z == 0) {
244 std::cout <<
" ERROR FOR crystal from fed/tt/xt" << fed_id <<
"/" << tt_id <<
"/" << xt_id
253 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"Finished badXT reading";
263 writeFile(
"last_tpg_badXT_settings.txt");
270 writeFile(
"last_tpg_badXT_settings.txt");
272 std::cout <<
" even if the tag/version is not the same, the badXT id is the same -> no transfer needed " 279 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag <<
" version=" << the_config_version
284 std::cout <<
" **************** " << std::endl;
286 }
else if (
nr == 0) {
288 std::cout <<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed " << std::endl;
289 std::cout <<
" **************** " << std::endl;
294 std::cout <<
" the tag/version is the same -> no transfer needed " << std::endl;
295 std::cout <<
" **************** " << std::endl;
296 writeFile(
"last_tpg_badXT_settings.txt");
304 edm::LogInfo(
"EcalTPGBadXTHandler") <<
"Ecal - > end of getNewObjects -----------";
void setRunTypeDef(const RunTypeDef &runTypeDef)
std::vector< RunIOV > getRuns()
void writeFile(const char *inputFile)
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
void fetchConfigSet(ICONF *iconf) noexcept(false)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
cond::TagInfo_t const & tagInfo() const
void setValue(const uint32_t id, const Item &item)
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID) noexcept(false)
std::vector< std::pair< EcalTPGCrystalStatus *, Time_t > > m_to_transfer
EcalCondDBInterface * econn
void setLocationDef(const LocationDef &locDef)
EcalTPGCrystalStatus * produceEcalTrgChannelStatus()
Log< level::Info, false > LogInfo
unsigned int m_i_run_number
std::string getConfigTag() const
void setConfigTag(std::string x)
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf) noexcept(false)
void setGeneralTag(std::string tag)
static const int SMCRYSTALMODE
void readFromFile(const char *inputFile)