CMS 3D CMS Logo

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

#include <LHCInfoPopConSourceHandler.h>

Inheritance diagram for LHCInfoPopConSourceHandler:
popcon::PopConSourceHandler< LHCInfo >

Public Member Functions

void getNewObjects () override
 
std::string id () const override
 
 LHCInfoPopConSourceHandler (const edm::ParameterSet &pset)
 
 ~LHCInfoPopConSourceHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< LHCInfo >
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 ()
 
cond::TagInfo_t const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Member Functions

void addEmptyPayload (cond::Time_t iov)
 
bool getCTTPSData (cond::persistency::Session &session, const boost::posix_time::ptime &beginFillTime, const boost::posix_time::ptime &endFillTime)
 
bool getDipData (cond::persistency::Session &session, const boost::posix_time::ptime &beginFillTime, const boost::posix_time::ptime &endFillTime)
 
bool getEcalData (cond::persistency::Session &session, const boost::posix_time::ptime &lowerTime, const boost::posix_time::ptime &upperTime, bool update)
 
bool getFillData (cond::persistency::Session &session, unsigned short fillId)
 
size_t getLumiData (cond::persistency::Session &session, const boost::posix_time::ptime &beginFillTime, const boost::posix_time::ptime &endFillTime)
 
bool getNextFillData (cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, bool ended)
 

Private Attributes

std::string m_authpath
 
std::string m_connectionString
 
bool m_debug
 
std::string m_dipSchema
 
std::string m_ecalConnectionString
 
bool m_endFill = true
 
boost::posix_time::ptime m_endTime
 
std::unique_ptr< LHCInfom_fillPayload
 
bool m_lastPayloadEmpty = false
 
std::string m_name
 
std::shared_ptr< LHCInfom_prevPayload
 
unsigned int m_samplingInterval
 
boost::posix_time::ptime m_startTime
 
std::vector< std::pair
< cond::Time_t,
std::shared_ptr< LHCInfo > > > 
m_tmpBuffer
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< LHCInfo >
typedef std::map< Time_t,
std::shared_ptr< LHCInfo > > 
Container
 
typedef std::unique_ptr< LHCInfoRef
 
typedef PopConSourceHandler
< LHCInfo
self
 
typedef cond::Time_t Time_t
 
typedef LHCInfo value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< LHCInfo >
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< LHCInfo >
Container m_iovs
 
std::vector< std::pair
< LHCInfo *, Time_t > > 
m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 10 of file LHCInfoPopConSourceHandler.h.

Constructor & Destructor Documentation

LHCInfoPopConSourceHandler::LHCInfoPopConSourceHandler ( const edm::ParameterSet pset)

Definition at line 21 of file LHCInfoPopConSourceHandler.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getUntrackedParameter(), m_endTime, m_startTime, submitPVValidationJobs::now, and AlCaHLTBitMon_QueryRunRegistry::string.

22  : m_debug(pset.getUntrackedParameter<bool>("debug", false)),
23  m_startTime(),
24  m_endTime(),
25  m_samplingInterval((unsigned int)pset.getUntrackedParameter<unsigned int>("samplingInterval", 300)),
26  m_endFill(pset.getUntrackedParameter<bool>("endFill", true)),
27  m_name(pset.getUntrackedParameter<std::string>("name", "LHCInfoPopConSourceHandler")),
28  m_connectionString(pset.getUntrackedParameter<std::string>("connectionString", "")),
29  m_ecalConnectionString(pset.getUntrackedParameter<std::string>("ecalConnectionString", "")),
30  m_dipSchema(pset.getUntrackedParameter<std::string>("DIPSchema", "")),
31  m_authpath(pset.getUntrackedParameter<std::string>("authenticationPath", "")),
32  m_fillPayload(),
33  m_prevPayload(),
34  m_tmpBuffer() {
35  if (pset.exists("startTime")) {
36  m_startTime = boost::posix_time::time_from_string(pset.getUntrackedParameter<std::string>("startTime"));
37  }
38  boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
39  m_endTime = now;
40  if (pset.exists("endTime")) {
41  m_endTime = boost::posix_time::time_from_string(pset.getUntrackedParameter<std::string>("endTime"));
42  if (m_endTime > now)
43  m_endTime = now;
44  }
45 }
T getUntrackedParameter(std::string const &, T const &) const
boost::posix_time::ptime m_startTime
std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo > > > m_tmpBuffer
std::unique_ptr< LHCInfo > m_fillPayload
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::shared_ptr< LHCInfo > m_prevPayload
boost::posix_time::ptime m_endTime
LHCInfoPopConSourceHandler::~LHCInfoPopConSourceHandler ( )
override

Definition at line 48 of file LHCInfoPopConSourceHandler.cc.

48 {}

Member Function Documentation

void LHCInfoPopConSourceHandler::addEmptyPayload ( cond::Time_t  iov)
private

Definition at line 773 of file LHCInfoPopConSourceHandler.cc.

References PVValHelper::add(), popcon::PopConSourceHandler< LHCInfo >::m_iovs, m_lastPayloadEmpty, and m_prevPayload.

Referenced by getNewObjects().

773  {
774  bool add = false;
775  if (m_iovs.empty()) {
776  if (!m_lastPayloadEmpty)
777  add = true;
778  } else {
779  auto lastAdded = m_iovs.rbegin()->second;
780  if (lastAdded->fillNumber() != 0) {
781  add = true;
782  }
783  }
784  if (add) {
785  auto newPayload = std::make_shared<LHCInfo>();
786  m_iovs.insert(std::make_pair(iov, newPayload));
787  m_prevPayload = newPayload;
788  }
789 }
std::shared_ptr< LHCInfo > m_prevPayload
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
bool LHCInfoPopConSourceHandler::getCTTPSData ( cond::persistency::Session session,
const boost::posix_time::ptime &  beginFillTime,
const boost::posix_time::ptime &  endFillTime 
)
private

Definition at line 532 of file LHCInfoPopConSourceHandler.cc.

