CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
popcon::EcalDAQHandler Class Reference

#include <EcalDAQHandler.h>

Inheritance diagram for popcon::EcalDAQHandler:
popcon::PopConSourceHandler< EcalDAQTowerStatus >

Public Member Functions

int detIDToLogicID (int, int, int)
 
 EcalDAQHandler (edm::ParameterSet const &)
 
void getNewObjects ()
 
std::string id () const
 
uint16_t OffDBStatus (uint16_t dbStatus, int pos)
 
 ~EcalDAQHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalDAQTowerStatus >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (cond::DbSession dbSession, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (cond::DbSession session, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Public Attributes

EcalCondDBInterfaceeconn
 

Private Attributes

unsigned long m_firstRun
 
std::string m_gentag
 
unsigned long m_lastRun
 
std::string m_location
 
std::string m_name
 
std::string m_pass
 
std::string m_runtype
 
std::string m_sid
 
std::string m_user
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalDAQTowerStatus >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< EcalDAQTowerStatus
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< EcalDAQTowerStatus
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalDAQTowerStatus value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalDAQTowerStatus >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalDAQTowerStatus >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 48 of file EcalDAQHandler.h.

Constructor & Destructor Documentation

popcon::EcalDAQHandler::EcalDAQHandler ( edm::ParameterSet const &  ps)

Definition at line 132 of file EcalDAQHandler.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), m_firstRun, m_gentag, m_lastRun, m_location, m_pass, m_runtype, m_sid, and m_user.

133  : m_name(ps.getUntrackedParameter<std::string>("name","EcalDAQHandler")) {
134 
135  std::cout << "EcalDAQ Source handler constructor\n" << std::endl;
136  m_firstRun =(unsigned long)atoi( ps.getParameter<std::string>("firstRun").c_str());
137  m_lastRun =(unsigned long)atoi( ps.getParameter<std::string>("lastRun").c_str());
138  m_sid = ps.getParameter<std::string>("OnlineDBSID");
139  m_user = ps.getParameter<std::string>("OnlineDBUser");
140  m_pass = ps.getParameter<std::string>("OnlineDBPassword");
141  m_location = ps.getParameter<std::string>("location");
142  m_runtype = ps.getParameter<std::string>("runtype");
143  m_gentag = ps.getParameter<std::string>("gentag");
144 
145  std::cout << m_sid << "/" << m_user << std::endl;
146 
147 }
unsigned long m_lastRun
unsigned long m_firstRun
tuple cout
Definition: gather_cfg.py:41
popcon::EcalDAQHandler::~EcalDAQHandler ( )

Definition at line 149 of file EcalDAQHandler.cc.

149  {
150 }

Member Function Documentation

int popcon::EcalDAQHandler::detIDToLogicID ( int  ,
int  ,
int   
)
void popcon::EcalDAQHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalDAQTowerStatus >.

Definition at line 160 of file EcalDAQHandler.cc.

References EcalCondTowerObjectContainer< T >::barrel(), gather_cfg::cout, debug, EcalBarrel, EcalCondTowerObjectContainer< T >::end(), edm::hlt::Exception, EcalCondTowerObjectContainer< T >::find(), ODFEDAQConfig::getBadTTId(), RunFEConfigDat::getConfigId(), EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getLogicID(), RunList::getRuns(), EcalTrigTowerDetId::hashedIndex(), ietaEB, iphiEB, ixx, iyy, gen::k, min, L1TEmulatorMonitor_cff::p, DetId::rawId(), RunTag::setGeneralTag(), ODFEDAQConfig::setId(), ODBadTTInfo::setId(), LocationDef::setLocation(), RunTag::setLocationDef(), RunTypeDef::setRunType(), RunTag::setRunTypeDef(), EcalCondTowerObjectContainer< T >::setValue(), EcalTrigTowerDetId::validDetId(), EcalScDetId::validDetId(), and z.

160  {
161  // bool lot_of_printout=false;
162  std::cout << "------- Ecal DAQ - > getNewObjects\n";
163 
164  std::ostringstream ss;
165  ss<<"ECAL ";
166 
167  unsigned long long max_since = 1;
168 
169  // this is the last inserted run
170  max_since = tagInfo().lastInterval.first;
171 
172  // this is the last object in the DB
173  std::cout << " max_since : " << max_since << std::endl;
174 
175 
176  Ref daq_db = lastPayload();
177  std::cout << "retrieved last payload " << std::endl;
178 
179  // we copy the last valid record to a temporary object peds
180  EcalDAQTowerStatus* daq_temp = new EcalDAQTowerStatus();
181 
182  // barrel
183  uint16_t oldEBStatus[72][17][2];
184  uint16_t newEBStatus[72][17][2];
185  uint16_t oldEEStatus[20][20][2];
186  uint16_t newEEStatus[20][20][2];
187  int iz = -1;
188  for(int k = 0 ; k < 2; k++ ) {
189  if(k == 1) iz = 1;
190  for(int iphi = 1 ; iphi < 73; iphi++) {
191  for(int ieta = 1 ; ieta < 18; ieta++) {
192  if (EcalTrigTowerDetId::validDetId(iz,EcalBarrel,ieta,iphi )){
193  EcalTrigTowerDetId ebid(iz,EcalBarrel,ieta,iphi);
194 
195  uint16_t dbStatus = 0;
196  dbStatus =(daq_db->barrel( ebid.hashedIndex())).getStatusCode();
197  oldEBStatus[iphi - 1][ieta -1][k] = dbStatus;
198 
199  EcalDAQTowerStatus::const_iterator it =daq_db->find(ebid.rawId());
200  if ( it != daq_db->end() ) {
201  } else {
202  std::cout<<"*** error channel not found: eta/phi ="<< ieta << "/" << iphi << std::endl;
203  }
204  daq_temp->setValue( ebid, dbStatus );
205  if(dbStatus != 0) std::cout << "barrel side " << k << " phi " << iphi << " eta " << ieta << " status " << dbStatus << std::endl;
206  }
207  } // end loop over ieta
208  } // end loop over iphi
209 
210  // endcap
211  for(int ix = 1 ; ix < 21; ix++) {
212  for(int iy = 1 ; iy < 21; iy++) {
213  if (EcalScDetId::validDetId(ix,iy,iz )){
214  EcalScDetId eeid(ix,iy,iz);
215 
216  EcalDAQTowerStatus::const_iterator it =daq_db->find(eeid.rawId());
217 
218  uint16_t dbStatus = 0;
219  if ( it != daq_db->end() ) {
220  dbStatus = it->getStatusCode();
221  }
222  oldEEStatus[ix - 1][iy -1][k] = dbStatus;
223  daq_temp->setValue( eeid, dbStatus );
224  if(dbStatus != 0) std::cout << "endcap side " << k << " x " << ix << " y " << iy << " status " << dbStatus << std::endl;
225  }
226  } // end loop over iy
227  } // end loop over ix
228  } // end loop over k (side)
229 
230  // now read the actual status from the online DB
231 
232 
233  std::cout << "Retrieving DAQ status from OMDS DB ... " << std::endl;
235  std::cout << "Connection done" << std::endl;
236 
237  if (!econn) {
238  std::cout << " Problem with OMDS: connection parameters " << m_sid << "/" << m_user << "/" << m_pass << std::endl;
239  throw cms::Exception("OMDS not available");
240  }
241 
242  // code from EcalTPGBadTTHandler.cc
243  LocationDef my_locdef;
244  my_locdef.setLocation(m_location);
245 
246  RunTypeDef my_rundef;
247  my_rundef.setRunType(m_runtype);
248 
249  RunTag my_runtag;
250  my_runtag.setLocationDef( my_locdef );
251  my_runtag.setRunTypeDef( my_rundef );
252  my_runtag.setGeneralTag(m_gentag);
253 
254  // range of validity
255  int min_run = 0;
256  if(m_firstRun < (unsigned long)max_since) {
257  min_run= (int)max_since+1; // we have to add 1 to the last transferred one
258  }
259  else { min_run=(int)m_firstRun; }
260  int max_run=(int)m_lastRun;
261  std::cout << "min_run " << min_run << " max_run " << max_run << std::endl;
262 
263  RunList my_list;
264  my_list = econn->fetchRunListByLocation(my_runtag, min_run, max_run, my_locdef);
265 
266  std::vector<RunIOV> run_vec = my_list.getRuns();
267  int num_runs = run_vec.size();
268 
269  std::cout << " number of runs is : " << num_runs << std::endl;
270 
271  unsigned long irun=0;
272  if(num_runs > 0){
273  // char outfile[800];
274  //sprintf(outfile,"BadChannelsEB_run%d.txt",min_run);
275  //ofstream *daqFile;
276  //daqFile = new ofstream(outfile,ios::out);
277 
278  bool debug = false;
279  // for(int kr = 0; kr < num_runs; kr++){
280  int krmax = std::min(num_runs, 1000);
281  for(int kr = 0; kr < krmax; kr++){
282  if(m_to_transfer.size() < 20 ) {
283 
284  if(run_vec[kr].getRunTag().getGeneralTag() != "GLOBAL") continue;
285  bool somediff = false;
286  // initialize this run status to all OK
287  if(kr == 0) debug = true;
288  else debug = false;
289  irun = (unsigned long) run_vec[kr].getRunNumber();
290  for(int k = 0 ; k < 2; k++ ) {
291  for(int iphi = 0 ; iphi < 72; iphi++) {
292  for(int ieta = 0 ; ieta < 17; ieta++) {
293  newEBStatus[iphi][ieta][k] = 0;
294  }
295  }
296  for(int ix = 0 ; ix < 20; ix++) {
297  for(int iy = 0 ; iy < 20; iy++) {
298  newEEStatus[ix][iy][k] = 0;
299  }
300  }
301  } // loop over side
302 
303 
304 
305  // these are the online conditions DB classes readout FEDs
306  std::map<EcalLogicID, RunDat> fed_dat;
307  econn->fetchDataSet(&fed_dat, &run_vec[kr]);
308 
309  // these are the online conditions DB classes unread FEs
310  typedef std::map<EcalLogicID, RunDat>::const_iterator fedIter;
311  // EcalLogicID ecid_xt;
312  RunDat rdat_fe;
313  EcalLogicID idfed;
314 
315  std::map<EcalLogicID, RunFEConfigDat> feconfig;
316  econn->fetchDataSet(&feconfig, &run_vec[kr]);
317 
318  if(fed_dat.size() == 0 || feconfig.size() == 0) {
319  std::cout << " run " << irun << " tag " << run_vec[kr].getRunTag().getGeneralTag()
320  << " Run type " << run_vec[kr].getRunTag().getRunTypeDef().getRunType()
321  << " feconfig and/or read FED size = 0, leaving..." << std::endl;
322  continue;
323  }
324 
325 
326  if(fed_dat.size() != 54 ) {
327  // debug = true;
328  int SM[36] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
329  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
330  int Sect[2][9] = {{0, 0, 0, 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0, 0, 0}};
331  for (fedIter p=fed_dat.begin(); p!=fed_dat.end(); p++) {
332  idfed = p->first;
333  int sm = 0;
334  int z = 0;
335  if(idfed.getLogicID()<2000000000){// eb
336  sm = idfed.getID1();
337  // std::cout << " EB " << sm;
338  SM[sm - 1] = 1;
339  }
340  else { // ee
341  z = idfed.getID1();
342  sm = idfed.getID2();
343  // std::cout << " EE " << z << " " << sm;
344  int izz = z;
345  if(z == -1) izz = 0;
346  Sect[izz][sm - 1] = 1;
347  }
348  } // loop over all FED
350  /* if(irun == 124089) {
351  Sect[0][2] = 0;
352  Sect[1][7] = 0;
353  } */
355  // mark all TT/SC in the not read out FEDs
356  for(int sm = 0; sm < 36; sm++) // barrel
357  if(SM[sm] != 1) {
358  //std::cout << " missing EB " << sm + 1 << std::endl;
359  if(sm < 18)
360  for(int tt = 0; tt < 68; tt++)
361  newEBStatus[iphiEB[sm][tt] - 1][ietaEB[sm][tt] - 1][0] = 1;
362  else
363  for(int tt = 0; tt < 68; tt++)
364  newEBStatus[iphiEB[sm - 18][tt] - 1][ietaEB[sm - 18][tt] - 1][1] = 1;
365  }
366  for(int z = 0; z < 2; z++) // endcaps
367  for(int sec = 0; sec < 9; sec++)
368  if(Sect[z][sec] != 1) {
369  //std::cout << " missing EE " << z << " " << sec + 1 << std::endl;
370  int sec18 = sec;
371  if(z == 1) sec18 = sec + 9;
372  for(int sc = 0 ; sc < 41; sc++) {
373  if(ixx[sec18][sc][0] != 0) {
374  newEEStatus[ixx[sec18][sc][0] - 1][iyy[sec18][sc][0] - 1][z] = 1;
375  if(ixx[sec18][sc][1] != 0) {
376  newEEStatus[ixx[sec18][sc][1] - 1][iyy[sec18][sc][1] - 1][z] = 1;
377  if(ixx[sec18][sc][2] != 0) {
378  newEEStatus[ixx[sec18][sc][2] - 1][iyy[sec18][sc][2] - 1][z] = 1;
379  }
380  }
381  }
382  } // loop over all possible SC in a sector
383  } // not read out sector
384  } // not all FED are read out
385 
386  typedef std::map<EcalLogicID, RunFEConfigDat>::const_iterator feConfIter;
387  // EcalLogicID ecid_xt;
388  RunFEConfigDat rd_fe;
389 
390  int fe_conf_id = 0;
391  for (feConfIter p=feconfig.begin(); p!=feconfig.end(); p++) {
392  // ecid_xt = p->first;
393  rd_fe = p->second;
394  fe_conf_id = rd_fe.getConfigId();
395  }
396 
397  // reading this configuration
398  ODFEDAQConfig myconfig;
399  myconfig.setId(fe_conf_id);
400  econn->fetchConfigSet(&myconfig);
401 
402  // list of bad towers
403  int myTT = myconfig.getBadTTId();
404  ODBadTTInfo mybadTT;
405  std::vector< ODBadTTDat > badTT_dat;
406  unsigned NbadTT = 0;
407 
408  /* if(myTT == 0) {
409  std::cout << " myTT = 0" << std::endl;
410  continue;
411  }
412  else {
413  */
414  if(myTT != 0) {
415  mybadTT.setId(myTT);
416  econn->fetchConfigSet(&mybadTT);
417 
418  econn->fetchConfigDataSet(&badTT_dat, &mybadTT);
419  NbadTT = badTT_dat.size();
420  }
421 
422  /* std::cout << " run " << irun << " tag " << run_vec[kr].getRunTag().getGeneralTag()
423  << " Run type " << run_vec[kr].getRunTag().getRunTypeDef().getRunType()
424  << " number of read FEDs " << fed_dat.size()
425  << " number of bad FEs " << NbadTT
426  << " fe_conf_id " << fe_conf_id << std::endl;
427  */
428 
429  // *daqFile << " run " << irun << " bad TT number " << NbadTT << "\n" << "Towers : ";
430  for(size_t iTT = 0; iTT < NbadTT; iTT++){
431  int fed_id = badTT_dat[iTT].getFedId();
432  int tt_id = badTT_dat[iTT].getTTId();
433  // int SM = badTT_dat[iTT].getSMId(); // SM always 0!
434  int side = 0; // EB/EE-
435  //*daqFile << fed_id << "/" << tt_id << " ";
436  // std::cout << fed_id << "/" << tt_id << "/" << SM << "/" ;
437  // std::cout << fed_id << "/" << tt_id << "/";
438  if(fed_id >= 610 && fed_id <= 645) { // barrel
439  if(tt_id > 68) {
440  //std::cout << " Problem in Fed " << fed_id << " TT " << tt_id << " Give up " << std::endl;
441  continue;
442  }
443  if(fed_id > 627) side = +1; // EB+
444  if(debug) std::cout << " phi " << iphiEB[fed_id - 610][tt_id - 1]
445  << " eta " << ietaEB[fed_id - 610][tt_id - 1]
446  << " side " << side << std::endl;
447  newEBStatus[iphiEB[fed_id - 610][tt_id - 1] - 1][ietaEB[fed_id - 610][tt_id - 1] - 1][side] = 1;
448  }
449  else if(fed_id <= 609 || (fed_id >= 646 && fed_id <= 654)) { // endcap
450  if(tt_id > 41) {
451  //std::cout << " Problem in Fed " << fed_id << " SC " << tt_id << " Give up " << std::endl;
452  continue;
453  }
454  if(fed_id < 610) { // EE-
455  if(debug) std::cout << " x " << ixx[fed_id - 601][tt_id - 1][0]
456  << " y " << iyy[fed_id - 601][tt_id - 1][0];
457  newEEStatus[ixx[fed_id - 601][tt_id - 1][0] - 1][iyy[fed_id - 601][tt_id - 1][0] - 1][side] = 1;
458  if(ixx[fed_id - 601][tt_id - 1][1] != 0) { // partial SC
459  if(debug) std::cout << " x2 " << ixx[fed_id - 601][tt_id - 1][1]
460  << " y2 " << iyy[fed_id - 601][tt_id - 1][1];
461  newEEStatus[ixx[fed_id - 601][tt_id - 1][1] - 1][iyy[fed_id - 601][tt_id - 1][1] - 1][side] = 1;
462  if(ixx[fed_id - 601][tt_id - 1][2] != 0) { // partial SC
463  if(debug) std::cout << " x3 " << ixx[fed_id - 601][tt_id - 1][2]
464  << " y3 " << iyy[fed_id - 601][tt_id - 1][2];
465  newEEStatus[ixx[fed_id - 601][tt_id - 1][2] - 1][iyy[fed_id - 601][tt_id - 1][2] - 1][side] = 1;
466  }
467  }
468  if(debug) std::cout << " side " << side << std::endl;
469  }
470  else { // EE+
471  side = +1;
472  if(debug) std::cout << " x " << ixx[fed_id - 637][tt_id - 1][0]
473  << " y " << iyy[fed_id - 637][tt_id - 1][0];
474  newEEStatus[ixx[fed_id - 637][tt_id - 1][0] - 1][iyy[fed_id - 637][tt_id - 1][0] - 1][side] = 1;
475  if(ixx[fed_id - 637][tt_id - 1][1] != 0) { // partial SC
476  if(debug) std::cout << " x2 " << ixx[fed_id - 637][tt_id - 1][1]
477  << " y2 " << iyy[fed_id - 637][tt_id - 1][1];
478  newEEStatus[ixx[fed_id - 637][tt_id - 1][1] - 1][iyy[fed_id - 637][tt_id - 1][1] - 1][side] = 1;
479  if(ixx[fed_id - 637][tt_id - 1][2] != 0) { // partial SC
480  if(debug) std::cout << " x3 " << ixx[fed_id - 637][tt_id - 1][2]
481  << " y3 " << iyy[fed_id - 637][tt_id - 1][2];
482  newEEStatus[ixx[fed_id - 637][tt_id - 1][2] - 1][iyy[fed_id - 637][tt_id - 1][2] - 1][side] = 1;
483  }
484  }
485  if(debug) std::cout << " side " << side << std::endl;
486  }
487  }
488  else {
489  std::cout << " Strange Fed " << fed_id << " TT/SC " << tt_id << " Give up " << std::endl;
490  continue;
491  }
492  } // end loop over iTT
493  if(debug) std::cout << std::endl;
494  //*daqFile << std::endl;
495  for(int k = 0 ; k < 2; k++ ) {
496  int iz = -1;
497  if(k == 1) iz = 1;
498  if(debug) std::cout << " Side : " << k << " barrel " << std::endl; // barrel
499  for(int iphi = 0 ; iphi < 72; iphi++) {
500  for(int ieta = 0 ; ieta < 17; ieta++) {
501  if(newEBStatus[iphi][ieta][k] != oldEBStatus[iphi][ieta][k]) {
502  somediff = true;
503  EcalTrigTowerDetId ebid(iz, EcalBarrel, ieta + 1, iphi + 1);
504  daq_temp->setValue( ebid, newEBStatus[iphi][ieta][k]);
505  if(debug) std::cout << " change in EB side " << iz << " phi " << iphi +1 << " eta " << ieta + 1 << std::endl;
506  } // new status
507  if(debug) std::cout << newEBStatus[iphi][ieta][k] << " " ;
508  oldEBStatus[iphi][ieta][k] = newEBStatus[iphi][ieta][k];
509  }
510  if(debug) std::cout << std::endl;
511  }
512  if(debug) std::cout << " endcaps " << std::endl; // endcap
513  for(int iy = 0 ; iy < 20; iy++) {
514  for(int ix = 0 ; ix < 20; ix++) {
515  if (EcalScDetId::validDetId(ix + 1, iy + 1, iz )){
516  if(newEEStatus[ix][iy][k] != oldEEStatus[ix][iy][k]) {
517  somediff = true;
518  EcalScDetId eeid(ix + 1, iy + 1, iz);
519  daq_temp->setValue( eeid, newEEStatus[ix][iy][k]);
520  if(debug) std::cout << " change in EE side " << iz << " x " << ix +1 << " y " << iy + 1 << std::endl;
521  } // new status
522  if(debug) std::cout << newEEStatus[ix][iy][k] << " " ;
523  oldEEStatus[ix][iy][k] = newEEStatus[ix][iy][k];
524  } // valid SC
525  else {
526  if(debug) std::cout << ". ";
527  }
528  }
529  if(debug) std::cout << std::endl;
530  }
531  } // loop over side
532 
533  if(somediff) {
534 
535  // we copy the last valid record to the object that is sent to the DB
536  EcalDAQTowerStatus* daq_pop = new EcalDAQTowerStatus();
537 
538 
539 
540  int iz = -1;
541  for(int k = 0 ; k < 2; k++ ) {
542  if(k == 1) iz = 1;
543  for(int iphi = 1 ; iphi < 73; iphi++) {
544  for(int ieta = 1 ; ieta < 18; ieta++) {
545  if (EcalTrigTowerDetId::validDetId(iz,EcalBarrel,ieta,iphi )){
546  EcalTrigTowerDetId ebid(iz,EcalBarrel,ieta,iphi);
547  uint16_t dbStatus = 0;
548  dbStatus =(daq_temp->barrel( ebid.hashedIndex())).getStatusCode();
549  daq_pop->setValue( ebid, dbStatus );
550  }
551  } // end loop over ieta
552  } // end loop over iphi
553 
554  // endcap
555  for(int ix = 1 ; ix < 21; ix++) {
556  for(int iy = 1 ; iy < 21; iy++) {
557  if (EcalScDetId::validDetId(ix,iy,iz )){
558  EcalScDetId eeid(ix,iy,iz);
559 
560  EcalDAQTowerStatus::const_iterator it =daq_temp->find(eeid.rawId());
561  uint16_t dbStatus = 0;
562  if ( it != daq_temp->end() ) {
563  dbStatus = it->getStatusCode();
564  }
565  daq_pop->setValue( eeid, dbStatus );
566  }
567  } // end loop over iy
568  } // end loop over ix
569  } // end loop over k (side)
570 
571 
572 
573  std::cout << "Generating popcon record for run "<< irun << std::endl;
574 
575  m_to_transfer.push_back(std::make_pair((EcalDAQTowerStatus*)daq_pop, irun));
576 
577  ss << "Run=" << irun << "_DAQchanged_"<<std::endl;
578  m_userTextLog = ss.str()+";";
579  } // some change found
580  else {
581 
582  std::cout<< "Run DAQ record was the same as previous run " << std::endl;
583  ss << "Run=" << irun << "_DAQunchanged_"<<std::endl;
584  m_userTextLog = ss.str()+";";
585 
586  } // no change
587 
588  } // check on number of already transferred runs
589  } // loop over runs
590  } // check on run number > 0
591 
592  // disconnect from DB
593  delete econn;
594  delete daq_temp;
595  std::cout << "Ecal - > end of getNewObjects -----------\n";
596 }
EcalDAQTowerStatusMap EcalDAQTowerStatus
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:63
std::vector< RunIOV > getRuns()
Definition: RunList.cc:35
unsigned long m_lastRun
void setLocationDef(const LocationDef locDef)
Definition: RunTag.cc:53
void setId(int id)
Definition: ODFEDAQConfig.h:18
int iyy[18][41][3]
Definition: RunTag.h:13
RunList fetchRunListByLocation(RunTag tag, int min_run, int max_run, const LocationDef locDef)
#define min(a, b)
Definition: mlp_lapack.h:161
int ixx[18][41][3]
void setValue(const uint32_t id, const Item &item)
const_iterator find(uint32_t rawId) const
int getID2() const
Definition: EcalLogicID.cc:52
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf)
EcalCondDBInterface * econn
Definition: DDAxes.h:10
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov)
void setRunTypeDef(const RunTypeDef runTypeDef)
Definition: RunTag.cc:70
int getID1() const
Definition: EcalLogicID.cc:47
int getLogicID() const
Definition: EcalLogicID.cc:42
int getBadTTId() const
Definition: ODFEDAQConfig.h:36
int k[5][pyjets_maxn]
void setId(int id)
Definition: ODBadTTInfo.h:18
int iphiEB[36][68]
void setRunType(std::string runtype)
Definition: RunTypeDef.cc:33
int getConfigId() const
unsigned long m_firstRun
void fetchConfigSet(ICONF *iconf)
const Item & barrel(size_t hashedIndex) const
Definition: RunDat.h:11
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
int ietaEB[36][68]
cond::ValidityInterval lastInterval
Definition: TagInfo.h:11
void setLocation(std::string loc)
Definition: LocationDef.cc:33
tuple cout
Definition: gather_cfg.py:41
std::vector< Item >::const_iterator const_iterator
void setGeneralTag(std::string tag)
Definition: RunTag.cc:36
#define debug
Definition: MEtoEDMFormat.h:34
std::string popcon::EcalDAQHandler::id ( void  ) const
inlinevirtual

