25 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGLutIdMapHandler")) {
27 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"EcalTPGLutIdMap Source handler constructor";
50 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"Started GetNewObjects!!!";
55 std::cout <<
"got offlineInfo = " << std::endl;
59 std::cout <<
" First object for this tag " << std::endl;
62 unsigned int max_since=0;
64 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"max_since : " << max_since;
65 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"retrieved last payload ";
68 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"Retrieving run list from ONLINE DB ... ";
70 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"Making connection...";
105 if(min_run<max_since) {
113 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
119 std::vector<RunIOV> run_vec= my_list.
getRuns();
120 size_t num_runs=run_vec.size();
122 std::cout <<
"number of runs is : "<< num_runs<< std::endl;
127 for(
size_t kr=0; kr<run_vec.size(); kr++){
129 irun=
static_cast<unsigned int>(run_vec[kr].getRunNumber());
131 std::cout<<
" **************** "<<std::endl;
132 std::cout<<
" **************** "<<std::endl;
136 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
140 int the_config_version=0;
142 std::map< EcalLogicID, RunTPGConfigDat>::const_iterator it;
145 for( it=dataset.begin(); it!=dataset.end(); it++ )
158 std::cout<<
" run= "<<irun<<
" tag "<<the_config_tag<<
" version="<<the_config_version <<std::endl;
164 std::cout<<
"the tag is different from last transferred run ... retrieving last config set from DB"<<std::endl;
171 std::cout <<
" before fetch config set" << std::endl;
172 econn-> fetchConfigSet(&fe_main_info);
173 std::cout <<
" after fetch config set" << std::endl;
182 fe_lut_info.
setId(lutId);
183 econn-> fetchConfigSet(&fe_lut_info);
184 std::map<EcalLogicID, FEConfigLUTGroupDat> dataset_TpgLut;
187 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"Got object!";
191 typedef std::map<EcalLogicID, FEConfigLUTGroupDat>::const_iterator CIfelut;
196 for (CIfelut
p = dataset_TpgLut.begin();
p != dataset_TpgLut.end();
p++)
203 unsigned int lutArray[1024] ;
204 for (
int ilut=0;ilut<1024;++ilut) {
224 writeFile(
"last_tpg_lutIdMap_settings.txt");
232 writeFile(
"last_tpg_lutIdMap_settings.txt");
234 std::cout<<
" even if the tag/version is not the same, the lutIdMap id is the same -> no transfer needed "<< std::endl;
241 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" <<the_config_tag
242 <<
" version="<<the_config_version<< std::endl;
247 std::cout<<
" **************** "<<std::endl;
251 std::cout<<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed "<< std::endl;
252 std::cout<<
" **************** "<<std::endl;
257 std::cout<<
" the tag/version is the same -> no transfer needed "<< std::endl;
258 std::cout<<
" **************** "<<std::endl;
259 writeFile(
"last_tpg_lutIdMap_settings.txt");
267 edm::LogInfo(
"EcalTPGLutIdMapHandler") <<
"Ecal - > end of getNewObjects -----------";
281 inpFile = fopen(inputFile,
"r");
289 std::ostringstream
str;
291 fgets(line,255,inpFile);
293 str <<
"gen tag " <<
m_i_tag << std::endl ;
295 fgets(line,255,inpFile);
299 fgets(line,255,inpFile);
303 fgets(line,255,inpFile);
305 str <<
"lutIdMap_config= " <<
m_i_lutIdMap << std::endl ;
316 std::ofstream myfile;
317 myfile.open (inputFile);
T getParameter(std::string const &) const
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 getConfigTag() const
int getLUTGroupId() const
void writeFile(const char *inputFile)
EcalCondDBInterface * econn
std::string to_string(char value[])
EcalTPGLutIdMapHandler(edm::ParameterSet const &)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
void setLut(const unsigned int *lut)
OldContainer m_to_transfer
cond::ValidityInterval lastInterval
unsigned int m_i_run_number
int getLUTValue(int i) const
void setValue(const uint32_t &id, const EcalTPGLut &value)
void setLocationDef(const LocationDef &locDef)
void setRunType(std::string runtype)
void readFromFile(const char *inputFile)
void setConfigTag(std::string x)
std::string m_locationsource
void setLocation(std::string loc)
~EcalTPGLutIdMapHandler()
void setGeneralTag(std::string tag)
cond::TagInfo_t const & tagInfo() const