25 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGLinConstHandler")) {
27 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"EcalTPGLinConst Source handler constructor";
49 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Started getNewObjects";
53 std::cout <<
"got offlineInfo = " << std::endl;
57 std::cout <<
" First object for this tag " << std::endl;
60 unsigned int max_since =0;
62 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"max_since = " << max_since;
63 edm::LogInfo(
"EcalTPGLinConstHandler")<<
"Retrieved last payload ";
66 edm::LogInfo(
"EcalTPGLinConstHandler")<<
"Retrieving run list from ONLINE DB ... " << std::endl;
68 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Making connection..." << std::flush;
70 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Done." << std::endl;
102 if(min_run<max_since) {
103 min_run= max_since+1;
109 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"min_run= " << min_run <<
"max_run = " << max_run;
115 std::vector<RunIOV> run_vec= my_list.
getRuns();
116 size_t num_runs=run_vec.size();
118 std::cout <<
"number of runs is : "<< num_runs<< std::endl;
123 for(
size_t kr=0; kr<run_vec.size(); kr++){
125 irun=
static_cast<unsigned int>(run_vec[kr].getRunNumber());
126 std::cout<<
" **************** "<<std::endl;
127 std::cout<<
" **************** "<<std::endl;
131 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
135 int the_config_version=0;
137 std::map< EcalLogicID, RunTPGConfigDat>::const_iterator it;
140 for( it=dataset.begin(); it!=dataset.end(); it++ )
154 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"<<std::endl;
167 std::cout <<
" before fetch config set" << std::endl;
168 econn-> fetchConfigSet(&fe_main_info);
169 std::cout <<
" after fetch config set" << std::endl;
178 fe_lin_info.
setId(linId);
179 econn-> fetchConfigSet(&fe_lin_info);
180 std::map<EcalLogicID, FEConfigLinDat> dataset_TpgLin;
184 typedef std::map<EcalLogicID, FEConfigLinDat>::const_iterator CIfelin;
189 for (CIfelin
p = dataset_TpgLin.begin();
p != dataset_TpgLin.end();
p++) {
195 if (ecid_name==
"EB_crystal_number") {
196 int sm_num=ecid_xt.
getID1();
197 int xt_num=ecid_xt.
getID2();
208 linC->
insert(std::make_pair(ebdetid.
rawId(),item));
227 linC->
insert(std::make_pair(eedetid.
rawId(),item));
250 std::cout<<
" even if the tag/version is not the same, the linearization constants id is the same -> no transfer needed "<< std::endl;
254 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" <<the_config_tag
255 <<
" version="<<the_config_version<< std::endl;
260 std::cout<<
" **************** "<<std::endl;
264 std::cout<<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed "<< std::endl;
265 std::cout<<
" **************** "<<std::endl;
270 std::cout<<
" the tag/version is the same -> no transfer needed "<< std::endl;
271 std::cout<<
" **************** "<<std::endl;
280 edm::LogInfo(
"EcalTPGLinConstHandler") <<
"Ecal - > end of getNewObjects -----------";
292 inpFile = fopen(inputFile,
"r");
300 std::ostringstream
str;
302 fgets(line,255,inpFile);
304 str <<
"gen tag " <<
m_i_tag << std::endl ;
306 fgets(line,255,inpFile);
310 fgets(line,255,inpFile);
314 fgets(line,255,inpFile);
316 str <<
"lin_config= " <<
m_i_lin << std::endl ;
327 std::ofstream myfile;
328 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
std::string to_string(char value[])
void getNewObjects() override
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
OldContainer m_to_transfer
uint32_t rawId() const
get the raw id
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