CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
popcon::EcalTPGWeightGroupHandler Class Reference

#include <EcalTPGWeightGroupHandler.h>

Inheritance diagram for popcon::EcalTPGWeightGroupHandler:
popcon::PopConSourceHandler< EcalTPGWeightGroup >

Public Member Functions

 EcalTPGWeightGroupHandler (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
std::map< std::string, int > makeStripId ()
 
void readFromFile (const char *inputFile)
 
void readtxtFile ()
 
void readxmlFile ()
 
void writeFile (const char *inputFile)
 
 ~EcalTPGWeightGroupHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGWeightGroup >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Public Attributes

EcalCondDBInterfaceeconn
 

Private Member Functions

std::string to_string (char value[])
 

Private Attributes

std::map< std::string, int > correspId
 
const EcalElectronicsMappingecalMapping_
 
std::string m_file_name
 
std::string m_file_type
 
unsigned int m_firstRun
 
std::string m_gentag
 
unsigned int m_i_run_number
 
std::string m_i_tag
 
int m_i_version
 
int m_i_weightGroup
 
unsigned int m_lastRun
 
std::string m_location
 
std::string m_locationsource
 
std::string m_name
 
std::string m_pass
 
unsigned int m_runnr
 
std::string m_runtype
 
std::string m_sid
 
std::string m_user
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGWeightGroup >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< EcalTPGWeightGroup *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalTPGWeightGroupself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGWeightGroup value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGWeightGroup >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGWeightGroup >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 49 of file EcalTPGWeightGroupHandler.h.

Constructor & Destructor Documentation

popcon::EcalTPGWeightGroupHandler::EcalTPGWeightGroupHandler ( edm::ParameterSet const &  )

Definition at line 31 of file EcalTPGWeightGroupHandler.cc.

References edm::ParameterSet::getParameter(), m_file_name, m_file_type, m_firstRun, m_gentag, m_lastRun, m_location, m_locationsource, m_pass, m_runtype, m_sid, m_user, and AlCaHLTBitMon_QueryRunRegistry::string.

32  : m_name(ps.getUntrackedParameter<std::string>("name","EcalTPGWeightGroupHandler")) {
33 
34  edm::LogInfo("EcalTPGWeightGroupHandler") << "EcalTPGWeightGroup Source handler constructor.";
35  m_firstRun=static_cast<unsigned int>(atoi( ps.getParameter<std::string>("firstRun").c_str()));
36  m_lastRun=static_cast<unsigned int>(atoi( ps.getParameter<std::string>("lastRun").c_str()));
37  m_sid= ps.getParameter<std::string>("OnlineDBSID");
38  m_user= ps.getParameter<std::string>("OnlineDBUser");
39  m_pass= ps.getParameter<std::string>("OnlineDBPassword");
40  m_locationsource= ps.getParameter<std::string>("LocationSource");
41  m_location=ps.getParameter<std::string>("Location");
42  m_gentag=ps.getParameter<std::string>("GenTag");
43  m_runtype=ps.getParameter<std::string>("RunType");
44  m_file_type = ps.getParameter<std::string>("fileType"); // xml/txt
45  m_file_name = ps.getParameter<std::string>("fileName");
46 
47  edm::LogInfo("EcalTPGWeightGroupHandler") << m_sid<<"/"<<m_user<<"/"<<m_location<<"/"<<m_gentag;
48 }
popcon::EcalTPGWeightGroupHandler::~EcalTPGWeightGroupHandler ( )
override

Definition at line 50 of file EcalTPGWeightGroupHandler.cc.

50  {
51 }

Member Function Documentation

void popcon::EcalTPGWeightGroupHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGWeightGroup >.

Definition at line 53 of file EcalTPGWeightGroupHandler.cc.

References writedatasetfile::dataset, MillePedeFileConverter_cfg::e, econn, cppFunctionSkipper::exception, Exception, EcalCondDBInterface::fetchDataSet(), EcalCondDBInterface::fetchGlobalRunListByLocation(), RunTPGConfigDat::getConfigTag(), EcalCondDBInterface::getEcalLogicIDSetOrdered(), EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getID3(), EcalLogicID::getName(), RunList::getRuns(), RunTPGConfigDat::getVersion(), FEConfigMainInfo::getWeiId(), globals_cff::id1, globals_cff::id2, cond::TagInfo_t::lastInterval, m_file_type, m_firstRun, m_gentag, m_i_run_number, m_i_tag, m_i_version, m_i_weightGroup, m_lastRun, m_location, m_pass, m_runtype, m_sid, popcon::PopConSourceHandler< EcalTPGWeightGroup >::m_to_transfer, m_user, genParticles_cff::map, cond::TagInfo_t::name, AlCaHLTBitMon_ParallelJobs::p, readFromFile(), readtxtFile(), readxmlFile(), IODConfig::setConfigTag(), RunTag::setGeneralTag(), FEConfigWeightInfo::setId(), LocationDef::setLocation(), RunTag::setLocationDef(), RunTypeDef::setRunType(), RunTag::setRunTypeDef(), EcalTPGGroups::setValue(), FEConfigMainInfo::setVersion(), cond::TagInfo_t::size, findQualityFiles::size, str, AlCaHLTBitMon_QueryRunRegistry::string, digitizers_cfi::strip, popcon::PopConSourceHandler< EcalTPGWeightGroup >::tagInfo(), groupFilesInBlocks::tt, and writeFile().

53  {
54  if(m_file_type == "txt") {
55  readtxtFile();
56  }
57  else if(m_file_type == "xml") {
58  readxmlFile();
59  }
60  else {
61  edm::LogInfo("EcalTPGWeightGroupHandler") << "Started GetNewObjects!!!";
62 
63  //check whats already inside of database
64  if (tagInfo().size){
65  //check whats already inside of database
66  edm::LogInfo(" got offlineInfo = ");
67  edm::LogInfo(" tag name = ") << tagInfo().name;
68  edm::LogInfo(" size = ") << tagInfo().size;
69  } else {
70  edm::LogInfo(" First object for this tag ");
71  }
72 
73  unsigned int max_since=0;
74  max_since=static_cast<unsigned int>(tagInfo().lastInterval.first);
75  edm::LogInfo("EcalTPGWeightGroupHandler") << "max_since : " << max_since;
76 
77  edm::LogInfo("EcalTPGWeightGroupHandler") << "retrieved last payload ";
78 
79  // here we retrieve all the runs after the last from online DB
80 
81  edm::LogInfo("EcalTPGWeightGroupHandler") << "Retrieving run list from ONLINE DB ... ";
82 
83  edm::LogInfo("EcalTPGWeightGroupHandler") << "Making connection...";
85  edm::LogInfo("EcalTPGWeightGroupHandler") << "Done.";
86 
87  if (!econn)
88  {
89  edm::LogInfo(" connection parameters ") <<m_sid <<"/"<<m_user;
90  // cerr << e.what();
91  throw cms::Exception("OMDS not available");
92  }
93 
94 
95  LocationDef my_locdef;
96  my_locdef.setLocation(m_location);
97 
98  RunTypeDef my_rundef;
99  my_rundef.setRunType(m_runtype);
100 
101  RunTag my_runtag;
102  my_runtag.setLocationDef( my_locdef );
103  my_runtag.setRunTypeDef( my_rundef );
104  my_runtag.setGeneralTag(m_gentag);
105 
106  readFromFile("last_tpg_weightGroup_settings.txt");
107 
108  unsigned int min_run=m_i_run_number+1;
109 
111  min_run=m_i_run_number+1;
112  } else {
113  min_run=m_firstRun;
114  }
115 
116  if(min_run<max_since) {
117  min_run=max_since+1; // we have to add 1 to the last transferred one
118  }
119 
120  edm::LogInfo("m_i_run_number")<< m_i_run_number <<"m_firstRun "<<m_firstRun<< "max_since " <<max_since;
121 
122  unsigned int max_run=m_lastRun;
123  edm::LogInfo("EcalTPGWeightGroupHandler") << "min_run= " << min_run << " max_run= " << max_run;
124 
125  RunList my_list;
126  my_list=econn->fetchGlobalRunListByLocation(my_runtag, min_run, max_run, my_locdef);
127  // my_list=econn->fetchRunListByLocation(my_runtag,min_run,max_run,my_locdef);
128 
129  std::vector<RunIOV> run_vec= my_list.getRuns();
130  size_t num_runs=run_vec.size();
131 
132  edm::LogInfo("number of runs is : ")<< num_runs;
133 
134  unsigned int irun=0;
135  if(num_runs>0){
136 
137  // going to query the ecal logic id
138  std::vector<EcalLogicID> my_StripEcalLogicId_EE;
139  my_StripEcalLogicId_EE = econn->getEcalLogicIDSetOrdered( "ECAL_readout_strip",
140  1, 2000,
141  1, 70,
142  0,5,
143  "EE_offline_stripid",123 );
144 
145  edm::LogInfo(" GOT the logic ID for the EE trigger strips ");
146 
147  for(size_t kr=0; kr<run_vec.size(); kr++){
148 
149  irun=static_cast<unsigned int>(run_vec[kr].getRunNumber());
150 
151  edm::LogInfo(" **************** ");
152  edm::LogInfo(" **************** ");
153  edm::LogInfo(" run= ")<<irun;
154 
155  // retrieve the data :
156  std::map<EcalLogicID, RunTPGConfigDat> dataset;
157  econn->fetchDataSet(&dataset, &run_vec[kr]);
158 
159  std::string the_config_tag="";
160  int the_config_version=0;
161 
162  std::map< EcalLogicID, RunTPGConfigDat>::const_iterator it;
163 
164  int nr=0;
165  for( it=dataset.begin(); it!=dataset.end(); it++ )
166  {
167  ++nr;
168  //EcalLogicID ecalid = it->first;
169 
170  RunTPGConfigDat dat = it->second;
171  the_config_tag=dat.getConfigTag();
172  the_config_version=dat.getVersion();
173  }
174 
175  // it is all the same for all SM... get the last one
176 
177 
178  edm::LogInfo(" run= ")<<irun<<" tag "<<the_config_tag<<" version="<<the_config_version;
179 
180  // here we should check if it is the same as previous run.
181 
182 
183  if((the_config_tag != m_i_tag || the_config_version != m_i_version ) && nr>0 ) {
184  edm::LogInfo("the tag is different from last transferred run ... retrieving last config set from DB");
185 
186  FEConfigMainInfo fe_main_info;
187  fe_main_info.setConfigTag(the_config_tag);
188  fe_main_info.setVersion(the_config_version);
189 
190  try{
191  edm::LogInfo(" before fetch config set");
192  econn-> fetchConfigSet(&fe_main_info);
193  edm::LogInfo(" after fetch config set");
194 
195 
196  // now get TPGWeightGroup
197  int wId=fe_main_info.getWeiId();
198 
199  if( wId != m_i_weightGroup ) {
200 
201  FEConfigWeightInfo fe_w_info;
202  fe_w_info.setId(wId);
203  econn-> fetchConfigSet(&fe_w_info);
204  std::map<EcalLogicID, FEConfigWeightDat> dataset_TpgW;
205  econn->fetchDataSet(&dataset_TpgW, &fe_w_info);
206 
207 
208  EcalTPGWeightGroup* weightG = new EcalTPGWeightGroup;
209  typedef std::map<EcalLogicID, FEConfigWeightDat>::const_iterator CIfesli;
210  EcalLogicID ecid_xt;
211  int weightGroup;
212  int icells=0;
213 
214  std::map<std::string,int> map;
216 
217  for (CIfesli p = dataset_TpgW.begin(); p != dataset_TpgW.end(); p++) {
218  ecid_xt = p->first;
219  weightGroup = p->second.getWeightGroupId();
220 
221  std::string ecid_name=ecid_xt.getName();
222 
223  // EB data
224  if (ecid_name=="EB_VFE") {
225  int sm=ecid_xt.getID1();
226  int tt=ecid_xt.getID2();
227  int strip=ecid_xt.getID3();
228  int tcc= sm+54;
229  if(sm>18) tcc=sm+18 ;
230 
231  // simple formula to calculate the Srip EB identifier
232 
233  unsigned int stripEBId = 303176+(tt-1)*64+(strip-1)*8+(tcc-37)*8192;
234 
235  weightG->setValue(stripEBId,weightGroup);
236  ++icells;
237  }
238  else if (ecid_name=="ECAL_readout_strip"){
239  // EE data to add
240  int id1=ecid_xt.getID1();
241  int id2=ecid_xt.getID2();
242  int id3=ecid_xt.getID3();
243 
244  bool set_the_strip=false;
245  int stripEEId;
246  for (size_t istrip=0; istrip<my_StripEcalLogicId_EE.size(); istrip++) {
247 
248  if(!set_the_strip){
249 
250  if(my_StripEcalLogicId_EE[istrip].getID1()==id1
251  && my_StripEcalLogicId_EE[istrip].getID2()==id2
252  && my_StripEcalLogicId_EE[istrip].getID3()==id3
253  ){
254  stripEEId =my_StripEcalLogicId_EE[istrip].getLogicID();
255  set_the_strip=true;
256  break;
257  }
258  }
259 
260  }
261 
262  if(set_the_strip){
263 
264  weightG->setValue(stripEEId,weightGroup);
265 
266  } else {
267  edm::LogInfo(" these may be the additional towers TCC/TT ")
268  << id1<<"/"<<id2;
269  }
270 
271  ++icells;
272  }
273  }
274 
275  Time_t snc= (Time_t) irun ;
276 
277  m_to_transfer.push_back(std::make_pair((EcalTPGWeightGroup*)weightG,snc));
278 
279  m_i_run_number=irun;
280  m_i_tag=the_config_tag;
281  m_i_version=the_config_version;
282  m_i_weightGroup=wId;
283 
284  writeFile("last_tpg_weightGroup_settings.txt");
285 
286  } else {
287 
288  m_i_run_number=irun;
289  m_i_tag=the_config_tag;
290  m_i_version=the_config_version;
291 
292  writeFile("last_tpg_weightGroup_settings.txt");
293 
294  edm::LogInfo(" even if the tag/version is not the same, the weight group id is the same -> no transfer needed ");
295 
296  }
297 
298  }
299 
300  catch (std::exception &e) {
301  edm::LogInfo("ERROR: THIS CONFIG DOES NOT EXIST: tag=") <<the_config_tag
302  <<" version="<<the_config_version;
303  edm::LogInfo("Exception")<< e.what();
304  m_i_run_number=irun;
305 
306  }
307  edm::LogInfo(" **************** ");
308 
309  } else if(nr==0) {
310  m_i_run_number=irun;
311  edm::LogInfo(" no tag saved to RUN_TPGCONFIG_DAT by EcalSupervisor -> no transfer needed ");
312  edm::LogInfo(" **************** ");
313  } else {
314  m_i_run_number=irun;
315  m_i_tag=the_config_tag;
316  m_i_version=the_config_version;
317  edm::LogInfo(" the tag/version is the same -> no transfer needed ");
318  edm::LogInfo(" **************** ");
319  writeFile("last_tpg_weightGroup_settings.txt");
320  }
321 
322  }
323  }
324 
325  delete econn;
326  } // usual way
327  edm::LogInfo("EcalTPGWeightGroupHandler") << "Ecal - > end of getNewObjects -----------";
328 }
size
Write out results.
void setRunTypeDef(const RunTypeDef &runTypeDef)
Definition: RunTag.cc:70
std::vector< RunIOV > getRuns()
Definition: RunList.cc:35
RunList fetchGlobalRunListByLocation(const RunTag &tag, int min_run, int max_run, const LocationDef &locDef) noexcept(false)
std::string getConfigTag() const
int getVersion() const
Definition: RunTag.h:13
size_t size
Definition: Types.h:78
void setVersion(int id)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
std::string name
Definition: Types.h:74
int getID2() const
Definition: EcalLogicID.cc:51
cond::ValidityInterval lastInterval
Definition: Types.h:76
std::string getName() const
Definition: EcalLogicID.cc:36
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)
int getWeiId() const
void setValue(const uint32_t &rawId, const uint32_t &ObjectId)
Definition: EcalTPGGroups.cc:9
int getID1() const
Definition: EcalLogicID.cc:46
void setLocationDef(const LocationDef &locDef)
Definition: RunTag.cc:53
void setRunType(std::string runtype)
Definition: RunTypeDef.cc:33
void setConfigTag(std::string x)
Definition: IODConfig.h:31
void setLocation(std::string loc)
Definition: LocationDef.cc:33
int getID3() const
Definition: EcalLogicID.cc:56
void setGeneralTag(std::string tag)
Definition: RunTag.cc:36
#define str(s)
std::string popcon::EcalTPGWeightGroupHandler::id ( ) const
inlineoverridevirtual
std::map<std::string, int> popcon::EcalTPGWeightGroupHandler::makeStripId ( )
void popcon::EcalTPGWeightGroupHandler::readFromFile ( const char *  inputFile)

