29 : m_name(ps.getUntrackedParameter<
std::
string>(
"name",
"EcalTPGFineGrainStripEEHandler")) {
31 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"EcalTPGFineGrainStripEEHandler Source handler constructor";
53 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"Started GetNewObjects!!!";
58 std::cout <<
"got offlineInfo = " << std::endl;
62 std::cout <<
" First object for this tag " << std::endl;
65 unsigned int max_since=0;
67 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"max_since : " << max_since;
68 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"retrieved last payload ";
72 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"Retrieving run list from ONLINE DB ... ";
74 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"Making connection...";
76 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"Done.";
106 if(min_run<max_since) {
113 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"min_run= " << min_run <<
"max_run= " << max_run;
120 std::vector<RunIOV> run_vec= my_list.
getRuns();
121 size_t num_runs=run_vec.size();
123 std::cout <<
"number of runs is : "<< num_runs<< std::endl;
129 std::vector<EcalLogicID> my_StripEcalLogicId_EE;
134 "EE_offline_stripid",123 );
135 std::cout <<
" GOT the logic ID for the EE trigger strips "<< std::endl;
138 for(
size_t kr=0; kr<run_vec.size(); kr++){
140 irun=
static_cast<unsigned int>(run_vec[kr].getRunNumber());
142 std::cout<<
" **************** "<<std::endl;
143 std::cout<<
" **************** "<<std::endl;
147 std::map<EcalLogicID, RunTPGConfigDat>
dataset;
151 int the_config_version=0;
153 std::map< EcalLogicID, RunTPGConfigDat>::const_iterator it;
156 for( it=dataset.begin(); it!=dataset.end(); it++ )
168 std::cout<<
" run= "<<irun<<
" tag "<<the_config_tag<<
" version="<<the_config_version <<std::endl;
174 std::cout<<
"the tag is different from last transferred run ... retrieving last config set from DB"<<std::endl;
181 std::cout <<
" before fetch config set" << std::endl;
182 econn-> fetchConfigSet(&fe_main_info);
183 std::cout <<
" after fetch config set" << std::endl;
192 fe_fgr_info.
setId(fgrId);
193 econn-> fetchConfigSet(&fe_fgr_info);
194 std::map<EcalLogicID, FEConfigFgrEEStripDat> dataset_TpgFineGrainStripEE;
198 typedef std::map<EcalLogicID, FEConfigFgrEEStripDat>::const_iterator CIfefgr;
204 for (CIfefgr
p = dataset_TpgFineGrainStripEE.begin();
p != dataset_TpgFineGrainStripEE.end();
p++) {
212 if (ecid_name==
"EB_VFE") {
217 if(sm>18) tcc=sm+18 ;
221 unsigned int stripEBId = 303176+(tt-1)*64+(strip-1)*8+(tcc-37)*8192;
227 fgrStripEE->
setValue(stripEBId,item);
231 }
else if (ecid_name==
"ECAL_readout_strip"){
240 bool set_the_strip=
false;
242 for (
size_t istrip=0; istrip<my_StripEcalLogicId_EE.size(); istrip++) {
246 if(my_StripEcalLogicId_EE[istrip].getID1()==id1
247 && my_StripEcalLogicId_EE[istrip].getID2()==id2
248 && my_StripEcalLogicId_EE[istrip].getID3()==id3
250 stripEEId =my_StripEcalLogicId_EE[istrip].getLogicID();
263 fgrStripEE->
setValue(stripEEId,item);
265 std::cout <<
" these may be the additional towers TCC/TT " 266 << id1<<
"/"<<id2<<std::endl;
282 writeFile(
"last_tpg_fgrStripEE_settings.txt");
290 writeFile(
"last_tpg_fgrStripEE_settings.txt");
292 std::cout<<
" even if the tag/version is not the same, the fgrStripEEestals id is the same -> no transfer needed "<< std::endl;
299 std::cout <<
"ERROR: THIS CONFIG DOES NOT EXIST: tag=" <<the_config_tag
300 <<
" version="<<the_config_version<< std::endl;
305 std::cout<<
" **************** "<<std::endl;
309 std::cout<<
" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed "<< std::endl;
310 std::cout<<
" **************** "<<std::endl;
315 std::cout<<
" the tag/version is the same -> no transfer needed "<< std::endl;
316 std::cout<<
" **************** "<<std::endl;
317 writeFile(
"last_tpg_fgrStripEE_settings.txt");
325 edm::LogInfo(
"EcalTPGFineGrainStripEEHandler") <<
"Ecal - > end of getNewObjects -----------";
339 inpFile = fopen(inputFile,
"r");
347 std::ostringstream
str;
349 fgets(line,255,inpFile);
351 str <<
"gen tag " <<
m_i_tag << std::endl ;
353 fgets(line,255,inpFile);
357 fgets(line,255,inpFile);
361 fgets(line,255,inpFile);
374 std::ofstream myfile;
375 myfile.open (inputFile);
T getParameter(std::string const &) const
void setRunTypeDef(const RunTypeDef &runTypeDef)
EcalCondDBInterface * econn
std::vector< RunIOV > getRuns()
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
void writeFile(const char *inputFile)
std::string getConfigTag() const
unsigned int getThreshold() const
void readFromFile(const char *inputFile)
std::string to_string(char value[])
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
OldContainer m_to_transfer
void setValue(const uint32_t &id, const Item &value)
std::string m_locationsource
unsigned int getLUTFgr() const
cond::ValidityInterval lastInterval
std::string getName() const
EcalTPGFineGrainStripEEHandler(edm::ParameterSet 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 getNewObjects() override
void setLocationDef(const LocationDef &locDef)
~EcalTPGFineGrainStripEEHandler() override
void setRunType(std::string runtype)
void setConfigTag(std::string x)
unsigned int m_i_run_number
void setLocation(std::string loc)
void setGeneralTag(std::string tag)
cond::TagInfo_t const & tagInfo() const