33 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Started GetNewObjects!!!";
38 std::cout <<
"got offlineInfo = " << std::endl;
42 std::cout <<
" First object for this tag " << std::endl;
45 unsigned int max_since = 0;
46 max_since = static_cast<unsigned int>(
tagInfo().lastInterval.since);
47 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"max_since : " << max_since;
50 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"retrieved last payload ";
53 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Retrieving run list from ONLINE DB ... ";
55 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Making connection...";
89 if (min_run < max_since) {
90 min_run = max_since + 1;
94 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
100 std::vector<RunIOV> run_vec = my_list.
getRuns();
101 size_t num_runs = run_vec.size();
103 std::cout <<
"number of runs is : " << num_runs << std::endl;
107 for (
size_t kr = 0; kr < run_vec.size(); kr++) {
108 irun = static_cast<unsigned int>(run_vec[kr].
getRunNumber());
110 std::cout <<
" **************** " << std::endl;
111 std::cout <<
" **************** " << std::endl;
112 std::cout <<
" run= " << irun << std::endl;
115 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
119 int the_config_version = 0;
121 std::map<EcalLogicID, RunTPGConfigDat>::const_iterator it;
134 std::cout <<
" run= " << irun <<
" tag " << the_config_tag <<
" version=" << the_config_version << std::endl;
139 std::cout <<
"the tag is different from last transferred run ... retrieving last config set from DB"
147 std::cout <<
" before fetch config set" << std::endl;
149 std::cout <<
" after fetch config set" << std::endl;
152 int linId = fe_main_info.
getLinId();
153 int fgrId = fe_main_info.
getFgrId();
154 int lutId = fe_main_info.
getLUTId();
157 std::cout <<
"one of the parameters: linId, LutId or fgrId is different from" << std::endl;
158 std::cout <<
"last transferred run ..." << std::endl;
163 fe_physLin_info.
setId(linId);
164 fe_physFgr_info.
setId(fgrId);
165 fe_physLut_info.
setId(lutId);
170 std::map<EcalLogicID, FEConfigLinParamDat> dataset_TpgPhysicsLin;
171 std::map<EcalLogicID, FEConfigLUTParamDat> dataset_TpgPhysicsLut;
172 std::map<EcalLogicID, FEConfigFgrParamDat> dataset_TpgPhysicsFgr;
179 typedef std::map<EcalLogicID, FEConfigLinParamDat>::const_iterator CIfeLin;
180 typedef std::map<EcalLogicID, FEConfigLUTParamDat>::const_iterator CIfeLUT;
181 typedef std::map<EcalLogicID, FEConfigFgrParamDat>::const_iterator CIfeFgr;
190 std::map<int, float> EtSatLinEB;
191 std::map<int, float> EtSatLinEE;
192 typedef std::map<int, float>::const_iterator itEtSat;
194 std::map<int, EcalTPGPhysicsConst::Item> temporaryMapEB;
195 std::map<int, EcalTPGPhysicsConst::Item> temporaryMapEE;
196 typedef std::map<int, EcalTPGPhysicsConst::Item>::iterator iterEB;
197 typedef std::map<int, EcalTPGPhysicsConst::Item>::iterator iterEE;
199 for (CIfeLin p0 = dataset_TpgPhysicsLin.begin(); p0 != dataset_TpgPhysicsLin.end(); p0++) {
200 ecidLin_xt = p0->first;
201 rd_physLin = p0->second;
205 if (ecid_nameLin ==
"EB") {
207 EtSatLinEB.insert(std::make_pair(eb.rawId(), rd_physLin.
getETSat()));
208 }
else if (ecid_nameLin ==
"EE") {
210 EtSatLinEE.insert(std::make_pair(ee.rawId(), rd_physLin.
getETSat()));
215 for (CIfeLUT
p1 = dataset_TpgPhysicsLut.begin();
p1 != dataset_TpgPhysicsLut.end();
p1++) {
216 ecidLut_xt =
p1->first;
217 rd_physLut =
p1->second;
222 if (ecid_nameLut ==
"EB") {
225 for (itEtSat it1 = EtSatLinEB.begin(); it1 != EtSatLinEB.end(); it1++) {
226 if (it1->first == (
int)eb.rawId()) {
227 float ETSatLin = it1->second;
229 if (rd_physLut.
getETSat() == ETSatLin) {
234 item.FG_lowThreshold = 0;
235 item.FG_highThreshold = 0;
236 item.FG_lowRatio = 0;
237 item.FG_highRatio = 0;
238 temporaryMapEB.insert(std::make_pair(eb.rawId(),
item));
240 throw cms::Exception(
"The values of the ETSatLin and ETSatLut are different.");
245 }
else if (ecid_nameLut ==
"EE") {
250 for (itEtSat it2 = EtSatLinEE.begin(); it2 != EtSatLinEE.end(); it2++) {
251 if (it2->first == (
int)ee.rawId()) {
252 float ETSatLin = it2->second;
254 if (rd_physLut.
getETSat() == ETSatLin) {
259 item.FG_lowThreshold = 0;
260 item.FG_highThreshold = 0;
261 item.FG_lowRatio = 0;
262 item.FG_highRatio = 0;
263 temporaryMapEE.insert(std::make_pair(ee.rawId(),
item));
265 throw cms::Exception(
"The values of the ETSatLin and ETSatLut are different.");
275 for (CIfeFgr
p2 = dataset_TpgPhysicsFgr.begin();
p2 != dataset_TpgPhysicsFgr.end();
p2++) {
276 ecidFgr_xt =
p2->first;
277 rd_physFgr =
p2->second;
282 if (ecid_nameFgr ==
"EB") {
285 for (iterEB itt = temporaryMapEB.begin(); itt != temporaryMapEB.end(); itt++) {
286 if (itt->first == (
int)eb.rawId()) {
292 physC->
setValue(eb.rawId(), itt->second);
298 }
else if (ecid_nameFgr ==
"EE") {
304 for (iterEE itEE = temporaryMapEE.begin(); itEE != temporaryMapEE.end(); itEE++) {
305 if (itEE->first == (
int)ee.rawId()) {
312 physC->
setValue(ee.rawId(), itEE->second);
333 writeFile(
"last_tpg_physC_settings.txt");
340 writeFile(
"last_tpg_physC_settings.txt");
342 std::cout <<
" even if the tag/version is not the same, the physics constants id is the same -> no "
350 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" << the_config_tag <<
" version=" << the_config_version
355 std::cout <<
" **************** " << std::endl;
357 }
else if (
nr == 0) {
359 std::cout <<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed " << std::endl;
360 std::cout <<
" **************** " << std::endl;
365 std::cout <<
" the tag/version is the same -> no transfer needed " << std::endl;
366 std::cout <<
" **************** " << std::endl;
367 writeFile(
"last_tpg_physC_settings.txt");
373 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Ecal - > end of getNewObjects -----------";