Definition at line 414 of file EcalTPGWeightGroupHandler.cc.

References analyzePatCleaning_cfg::inputFile, mps_splice::line, m_i_run_number, m_i_tag, m_i_version, m_i_weightGroup, str, and to_string().

Referenced by getNewObjects().

414  {
415  //-------------------------------------------------------------
416 
417  m_i_tag="";
418  m_i_version=0;
419  m_i_run_number=0;
420  m_i_weightGroup=0;
421 
422  FILE *inpFile; // input file
423  inpFile = fopen(inputFile,"r");
424  if(!inpFile) {
425  edm::LogError("EcalTPGWeightGroupHandler")<<"*** Can not open file: "<<inputFile;
426  return;
427  }
428 
429  char line[256];
430 
431  std::ostringstream str;
432 
433  fgets(line,255,inpFile);
434  m_i_tag=to_string(line);
435  str << "gen tag " << m_i_tag << std::endl ; // should I use this?
436 
437  fgets(line,255,inpFile);
438  m_i_version=atoi(line);
439  str << "version= " << m_i_version << std::endl ;
440 
441  fgets(line,255,inpFile);
442  m_i_run_number=atoi(line);
443  str << "run_number= " << m_i_run_number << std::endl ;
444 
445  fgets(line,255,inpFile);
446  m_i_weightGroup=atoi(line);
447  str << "weightGroup_config= " << m_i_weightGroup << std::endl ;
448 
449 
450  fclose(inpFile); // close inp. file
451 
452 }
#define str(s)
void popcon::EcalTPGWeightGroupHandler::readtxtFile ( )

