14 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGFineGrainTowerEEHandler")) {
16 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"EcalTPGFineGrainTowerEE Source handler constructor.";
38 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"Started GetNewObjects!!!";
43 std::cout <<
"got offlineInfo = " << std::endl;
47 std::cout <<
" First object for this tag " << std::endl;
50 unsigned int max_since=0;
52 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"max_since : " << max_since;
55 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"retrieved last payload ";
58 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"Retrieving run list from ONLINE DB ... ";
60 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"Making connection...";
62 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"Done.";
93 if(min_run<max_since) {
100 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"min_run= " << min_run <<
" max_run= " << max_run;
106 std::vector<RunIOV> run_vec= my_list.
getRuns();
107 size_t num_runs=run_vec.size();
109 std::cout <<
"number of runs is : "<< num_runs<< std::endl;
114 std::vector<EcalLogicID> my_TTEcalLogicId_EE;
119 "EE_offline_towerid",12 );
120 std::cout <<
" GOT the logic ID for the EE trigger towers "<< std::endl;
122 for(
size_t kr=0; kr<run_vec.size(); kr++){
124 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++ )
151 std::cout<<
" run= "<<irun<<
" tag "<<the_config_tag<<
" version="<<the_config_version <<std::endl;
157 std::cout<<
"the tag is different from last transferred run ... retrieving last config set from DB"<<std::endl;
164 std::cout <<
" before fetch config set" << std::endl;
165 econn-> fetchConfigSet(&fe_main_info);
166 std::cout <<
" after fetch config set" << std::endl;
174 fe_fgr_info.
setId(fgrId);
175 econn-> fetchConfigSet(&fe_fgr_info);
176 std::map<EcalLogicID, FEConfigFgrEETowerDat> dataset_TpgFineGrainEE;
180 typedef std::map<EcalLogicID, FEConfigFgrEETowerDat>::const_iterator CIfefgr;
185 for (CIfefgr
p = dataset_TpgFineGrainEE.begin();
p != dataset_TpgFineGrainEE.end();
p++) {
191 if (ecid_name==
"EE_trigger_tower") {
193 int tccid=ecid_xt.
getID1();
195 int towerid=ecid_xt.
getID2();
197 bool set_the_tower=
false;
199 for (
size_t itower=0; itower<my_TTEcalLogicId_EE.size(); itower++) {
203 if(my_TTEcalLogicId_EE[itower].getID1()==tccid && my_TTEcalLogicId_EE[itower].getID2()==towerid){
204 towid =my_TTEcalLogicId_EE[itower].getLogicID();
216 std::cout <<
" these may be the additional towers TCC/TT " 217 << tccid<<
"/"<<towerid<<std::endl;
233 writeFile(
"last_tpg_fgrTTEE_settings.txt");
241 writeFile(
"last_tpg_fgrTTEE_settings.txt");
243 std::cout<<
" even if the tag/version is not the same, the fgrTTEE id is the same -> no transfer needed "<< std::endl;
248 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" <<the_config_tag
249 <<
" version="<<the_config_version<< std::endl;
254 std::cout<<
" **************** "<<std::endl;
258 std::cout<<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed "<< std::endl;
259 std::cout<<
" **************** "<<std::endl;
264 std::cout<<
" the tag/version is the same -> no transfer needed "<< std::endl;
265 std::cout<<
" **************** "<<std::endl;
266 writeFile(
"last_tpg_fgrTTEE_settings.txt");
273 edm::LogInfo(
"EcalTPGFineGrainTowerEEHandler") <<
"Ecal - > end of getNewObjects -----------";
286 inpFile = fopen(inputFile,
"r");
294 std::ostringstream
str;
296 fgets(line,255,inpFile);
298 str <<
"gen tag " <<
m_i_tag << std::endl ;
300 fgets(line,255,inpFile);
304 fgets(line,255,inpFile);
308 fgets(line,255,inpFile);
310 str <<
"fgrTTEE_config= " <<
m_i_fgrTTEE << std::endl ;
321 std::ofstream myfile;
322 myfile.open (inputFile);
std::string to_string(char value[])
T getParameter(std::string const &) const
void setRunTypeDef(const RunTypeDef &runTypeDef)
std::vector< RunIOV > getRuns()
edm::Ref< Container > Ref
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
std::string getConfigTag() const
void writeFile(const char *inputFile)
EcalTPGFineGrainTowerEEHandler(edm::ParameterSet const &)
void readFromFile(const char *inputFile)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
EcalCondDBInterface * econn
OldContainer m_to_transfer
~EcalTPGFineGrainTowerEEHandler() override
unsigned int m_i_run_number
cond::ValidityInterval lastInterval
std::string getName() const
std::vector< EcalLogicID > getEcalLogicIDSetOrdered(std::string name, int fromId1, int toId1, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="", int orderedBy=EcalLogicID::NULLID) noexcept(false)
void setValue(const uint32_t &id, const uint32_t &lut)
void setLocationDef(const LocationDef &locDef)
std::string m_locationsource
void getNewObjects() override
void setRunType(std::string runtype)
void setConfigTag(std::string x)
void setLocation(std::string loc)
void setGeneralTag(std::string tag)
cond::TagInfo_t const & tagInfo() const