References cond::persistency::Session::coralSession(), LHCInfoImpl::LumiSectionFilter::current(), alcazmumu_cfi::filter, cond::time::from_boost(), m_debug, m_tmpBuffer, jetCorrFactors_cfi::payload, LHCInfoImpl::LumiSectionFilter::process(), runTheMatrix::ret, LHCInfo::setBetaStar(), LHCInfo::setCrossingAngle(), LHCInfo::setCtppsStatus(), LHCInfo::setLhcComment(), LHCInfo::setLhcState(), LHCInfo::setLumiSection(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getNewObjects().

534  {
535  //run the fifth query against the CTPPS schema
536  //Initializing the CMS_CTP_CTPPS_COND schema.
537  coral::ISchema& CTPPS = session.coralSession().schema("CMS_CTP_CTPPS_COND");
538  //execute query for CTPPS Data
539  std::unique_ptr<coral::IQuery> CTPPSDataQuery(CTPPS.newQuery());
540  //FROM clause
541  CTPPSDataQuery->addToTableList(std::string("CTPPS_LHC_MACHINE_PARAMS"));
542  //SELECT clause
543  CTPPSDataQuery->addToOutputList(std::string("DIP_UPDATE_TIME"));
544  CTPPSDataQuery->addToOutputList(std::string("LHC_STATE"));
545  CTPPSDataQuery->addToOutputList(std::string("LHC_COMMENT"));
546  CTPPSDataQuery->addToOutputList(std::string("CTPPS_STATUS"));
547  CTPPSDataQuery->addToOutputList(std::string("LUMI_SECTION"));
548  CTPPSDataQuery->addToOutputList(std::string("XING_ANGLE_URAD"));
549  CTPPSDataQuery->addToOutputList(std::string("BETA_STAR_CMS"));
550  //WHERE CLAUSE
551  coral::AttributeList CTPPSDataBindVariables;
552  CTPPSDataBindVariables.extend<coral::TimeStamp>(std::string("beginFillTime"));
553  CTPPSDataBindVariables.extend<coral::TimeStamp>(std::string("endFillTime"));
554  CTPPSDataBindVariables[std::string("beginFillTime")].data<coral::TimeStamp>() = coral::TimeStamp(beginFillTime);
555  CTPPSDataBindVariables[std::string("endFillTime")].data<coral::TimeStamp>() = coral::TimeStamp(endFillTime);
556  std::string conditionStr = std::string("DIP_UPDATE_TIME>= :beginFillTime and DIP_UPDATE_TIME< :endFillTime");
557  CTPPSDataQuery->setCondition(conditionStr, CTPPSDataBindVariables);
558  //ORDER BY clause
559  CTPPSDataQuery->addToOrderList(std::string("DIP_UPDATE_TIME"));
560  //define query output
561  coral::AttributeList CTPPSDataOutput;
562  CTPPSDataOutput.extend<coral::TimeStamp>(std::string("DIP_UPDATE_TIME"));
563  CTPPSDataOutput.extend<std::string>(std::string("LHC_STATE"));
564  CTPPSDataOutput.extend<std::string>(std::string("LHC_COMMENT"));
565  CTPPSDataOutput.extend<std::string>(std::string("CTPPS_STATUS"));
566  CTPPSDataOutput.extend<int>(std::string("LUMI_SECTION"));
567  CTPPSDataOutput.extend<float>(std::string("XING_ANGLE_URAD"));
568  CTPPSDataOutput.extend<float>(std::string("BETA_STAR_CMS"));
569  CTPPSDataQuery->defineOutput(CTPPSDataOutput);
570  //execute the query
571  coral::ICursor& CTPPSDataCursor = CTPPSDataQuery->execute();
572  cond::Time_t dipTime = 0;
573  std::string lhcState = "", lhcComment = "", ctppsStatus = "";
574  unsigned int lumiSection = 0;
575  float crossingAngle = 0., betastar = 0.;
576 
577  bool ret = false;
579  while (CTPPSDataCursor.next()) {
580  if (m_debug) {
581  std::ostringstream CTPPS;
582  CTPPSDataCursor.currentRow().toOutputStream(CTPPS);
583  }
584  coral::Attribute const& dipTimeAttribute = CTPPSDataCursor.currentRow()[std::string("DIP_UPDATE_TIME")];
585  if (!dipTimeAttribute.isNull()) {
586  dipTime = cond::time::from_boost(dipTimeAttribute.data<coral::TimeStamp>().time());
587  if (filter.process(dipTime)) {
588  ret = true;
589  coral::Attribute const& lhcStateAttribute = CTPPSDataCursor.currentRow()[std::string("LHC_STATE")];
590  if (!lhcStateAttribute.isNull()) {
591  lhcState = lhcStateAttribute.data<std::string>();
592  }
593  coral::Attribute const& lhcCommentAttribute = CTPPSDataCursor.currentRow()[std::string("LHC_COMMENT")];
594  if (!lhcCommentAttribute.isNull()) {
595  lhcComment = lhcCommentAttribute.data<std::string>();
596  }
597  coral::Attribute const& ctppsStatusAttribute = CTPPSDataCursor.currentRow()[std::string("CTPPS_STATUS")];
598  if (!ctppsStatusAttribute.isNull()) {
599  ctppsStatus = ctppsStatusAttribute.data<std::string>();
600  }
601  coral::Attribute const& lumiSectionAttribute = CTPPSDataCursor.currentRow()[std::string("LUMI_SECTION")];
602  if (!lumiSectionAttribute.isNull()) {
603  lumiSection = lumiSectionAttribute.data<int>();
604  }
605  coral::Attribute const& crossingAngleAttribute = CTPPSDataCursor.currentRow()[std::string("XING_ANGLE_URAD")];
606  if (!crossingAngleAttribute.isNull()) {
607  crossingAngle = crossingAngleAttribute.data<float>();
608  }
609  coral::Attribute const& betaStarAttribute = CTPPSDataCursor.currentRow()[std::string("BETA_STAR_CMS")];
610  if (!betaStarAttribute.isNull()) {
611  betastar = betaStarAttribute.data<float>();
612  }
613  for (auto it = filter.current(); it != m_tmpBuffer.end(); it++) {
614  // set the current values to all of the payloads of the lumi section samples after the current since
615  LHCInfo& payload = *(it->second);
616  payload.setCrossingAngle(crossingAngle);
617  payload.setBetaStar(betastar);
618  payload.setLhcState(lhcState);
619  payload.setLhcComment(lhcComment);
620  payload.setCtppsStatus(ctppsStatus);
621  payload.setLumiSection(lumiSection);
622  }
623  }
624  }
625  }
626  return ret;
627 }
void setLumiSection(unsigned int const &lumiSection)
Definition: LHCInfo.cc:352
tuple ret
prodAgent to be discontinued
std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo > > > m_tmpBuffer
void setLhcComment(std::string const &lhcComment)
Definition: LHCInfo.cc:344
unsigned long long Time_t
Definition: Time.h:14
void setBetaStar(float const &betaStar)
Definition: LHCInfo.cc:300
void setLhcState(std::string const &lhcState)
Definition: LHCInfo.cc:340
Time_t from_boost(boost::posix_time::ptime bt)
coral::ISessionProxy & coralSession()
Definition: Session.cc:218
void setCtppsStatus(std::string const &ctppsStatus)
Definition: LHCInfo.cc:348
void setCrossingAngle(float const &angle)
Definition: LHCInfo.cc:298
bool LHCInfoPopConSourceHandler::getDipData ( cond::persistency::Session session,
const boost::posix_time::ptime &  beginFillTime,
const boost::posix_time::ptime &  endFillTime 
)
private

Definition at line 389 of file LHCInfoPopConSourceHandler.cc.

References LHCInfo::availableBunchSlots, cond::persistency::Session::coralSession(), cond::time::from_boost(), m_debug, m_dipSchema, m_fillPayload, or, runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getNewObjects().

391  {
392  //run the third and fourth query against the schema hosting detailed DIP information
393  coral::ISchema& beamCondSchema = session.coralSession().schema(m_dipSchema);
394  //start the transaction against the DIP "deep" database backend schema
395  //prepare the WHERE clause for both queries
396  coral::AttributeList bunchConfBindVariables;
397  bunchConfBindVariables.extend<coral::TimeStamp>(std::string("beginFillTime"));
398  bunchConfBindVariables.extend<coral::TimeStamp>(std::string("endFillTime"));
399  bunchConfBindVariables[std::string("beginFillTime")].data<coral::TimeStamp>() = coral::TimeStamp(beginFillTime);
400  bunchConfBindVariables[std::string("endFillTime")].data<coral::TimeStamp>() = coral::TimeStamp(endFillTime);
401  std::string conditionStr = std::string("DIPTIME >= :beginFillTime and DIPTIME< :endFillTime");
402  //define the output types for both queries
403  coral::AttributeList bunchConfOutput;
404  bunchConfOutput.extend<coral::TimeStamp>(std::string("DIPTIME"));
405  bunchConfOutput.extend<unsigned short>(std::string("BUCKET"));
406  //execute query for Beam 1
407  std::unique_ptr<coral::IQuery> bunchConf1Query(beamCondSchema.newQuery());
408  bunchConf1Query->addToTableList(std::string("LHC_CIRCBUNCHCONFIG_BEAM1"),
409  std::string("BEAMCONF\", TABLE( BEAMCONF.VALUE ) \"BUCKETS"));
410  bunchConf1Query->addToOutputList(std::string("BEAMCONF.DIPTIME"), std::string("DIPTIME"));
411  bunchConf1Query->addToOutputList(std::string("BUCKETS.COLUMN_VALUE"), std::string("BUCKET"));
412  bunchConf1Query->setCondition(conditionStr, bunchConfBindVariables);
413  bunchConf1Query->addToOrderList(std::string("DIPTIME"));
414  bunchConf1Query->limitReturnedRows(LHCInfo::availableBunchSlots); //maximum number of filled bunches
415  bunchConf1Query->defineOutput(bunchConfOutput);
416 
417  coral::ICursor& bunchConf1Cursor = bunchConf1Query->execute();
418  std::bitset<LHCInfo::bunchSlots + 1> bunchConfiguration1(0ULL);
419  bool ret = false;
420  cond::Time_t lumiSectionTime = 0;
421  while (bunchConf1Cursor.next()) {
422  if (m_debug) {
423  std::ostringstream b1s;
424  bunchConf1Cursor.currentRow().toOutputStream(b1s);
425  }
426  coral::Attribute const& dipTimeAttribute = bunchConf1Cursor.currentRow()[std::string("DIPTIME")];
427  coral::Attribute const& bunchConf1Attribute = bunchConf1Cursor.currentRow()[std::string("BUCKET")];
428  if (!dipTimeAttribute.isNull() and !bunchConf1Attribute.isNull()) {
429  cond::Time_t dipTime = cond::time::from_boost(dipTimeAttribute.data<coral::TimeStamp>().time());
430  // assuming only one sample has been selected...
431  unsigned short slot = (bunchConf1Attribute.data<unsigned short>() - 1) / 10 + 1;
432  if (lumiSectionTime == 0 or lumiSectionTime == dipTime) {
433  bunchConfiguration1[slot] = true;
434  } else
435  break;
436  lumiSectionTime = dipTime;
437  }
438  }
439  if (ret) {
440  m_fillPayload->setBunchBitsetForBeam1(bunchConfiguration1);
441  }
442 
443  //execute query for Beam 2
444  std::unique_ptr<coral::IQuery> bunchConf2Query(beamCondSchema.newQuery());
445  bunchConf2Query->addToTableList(std::string("LHC_CIRCBUNCHCONFIG_BEAM2"),
446  std::string("BEAMCONF\", TABLE( BEAMCONF.VALUE ) \"BUCKETS"));
447  bunchConf2Query->addToOutputList(std::string("BEAMCONF.DIPTIME"), std::string("DIPTIME"));
448  bunchConf2Query->addToOutputList(std::string("BUCKETS.COLUMN_VALUE"), std::string("BUCKET"));
449  bunchConf2Query->setCondition(conditionStr, bunchConfBindVariables);
450  bunchConf2Query->addToOrderList(std::string("DIPTIME"));
451  bunchConf2Query->limitReturnedRows(LHCInfo::availableBunchSlots); //maximum number of filled bunches
452  bunchConf2Query->defineOutput(bunchConfOutput);
453  coral::ICursor& bunchConf2Cursor = bunchConf2Query->execute();
454 
455  std::bitset<LHCInfo::bunchSlots + 1> bunchConfiguration2(0ULL);
456  ret = false;
457  lumiSectionTime = 0;
458  while (bunchConf2Cursor.next()) {
459  if (m_debug) {
460  std::ostringstream b2s;
461  bunchConf2Cursor.currentRow().toOutputStream(b2s);
462  }
463  coral::Attribute const& dipTimeAttribute = bunchConf2Cursor.currentRow()[std::string("DIPTIME")];
464  coral::Attribute const& bunchConf2Attribute = bunchConf2Cursor.currentRow()[std::string("BUCKET")];
465  if (!dipTimeAttribute.isNull() and !bunchConf2Attribute.isNull()) {
466  ret = true;
467  cond::Time_t dipTime = cond::time::from_boost(dipTimeAttribute.data<coral::TimeStamp>().time());
468  // assuming only one sample has been selected...
469  unsigned short slot = (bunchConf2Attribute.data<unsigned short>() - 1) / 10 + 1;
470  if (lumiSectionTime == 0 or lumiSectionTime == dipTime) {
471  bunchConfiguration2[slot] = true;
472  } else
473  break;
474  lumiSectionTime = dipTime;
475  }
476  }
477  if (ret) {
478  m_fillPayload->setBunchBitsetForBeam2(bunchConfiguration2);
479  }
480  //execute query for lumiPerBX
481  std::unique_ptr<coral::IQuery> lumiDataQuery(beamCondSchema.newQuery());
482  lumiDataQuery->addToTableList(std::string("CMS_LHC_LUMIPERBUNCH"),
483  std::string("LUMIPERBUNCH\", TABLE( LUMIPERBUNCH.LUMI_BUNCHINST ) \"VALUE"));
484  lumiDataQuery->addToOutputList(std::string("LUMIPERBUNCH.DIPTIME"), std::string("DIPTIME"));
485  lumiDataQuery->addToOutputList(std::string("VALUE.COLUMN_VALUE"), std::string("LUMI_BUNCH"));
486  coral::AttributeList lumiDataBindVariables;
487  lumiDataBindVariables.extend<coral::TimeStamp>(std::string("beginFillTime"));
488  lumiDataBindVariables.extend<coral::TimeStamp>(std::string("endFillTime"));
489  lumiDataBindVariables[std::string("beginFillTime")].data<coral::TimeStamp>() = coral::TimeStamp(beginFillTime);
490  lumiDataBindVariables[std::string("endFillTime")].data<coral::TimeStamp>() = coral::TimeStamp(endFillTime);
491  conditionStr = std::string("DIPTIME BETWEEN :beginFillTime AND :endFillTime");
492  lumiDataQuery->setCondition(conditionStr, lumiDataBindVariables);
493  lumiDataQuery->addToOrderList(std::string("DIPTIME"));
494  lumiDataQuery->limitReturnedRows(3564); //Maximum number of bunches.
495  //define query output
496  coral::AttributeList lumiDataOutput;
497  lumiDataOutput.extend<coral::TimeStamp>(std::string("DIPTIME"));
498  lumiDataOutput.extend<float>(std::string("LUMI_BUNCH"));
499  lumiDataQuery->defineOutput(lumiDataOutput);
500  //execute the query
501  coral::ICursor& lumiDataCursor = lumiDataQuery->execute();
502 
503  std::vector<float> lumiPerBX;
504  ret = false;
505  lumiSectionTime = 0;
506  while (lumiDataCursor.next()) {
507  if (m_debug) {
508  std::ostringstream lpBX;
509  lumiDataCursor.currentRow().toOutputStream(lpBX);
510  }
511  coral::Attribute const& dipTimeAttribute = lumiDataCursor.currentRow()[std::string("DIPTIME")];
512  coral::Attribute const& lumiBunchAttribute = lumiDataCursor.currentRow()[std::string("LUMI_BUNCH")];
513  if (!dipTimeAttribute.isNull() and !lumiBunchAttribute.isNull()) {
514  ret = true;
515  cond::Time_t dipTime = cond::time::from_boost(dipTimeAttribute.data<coral::TimeStamp>().time());
516  // assuming only one sample has been selected...
517  float lumi_b = lumiBunchAttribute.data<float>();
518  if (lumiSectionTime == 0 or lumiSectionTime == dipTime) {
519  if (lumi_b != 0.00)
520  lumiPerBX.push_back(lumi_b);
521  } else
522  break;
523  lumiSectionTime = dipTime;
524  }
525  }
526  if (ret) {
527  m_fillPayload->setLumiPerBX(lumiPerBX);
528  }
529  return ret;
530 }
tuple ret
prodAgent to be discontinued
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::unique_ptr< LHCInfo > m_fillPayload
unsigned long long Time_t
Definition: Time.h:14
Time_t from_boost(boost::posix_time::ptime bt)
static size_t const availableBunchSlots
Definition: LHCInfo.h:61
coral::ISessionProxy & coralSession()
Definition: Session.cc:218
bool LHCInfoPopConSourceHandler::getEcalData ( cond::persistency::Session session,
const boost::posix_time::ptime &  lowerTime,
const boost::posix_time::ptime &  upperTime,
bool  update 
)
private

Definition at line 667 of file LHCInfoPopConSourceHandler.cc.

References LHCInfoImpl::LumiSectionFilter::current(), ECAL, alcazmumu_cfi::filter, cond::time::from_boost(), CommonMethods::isnan(), m_debug, m_name, m_prevPayload, m_tmpBuffer, cond::persistency::Session::nominalSchema(), jetCorrFactors_cfi::payload, LHCInfoImpl::LumiSectionFilter::process(), runTheMatrix::ret, LHCInfoImpl::setElementData(), AlCaHLTBitMon_QueryRunRegistry::string, cond::time::to_boost(), and relativeConstraints::value.

Referenced by getNewObjects().

670  {
671  //run the sixth query against the CMS_DCS_ENV_PVSS_COND schema
672  //Initializing the CMS_DCS_ENV_PVSS_COND schema.
673  coral::ISchema& ECAL = session.nominalSchema();
674  //start the transaction against the fill logging schema
675  //execute query for ECAL Data
676  std::unique_ptr<coral::IQuery> ECALDataQuery(ECAL.newQuery());
677  //FROM clause
678  ECALDataQuery->addToTableList(std::string("BEAM_PHASE"));
679  //SELECT clause
680  ECALDataQuery->addToOutputList(std::string("CHANGE_DATE"));
681  ECALDataQuery->addToOutputList(std::string("DIP_value"));
682  ECALDataQuery->addToOutputList(std::string("element_nr"));
683  ECALDataQuery->addToOutputList(std::string("VALUE_NUMBER"));
684  //WHERE CLAUSE
685  coral::AttributeList ECALDataBindVariables;
686  ECALDataBindVariables.extend<coral::TimeStamp>(std::string("lowerTime"));
687  ECALDataBindVariables.extend<coral::TimeStamp>(std::string("upperTime"));
688  ECALDataBindVariables[std::string("lowerTime")].data<coral::TimeStamp>() = coral::TimeStamp(lowerTime);
689  ECALDataBindVariables[std::string("upperTime")].data<coral::TimeStamp>() = coral::TimeStamp(upperTime);
690  std::string conditionStr = std::string(
691  "(DIP_value LIKE '%beamPhaseMean%' OR DIP_value LIKE '%cavPhaseMean%') AND CHANGE_DATE >= :lowerTime AND "
692  "CHANGE_DATE < :upperTime");
693 
694  ECALDataQuery->setCondition(conditionStr, ECALDataBindVariables);
695  //ORDER BY clause
696  ECALDataQuery->addToOrderList(std::string("CHANGE_DATE"));
697  ECALDataQuery->addToOrderList(std::string("DIP_value"));
698  ECALDataQuery->addToOrderList(std::string("element_nr"));
699  //define query output
700  coral::AttributeList ECALDataOutput;
701  ECALDataOutput.extend<coral::TimeStamp>(std::string("CHANGE_DATE"));
702  ECALDataOutput.extend<std::string>(std::string("DIP_value"));
703  ECALDataOutput.extend<unsigned int>(std::string("element_nr"));
704  ECALDataOutput.extend<float>(std::string("VALUE_NUMBER"));
705  //ECALDataQuery->limitReturnedRows( 14256 ); //3564 entries per vector.
706  ECALDataQuery->defineOutput(ECALDataOutput);
707  //execute the query
708  coral::ICursor& ECALDataCursor = ECALDataQuery->execute();
709  cond::Time_t changeTime = 0;
710  cond::Time_t firstTime = 0;
711  std::string dipVal = "";
712  unsigned int elementNr = 0;
713  float value = 0.;
714  std::set<cond::Time_t> initializedVectors;
716  bool ret = false;
717  if (m_prevPayload.get()) {
718  for (auto& lumiSlot : m_tmpBuffer) {
719  lumiSlot.second->setBeam1VC(m_prevPayload->beam1VC());
720  lumiSlot.second->setBeam2VC(m_prevPayload->beam2VC());
721  lumiSlot.second->setBeam1RF(m_prevPayload->beam1RF());
722  lumiSlot.second->setBeam2RF(m_prevPayload->beam2RF());
723  }
724  }
725  std::map<cond::Time_t, cond::Time_t> iovMap;
726  cond::Time_t lowerLumi = m_tmpBuffer.front().first;
727  while (ECALDataCursor.next()) {
728  if (m_debug) {
729  std::ostringstream ECAL;
730  ECALDataCursor.currentRow().toOutputStream(ECAL);
731  }
732  coral::Attribute const& changeDateAttribute = ECALDataCursor.currentRow()[std::string("CHANGE_DATE")];
733  if (!changeDateAttribute.isNull()) {
734  ret = true;
735  boost::posix_time::ptime chTime = changeDateAttribute.data<coral::TimeStamp>().time();
736  // move the first IOV found to the start of the fill interval selected
737  if (changeTime == 0) {
738  firstTime = cond::time::from_boost(chTime);
739  }
740  changeTime = cond::time::from_boost(chTime);
741  cond::Time_t iovTime = changeTime;
742  if (!update and changeTime == firstTime)
743  iovTime = lowerLumi;
744  coral::Attribute const& dipValAttribute = ECALDataCursor.currentRow()[std::string("DIP_value")];
745  coral::Attribute const& valueNumberAttribute = ECALDataCursor.currentRow()[std::string("VALUE_NUMBER")];
746  coral::Attribute const& elementNrAttribute = ECALDataCursor.currentRow()[std::string("element_nr")];
747  if (!dipValAttribute.isNull() and !valueNumberAttribute.isNull()) {
748  dipVal = dipValAttribute.data<std::string>();
749  elementNr = elementNrAttribute.data<unsigned int>();
750  value = valueNumberAttribute.data<float>();
751  if (isnan(value))
752  value = 0.;
753  if (filter.process(iovTime)) {
754  iovMap.insert(std::make_pair(changeTime, filter.current()->first));
755  for (auto it = filter.current(); it != m_tmpBuffer.end(); it++) {
756  LHCInfo& payload = *(it->second);
757  LHCInfoImpl::setElementData(it->first, dipVal, elementNr, value, payload, initializedVectors);
758  }
759  }
760  //}
761  }
762  }
763  }
764  if (m_debug) {
765  for (auto& im : iovMap) {
766  edm::LogInfo(m_name) << "Found iov=" << im.first << " (" << cond::time::to_boost(im.first) << " ) moved to "
767  << im.second << " ( " << cond::time::to_boost(im.second) << " )";
768  }
769  }
770  return ret;
771 }
tuple ret
prodAgent to be discontinued
std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo > > > m_tmpBuffer
std::shared_ptr< LHCInfo > m_prevPayload
unsigned long long Time_t
Definition: Time.h:14
coral::ISchema & nominalSchema()
Definition: Session.cc:224
Time_t from_boost(boost::posix_time::ptime bt)
Log< level::Info, false > LogInfo
void setElementData(cond::Time_t since, const std::string &dipVal, unsigned int elementNr, float value, LHCInfo &payload, std::set< cond::Time_t > &initList)
#define update(a, b)
boost::posix_time::ptime to_boost(Time_t iValue)
bool LHCInfoPopConSourceHandler::getFillData ( cond::persistency::Session session,
unsigned short  fillId 
)
private

Definition at line 250 of file LHCInfoPopConSourceHandler.cc.

References m_debug, m_fillPayload, LHCInfoImpl::makeFillDataQuery(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getNewObjects().

250  {
251  // Prepare the WHERE clause
252  coral::AttributeList fillDataBindVariables;
253  fillDataBindVariables.extend<unsigned short>(std::string("fillId"));
254  fillDataBindVariables[std::string("fillId")].data<unsigned short>() = fillId;
255  std::string conditionStr = "LHCFILL=:fillId";
256  return LHCInfoImpl::makeFillDataQuery(session, conditionStr, fillDataBindVariables, m_fillPayload, m_debug);
257 }
std::unique_ptr< LHCInfo > m_fillPayload
bool makeFillDataQuery(cond::persistency::Session &session, const std::string &conditionString, const coral::AttributeList &fillDataBindVariables, std::unique_ptr< LHCInfo > &targetPayload, bool debug)
size_t LHCInfoPopConSourceHandler::getLumiData ( cond::persistency::Session session,
const boost::posix_time::ptime &  beginFillTime,
const boost::posix_time::ptime &  endFillTime 
)
private

Definition at line 259 of file LHCInfoPopConSourceHandler.cc.

References cond::time::from_boost(), m_fillPayload, m_tmpBuffer, cond::persistency::Session::nominalSchema(), jetCorrFactors_cfi::payload, LHCInfo::setDelivLumi(), LHCInfo::setInstLumi(), LHCInfo::setInstLumiError(), LHCInfo::setRecLumi(), SiStripO2O_cfg_template::since, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getNewObjects().

261  {
262  coral::ISchema& runTimeLoggerSchema = session.nominalSchema();
263  //prepare the query for table 2:
264  std::unique_ptr<coral::IQuery> fillDataQuery2(runTimeLoggerSchema.newQuery());
265  //FROM clause
266  fillDataQuery2->addToTableList(std::string("LUMI_SECTIONS"));
267  //SELECT clause
268  fillDataQuery2->addToOutputList(std::string("DELIVLUMI"));
269  fillDataQuery2->addToOutputList(std::string("LIVELUMI"));
270  fillDataQuery2->addToOutputList(std::string("INSTLUMI"));
271  fillDataQuery2->addToOutputList(std::string("INSTLUMIERROR"));
272  fillDataQuery2->addToOutputList(std::string("STARTTIME"));
273  fillDataQuery2->addToOutputList(std::string("LHCFILL"));
274  //WHERE clause
275  coral::AttributeList fillDataBindVariables;
276  fillDataBindVariables.extend<coral::TimeStamp>(std::string("start"));
277  fillDataBindVariables.extend<coral::TimeStamp>(std::string("stop"));
278  fillDataBindVariables[std::string("start")].data<coral::TimeStamp>() = coral::TimeStamp(beginFillTime);
279  fillDataBindVariables[std::string("stop")].data<coral::TimeStamp>() = coral::TimeStamp(endFillTime);
280  std::string conditionStr = "DELIVLUMI IS NOT NULL AND STARTTIME >= :start AND STARTTIME< :stop";
281  fillDataQuery2->setCondition(conditionStr, fillDataBindVariables);
282  //ORDER BY clause
283  fillDataQuery2->addToOrderList(std::string("STARTTIME"));
284  //define query output*/
285  coral::AttributeList fillDataOutput2;
286  fillDataOutput2.extend<float>(std::string("DELIVEREDLUMI"));
287  fillDataOutput2.extend<float>(std::string("RECORDEDLUMI"));
288  fillDataOutput2.extend<float>(std::string("INSTLUMI"));
289  fillDataOutput2.extend<float>(std::string("INSTLUMIERROR"));
290  fillDataOutput2.extend<coral::TimeStamp>(std::string("STARTTIME"));
291  fillDataOutput2.extend<int>(std::string("LHCFILL"));
292  fillDataQuery2->defineOutput(fillDataOutput2);
293  //execute the query
294  coral::ICursor& fillDataCursor2 = fillDataQuery2->execute();
295 
296  size_t nlumi = 0;
297  while (fillDataCursor2.next()) {
298  nlumi++;
299  float delivLumi = 0., recLumi = 0., instLumi = 0, instLumiErr = 0.;
300  cond::Time_t since = 0;
301  coral::Attribute const& delivLumiAttribute = fillDataCursor2.currentRow()[std::string("DELIVEREDLUMI")];
302  if (!delivLumiAttribute.isNull()) {
303  delivLumi = delivLumiAttribute.data<float>() / 1000.;
304  }
305  coral::Attribute const& recLumiAttribute = fillDataCursor2.currentRow()[std::string("RECORDEDLUMI")];
306  if (!recLumiAttribute.isNull()) {
307  recLumi = recLumiAttribute.data<float>() / 1000.;
308  }
309  coral::Attribute const& instLumiAttribute = fillDataCursor2.currentRow()[std::string("INSTLUMI")];
310  if (!instLumiAttribute.isNull()) {
311  instLumi = instLumiAttribute.data<float>() / 1000.;
312  }
313  coral::Attribute const& instLumiErrAttribute = fillDataCursor2.currentRow()[std::string("INSTLUMIERROR")];
314  if (!instLumiErrAttribute.isNull()) {
315  instLumiErr = instLumiErrAttribute.data<float>() / 1000.;
316  }
317  coral::Attribute const& startLumiSectionAttribute = fillDataCursor2.currentRow()[std::string("STARTTIME")];
318  if (!startLumiSectionAttribute.isNull()) {
319  since = cond::time::from_boost(startLumiSectionAttribute.data<coral::TimeStamp>().time());
320  }
321  LHCInfo* thisLumiSectionInfo = m_fillPayload->cloneFill();
322  m_tmpBuffer.emplace_back(std::make_pair(since, thisLumiSectionInfo));
323  LHCInfo& payload = *thisLumiSectionInfo;
324  payload.setDelivLumi(delivLumi);
325  payload.setRecLumi(recLumi);
326  payload.setInstLumi(instLumi);
327  payload.setInstLumiError(instLumiErr);
328  }
329  return nlumi;
330 }
void setInstLumi(float const &instLumi)
Definition: LHCInfo.cc:316
std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo > > > m_tmpBuffer
std::unique_ptr< LHCInfo > m_fillPayload
void setInstLumiError(float const &instLumiError)
Definition: LHCInfo.cc:318
void setDelivLumi(float const &delivLumi)
Definition: LHCInfo.cc:312
unsigned long long Time_t
Definition: Time.h:14
coral::ISchema & nominalSchema()
Definition: Session.cc:224
Time_t from_boost(boost::posix_time::ptime bt)
void setRecLumi(float const &recLumi)
Definition: LHCInfo.cc:314
void LHCInfoPopConSourceHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< LHCInfo >.

Definition at line 843 of file LHCInfoPopConSourceHandler.cc.

References addEmptyPayload(), cond::persistency::Transaction::commit(), cond::persistency::ConnectionPool::configure(), cond::persistency::ConnectionPool::createSession(), popcon::PopConSourceHandler< LHCInfo >::dbSession(), Debug, cond::persistency::Session::fetchPayload(), cond::time::from_boost(), getCTTPSData(), getDipData(), getEcalData(), getFillData(), getLumiData(), getNextFillData(), cond::TagInfo_t::lastInterval, m_authpath, m_connectionString, m_debug, m_ecalConnectionString, m_endFill, m_fillPayload, popcon::PopConSourceHandler< LHCInfo >::m_iovs, m_name, m_prevPayload, m_startTime, m_tmpBuffer, cond::TagInfo_t::name, mergeVDriftHistosByStation::name, cond::Iov_t::payloadId, run_AlCaRecoTriggerBitsUpdateWorkflow::session, cond::persistency::ConnectionPool::setAuthenticationPath(), cond::persistency::ConnectionPool::setMessageVerbosity(), cond::Iov_t::since, cond::TagInfo_t::size, cond::persistency::Transaction::start(), popcon::PopConSourceHandler< LHCInfo >::tagInfo(), cond::time::to_boost(), cond::persistency::Session::transaction(), and LHCInfoImpl::transferPayloads().

843  {
844  //reference to the last payload in the tag
845  Ref previousFill;
846 
847  //if a new tag is created, transfer fake fill from 1 to the first fill for the first time
848  if (tagInfo().name.empty()) {
849  edm::LogInfo(m_name) << "New tag " << tagInfo().name << "; from " << m_name << "::getNewObjects";
850  } else {
851  //check what is already inside the database
852  edm::LogInfo(m_name) << "got info for tag " << tagInfo().name << ": size " << tagInfo().size
853  << ", last object valid since " << tagInfo().lastInterval.since << " ( "
854  << boost::posix_time::to_iso_extended_string(
855  cond::time::to_boost(tagInfo().lastInterval.since))
856  << " ); from " << m_name << "::getNewObjects";
857  }
858 
859  cond::Time_t lastSince = tagInfo().lastInterval.since;
860  if (lastSince == 0) {
861  // for a new or empty tag, an empty payload should be added on top with since=1
862  addEmptyPayload(1);
863  } else {
864  edm::LogInfo(m_name) << "The last Iov in tag " << tagInfo().name << " valid since " << lastSince << "from "
865  << m_name << "::getNewObjects";
866  }
867 
868  boost::posix_time::ptime executionTime = boost::posix_time::second_clock::local_time();
869  cond::Time_t targetSince = 0;
870  cond::Time_t endIov = cond::time::from_boost(executionTime);
871  if (!m_startTime.is_not_a_date_time()) {
872  targetSince = cond::time::from_boost(m_startTime);
873  }
874  if (lastSince > targetSince)
875  targetSince = lastSince;
876 
877  edm::LogInfo(m_name) << "Starting sampling at "
878  << boost::posix_time::to_simple_string(cond::time::to_boost(targetSince));
879 
880  //retrieve the data from the relational database source
882  //configure the connection
883  if (m_debug) {
884  connection.setMessageVerbosity(coral::Debug);
885  } else {
886  connection.setMessageVerbosity(coral::Error);
887  }
888  connection.setAuthenticationPath(m_authpath);
889  connection.configure();
890  //create the sessions
893  // fetch last payload when available
894  if (!tagInfo().lastInterval.payloadId.empty()) {
896  session3.transaction().start(true);
898  session3.transaction().commit();
899  }
900 
901  bool iovAdded = false;
902  while (true) {
903  if (targetSince >= endIov) {
904  edm::LogInfo(m_name) << "Sampling ended at the time "
905  << boost::posix_time::to_simple_string(cond::time::to_boost(endIov));
906  break;
907  }
908  bool updateEcal = false;
909  boost::posix_time::ptime targetTime = cond::time::to_boost(targetSince);
910  boost::posix_time::ptime startSampleTime;
911  boost::posix_time::ptime endSampleTime;
912  if (!m_endFill and m_prevPayload->fillNumber() and m_prevPayload->endTime() == 0ULL) {
913  // execute the query for the current fill
914  session.transaction().start(true);
915  edm::LogInfo(m_name) << "Searching started fill #" << m_prevPayload->fillNumber();
916  bool foundFill = getFillData(session, m_prevPayload->fillNumber());
917  session.transaction().commit();
918  if (!foundFill) {
919  edm::LogError(m_name) << "Could not find fill #" << m_prevPayload->fillNumber();
920  break;
921  }
922  updateEcal = true;
923  startSampleTime = cond::time::to_boost(lastSince);
924  } else {
925  session.transaction().start(true);
926  edm::LogInfo(m_name) << "Searching new fill after " << boost::posix_time::to_simple_string(targetTime);
927  bool foundFill = getNextFillData(session, targetTime, m_endFill);
928  session.transaction().commit();
929  if (!foundFill) {
930  edm::LogInfo(m_name) << "No fill found - END of job.";
931  if (iovAdded)
932  addEmptyPayload(targetSince);
933  break;
934  }
935  startSampleTime = cond::time::to_boost(m_fillPayload->createTime());
936  }
937  cond::Time_t startFillTime = m_fillPayload->createTime();
938  cond::Time_t endFillTime = m_fillPayload->endTime();
939  unsigned short lhcFill = m_fillPayload->fillNumber();
940  if (endFillTime == 0ULL) {
941  edm::LogInfo(m_name) << "Found ongoing fill " << lhcFill << " created at " << cond::time::to_boost(startFillTime);
942  endSampleTime = executionTime;
943  targetSince = endIov;
944  } else {
945  edm::LogInfo(m_name) << "Found fill " << lhcFill << " created at " << cond::time::to_boost(startFillTime)
946  << " ending at " << cond::time::to_boost(endFillTime);
947  endSampleTime = cond::time::to_boost(endFillTime);
948  targetSince = endFillTime;
949  }
950 
951  session.transaction().start(true);
952  getDipData(session, startSampleTime, endSampleTime);
953  size_t nlumi = getLumiData(session, startSampleTime, endSampleTime);
954  edm::LogInfo(m_name) << "Found " << nlumi << " lumisections during the fill " << lhcFill;
955  boost::posix_time::ptime flumiStart = cond::time::to_boost(m_tmpBuffer.front().first);
956  boost::posix_time::ptime flumiStop = cond::time::to_boost(m_tmpBuffer.back().first);
957  edm::LogInfo(m_name) << "First lumi starts at " << flumiStart << " last lumi starts at " << flumiStop;
958  getCTTPSData(session, startSampleTime, endSampleTime);
959  session.transaction().commit();
960  session2.transaction().start(true);
961  getEcalData(session2, startSampleTime, endSampleTime, updateEcal);
962  session2.transaction().commit();
963  //
965  edm::LogInfo(m_name) << "Added " << niovs << " iovs within the Fill time";
966  m_tmpBuffer.clear();
967  iovAdded = true;
968  if (m_prevPayload->fillNumber() and m_fillPayload->endTime() != 0ULL)
969  addEmptyPayload(m_fillPayload->endTime());
970  }
971 }
cond::persistency::Session & dbSession() const
edm::ErrorSummaryEntry Error
bool getFillData(cond::persistency::Session &session, unsigned short fillId)
boost::posix_time::ptime m_startTime
bool getCTTPSData(cond::persistency::Session &session, const boost::posix_time::ptime &beginFillTime, const boost::posix_time::ptime &endFillTime)
Iov_t lastInterval
Definition: Types.h:73
std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo > > > m_tmpBuffer
size_t getLumiData(cond::persistency::Session &session, const boost::posix_time::ptime &beginFillTime, const boost::posix_time::ptime &endFillTime)
std::unique_ptr< LHCInfo > m_fillPayload
void start(bool readOnly=true)
Definition: Session.cc:18
Time_t since
Definition: Types.h:53
bool getEcalData(cond::persistency::Session &session, const boost::posix_time::ptime &lowerTime, const boost::posix_time::ptime &upperTime, bool update)
size_t size
Definition: Types.h:74
std::unique_ptr< T > fetchPayload(const cond::Hash &payloadHash)
Definition: Session.h:213
Log< level::Error, false > LogError
std::shared_ptr< LHCInfo > m_prevPayload
Transaction & transaction()
Definition: Session.cc:52
std::string name
Definition: Types.h:72
bool getDipData(cond::persistency::Session &session, const boost::posix_time::ptime &beginFillTime, const boost::posix_time::ptime &endFillTime)
unsigned long long Time_t
Definition: Time.h:14
Hash payloadId
Definition: Types.h:55
Session createSession(const std::string &connectionString, bool writeCapable=false)
size_t transferPayloads(const std::vector< std::pair< cond::Time_t, std::shared_ptr< LHCInfo >>> &buffer, std::map< cond::Time_t, std::shared_ptr< LHCInfo >> &iovsToTransfer, std::shared_ptr< LHCInfo > &prevPayload)
void setMessageVerbosity(coral::MsgLevel level)
Time_t from_boost(boost::posix_time::ptime bt)
Log< level::Info, false > LogInfo
void setAuthenticationPath(const std::string &p)
const bool Debug
boost::posix_time::ptime to_boost(Time_t iValue)
bool getNextFillData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, bool ended)
cond::TagInfo_t const & tagInfo() const
bool LHCInfoPopConSourceHandler::getNextFillData ( cond::persistency::Session session,
const boost::posix_time::ptime &  targetTime,
bool  ended 
)
private

Definition at line 234 of file LHCInfoPopConSourceHandler.cc.

References m_debug, m_fillPayload, LHCInfoImpl::makeFillDataQuery(), seconds(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getNewObjects().

236  {
237  // Prepare the WHERE clause
238  coral::AttributeList fillDataBindVariables;
239  fillDataBindVariables.extend<coral::TimeStamp>(std::string("targetTime"));
240  fillDataBindVariables[std::string("targetTime")].data<coral::TimeStamp>() =
241  coral::TimeStamp(targetTime + boost::posix_time::seconds(1));
242  //by imposing BEGINTIME IS NOT NULL, we remove fills which never went into stable beams,
243  //by additionally imposing ENDTIME IS NOT NULL, we select only finished fills
244  std::string conditionStr = "BEGINTIME IS NOT NULL AND CREATETIME > :targetTime AND LHCFILL IS NOT NULL";
245  if (ended)
246  conditionStr += " AND ENDTIME IS NOT NULL";
247  return LHCInfoImpl::makeFillDataQuery(session, conditionStr, fillDataBindVariables, m_fillPayload, m_debug);
248 }
double seconds()
std::unique_ptr< LHCInfo > m_fillPayload
bool makeFillDataQuery(cond::persistency::Session &session, const std::string &conditionString, const coral::AttributeList &fillDataBindVariables, std::unique_ptr< LHCInfo > &targetPayload, bool debug)
std::string LHCInfoPopConSourceHandler::id ( ) const
overridevirtual

Implements popcon::PopConSourceHandler< LHCInfo >.

Definition at line 973 of file LHCInfoPopConSourceHandler.cc.

References m_name.

973 { return m_name; }

Member Data Documentation

std::string LHCInfoPopConSourceHandler::m_authpath
private

Definition at line 46 of file LHCInfoPopConSourceHandler.h.

Referenced by getNewObjects().

std::string LHCInfoPopConSourceHandler::m_connectionString
private

Definition at line 45 of file LHCInfoPopConSourceHandler.h.

Referenced by getNewObjects().

bool LHCInfoPopConSourceHandler::m_debug
private
std::string LHCInfoPopConSourceHandler::m_dipSchema
private

Definition at line 46 of file LHCInfoPopConSourceHandler.h.

Referenced by getDipData().

std::string LHCInfoPopConSourceHandler::m_ecalConnectionString
private

Definition at line 45 of file LHCInfoPopConSourceHandler.h.

Referenced by getNewObjects().

bool LHCInfoPopConSourceHandler::m_endFill = true
private

Definition at line 42 of file LHCInfoPopConSourceHandler.h.

Referenced by getNewObjects().

boost::posix_time::ptime LHCInfoPopConSourceHandler::m_endTime
private

Definition at line 39 of file LHCInfoPopConSourceHandler.h.

Referenced by LHCInfoPopConSourceHandler().

std::unique_ptr<LHCInfo> LHCInfoPopConSourceHandler::m_fillPayload
private
bool LHCInfoPopConSourceHandler::m_lastPayloadEmpty = false
private

Definition at line 50 of file LHCInfoPopConSourceHandler.h.

Referenced by addEmptyPayload().

std::string LHCInfoPopConSourceHandler::m_name
private

Definition at line 43 of file LHCInfoPopConSourceHandler.h.

Referenced by getEcalData(), getNewObjects(), and id().

std::shared_ptr<LHCInfo> LHCInfoPopConSourceHandler::m_prevPayload
private

Definition at line 48 of file LHCInfoPopConSourceHandler.h.

Referenced by addEmptyPayload(), getEcalData(), and getNewObjects().

unsigned int LHCInfoPopConSourceHandler::m_samplingInterval
private

Definition at line 41 of file LHCInfoPopConSourceHandler.h.

boost::posix_time::ptime LHCInfoPopConSourceHandler::m_startTime
private

Definition at line 38 of file LHCInfoPopConSourceHandler.h.

Referenced by getNewObjects(), and LHCInfoPopConSourceHandler().

std::vector<std::pair<cond::Time_t, std::shared_ptr<LHCInfo> > > LHCInfoPopConSourceHandler::m_tmpBuffer
private

Definition at line 49 of file LHCInfoPopConSourceHandler.h.

Referenced by getCTTPSData(), getEcalData(), getLumiData(), and getNewObjects().