Definition at line 330 of file EcalTPGWeightGroupHandler.cc.

References MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, cmsRelvalreport::exit, kEBStrips, kEEStrips, m_file_name, m_firstRun, popcon::PopConSourceHandler< EcalTPGWeightGroup >::m_to_transfer, EcalTPGGroups::setValue(), and digitizers_cfi::strip.

Referenced by getNewObjects().

330  {
331  edm::LogInfo(" reading the input file ") << m_file_name;
332  std::ifstream fInput;
333  fInput.open(m_file_name);
334  if(!fInput.is_open()) {
335  edm::LogInfo("ERROR : cannot open file ") << m_file_name;
336  exit (1);
337  }
338  int weightGroup, stripEBId, stripEEId;
339  EcalTPGWeightGroup* weightG = new EcalTPGWeightGroup;
340  for (int strip = 0; strip < kEBStrips; strip++) {
341  fInput >> stripEBId >> weightGroup;
342  weightG->setValue(stripEBId,weightGroup);
343  }
344  for (int strip = 0; strip < kEEStrips; strip++) {
345  fInput >> stripEEId >> weightGroup;
346  weightG->setValue(stripEEId,weightGroup);
347  }
348  try {
349  Time_t snc = (Time_t) m_firstRun;
350  m_to_transfer.push_back(std::make_pair((EcalTPGWeightGroup*)weightG, snc));
351  } catch (std::exception &e) {
352  edm::LogInfo("EcalTPGWeightGroupHandler::readtxtFile error : ") << e.what();
353  }
354  edm::LogInfo(" **************** ");
355 }
const Int_t kEBStrips
const Int_t kEEStrips
void setValue(const uint32_t &rawId, const uint32_t &ObjectId)
Definition: EcalTPGGroups.cc:9
void popcon::EcalTPGWeightGroupHandler::readxmlFile ( )

