40 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"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(
"EcalTPGPhysicsConstHandler") <<
"max_since : " << max_since;
57 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"retrieved last payload ";
60 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Retrieving run list from ONLINE DB ... ";
62 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Making connection...";
98 if(min_run<max_since) {
103 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
110 std::vector<RunIOV> run_vec= my_list.
getRuns();
111 size_t num_runs=run_vec.size();
113 std::cout <<
"number of runs is : "<< num_runs<< std::endl;
118 for(
size_t kr=0; kr<run_vec.size(); kr++){
120 irun=
static_cast<unsigned int>(run_vec[kr].getRunNumber());
122 std::cout<<
" **************** "<<std::endl;
123 std::cout<<
" **************** "<<std::endl;
127 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
131 int the_config_version=0;
133 std::map< EcalLogicID, RunTPGConfigDat>::const_iterator it;
136 for( it=dataset.begin(); it!=dataset.end(); it++ )
149 std::cout<<
" run= "<<irun<<
" tag "<<the_config_tag<<
" version="<<the_config_version <<std::endl;
155 std::cout<<
"the tag is different from last transferred run ... retrieving last config set from DB"<<std::endl;
162 std::cout <<
" before fetch config set" << std::endl;
163 econn-> fetchConfigSet(&fe_main_info);
164 std::cout <<
" after fetch config set" << std::endl;
174 std::cout<<
"one of the parameters: linId, LutId or fgrId is different from" <<std::endl;
175 std::cout<<
"last transferred run ..."<<std::endl;
180 fe_physLin_info.
setId(linId);
181 fe_physFgr_info.
setId(fgrId);
182 fe_physLut_info.
setId(lutId);
184 econn-> fetchConfigSet(&fe_physLin_info);
185 econn-> fetchConfigSet(&fe_physFgr_info);
186 econn-> fetchConfigSet(&fe_physLut_info);
187 std::map<EcalLogicID, FEConfigLinParamDat> dataset_TpgPhysicsLin;
188 std::map<EcalLogicID, FEConfigLUTParamDat> dataset_TpgPhysicsLut;
189 std::map<EcalLogicID, FEConfigFgrParamDat> dataset_TpgPhysicsFgr;
196 typedef std::map<EcalLogicID, FEConfigLinParamDat>::const_iterator CIfeLin;
197 typedef std::map<EcalLogicID, FEConfigLUTParamDat>::const_iterator CIfeLUT;
198 typedef std::map<EcalLogicID, FEConfigFgrParamDat>::const_iterator CIfeFgr;
207 std::map<int,float> EtSatLinEB;
208 std::map<int,float> EtSatLinEE;
209 typedef std::map<int,float>::const_iterator itEtSat;
211 std::map<int,EcalTPGPhysicsConst::Item> temporaryMapEB;
212 std::map<int,EcalTPGPhysicsConst::Item> temporaryMapEE;
213 typedef std::map<int,EcalTPGPhysicsConst::Item>::iterator iterEB;
214 typedef std::map<int,EcalTPGPhysicsConst::Item>::iterator iterEE;
217 for (CIfeLin p0 = dataset_TpgPhysicsLin.begin(); p0 != dataset_TpgPhysicsLin.end(); p0++)
219 ecidLin_xt = p0->first;
220 rd_physLin = p0->second;
224 if(ecid_nameLin==
"EB") {
226 EtSatLinEB.insert(std::make_pair(eb.rawId(),rd_physLin.
getETSat()));
228 else if (ecid_nameLin==
"EE"){
230 EtSatLinEE.insert(std::make_pair(ee.rawId(),rd_physLin.
getETSat()));
236 for (CIfeLUT
p1 = dataset_TpgPhysicsLut.begin();
p1 != dataset_TpgPhysicsLut.end();
p1++)
238 ecidLut_xt =
p1->first;
239 rd_physLut =
p1->second;
244 if(ecid_nameLut==
"EB") {
248 for (itEtSat it1 = EtSatLinEB.begin() ; it1 != EtSatLinEB.end(); it1++){
250 if (it1->first == (
int)eb.rawId()){
251 float ETSatLin = it1->second;
253 if (rd_physLut.
getETSat() == ETSatLin) {
262 temporaryMapEB.insert(std::make_pair(eb.rawId(),item));
264 else throw cms::Exception(
"The values of the ETSatLin and ETSatLut are different.");
272 else if (ecid_nameLut==
"EE") {
277 for (itEtSat it2 = EtSatLinEE.begin(); it2 != EtSatLinEE.end(); it2++){
279 if (it2->first == (
int)ee.rawId()){
280 float ETSatLin = it2->second;
282 if (rd_physLut.
getETSat() == ETSatLin) {
291 temporaryMapEE.insert( std::make_pair(ee.rawId(),item) );
293 else throw cms::Exception(
"The values of the ETSatLin and ETSatLut are different.");
304 for (CIfeFgr
p2 = dataset_TpgPhysicsFgr.begin();
p2 != dataset_TpgPhysicsFgr.end();
p2++)
306 ecidFgr_xt =
p2->first;
307 rd_physFgr =
p2->second;
312 if(ecid_nameFgr==
"EB") {
317 for ( iterEB itt=temporaryMapEB.begin() ; itt != temporaryMapEB.end() ; itt++ ){
319 if (itt->first == (
int)eb.rawId()){
326 physC->
setValue(eb.rawId(),itt->second);
336 else if (ecid_nameFgr==
"EE") {
342 for ( iterEE itEE=temporaryMapEE.begin() ; itEE != temporaryMapEE.end() ; itEE++ ){
344 if (itEE->first == (
int)ee.rawId()){
352 physC->
setValue(ee.rawId(),itEE->second);
375 writeFile(
"last_tpg_physC_settings.txt");
383 writeFile(
"last_tpg_physC_settings.txt");
385 std::cout<<
" even if the tag/version is not the same, the physics constants id is the same -> no transfer needed "<< std::endl;
394 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" <<the_config_tag
395 <<
" version="<<the_config_version<< std::endl;
400 std::cout<<
" **************** "<<std::endl;
404 std::cout<<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed "<< std::endl;
405 std::cout<<
" **************** "<<std::endl;
410 std::cout<<
" the tag/version is the same -> no transfer needed "<< std::endl;
411 std::cout<<
" **************** "<<std::endl;
412 writeFile(
"last_tpg_physC_settings.txt");
418 edm::LogInfo(
"EcalTPGPhysicsConstHandler") <<
"Ecal - > end of getNewObjects -----------";
void setValue(const uint32_t &id, const Item &value)
void setRunTypeDef(const RunTypeDef &runTypeDef)
float getFGlowthresh() const
std::vector< RunIOV > getRuns()
edm::Ref< Container > Ref
std::string getConfigTag() const
float getFGhighthresh() const
float getFGhighratio() const
float getTTThreshhigh() const
OldContainer m_to_transfer
cond::ValidityInterval lastInterval
std::string getName() const
unsigned int m_i_run_number
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef)
float getTTThreshlow() const
void writeFile(const char *inputFile)
void setLocationDef(const LocationDef &locDef)
void setRunType(std::string runtype)
void readFromFile(const char *inputFile)
float getFGlowratio() const
double ttf_threshold_High
void setConfigTag(std::string x)
EcalCondDBInterface * econn
void setLocation(std::string loc)
void setGeneralTag(std::string tag)
tuple size
Write out results.
cond::TagInfo_t const & tagInfo() const