23 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGLinConstHandler")) {
24 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"EcalTPGLinConst Source handler constructor";
41 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Started getNewObjects";
45 std::cout <<
"got offlineInfo = " << std::endl;
49 std::cout <<
" First object for this tag " << std::endl;
52 unsigned int max_since = 0;
54 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"max_since = " << max_since;
55 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Retrieved last payload ";
58 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Retrieving run list from ONLINE DB ... " << std::endl;
60 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Making connection..." << std::flush;
62 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Done." << std::endl;
91 if (min_run < max_since) {
92 min_run = max_since + 1;
99 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"min_run= " << min_run <<
"max_run = " << max_run;
105 std::vector<RunIOV> run_vec = my_list.
getRuns();
106 size_t num_runs = run_vec.size();
108 std::cout <<
"number of runs is : " << num_runs << std::endl;
110 unsigned int irun = 0;
112 for (
size_t kr = 0; kr < run_vec.size(); kr++) {
113 irun =
static_cast<unsigned int>(run_vec[kr].getRunNumber());
114 std::cout <<
" **************** " << std::endl;
115 std::cout <<
" **************** " << std::endl;
116 std::cout <<
" run= " << irun << std::endl;
119 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
123 int the_config_version = 0;
125 std::map<EcalLogicID, RunTPGConfigDat>::const_iterator it;
128 for (it = dataset.begin(); it != dataset.end(); it++) {
139 std::cout <<
" run= " << irun <<
" tag " << the_config_tag <<
" version=" << the_config_version << std::endl;
144 std::cout <<
"the tag is different from last transferred run ... retrieving last config set from DB" 152 std::cout <<
" before fetch config set" << std::endl;
154 std::cout <<
" after fetch config set" << std::endl;
157 int linId = fe_main_info.
getLinId();
161 fe_lin_info.
setId(linId);
163 std::map<EcalLogicID, FEConfigLinDat> dataset_TpgLin;
167 typedef std::map<EcalLogicID, FEConfigLinDat>::const_iterator CIfelin;
172 for (CIfelin
p = dataset_TpgLin.begin();
p != dataset_TpgLin.end();
p++) {
178 if (ecid_name ==
"EB_crystal_number") {
179 int sm_num = ecid_xt.
getID1();
180 int xt_num = ecid_xt.
getID2();
231 std::cout <<
" even if the tag/version is not the same, the linearization constants id is the same -> no " 236 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag <<
" version=" << the_config_version
241 std::cout <<
" **************** " << std::endl;
243 }
else if (nr == 0) {
245 std::cout <<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed " << std::endl;
246 std::cout <<
" **************** " << std::endl;
251 std::cout <<
" the tag/version is the same -> no transfer needed " << std::endl;
252 std::cout <<
" **************** " << std::endl;
260 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Ecal - > end of getNewObjects -----------";
272 inpFile = fopen(inputFile,
"r");
280 std::ostringstream
str;
282 fgets(line, 255, inpFile);
284 str <<
"gen tag " <<
m_i_tag << std::endl;
286 fgets(line, 255, inpFile);
290 fgets(line, 255, inpFile);
294 fgets(line, 255, inpFile);
296 str <<
"lin_config= " <<
m_i_lin << std::endl;
304 std::ofstream myfile;
305 myfile.open(inputFile);
306 myfile <<
m_i_tag << std::endl;
309 myfile <<
m_i_lin << std::endl;
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
std::string to_string(char value[])
constexpr uint32_t rawId() const
get the raw id
void fetchConfigSet(ICONF *iconf) noexcept(false)
void getNewObjects() override
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
OldContainer m_to_transfer
cond::ValidityInterval lastInterval
std::string getName() const
void setLocationDef(const LocationDef &locDef)
void insert(std::pair< uint32_t, Item > const &a)
void readFromFile(const char *inputFile)
unsigned int m_i_run_number
EcalTPGLinConstHandler(edm::ParameterSet const &)
void setRunType(std::string runtype)
std::string m_locationsource
void setConfigTag(std::string x)
void writeFile(const char *inputFile)
void setLocation(std::string loc)
void setGeneralTag(std::string tag)
static const int SMCRYSTALMODE
EcalCondDBInterface * econn
~EcalTPGLinConstHandler() override
cond::TagInfo_t const & tagInfo() const
EcalTPGLinearizationConstMap EcalTPGLinearizationConst