Definition at line 357 of file EcalTPGWeightGroupHandler.cc.

References MillePedeFileConverter_cfg::e, cppFunctionSkipper::exception, cmsRelvalreport::exit, runEdmFileComparison::found, mps_fire::i, kEBStrips, kEEStrips, m_file_name, m_firstRun, popcon::PopConSourceHandler< EcalTPGWeightGroup >::m_to_transfer, EcalTPGGroups::setValue(), AlCaHLTBitMon_QueryRunRegistry::string, and digitizers_cfi::strip.

Referenced by getNewObjects().

357  {
358  edm::LogInfo(" reading the input file ") << m_file_name;
359  std::ifstream fxml;
360  fxml.open(m_file_name);
361  if(!fxml.is_open()) {
362  edm::LogInfo("ERROR : cannot open file ") << m_file_name;
363  exit (1);
364  }
365  std::string dummyLine, bid;
366  int weightGroup, stripEBId, stripEEId;
367  EcalTPGWeightGroup* weightG = new EcalTPGWeightGroup;
368  for(int i = 0; i < 6; i++) std::getline(fxml, dummyLine); // skip first lines
369  fxml >> bid;
370  std::size_t found = bid.find("</");
371  std::string stt = bid.substr(7, found - 7);
372  for(int i = 0; i < 2; i++) std::getline(fxml, dummyLine); // <item_version>0</item_version>
373  for (int strip = 0; strip < kEBStrips; strip++) {
374  std::getline(fxml, dummyLine); // <item
375  fxml >> bid; // <first
376  found = bid.find("</");
377  stt = bid.substr(7, found - 7);
378  std::istringstream sg1(stt);
379  sg1 >> stripEBId;
380  std::getline(fxml, dummyLine);
381  fxml >> bid; // <second
382  found = bid.find("</");
383  stt = bid.substr(8, found - 8);
384  std::istringstream sg2(stt);
385  sg2 >> weightGroup;
386  weightG->setValue(stripEBId,weightGroup);
387  for(int i = 0; i < 2; i++) std::getline(fxml, dummyLine); // </item>
388  }
389  for (int strip = 0; strip < kEEStrips; strip++) {
390  std::getline(fxml, dummyLine); // <item
391  fxml >> bid; // <first
392  found = bid.find("</");
393  stt = bid.substr(7, found - 7);
394  std::istringstream sg1(stt);
395  sg1 >> stripEEId;
396  std::getline(fxml, dummyLine);
397  fxml >> bid; // <second
398  found = bid.find("</");
399  stt = bid.substr(8, found - 8);
400  std::istringstream sg2(stt);
401  sg2 >> weightGroup;
402  weightG->setValue(stripEEId,weightGroup);
403  for(int i = 0; i < 2; i++) std::getline(fxml, dummyLine); // </item>
404  }
405  try {
406  Time_t snc = (Time_t) m_firstRun;
407  m_to_transfer.push_back(std::make_pair((EcalTPGWeightGroup*)weightG, snc));
408  } catch (std::exception &e) {
409  edm::LogInfo("EcalTPGWeightGroupHandler::readtxtFile error : ") << e.what();
410  }
411  edm::LogInfo(" **************** ");
412 }
const Int_t kEBStrips
const Int_t kEEStrips
void setValue(const uint32_t &rawId, const uint32_t &ObjectId)
Definition: EcalTPGGroups.cc:9
std::string popcon::EcalTPGWeightGroupHandler::to_string ( char  value[])
inlineprivate

