CMS 3D CMS Logo

RunInfoSchema.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_RunInfoSchema_h
2 #define CondCore_CondDB_RunInfoSchema_h
3 
4 #include "DbCore.h"
5 #include "IDbSchema.h"
6 //
7 #include <boost/date_time/posix_time/posix_time.hpp>
8 
9 namespace cond {
10 
11  namespace persistency {
12 
13  conddb_table(RUN_INFO) {
15  conddb_column(START_TIME, boost::posix_time::ptime);
16  conddb_column(END_TIME, boost::posix_time::ptime);
17 
18  struct MAX_RUN_NUMBER {
19  typedef cond::Time_t type;
20  static constexpr size_t size = 0;
22  static std::string fullyQualifiedName() { return "MAX(" + RUN_NUMBER::fullyQualifiedName() + ")"; }
23  };
24 
25  struct MIN_RUN_NUMBER {
26  typedef cond::Time_t type;
27  static constexpr size_t size = 0;
29  static std::string fullyQualifiedName() { return "MIN(" + RUN_NUMBER::fullyQualifiedName() + ")"; }
30  };
31 
32  struct MIN_START_TIME {
33  typedef boost::posix_time::ptime type;
34  static constexpr size_t size = 0;
36  static std::string fullyQualifiedName() { return "MIN(" + START_TIME::fullyQualifiedName() + ")"; }
37  };
38 
39  class Table : public IRunInfoTable {
40  public:
41  explicit Table(coral::ISchema& schema);
42  ~Table() override {}
43  bool exists() override;
44  void create() override;
45  bool select(cond::Time_t runNumber, boost::posix_time::ptime& start, boost::posix_time::ptime& end) override;
46  cond::Time_t getLastInserted(boost::posix_time::ptime& start, boost::posix_time::ptime& end) override;
47  bool getInclusiveRunRange(
48  cond::Time_t lower,
50  std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData)
51  override;
52  bool getInclusiveTimeRange(
53  const boost::posix_time::ptime& lower,
54  const boost::posix_time::ptime& upper,
55  std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >& runData)
56  override;
57  void insertOne(cond::Time_t runNumber,
58  const boost::posix_time::ptime& start,
59  const boost::posix_time::ptime& end) override;
60  void insert(const std::vector<std::tuple<cond::Time_t, boost::posix_time::ptime, boost::posix_time::ptime> >&
61  runs) override;
62  void updateEnd(cond::Time_t runNumber, const boost::posix_time::ptime& end) override;
63 
64  private:
65  coral::ISchema& m_schema;
66  };
67  }
68 
69  class RunInfoSchema : public IRunInfoSchema {
70  public:
71  explicit RunInfoSchema(coral::ISchema& schema);
72  ~RunInfoSchema() override {}
73  bool exists() override;
74  bool create() override;
75  IRunInfoTable& runInfoTable() override;
76 
77  private:
79  };
80 
81  } // namespace persistency
82 } // namespace cond
83 #endif
cond::persistency::RunInfoSchema::exists
bool exists() override
Definition: RunInfoSchema.cc:121
cond::persistency::RUN_INFO::MIN_RUN_NUMBER
Definition: RunInfoSchema.h:25
start
Definition: start.py:1
cond::persistency::RUN_INFO::MAX_RUN_NUMBER
Definition: RunInfoSchema.h:18
cond::persistency::RunInfoSchema::runInfoTable
IRunInfoTable & runInfoTable() override
Definition: RunInfoSchema.cc:136
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
cond::persistency::RUN_INFO::MIN_RUN_NUMBER::type
cond::Time_t type
Definition: RunInfoSchema.h:26
writedatasetfile.runs
runs
Definition: writedatasetfile.py:27
cond::persistency::RUN_INFO::END_TIME
Definition: RunInfoSchema.h:16
cond::persistency::RUN_INFO::MIN_START_TIME::type
boost::posix_time::ptime type
Definition: RunInfoSchema.h:33
cond::persistency::RunInfoSchema
Definition: RunInfoSchema.h:69
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
cond::persistency::RUN_INFO::MIN_START_TIME::fullyQualifiedName
static std::string fullyQualifiedName()
Definition: RunInfoSchema.h:36
HLT_Fake1_cff.tableName
tableName
Definition: HLT_Fake1_cff.py:10
cond::persistency::RUN_INFO::RUN_NUMBER
Definition: RunInfoSchema.h:14
conddb_column
#define conddb_column(...)
Definition: DbCore.h:76
cond::persistency::RUN_INFO::Table::m_schema
coral::ISchema & m_schema
Definition: RunInfoSchema.h:65
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
cond::persistency::RUN_INFO::MAX_RUN_NUMBER::tableName
static std::string tableName()
Definition: RunInfoSchema.h:21
cond::persistency::RunInfoSchema::m_runInfoTable
RUN_INFO::Table m_runInfoTable
Definition: RunInfoSchema.h:78
mps_fire.end
end
Definition: mps_fire.py:242
cond::persistency::IRunInfoSchema
Definition: IDbSchema.h:226
cond
Definition: plugin.cc:23
cond::persistency::RUN_INFO::Table::~Table
~Table() override
Definition: RunInfoSchema.h:42
cond::persistency::RunInfoSchema::create
bool create() override
Definition: RunInfoSchema.cc:127
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
DbCore.h
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
cond::persistency::RunInfoSchema::RunInfoSchema
RunInfoSchema(coral::ISchema &schema)
Definition: RunInfoSchema.cc:119
cond::persistency::RUN_INFO::MIN_RUN_NUMBER::tableName
static std::string tableName()
Definition: RunInfoSchema.h:28
cond::persistency::RUN_INFO::Table
Definition: RunInfoSchema.h:39
cond::persistency::RUN_INFO::MIN_START_TIME::tableName
static std::string tableName()
Definition: RunInfoSchema.h:35
conddb_table
#define conddb_table(NAME)
Definition: DbCore.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::persistency::IRunInfoTable
Definition: IDbSchema.h:203
cond::persistency::RunInfoSchema::~RunInfoSchema
~RunInfoSchema() override
Definition: RunInfoSchema.h:72
cond::persistency::RUN_INFO::MIN_START_TIME
Definition: RunInfoSchema.h:32
cond::persistency::RUN_INFO::MAX_RUN_NUMBER::type
cond::Time_t type
Definition: RunInfoSchema.h:19
edm::eventsetup::heterocontainer::insert
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
pileupCalc.upper
upper
Definition: pileupCalc.py:213
IDbSchema.h
cond::persistency::RUN_INFO::MIN_RUN_NUMBER::fullyQualifiedName
static std::string fullyQualifiedName()
Definition: RunInfoSchema.h:29
cond::persistency::RUN_INFO::MAX_RUN_NUMBER::fullyQualifiedName
static std::string fullyQualifiedName()
Definition: RunInfoSchema.h:22
cond::persistency::RUN_INFO::START_TIME
Definition: RunInfoSchema.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443