Implements popcon::PopConSourceHandler< EcalDAQTowerStatus >.

Definition at line 55 of file EcalDAQHandler.h.

References m_name.

55 { return m_name;}
uint16_t popcon::EcalDAQHandler::OffDBStatus ( uint16_t  dbStatus,
int  pos 
)

Definition at line 153 of file EcalDAQHandler.cc.

References pos.

153  {
154  uint16_t hv_off_dbstatus = ( dbStatus & (1 << pos ) ) ;
155  if(hv_off_dbstatus>0) hv_off_dbstatus=1;
156  return hv_off_dbstatus;
157 }

Member Data Documentation

EcalCondDBInterface* popcon::EcalDAQHandler::econn

Definition at line 56 of file EcalDAQHandler.h.

unsigned long popcon::EcalDAQHandler::m_firstRun
private

Definition at line 62 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

std::string popcon::EcalDAQHandler::m_gentag
private

Definition at line 70 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

unsigned long popcon::EcalDAQHandler::m_lastRun
private

Definition at line 63 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

std::string popcon::EcalDAQHandler::m_location
private

Definition at line 68 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

std::string popcon::EcalDAQHandler::m_name
private

Definition at line 67 of file EcalDAQHandler.h.

Referenced by id().

std::string popcon::EcalDAQHandler::m_pass
private

Definition at line 66 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

std::string popcon::EcalDAQHandler::m_runtype
private

Definition at line 69 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

std::string popcon::EcalDAQHandler::m_sid
private

Definition at line 64 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().

std::string popcon::EcalDAQHandler::m_user
private

Definition at line 65 of file EcalDAQHandler.h.

Referenced by EcalDAQHandler().