Definition at line 69 of file EcalTPGWeightGroupHandler.h.

References relativeConstraints::value.

Referenced by readFromFile().

69  {
70  std::ostringstream streamOut;
71  streamOut << value;
72  return streamOut.str();
73  }
void popcon::EcalTPGWeightGroupHandler::writeFile ( const char *  inputFile)

Definition at line 454 of file EcalTPGWeightGroupHandler.cc.

References m_i_run_number, m_i_tag, m_i_version, and m_i_weightGroup.

Referenced by getNewObjects(), and Vispa.Main.TabController.TabController::save().

454  {
455  //-------------------------------------------------------------
456 
457 
458  std::ofstream myfile;
459  myfile.open (inputFile);
460  myfile << m_i_tag <<std::endl;
461  myfile << m_i_version <<std::endl;
462  myfile << m_i_run_number <<std::endl;
463  myfile << m_i_weightGroup <<std::endl;
464 
465  myfile.close();
466 
467 }

Member Data Documentation

std::map<std::string, int> popcon::EcalTPGWeightGroupHandler::correspId
private

Definition at line 78 of file EcalTPGWeightGroupHandler.h.

const EcalElectronicsMapping* popcon::EcalTPGWeightGroupHandler::ecalMapping_
private

Definition at line 80 of file EcalTPGWeightGroupHandler.h.

