31 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGSlidingWindowHandler")) {
32 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"EcalTPGSlidingWindow Source handler constructor";
49 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"Started GetNewObjects!!!";
54 std::cout <<
"got offlineInfo = " << std::endl;
58 std::cout <<
" First object for this tag " << std::endl;
61 unsigned int max_since = 0;
63 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"max_since : " << max_since;
64 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"retrieved last payload ";
68 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"Retrieving run list from ONLINE DB ... ";
70 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"Making connection...";
99 if (min_run < max_since) {
100 min_run = max_since + 1;
108 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
114 std::vector<RunIOV> run_vec = my_list.
getRuns();
115 size_t num_runs = run_vec.size();
117 std::cout <<
"number of runs is : " << num_runs << std::endl;
119 unsigned int irun = 0;
122 std::vector<EcalLogicID> my_StripEcalLogicId_EE;
123 my_StripEcalLogicId_EE =
125 std::cout <<
" GOT the logic ID for the EE trigger strips " << std::endl;
127 for (
size_t kr = 0; kr < run_vec.size(); kr++) {
128 irun =
static_cast<unsigned int>(run_vec[kr].getRunNumber());
130 std::cout <<
" **************** " << std::endl;
131 std::cout <<
" **************** " << std::endl;
132 std::cout <<
" run= " << irun << std::endl;
135 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
139 int the_config_version = 0;
141 std::map<EcalLogicID, RunTPGConfigDat>::const_iterator it;
145 for (it = dataset.begin(); it != dataset.end(); it++) {
155 std::cout <<
" run= " << irun <<
" tag " << the_config_tag <<
" version=" << the_config_version << std::endl;
160 std::cout <<
"the tag is different from last transferred run ... retrieving last config set from DB" 168 std::cout <<
" before fetch config set" << std::endl;
170 std::cout <<
" after fetch config set" << std::endl;
173 int slidingId = fe_main_info.
getSliId();
177 fe_sli_info.
setId(slidingId);
179 std::map<EcalLogicID, FEConfigSlidingDat> dataset_TpgSli;
183 typedef std::map<EcalLogicID, FEConfigSlidingDat>::const_iterator CIfesli;
188 for (CIfesli
p = dataset_TpgSli.begin();
p != dataset_TpgSli.end();
p++) {
195 if (ecid_name ==
"EB_VFE") {
196 int sm = ecid_xt.
getID1();
205 unsigned int stripEBId = 303176 + (tt - 1) * 64 + (strip - 1) * 8 + (tcc - 37) * 8192;
210 }
else if (ecid_name ==
"ECAL_readout_strip") {
214 int id3 = ecid_xt.
getID3();
216 bool set_the_strip =
false;
218 for (
size_t istrip = 0; istrip < my_StripEcalLogicId_EE.size(); istrip++) {
219 if (!set_the_strip) {
220 if (my_StripEcalLogicId_EE[istrip].getID1() == id1 &&
221 my_StripEcalLogicId_EE[istrip].getID2() == id2 &&
222 my_StripEcalLogicId_EE[istrip].getID3() == id3) {
223 stripid = my_StripEcalLogicId_EE[istrip].getLogicID();
224 set_the_strip =
true;
234 std::cout <<
" these may be the additional towers TCC/TT " << id1 <<
"/" << id2 << std::endl;
249 writeFile(
"last_tpg_sliding_settings.txt");
256 writeFile(
"last_tpg_sliding_settings.txt");
259 <<
" even if the tag/version is not the same, the sliding windows id is the same -> no transfer needed " 263 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag <<
" version=" << the_config_version
270 std::cout <<
" **************** " << std::endl;
272 }
else if (nr == 0) {
274 std::cout <<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed " << std::endl;
275 std::cout <<
" **************** " << std::endl;
280 std::cout <<
" the tag/version is the same -> no transfer needed " << std::endl;
281 std::cout <<
" **************** " << std::endl;
282 writeFile(
"last_tpg_sliding_settings.txt");
289 edm::LogInfo(
"EcalTPGSlidingWindowHandler") <<
"Ecal - > end of getNewObjects -----------";
301 inpFile = fopen(inputFile,
"r");
309 std::ostringstream
str;
311 fgets(line, 255, inpFile);
313 str <<
"gen tag " <<
m_i_tag << std::endl;
315 fgets(line, 255, inpFile);
319 fgets(line, 255, inpFile);
323 fgets(line, 255, inpFile);
325 str <<
"sliding_config= " <<
m_i_sliding << std::endl;
333 std::ofstream myfile;
334 myfile.open(inputFile);
335 myfile <<
m_i_tag << std::endl;
T getParameter(std::string const &) const
void setRunTypeDef(const RunTypeDef &runTypeDef)
std::vector< RunIOV > getRuns()
void getNewObjects() override
void readFromFile(const char *inputFile)
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
std::string getConfigTag() const
std::string to_string(char value[])
void fetchConfigSet(ICONF *iconf) noexcept(false)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
OldContainer m_to_transfer
unsigned int m_i_run_number
cond::ValidityInterval lastInterval
std::string getName() 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::string m_locationsource
void writeFile(const char *inputFile)
void setLocationDef(const LocationDef &locDef)
void setValue(const uint32_t &id, const uint32_t &value)
void setRunType(std::string runtype)
~EcalTPGSlidingWindowHandler() override
EcalCondDBInterface * econn
void setConfigTag(std::string x)
EcalTPGSlidingWindowHandler(edm::ParameterSet const &)
void setLocation(std::string loc)
void setGeneralTag(std::string tag)
cond::TagInfo_t const & tagInfo() const