forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created perLS PopCon: cloned old one, removed irrelevant code and adj…
…usted the rest
- Loading branch information
1 parent
190a475
commit 67071cc
Showing
6 changed files
with
730 additions
and
1 deletion.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
CondTools/RunInfo/interface/LHCInfoPerLSPopConSourceHandler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef LHCINFOPOPCONSOURCEHANDLER_H | ||
#define LHCINFOPOPCONSOURCEHANDLER_H | ||
|
||
#include <string> | ||
|
||
#include "CondCore/PopCon/interface/PopConSourceHandler.h" | ||
#include "CondFormats/RunInfo/interface/LHCInfoPerLS.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h" | ||
#include "CondCore/CondDB/interface/Types.h" | ||
#include "CondTools/RunInfo/interface/OMSAccess.h" | ||
|
||
|
||
namespace cond { | ||
class OMSService; | ||
} | ||
|
||
class LHCInfoPerLSPopConSourceHandler : public popcon::PopConSourceHandler<LHCInfoPerLS> { | ||
public: | ||
LHCInfoPerLSPopConSourceHandler(const edm::ParameterSet& pset); | ||
~LHCInfoPerLSPopConSourceHandler() override; | ||
void getNewObjects() override; | ||
std::string id() const override; | ||
|
||
static constexpr unsigned int kLumisectionsQueryLimit = 4000; | ||
|
||
private: | ||
void addEmptyPayload(cond::Time_t iov); | ||
|
||
bool makeFillPayload(std::unique_ptr<LHCInfoPerLS>& targetPayload, | ||
const cond::OMSServiceResult& queryResult); | ||
|
||
|
||
size_t getLumiData(const cond::OMSService& service, | ||
unsigned short fillId, | ||
const boost::posix_time::ptime& beginFillTime, | ||
const boost::posix_time::ptime& endFillTime); | ||
bool getCTTPSData(cond::persistency::Session& session, | ||
const boost::posix_time::ptime& beginFillTime, | ||
const boost::posix_time::ptime& endFillTime); | ||
|
||
private: | ||
bool m_debug; | ||
// starting date for sampling | ||
boost::posix_time::ptime m_startTime; | ||
boost::posix_time::ptime m_endTime; | ||
// sampling interval in seconds | ||
unsigned int m_samplingInterval; | ||
bool m_endFill = true; | ||
std::string m_name; | ||
//for reading from relational database source | ||
std::string m_connectionString, m_ecalConnectionString; | ||
std::string m_dipSchema, m_authpath; | ||
std::string m_omsBaseUrl; | ||
std::unique_ptr<LHCInfoPerLS> m_fillPayload; | ||
std::shared_ptr<LHCInfoPerLS> m_prevPayload; | ||
cond::Time_t m_startFillTime; | ||
cond::Time_t m_endFillTime; | ||
cond::Time_t m_prevEndFillTime; | ||
std::vector<std::pair<cond::Time_t, std::shared_ptr<LHCInfoPerLS> > > m_tmpBuffer; | ||
bool m_lastPayloadEmpty = false; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "CondCore/PopCon/interface/PopConAnalyzer.h" | ||
#include "CondTools/RunInfo/interface/LHCInfoPerLSPopConSourceHandler.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
|
||
typedef popcon::PopConAnalyzer<LHCInfoPerLSPopConSourceHandler> LHCInfoPerLSPopConAnalyzer; | ||
//define this as a plug-in | ||
DEFINE_FWK_MODULE(LHCInfoPerLSPopConAnalyzer); |
88 changes: 88 additions & 0 deletions
88
CondTools/RunInfo/python/LHCInfoPerLSPopConAnalyzerEndFill.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import socket | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
process = cms.Process("LHCInfoPerLSPopulator") | ||
from CondCore.CondDB.CondDB_cfi import * | ||
#process.load("CondCore.DBCommon.CondDBCommon_cfi") | ||
#process.CondDBCommon.connect = 'sqlite_file:lhcinfoperls_pop_test.db' | ||
#process.CondDBCommon.DBParameters.authenticationPath = '.' | ||
#process.CondDBCommon.DBParameters.messageLevel=cms.untracked.int32(1) | ||
|
||
sourceConnection = 'oracle://cms_omds_adg/CMS_RUNINFO_R' | ||
if socket.getfqdn().find('.cms') != -1: | ||
sourceConnection = 'oracle://cms_omds_lb/CMS_RUNINFO_R' | ||
|
||
options = VarParsing.VarParsing() | ||
options.register( 'destinationConnection' | ||
, 'sqlite_file:lhcinfo_pop_test.db' #default value | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.string | ||
, "Connection string to the DB where payloads will be possibly written." | ||
) | ||
options.register( 'targetConnection' | ||
, '' #default value | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.string | ||
, """Connection string to the target DB: | ||
if not empty (default), this provides the latest IOV and payloads to compare; | ||
it is the DB where payloads should be finally uploaded.""" | ||
) | ||
options.register( 'tag' | ||
, 'LHCInfoPerLS_PopCon_start_test' | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.string | ||
, "Tag written in destinationConnection and finally appended in targetConnection." | ||
) | ||
options.register( 'messageLevel' | ||
, 0 #default value | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.int | ||
, "Message level; default to 0" | ||
) | ||
options.parseArguments() | ||
|
||
CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) ) | ||
CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel ) | ||
|
||
process.MessageLogger = cms.Service("MessageLogger", | ||
cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')), | ||
destinations = cms.untracked.vstring('cout') | ||
) | ||
|
||
process.source = cms.Source("EmptyIOVSource", | ||
lastValue = cms.uint64(1), | ||
timetype = cms.string('runnumber'), | ||
firstValue = cms.uint64(1), | ||
interval = cms.uint64(1) | ||
) | ||
|
||
process.PoolDBOutputService = cms.Service("PoolDBOutputService", | ||
CondDBConnection, | ||
timetype = cms.untracked.string('timestamp'), | ||
toPut = cms.VPSet(cms.PSet(record = cms.string('LHCInfoPerLSRcd'), | ||
tag = cms.string( options.tag ) | ||
) | ||
) | ||
) | ||
|
||
process.Test1 = cms.EDAnalyzer("LHCInfoPerLSPopConAnalyzer", | ||
SinceAppendMode = cms.bool(True), | ||
record = cms.string('LHCInfoPerLSRcd'), | ||
name = cms.untracked.string('LHCInfo'), | ||
Source = cms.PSet(fill = cms.untracked.uint32(6417), | ||
startTime = cms.untracked.string('2021-09-10 03:10:18.000'), | ||
# endTime = cms.untracked.string('2018-04-06 05:00:00.000'), | ||
samplingInterval = cms.untracked.uint32( 600 ), | ||
endFill = cms.untracked.bool(True), | ||
connectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"), | ||
ecalConnectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_DCS_ENV_PVSS_COND"), | ||
DIPSchema = cms.untracked.string("CMS_BEAM_COND"), | ||
omsBaseUrl = cms.untracked.string("http://vocms0184.cern.ch/agg/api/v1"), | ||
#authenticationPath = cms.untracked.string("."), | ||
debug=cms.untracked.bool(False) | ||
), | ||
loggingOn = cms.untracked.bool(True), | ||
IsDestDbCheckedInQueryLog = cms.untracked.bool(False) | ||
) | ||
|
||
process.p = cms.Path(process.Test1) |
88 changes: 88 additions & 0 deletions
88
CondTools/RunInfo/python/LHCInfoPerLSPopConAnalyzerStartFill.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import socket | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
process = cms.Process("LHCInfoPerLSPopulator") | ||
from CondCore.CondDB.CondDB_cfi import * | ||
#process.load("CondCore.DBCommon.CondDBCommon_cfi") | ||
#process.CondDBCommon.connect = 'sqlite_file:lhcinfoperls_pop_test.db' | ||
#process.CondDBCommon.DBParameters.authenticationPath = '.' | ||
#process.CondDBCommon.DBParameters.messageLevel=cms.untracked.int32(1) | ||
|
||
sourceConnection = 'oracle://cms_omds_adg/CMS_RUNINFO_R' | ||
if socket.getfqdn().find('.cms') != -1: | ||
sourceConnection = 'oracle://cms_omds_lb/CMS_RUNINFO_R' | ||
|
||
options = VarParsing.VarParsing() | ||
options.register( 'destinationConnection' | ||
, 'sqlite_file:lhcinfo_pop_test.db' #default value | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.string | ||
, "Connection string to the DB where payloads will be possibly written." | ||
) | ||
options.register( 'targetConnection' | ||
, '' #default value | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.string | ||
, """Connection string to the target DB: | ||
if not empty (default), this provides the latest IOV and payloads to compare; | ||
it is the DB where payloads should be finally uploaded.""" | ||
) | ||
options.register( 'tag' | ||
, 'LHCInfoPerLS_PopCon_start_test' | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.string | ||
, "Tag written in destinationConnection and finally appended in targetConnection." | ||
) | ||
options.register( 'messageLevel' | ||
, 0 #default value | ||
, VarParsing.VarParsing.multiplicity.singleton | ||
, VarParsing.VarParsing.varType.int | ||
, "Message level; default to 0" | ||
) | ||
options.parseArguments() | ||
|
||
CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) ) | ||
CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel ) | ||
|
||
process.MessageLogger = cms.Service("MessageLogger", | ||
cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')), | ||
destinations = cms.untracked.vstring('cout') | ||
) | ||
|
||
process.source = cms.Source("EmptyIOVSource", | ||
lastValue = cms.uint64(1), | ||
timetype = cms.string('runnumber'), | ||
firstValue = cms.uint64(1), | ||
interval = cms.uint64(1) | ||
) | ||
|
||
process.PoolDBOutputService = cms.Service("PoolDBOutputService", | ||
CondDBConnection, | ||
timetype = cms.untracked.string('timestamp'), | ||
toPut = cms.VPSet(cms.PSet(record = cms.string('LHCInfoPerLSRcd'), | ||
tag = cms.string( options.tag ) | ||
) | ||
) | ||
) | ||
|
||
process.Test1 = cms.EDAnalyzer("LHCInfoPerLSPopConAnalyzer", | ||
SinceAppendMode = cms.bool(True), | ||
record = cms.string('LHCInfoPerLSRcd'), | ||
name = cms.untracked.string('LHCInfo'), | ||
Source = cms.PSet(fill = cms.untracked.uint32(6417), | ||
startTime = cms.untracked.string('2021-09-10 03:10:18.000'), | ||
# endTime = cms.untracked.string('2018-04-06 05:00:00.000'), | ||
samplingInterval = cms.untracked.uint32( 600 ), | ||
endFill = cms.untracked.bool(False), | ||
connectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"), | ||
ecalConnectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_DCS_ENV_PVSS_COND"), | ||
DIPSchema = cms.untracked.string("CMS_BEAM_COND"), | ||
omsBaseUrl = cms.untracked.string("http://vocms0184.cern.ch/agg/api/v1"), | ||
#authenticationPath = cms.untracked.string("."), | ||
debug=cms.untracked.bool(False) | ||
), | ||
loggingOn = cms.untracked.bool(True), | ||
IsDestDbCheckedInQueryLog = cms.untracked.bool(False) | ||
) | ||
|
||
process.p = cms.Path(process.Test1) |
Oops, something went wrong.