EcalCondDBInterface* popcon::EcalTPGWeightGroupHandler::econn

Definition at line 66 of file EcalTPGWeightGroupHandler.h.

Referenced by getNewObjects().

std::string popcon::EcalTPGWeightGroupHandler::m_file_name
private

Definition at line 92 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), readtxtFile(), and readxmlFile().

std::string popcon::EcalTPGWeightGroupHandler::m_file_type
private

Definition at line 91 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

unsigned int popcon::EcalTPGWeightGroupHandler::m_firstRun
private
std::string popcon::EcalTPGWeightGroupHandler::m_gentag
private

Definition at line 82 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

unsigned int popcon::EcalTPGWeightGroupHandler::m_i_run_number
private

Definition at line 94 of file EcalTPGWeightGroupHandler.h.

Referenced by getNewObjects(), readFromFile(), and writeFile().

std::string popcon::EcalTPGWeightGroupHandler::m_i_tag
private

Definition at line 90 of file EcalTPGWeightGroupHandler.h.

Referenced by getNewObjects(), readFromFile(), and writeFile().

int popcon::EcalTPGWeightGroupHandler::m_i_version
private

Definition at line 93 of file EcalTPGWeightGroupHandler.h.

Referenced by getNewObjects(), readFromFile(), and writeFile().

