6 #include "RelationalAccess/ISessionProxy.h" 7 #include "RelationalAccess/ISchema.h" 8 #include "RelationalAccess/IQuery.h" 9 #include "RelationalAccess/ICursor.h" 10 #include "CoralBase/AttributeList.h" 11 #include "CoralBase/Attribute.h" 12 #include "CoralBase/AttributeSpecification.h" 13 #include "CoralBase/TimeStamp.h" 21 m_debug( pset.getUntrackedParameter<
bool>(
"debug",
false ) )
24 ,m_samplingInterval( (unsigned
int)pset.getUntrackedParameter<unsigned
int>(
"samplingInterval", 300 ) )
25 ,m_name( pset.getUntrackedParameter<
std::
string>(
"name",
"LHCInfoPopConSourceHandler" ) )
26 ,m_connectionString(pset.getUntrackedParameter<
std::
string>(
"connectionString",
""))
27 ,m_ecalConnectionString(pset.getUntrackedParameter<
std::
string>(
"ecalConnectionString",
""))
28 ,m_dipSchema(pset.getUntrackedParameter<
std::
string>(
"DIPSchema",
""))
29 ,m_authpath(pset.getUntrackedParameter<
std::
string>(
"authenticationPath",
""))
31 if( pset.
exists(
"startTime") ){
34 boost::posix_time::ptime
now = boost::posix_time::second_clock::local_time();
36 if( pset.
exists(
"endTime") ){
48 ut.first += samplingInterval;
54 const boost::posix_time::ptime& targetTime,
57 coral::ISchema& runTimeLoggerSchema = session.
nominalSchema();
59 std::unique_ptr<coral::IQuery> fillDataQuery( runTimeLoggerSchema.newQuery() );
61 fillDataQuery->addToTableList(
std::string(
"RUNTIME_SUMMARY" ) );
63 fillDataQuery->addToOutputList(
std::string(
"LHCFILL" ) );
64 fillDataQuery->addToOutputList(
std::string(
"NBUNCHESBEAM1" ) );
65 fillDataQuery->addToOutputList(
std::string(
"NBUNCHESBEAM2" ) );
66 fillDataQuery->addToOutputList(
std::string(
"NCOLLIDINGBUNCHES" ) );
67 fillDataQuery->addToOutputList(
std::string(
"NTARGETBUNCHES" ) );
68 fillDataQuery->addToOutputList(
std::string(
"RUNTIME_TYPE_ID" ) );
69 fillDataQuery->addToOutputList(
std::string(
"PARTY1" ) );
70 fillDataQuery->addToOutputList(
std::string(
"PARTY2" ) );
71 fillDataQuery->addToOutputList(
std::string(
"CROSSINGANGLE" ) );
72 fillDataQuery->addToOutputList(
std::string(
"BETASTAR" ) );
73 fillDataQuery->addToOutputList(
std::string(
"INTENSITYBEAM1" ) );
74 fillDataQuery->addToOutputList(
std::string(
"INTENSITYBEAM2" ) );
75 fillDataQuery->addToOutputList(
std::string(
"ENERGY" ) );
76 fillDataQuery->addToOutputList(
std::string(
"CREATETIME" ) );
77 fillDataQuery->addToOutputList(
std::string(
"BEGINTIME" ) );
78 fillDataQuery->addToOutputList(
std::string(
"ENDTIME" ) );
79 fillDataQuery->addToOutputList(
std::string(
"INJECTIONSCHEME" ) );
81 coral::AttributeList fillDataBindVariables;
82 fillDataBindVariables.extend<coral::TimeStamp>(
std::string(
"targetTime"));
86 std::string conditionStr(
"BEGINTIME IS NOT NULL AND BEGINTIME <= :targetTime AND ENDTIME> :targetTime AND LHCFILL IS NOT NULL" );
88 conditionStr =
"BEGINTIME IS NOT NULL AND BEGINTIME > :targetTime AND LHCFILL IS NOT NULL AND ENDTIME IS NOT NULL";
90 fillDataQuery->setCondition( conditionStr, fillDataBindVariables );
92 fillDataQuery->addToOrderList(
std::string(
"BEGINTIME" ) );
94 coral::AttributeList fillDataOutput;
95 fillDataOutput.extend<
unsigned short>(
std::string(
"LHCFILL" ) );
96 fillDataOutput.extend<
unsigned short>(
std::string(
"NBUNCHESBEAM1" ) );
97 fillDataOutput.extend<
unsigned short>(
std::string(
"NBUNCHESBEAM2" ) );
98 fillDataOutput.extend<
unsigned short>(
std::string(
"NCOLLIDINGBUNCHES" ) );
99 fillDataOutput.extend<
unsigned short>(
std::string(
"NTARGETBUNCHES" ) );
100 fillDataOutput.extend<
int>(
std::string(
"RUNTIME_TYPE_ID" ) );
101 fillDataOutput.extend<
int>(
std::string(
"PARTY1" ) );
102 fillDataOutput.extend<
int>(
std::string(
"PARTY2" ) );
103 fillDataOutput.extend<
float>(
std::string(
"CROSSINGANGLE" ) );
104 fillDataOutput.extend<
float>(
std::string(
"BETASTAR" ) );
105 fillDataOutput.extend<
float>(
std::string(
"INTENSITYBEAM1" ) );
106 fillDataOutput.extend<
float>(
std::string(
"INTENSITYBEAM2" ) );
107 fillDataOutput.extend<
float>(
std::string(
"ENERGY" ) );
108 fillDataOutput.extend<coral::TimeStamp>(
std::string(
"CREATETIME" ) );
109 fillDataOutput.extend<coral::TimeStamp>(
std::string(
"BEGINTIME" ) );
110 fillDataOutput.extend<coral::TimeStamp>(
std::string(
"ENDTIME" ) );
112 fillDataQuery->defineOutput( fillDataOutput );
113 fillDataQuery->limitReturnedRows( 1 );
115 coral::ICursor& fillDataCursor = fillDataQuery->execute();
117 unsigned short currentFill = 0;
118 unsigned short bunches1 = 0, bunches2 = 0, collidingBunches = 0, targetBunches = 0;
121 float crossingAngle = 0., betastar = 0., intensityBeam1 = 0., intensityBeam2 = 0., energy = 0.;
122 coral::TimeStamp stableBeamStartTimeStamp, beamDumpTimeStamp;
123 cond::Time_t creationTime = 0ULL, stableBeamStartTime = 0ULL, beamDumpTime = 0ULL;
125 std::ostringstream ss;
127 if( fillDataCursor.next() ) {
130 std::ostringstream qs;
131 fillDataCursor.currentRow().toOutputStream( qs );
133 coral::Attribute
const & fillAttribute = fillDataCursor.currentRow()[
std::string(
"LHCFILL" ) ];
134 if( !fillAttribute.isNull() ){
135 currentFill = fillAttribute.data<
unsigned short>();
137 coral::Attribute
const & bunches1Attribute = fillDataCursor.currentRow()[
std::string(
"NBUNCHESBEAM1" ) ];
138 if( !bunches1Attribute.isNull() ) {
139 bunches1 = bunches1Attribute.data<
unsigned short>();
141 coral::Attribute
const & bunches2Attribute = fillDataCursor.currentRow()[
std::string(
"NBUNCHESBEAM2" ) ];
142 if( !bunches2Attribute.isNull() ) {
143 bunches2 = bunches2Attribute.data<
unsigned short>();
145 coral::Attribute
const & collidingBunchesAttribute = fillDataCursor.currentRow()[
std::string(
"NCOLLIDINGBUNCHES" ) ];
146 if( !collidingBunchesAttribute.isNull() ) {
147 collidingBunches = collidingBunchesAttribute.data<
unsigned short>();
149 coral::Attribute
const & targetBunchesAttribute = fillDataCursor.currentRow()[
std::string(
"NTARGETBUNCHES" ) ];
150 if( !targetBunchesAttribute.isNull() ) {
151 targetBunches = targetBunchesAttribute.data<
unsigned short>();
155 coral::Attribute
const & particleType1Attribute = fillDataCursor.currentRow()[
std::string(
"PARTY1" ) ];
156 if( !particleType1Attribute.isNull() ) {
159 coral::Attribute
const & particleType2Attribute = fillDataCursor.currentRow()[
std::string(
"PARTY2" ) ];
160 if( !particleType2Attribute.isNull() ) {
163 coral::Attribute
const & crossingAngleAttribute = fillDataCursor.currentRow()[
std::string(
"CROSSINGANGLE" ) ];
164 if( !crossingAngleAttribute.isNull() ) {
165 crossingAngle = crossingAngleAttribute.data<
float>();
167 coral::Attribute
const & betastarAttribute = fillDataCursor.currentRow()[
std::string(
"BETASTAR" ) ];
168 if( !betastarAttribute.isNull() ) {
169 betastar = betastarAttribute.data<
float>();
171 coral::Attribute
const & intensityBeam1Attribute = fillDataCursor.currentRow()[
std::string(
"INTENSITYBEAM1" ) ];
172 if( !intensityBeam1Attribute.isNull() ) {
173 intensityBeam1 = intensityBeam1Attribute.data<
float>();
175 coral::Attribute
const & intensityBeam2Attribute = fillDataCursor.currentRow()[
std::string(
"INTENSITYBEAM2" ) ];
176 if( !intensityBeam2Attribute.isNull() ) {
177 intensityBeam2 = intensityBeam2Attribute.data<
float>();
179 coral::Attribute
const & energyAttribute = fillDataCursor.currentRow()[
std::string(
"ENERGY" ) ];
180 if( !energyAttribute.isNull() ){
181 energy = energyAttribute.data<
float>();
188 stableBeamStartTimeStamp = fillDataCursor.currentRow()[
std::string(
"BEGINTIME" ) ].data<coral::TimeStamp>();
190 coral::Attribute
const & beamDumpTimeAttribute = fillDataCursor.currentRow()[
std::string(
"ENDTIME" ) ];
191 if( !beamDumpTimeAttribute.isNull() ) {
192 beamDumpTimeStamp = beamDumpTimeAttribute.data<coral::TimeStamp>();
195 coral::Attribute
const & injectionSchemeAttribute = fillDataCursor.currentRow()[
std::string(
"INJECTIONSCHEME" ) ];
196 if( !injectionSchemeAttribute.isNull() ) {
197 injectionScheme = injectionSchemeAttribute.data<
std::string>();
216 payload.
setFill( currentFill,
true );
238 const boost::posix_time::ptime& targetTime,
240 return getFillData( session, targetTime,
false, payload );
244 const boost::posix_time::ptime& targetTime,
246 return getFillData( session, targetTime,
true, payload );
250 const boost::posix_time::ptime& targetTime,
252 coral::ISchema& runTimeLoggerSchema = session.
nominalSchema();
254 std::unique_ptr<coral::IQuery> fillDataQuery2( runTimeLoggerSchema.newQuery() );
256 fillDataQuery2->addToTableList(
std::string(
"LUMI_SECTIONS" ) );
258 fillDataQuery2->addToOutputList(
std::string(
"DELIVLUMI" ) );
259 fillDataQuery2->addToOutputList(
std::string(
"LIVELUMI" ) );
260 fillDataQuery2->addToOutputList(
std::string(
"INSTLUMI" ) );
261 fillDataQuery2->addToOutputList(
std::string(
"INSTLUMIERROR" ) );
263 coral::AttributeList fillDataBindVariables;
264 fillDataBindVariables.extend<coral::TimeStamp>(
std::string(
"targetTime"));
266 std::string conditionStr =
"DELIVLUMI IS NOT NULL AND STARTTIME < :targetTime AND STOPTIME> :targetTime";
267 fillDataQuery2->setCondition( conditionStr, fillDataBindVariables );
269 fillDataQuery2->addToOrderList(
std::string(
"LHCFILL" ) );
272 coral::AttributeList fillDataOutput2;
273 fillDataOutput2.extend<
float>(
std::string(
"DELIVEREDLUMI" ) );
274 fillDataOutput2.extend<
float>(
std::string(
"RECORDEDLUMI" ) );
275 fillDataOutput2.extend<
float>(
std::string(
"INSTLUMI" ) );
276 fillDataOutput2.extend<
float>(
std::string(
"INSTLUMIERROR" ) );
277 fillDataQuery2->defineOutput( fillDataOutput2 );
279 coral::ICursor& fillDataCursor2 = fillDataQuery2->execute();
281 float delivLumi = 0., recLumi = 0.,
instLumi = 0, instLumiErr = 0.;
283 if( fillDataCursor2.next()){
285 coral::Attribute
const & delivLumiAttribute = fillDataCursor2.currentRow()[
std::string(
"DELIVEREDLUMI" ) ];
286 if( !delivLumiAttribute.isNull() ){
287 delivLumi = delivLumiAttribute.data<
float>() / 1000.;
289 coral::Attribute
const & recLumiAttribute = fillDataCursor2.currentRow()[
std::string(
"RECORDEDLUMI" ) ];
290 if( !recLumiAttribute.isNull() ){
291 recLumi = recLumiAttribute.data<
float>() / 1000.;
293 coral::Attribute
const & instLumiAttribute = fillDataCursor2.currentRow()[
std::string(
"INSTLUMI" ) ];
294 if( !instLumiAttribute.isNull() ){
295 instLumi = instLumiAttribute.data<
float>() / 1000.;
297 coral::Attribute
const & instLumiErrAttribute = fillDataCursor2.currentRow()[
std::string(
"INSTLUMIERROR" ) ];
298 if( !instLumiErrAttribute.isNull() ){
299 instLumiErr = instLumiErrAttribute.data<
float>() / 1000.;
301 if( delivLumi > 0. ){
312 const boost::posix_time::ptime& targetTime,
318 coral::AttributeList bunchConfBindVariables;
319 bunchConfBindVariables.extend<coral::TimeStamp>(
std::string(
"targetTime"));
323 coral::AttributeList bunchConfOutput;
324 bunchConfOutput.extend<coral::TimeStamp>(
std::string(
"DIPTIME" ) );
325 bunchConfOutput.extend<
unsigned short>(
std::string(
"BUCKET" ) );
327 std::unique_ptr<coral::IQuery> bunchConf1Query(beamCondSchema.newQuery());
328 bunchConf1Query->addToTableList(
std::string(
"LHC_CIRCBUNCHCONFIG_BEAM1" ),
std::string(
"BEAMCONF\", TABLE( BEAMCONF.VALUE ) \"BUCKETS" ) );
331 bunchConf1Query->setCondition( conditionStr, bunchConfBindVariables );
332 bunchConf1Query->addToOrderList(
std::string(
"DIPTIME DESC" ) );
334 bunchConf1Query->defineOutput( bunchConfOutput );
335 coral::ICursor& bunchConf1Cursor = bunchConf1Query->execute();
337 std::bitset<LHCInfo::bunchSlots+1> bunchConfiguration1( 0ULL );
339 while( bunchConf1Cursor.next() ) {
342 std::ostringstream b1s;
343 bunchConf1Cursor.currentRow().toOutputStream( b1s );
345 if( bunchConf1Cursor.currentRow()[
std::string(
"BUCKET" ) ].data<
unsigned short>() != 0 ) {
346 unsigned short slot = ( bunchConf1Cursor.currentRow()[
std::string(
"BUCKET" ) ].data<
unsigned short>() - 1 ) / 10 + 1;
347 bunchConfiguration1[ slot ] =
true;
356 std::unique_ptr<coral::IQuery> bunchConf2Query(beamCondSchema.newQuery());
357 bunchConf2Query->addToTableList(
std::string(
"LHC_CIRCBUNCHCONFIG_BEAM2" ),
std::string(
"BEAMCONF\", TABLE( BEAMCONF.VALUE ) \"BUCKETS" ) );
360 bunchConf2Query->setCondition( conditionStr, bunchConfBindVariables );
361 bunchConf2Query->addToOrderList(
std::string(
"DIPTIME DESC" ) );
363 bunchConf2Query->defineOutput( bunchConfOutput );
364 coral::ICursor& bunchConf2Cursor = bunchConf2Query->execute();
366 std::bitset<LHCInfo::bunchSlots+1> bunchConfiguration2( 0ULL );
368 while( bunchConf2Cursor.next() ) {
371 std::ostringstream b2s;
372 bunchConf2Cursor.currentRow().toOutputStream( b2s );
374 if( bunchConf2Cursor.currentRow()[
std::string(
"BUCKET" ) ].data<
unsigned short>() != 0 ) {
375 unsigned short slot = ( bunchConf2Cursor.currentRow()[
std::string(
"BUCKET" ) ].data<
unsigned short>() - 1 ) / 10 + 1;
376 bunchConfiguration2[ slot ] =
true;
384 std::unique_ptr<coral::IQuery> lumiDataQuery(beamCondSchema.newQuery());
385 lumiDataQuery->addToTableList(
std::string(
"CMS_LHC_LUMIPERBUNCH" ),
std::string(
"LUMIPERBUNCH\", TABLE( LUMIPERBUNCH.LUMI_BUNCHINST ) \"VALUE" ) );
388 coral::AttributeList lumiDataBindVariables;
389 lumiDataBindVariables.extend<coral::TimeStamp>(
std::string(
"targetTime" ) );
391 lumiDataBindVariables.extend<coral::TimeStamp>(
std::string(
"beamDumpTimeStamp" ) );
393 conditionStr =
std::string(
"DIPTIME BETWEEN :targetTime AND :beamDumpTimeStamp" );
394 lumiDataQuery->setCondition( conditionStr, lumiDataBindVariables );
395 lumiDataQuery->addToOrderList(
std::string(
"DIPTIME DESC" ) );
396 lumiDataQuery->limitReturnedRows(3564);
398 coral::AttributeList lumiDataOutput;
399 lumiDataOutput.extend<coral::TimeStamp>(
std::string(
"TIME" ) );
400 lumiDataOutput.extend<
float>(
std::string(
"VALUE" ) );
401 lumiDataQuery->defineOutput( lumiDataOutput );
403 coral::ICursor& lumiDataCursor = lumiDataQuery->execute();
405 std::vector<float> lumiPerBX;
407 while( lumiDataCursor.next() ) {
410 std::ostringstream lpBX;
411 lumiDataCursor.currentRow().toOutputStream( lpBX );
413 if( lumiDataCursor.currentRow()[
std::string(
"VALUE" ) ].data<
float>() != 0.00 ) {
414 lumiPerBX.push_back(lumiDataCursor.currentRow()[
std::string(
"VALUE" ) ].data<
float>());
424 const boost::posix_time::ptime& targetTime,
428 coral::ISchema& CTPPS = session.
coralSession().schema(
"CMS_CTP_CTPPS_COND");
430 std::unique_ptr<coral::IQuery> CTPPSDataQuery( CTPPS.newQuery() );
432 CTPPSDataQuery->addToTableList(
std::string(
"CTPPS_LHC_MACHINE_PARAMS" ) );
434 CTPPSDataQuery->addToOutputList(
std::string(
"LHC_STATE" ) );
435 CTPPSDataQuery->addToOutputList(
std::string(
"LHC_COMMENT" ) );
436 CTPPSDataQuery->addToOutputList(
std::string(
"CTPPS_STATUS" ) );
437 CTPPSDataQuery->addToOutputList(
std::string(
"LUMI_SECTION" ) );
439 coral::AttributeList CTPPSDataBindVariables;
440 CTPPSDataBindVariables.extend<coral::TimeStamp>(
std::string(
"targetTime" ) );
443 CTPPSDataQuery->setCondition( conditionStr, CTPPSDataBindVariables );
445 CTPPSDataQuery->addToOrderList(
std::string(
"DIP_UPDATE_TIME DESC" ) );
447 coral::AttributeList CTPPSDataOutput;
451 CTPPSDataOutput.extend<
int>(
std::string(
"LUMI_SECTION" ) );
452 CTPPSDataQuery->limitReturnedRows( 1 );
453 CTPPSDataQuery->defineOutput( CTPPSDataOutput );
455 coral::ICursor& CTPPSDataCursor = CTPPSDataQuery->execute();
456 std::string lhcState =
"", lhcComment =
"", ctppsStatus =
"";
457 unsigned int lumiSection = 0;
460 if( CTPPSDataCursor.next() ) {
463 std::ostringstream CTPPS;
464 CTPPSDataCursor.currentRow().toOutputStream( CTPPS );
466 coral::Attribute
const & lhcStateAttribute = CTPPSDataCursor.currentRow()[
std::string(
"LHC_STATE" ) ];
467 if( !lhcStateAttribute.isNull() ) {
471 coral::Attribute
const & lhcCommentAttribute = CTPPSDataCursor.currentRow()[
std::string(
"LHC_COMMENT" ) ];
472 if( !lhcCommentAttribute.isNull() ) {
473 lhcComment = lhcCommentAttribute.data<
std::string>();
476 coral::Attribute
const & ctppsStatusAttribute = CTPPSDataCursor.currentRow()[
std::string(
"CTPPS_STATUS" ) ];
477 if( !ctppsStatusAttribute.isNull() ) {
478 ctppsStatus = ctppsStatusAttribute.data<
std::string>();
481 coral::Attribute
const & lumiSectionAttribute = CTPPSDataCursor.currentRow()[
std::string(
"LUMI_SECTION" ) ];
482 if( !lumiSectionAttribute.isNull() ) {
483 lumiSection = lumiSectionAttribute.data<
int>();
494 const boost::posix_time::ptime& targetTime,
501 std::unique_ptr<coral::IQuery> ECALDataQuery( ECAL.newQuery() );
503 ECALDataQuery->addToTableList(
std::string(
"BEAM_PHASE" ) );
505 ECALDataQuery->addToOutputList(
std::string(
"DIP_value" ) );
506 ECALDataQuery->addToOutputList(
std::string(
"element_nr" ) );
508 coral::AttributeList ECALDataBindVariables;
509 std::string conditionStr =
std::string(
"DIP_value LIKE '%beamPhaseMean%' OR DIP_value LIKE '%cavPhaseMean%'" );
511 ECALDataQuery->setCondition( conditionStr, ECALDataBindVariables );
513 ECALDataQuery->addToOrderList(
std::string(
"CHANGE_DATE" ) );
514 ECALDataQuery->addToOrderList(
std::string(
"DIP_value" ) );
515 ECALDataQuery->addToOrderList(
std::string(
"element_nr" ) );
517 coral::AttributeList ECALDataOutput;
519 ECALDataOutput.extend<
float>(
std::string(
"element_nr" ) );
520 ECALDataQuery->limitReturnedRows( 14256 );
521 ECALDataQuery->defineOutput( ECALDataOutput );
523 coral::ICursor& ECALDataCursor = ECALDataQuery->execute();
524 std::vector<float> beam1VC, beam2VC, beam1RF, beam2RF;
526 std::map<std::string, int> vecMap;
533 while( ECALDataCursor.next() ) {
536 std::ostringstream
ECAL;
537 ECALDataCursor.currentRow().toOutputStream( ECAL );
539 coral::Attribute
const & dipValAttribute = ECALDataCursor.currentRow()[
std::string(
"DIP_value" ) ];
540 if( !dipValAttribute.isNull() ) {
544 coral::Attribute
const & elementNrAttribute = ECALDataCursor.currentRow()[
std::string(
"element_nr" ) ];
545 if( !elementNrAttribute.isNull() ){
546 switch( vecMap[dipVal] )
549 beam1VC.push_back(elementNrAttribute.data<
float>());
552 beam2VC.push_back(elementNrAttribute.data<
float>());
555 beam1RF.push_back(elementNrAttribute.data<
float>());
558 beam2RF.push_back(elementNrAttribute.data<
float>());
587 m_to_transfer.push_back( std::make_pair( newPayload, iov ) );
597 if( !lastAdded->
equals( newPayload ) ) {
602 m_to_transfer.push_back( std::make_pair( &newPayload, iov ) );
621 <<
" ); from " <<
m_name <<
"::getNewObjects";
630 <<
" valid since " << lastIov
631 <<
"from " <<
m_name <<
"::getNewObjects";
637 if( targetIov < tgtIov ) targetIov = tgtIov;
645 std::unique_ptr<LHCInfo> currentFillPayload;
661 if( !
tagInfo().lastPayloadToken.empty() ){
666 if( lastPayload->fillNumber() != 0 ){
667 currentFillPayload.reset(lastPayload->cloneFill());
672 if( currentFillPayload.get() ==
nullptr ){
673 currentFillPayload.reset(
new LHCInfo() );
679 cond::Time_t firstIov = currentFillPayload->beginTime();
680 firstIov =
std::max( firstIov,lastIov );
681 targetIov =
std::max( targetIov,firstIov);
684 currentFillPayload.reset();
691 if( targetIov >= endIov ){
696 if( !currentFillPayload.get() ){
697 currentFillPayload.reset(
new LHCInfo() );
699 edm::LogInfo(
m_name ) <<
"Searching new fill after "<<boost::posix_time::to_simple_string(targetTime);
700 bool foundFill =
getNextFillData( session, targetTime, *currentFillPayload );
703 currentFillPayload.reset();
708 cond::Time_t newTargetIov = currentFillPayload->beginTime();
710 if( newTargetIov > targetIov ){
712 targetIov = newTargetIov;
718 edm::LogInfo(
m_name )<<
"Getting sample at:"<<boost::posix_time::to_simple_string(targetTime);
731 cond::Time_t endSampling = currentFillPayload->endTime();
732 if( endSampling == 0 ) endSampling =
cond::time::from_boost( boost::posix_time::second_clock::local_time() );
733 if( targetIov > endSampling ){
736 targetIov = endSampling;
737 currentFillPayload =
nullptr;
740 if( targetIov >= endIov ){
bool equals(const LHCInfo &rhs) const
cond::persistency::Session & dbSession() const
edm::ErrorSummaryEntry Error
void setBeam1RF(std::vector< float > const &beam1RF)
T getUntrackedParameter(std::string const &, T const &) const
bool getNextFillData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, LHCInfo &payload)
void setLumiSection(unsigned int const &lumiSection)
void setBeginTime(cond::Time_t const &beginTime)
void setInstLumi(float const &instLumi)
void setEnergy(float const &energy)
edm::Ref< Container > Ref
boost::posix_time::ptime m_startTime
std::string m_connectionString
bool getFillData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, bool next, LHCInfo &payload)
void setInstLumiError(float const &instLumiError)
void start(bool readOnly=true)
bool getLumiData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, LHCInfo &payload)
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
cond::Time_t pack(cond::UnpackedTime iValue)
void setDelivLumi(float const &delivLumi)
void setBeam1VC(std::vector< float > const &beam1VC)
Transaction & transaction()
OldContainer m_to_transfer
void setBunchesInBeam1(unsigned short const &bunches)
void setLhcComment(std::string const &lhcComment)
void setFill(unsigned short const &lhcFill, bool const &fromData)
cond::ValidityInterval lastInterval
unsigned long long Time_t
boost::posix_time::ptime m_endTime
void setBetaStar(float const &betaStar)
coral::ISchema & nominalSchema()
Session createSession(const std::string &connectionString, bool writeCapable=false)
void setLumiPerBX(std::vector< float > const &lumiPerBX)
void setBunchesInBeam2(unsigned short const &bunches)
bool getEcalData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, LHCInfo &payload)
cond::Time_t getNextIov(cond::Time_t prevIov, unsigned int samplingInterval)
void setBeam2RF(std::vector< float > const &beam2RF)
void setLhcState(std::string const &lhcState)
void setBeam2VC(std::vector< float > const &beam2VC)
void setCollidingBunches(unsigned short const &collidingBunches)
void setMessageVerbosity(coral::MsgLevel level)
Time_t from_boost(boost::posix_time::ptime bt)
bool getCTTPSData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, LHCInfo &payload)
bool getCurrentFillData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, LHCInfo &payload)
void setRecLumi(float const &recLumi)
static size_t const availableBunchSlots
cond::Time_t const endTime() const
void addEmptyPayload(cond::Time_t iov)
void addPayload(LHCInfo &newPayload, cond::Time_t iov)
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
void setInjectionScheme(std::string const &injectionScheme)
std::string lastPayloadToken
void setCreationTime(cond::Time_t const &createTime)
void setTargetBunches(unsigned short const &targetBunches)
coral::ISessionProxy & coralSession()
void setCtppsStatus(std::string const &ctppsStatus)
std::pair< unsigned int, unsigned int > UnpackedTime
unsigned short const fillNumber() const
~LHCInfoPopConSourceHandler() override
void setBunchBitsetForBeam1(std::bitset< bunchSlots+1 > const &bunchConfiguration)
void setBunchBitsetForBeam2(std::bitset< bunchSlots+1 > const &bunchConfiguration)
std::string id() const override
void setIntensityForBeam1(float const &intensity)
void setEndTime(cond::Time_t const &endTime)
unsigned int m_samplingInterval
std::vector< std::unique_ptr< LHCInfo > > m_payloadBuffer
std::string m_ecalConnectionString
void setIntensityForBeam2(float const &intensity)
void setAuthenticationPath(const std::string &p)
void setFillType(FillTypeId const &fillType)
void getNewObjects() override
const Time_t MAX_VAL(std::numeric_limits< Time_t >::max())
void setCrossingAngle(float const &angle)
boost::posix_time::ptime to_boost(Time_t iValue)
int add(value_type *payload, Summary *summary, Time_t time)
cond::TagInfo_t const & tagInfo() const
bool getDipData(cond::persistency::Session &session, const boost::posix_time::ptime &targetTime, LHCInfo &payload)
cond::UnpackedTime unpack(cond::Time_t iValue)
LHCInfoPopConSourceHandler(const edm::ParameterSet &pset)
std::shared_ptr< T > fetchPayload(const cond::Hash &payloadHash)