56 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"Started GetNewObjects!!!";
61 std::cout <<
"got offlineInfo = " << std::endl;
65 std::cout <<
" First object for this tag " << std::endl;
68 unsigned int max_since = 0;
70 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"max_since : " << max_since;
72 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"retrieved last payload ";
76 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"Retrieving run list from ONLINE DB ... ";
78 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"Making connection...";
101 unsigned int min_run;
109 if (min_run < max_since) {
110 min_run = max_since + 1;
117 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"min_run= " << min_run <<
" max_run= " << max_run;
123 std::vector<RunIOV> run_vec = my_list.
getRuns();
124 size_t num_runs = run_vec.size();
126 std::cout <<
"number of runs is : " << num_runs << std::endl;
128 unsigned int irun = 0;
131 std::vector<EcalLogicID> my_StripEcalLogicId_EE;
132 my_StripEcalLogicId_EE =
135 std::cout <<
" GOT the logic ID for the EE trigger strips " << std::endl;
137 for (
size_t kr = 0; kr < run_vec.size(); kr++) {
138 irun =
static_cast<unsigned int>(run_vec[kr].getRunNumber());
140 std::cout <<
" **************** " << std::endl;
141 std::cout <<
" **************** " << std::endl;
142 std::cout <<
" run= " << irun << std::endl;
145 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
149 int the_config_version = 0;
151 std::map<EcalLogicID, RunTPGConfigDat>::const_iterator
it;
165 std::cout <<
" run= " << irun <<
" tag " << the_config_tag <<
" version=" << the_config_version << std::endl;
170 std::cout <<
"the tag is different from last transferred run ... retrieving last config set from DB" 178 std::cout <<
" before fetch config set" << std::endl;
180 std::cout <<
" after fetch config set" << std::endl;
187 fe_oddw_info.
setId(wId);
189 std::map<EcalLogicID, FEConfigOddWeightDat> dataset_TpgW;
193 typedef std::map<EcalLogicID, FEConfigOddWeightDat>::const_iterator CIfesli;
197 std::map<std::string, int>
map;
200 for (CIfesli
p = dataset_TpgW.begin();
p != dataset_TpgW.end();
p++) {
202 weightGroup =
p->second.getWeightGroupId();
207 if (ecid_name ==
"EB_VFE") {
217 unsigned int stripEBId = 303176 + (
tt - 1) * 64 + (
strip - 1) * 8 + (tcc - 37) * 8192;
219 weightG->
setValue(stripEBId, weightGroup);
220 }
else if (ecid_name ==
"ECAL_readout_strip") {
224 int id3 = ecid_xt.
getID3();
226 bool set_the_strip =
false;
228 for (
size_t istrip = 0; istrip < my_StripEcalLogicId_EE.size(); istrip++) {
229 if (!set_the_strip) {
230 if (my_StripEcalLogicId_EE[istrip].getID1() ==
id1 &&
231 my_StripEcalLogicId_EE[istrip].getID2() ==
id2 &&
232 my_StripEcalLogicId_EE[istrip].getID3() == id3) {
233 stripEEId = my_StripEcalLogicId_EE[istrip].getLogicID();
234 set_the_strip =
true;
241 weightG->
setValue(stripEEId, weightGroup);
244 std::cout <<
" these may be the additional towers TCC/TT " <<
id1 <<
"/" <<
id2 << std::endl;
258 writeFile(
"last_tpg_OddweightGroup_settings.txt");
265 writeFile(
"last_tpg_OddweightGroup_settings.txt");
268 <<
" even if the tag/version is not the same, the weight group id is the same -> no transfer needed " 275 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag
276 <<
" version=" << the_config_version << std::endl;
280 std::cout <<
" **************** " << std::endl;
282 }
else if (
nr == 0) {
284 std::cout <<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed " << std::endl;
285 std::cout <<
" **************** " << std::endl;
290 std::cout <<
" the tag/version is the same -> no transfer needed " << std::endl;
291 std::cout <<
" **************** " << std::endl;
292 writeFile(
"last_tpg_OddweightGroup_settings.txt");
299 edm::LogInfo(
"EcalTPGOddWeightGroupHandler") <<
"Ecal - > end of getNewObjects -----------";
void setRunTypeDef(const RunTypeDef &runTypeDef)
std::vector< RunIOV > getRuns()
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
std::string getName() const
void fetchConfigSet(ICONF *iconf) noexcept(false)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
cond::TagInfo_t const & tagInfo() const
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< EcalTPGOddWeightGroup *, Time_t > > m_to_transfer
void setValue(const uint32_t &rawId, const uint32_t &ObjectId)
void setLocationDef(const LocationDef &locDef)
unsigned int m_i_run_number
Log< level::Info, false > LogInfo
EcalCondDBInterface * econn
std::string getConfigTag() const
void setConfigTag(std::string x)
ALPAKA_FN_ACC int sm(int ieta, int iphi)
void readFromFile(const char *inputFile)
void writeFile(const char *inputFile)
void setGeneralTag(std::string tag)