27 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGPedestalsHandler")) {
29 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"EcalTPGPedestals Source handler constructor";
52 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"Started getNewObjects";
57 std::cout <<
"got offlineInfo = " << std::endl;
61 std::cout <<
" First object for this tag " << std::endl;
64 unsigned int max_since =0;
66 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"max_since = " << max_since;
67 edm::LogInfo(
"EcalTPGPedestalsHandler")<<
"Retrieved last payload ";
70 edm::LogInfo(
"EcalTPGPedestalsHandler")<<
"Retrieving run list from ONLINE DB ... " << std::endl;
72 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"Making connection..." << std::flush;
74 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"Done." << std::endl;
104 if(min_run<max_since) {
105 min_run= max_since+1;
111 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"min_run= " << min_run <<
" max_run = " << max_run;
116 std::vector<RunIOV> run_vec= my_list.
getRuns();
117 size_t num_runs=run_vec.size();
119 std::cout <<
"number of runs is : "<< num_runs<< std::endl;
125 for(
size_t kr=0; kr<run_vec.size(); kr++){
126 irun=
static_cast<unsigned int>(run_vec[kr].getRunNumber());
128 std::cout<<
" **************** "<<std::endl;
129 std::cout<<
" **************** "<<std::endl;
134 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
138 int the_config_version=0;
140 std::map< EcalLogicID, RunTPGConfigDat>::const_iterator it;
143 for ( it=dataset.begin(); it!=dataset.end(); it++ )
156 std::cout<<
" run= "<<irun<<
" tag "<<the_config_tag<<
" version="<<the_config_version <<std::endl;
162 std::cout<<
"the tag is different from last transferred run ... retrieving last config set from DB"<<std::endl;
169 std::cout <<
" before fetch config set" << std::endl;
170 econn-> fetchConfigSet(&fe_main_info);
171 std::cout <<
" after fetch config set" << std::endl;
179 fe_ped_info.
setId(pedId);
180 econn-> fetchConfigSet(&fe_ped_info);
181 std::map<EcalLogicID, FEConfigPedDat> dataset_TpgPed;
186 typedef std::map<EcalLogicID, FEConfigPedDat>::const_iterator CIfeped;
190 for (CIfeped
p = dataset_TpgPed.begin();
p != dataset_TpgPed.end();
p++)
198 if (ecid_name==
"EB_crystal_number") {
199 if(icells<10)
std::cout <<
" copy the EB data " <<
" icells = " << icells << std::endl;
200 int sm_num=ecid_xt.
getID1();
201 int xt_num=ecid_xt.
getID2();
209 peds->
insert(std::make_pair(ebdetid.
rawId(),item));
211 }
else if (ecid_name==
"EE_crystal_number"){
223 peds->
insert(std::make_pair(eedetid.
rawId(),item));
247 std::cout<<
" even if the tag/version is not the same, the pedestals 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;
281 edm::LogInfo(
"EcalTPGPedestalsHandler") <<
"Ecal - > end of getNewObjects -----------";
296 inpFile = fopen(inputFile,
"r");
304 std::ostringstream
str;
306 fgets(line,255,inpFile);
308 str <<
"gen tag " <<
m_i_tag << std::endl ;
310 fgets(line,255,inpFile);
314 fgets(line,255,inpFile);
318 fgets(line,255,inpFile);
320 str <<
"ped_config= " <<
m_i_ped << std::endl ;
331 std::ofstream myfile;
332 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
float getPedMeanG1() const
~EcalTPGPedestalsHandler()
EcalCondDBInterface * econn
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
OldContainer m_to_transfer
uint32_t rawId() const
get the raw id
void writeFile(const char *inputFile)
T x() const
Cartesian x coordinate.
std::string m_locationsource
cond::ValidityInterval lastInterval
std::string getName() const
unsigned int m_i_run_number
float getPedMeanG12() const
void setLocationDef(const LocationDef &locDef)
void insert(std::pair< uint32_t, Item > const &a)
std::string to_string(char value[])
void setRunType(std::string runtype)
void readFromFile(const char *inputFile)
float getPedMeanG6() const
void setConfigTag(std::string x)
EcalTPGPedestalsHandler(edm::ParameterSet const &)
void setLocation(std::string loc)
void setGeneralTag(std::string tag)
static const int SMCRYSTALMODE
EcalTPGPedestalsMap EcalTPGPedestals
cond::TagInfo_t const & tagInfo() const