int popcon::EcalTPGWeightGroupHandler::m_i_weightGroup
private

Definition at line 95 of file EcalTPGWeightGroupHandler.h.

Referenced by getNewObjects(), readFromFile(), and writeFile().

unsigned int popcon::EcalTPGWeightGroupHandler::m_lastRun
private

Definition at line 76 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

std::string popcon::EcalTPGWeightGroupHandler::m_location
private

Definition at line 81 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

std::string popcon::EcalTPGWeightGroupHandler::m_locationsource
private

Definition at line 86 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler().

std::string popcon::EcalTPGWeightGroupHandler::m_name
private

Definition at line 87 of file EcalTPGWeightGroupHandler.h.

std::string popcon::EcalTPGWeightGroupHandler::m_pass
private

Definition at line 85 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

unsigned int popcon::EcalTPGWeightGroupHandler::m_runnr
private

Definition at line 88 of file EcalTPGWeightGroupHandler.h.

std::string popcon::EcalTPGWeightGroupHandler::m_runtype
private

Definition at line 89 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

std::string popcon::EcalTPGWeightGroupHandler::m_sid
private

Definition at line 83 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().

std::string popcon::EcalTPGWeightGroupHandler::m_user
private

Definition at line 84 of file EcalTPGWeightGroupHandler.h.

Referenced by EcalTPGWeightGroupHandler(), and getNewObjects().