ATLAS Offline Software
Loading...
Searching...
No Matches
CoolRpc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4
5//*************************************************
6// Class for the RPC interface with the COOL DB
7// author Monica Verducci monica.verducci@cern.ch
8//************************************************
9
10#ifndef dqutilsCoolRpc_h
11#define dqutilsCoolRpc_h
12
13// Protect CINT from some system definitions that cause problems
14#ifndef __CINT__
15//COOL API include files (CoolKernel)
16 #include "CoolKernel/pointers.h"
17 #include "CoolKernel/ValidityKey.h"
18#else
19namespace cool {
20 class IDatabasePtr;
21 class IFolderPtr;
22}
23#endif
24
25
26
27
28#include <TObject.h>
29
30//CORAL API include files
31#include "CoralBase/AttributeList.h"
32
33//COOL API include files (CoolApplication)
34#include "CoolApplication/Application.h"
35// --> limits.h is needed for CoolKernel/types.h
36#include <limits.h>
37#include "CoolKernel/types.h"
38#include "CoolKernel/ChannelId.h"
39#include "CoolKernel/RecordSpecification.h"
40#include "CoolKernel/ChannelSelection.h"
41
42#include <string>
43
44namespace coral {
45 class AttributeList;
46}
47
48namespace cool {
49 class RecordSpecification;
50 class ChannelSelection;
51}
52
53
54namespace dqutils {
55 class CoolRpc: public cool::Application, public TObject {
56 private:
57// Protect CINT from some system definitions that cause problems
58// CINT does not need to know about these private variables
59#ifndef __CINT__
60 cool::ValidityKey m_since {};
61 cool::ValidityKey m_until {};
62 cool::IDatabasePtr m_coolDb {};
63 cool::IFolderPtr m_coolFolder {};
64#endif
65 public:
66 // Connects to the database. Throws a "DatabaseDoesNotExis" exception if database does not exist.
67 cool::IDatabasePtr coolDbInstance(const std::string& dbStr, bool readOnly);
68 //cool::IDatabasePtr write(std::string stringa);
69 //cool::IDatabasePtr coolDbInstance(std::string dbStr);
70
71
72 // Browses the COOL folder. Throws a "FolderNotFound" exception if folder does not exist.
73 cool::IFolderPtr coolFolderInstance(const std::string& folderStr);
74 // Various methods to set and print the intervall of validity.
75
76 void coolDbFolder(const std::string& dbStr, const std::string& folderStr);
77 void setSince(cool::Int64 run, cool::Int64 lumi);
78 void setUntil(cool::Int64 iovmax, cool::Int64 lumi);
79 void printIOV();
80 void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU);
81 void setIOV(cool::Int64 run);
82
83 // Methods needed to come up to COOL framework.
84 cool::RecordSpecification createSpecData();
85 coral::AttributeList createPayloadData(const std::string& recEta,
86 const std::string& DetEta,
87 const std::string& recPhi1,
88 const std::string& recPhi2,
89 const std::string& detPhi1,
90 const std::string& detPhi2,
91 const cool::RecordSpecification& spec);
92
93 cool::RecordSpecification createSpecDataCondDB();
94 coral::AttributeList createPayloadDataCondDB(const std::string& PanelRes, const std::string& StripStatus,
95 const cool::RecordSpecification& spec);
96
97 // Constructors and Destructors.
98 void CoolOpen(const std::string& dbStr);
99
100 //CoolRpc();
101 virtual ~CoolRpc ();
102
103
104 void dump(cool::ChannelSelection selection);
105 std::string dumpField(cool::ChannelId channelId, const std::string & field);
106 int dumpCode(const std::string& channelName);
107
108 void dumpall();
109
110 void insert(cool::Int64 run,
111 cool::ChannelId channelId,
112 const std::string& recEta,
113 const std::string& DetEta,
114 const std::string& recPhi1,
115 const std::string& recPhi2,
116 const std::string& detPhi1,
117 const std::string& detPhi2);
118 void insert_withTag(cool::Int64 run,
119 cool::ChannelId channelId,
120 const std::string& recEta,
121 const std::string& DetEta,
122 const std::string& recPhi1,
123 const std::string& recPhi2,
124 const std::string& detPhi1,
125 const std::string& detPhi2,
126 const std::string& cool_tag);
127 void insertCondDB_withTag(cool::Int64 run,
128 cool::ChannelId channelId,
129 const std::string& PanelRes,
130 const std::string& StringStatus,
131 const std::string& cool_tag);
132
133 cool::IFolderPtr getCoolFolder();
134 cool::IDatabasePtr getCoolDb();
135
136
137 // Needed for the ROOT interface.
138 ClassDef(CoolRpc, 0) // A class for modifying DQ info in the COOL database
139 };
140}
141
142#endif
cool::ValidityKey m_until
Definition CoolRpc.h:61
void insert(cool::Int64 run, cool::ChannelId channelId, const std::string &recEta, const std::string &DetEta, const std::string &recPhi1, const std::string &recPhi2, const std::string &detPhi1, const std::string &detPhi2)
void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU)
void setSince(cool::Int64 run, cool::Int64 lumi)
cool::IDatabasePtr coolDbInstance(const std::string &dbStr, bool readOnly)
void CoolOpen(const std::string &dbStr)
void insert_withTag(cool::Int64 run, cool::ChannelId channelId, const std::string &recEta, const std::string &DetEta, const std::string &recPhi1, const std::string &recPhi2, const std::string &detPhi1, const std::string &detPhi2, const std::string &cool_tag)
cool::RecordSpecification createSpecDataCondDB()
virtual ~CoolRpc()
coral::AttributeList createPayloadData(const std::string &recEta, const std::string &DetEta, const std::string &recPhi1, const std::string &recPhi2, const std::string &detPhi1, const std::string &detPhi2, const cool::RecordSpecification &spec)
void setUntil(cool::Int64 iovmax, cool::Int64 lumi)
cool::ValidityKey m_since
Definition CoolRpc.h:60
cool::RecordSpecification createSpecData()
void insertCondDB_withTag(cool::Int64 run, cool::ChannelId channelId, const std::string &PanelRes, const std::string &StringStatus, const std::string &cool_tag)
void setIOV(cool::Int64 run)
cool::IDatabasePtr m_coolDb
Definition CoolRpc.h:62
std::string dumpField(cool::ChannelId channelId, const std::string &field)
void coolDbFolder(const std::string &dbStr, const std::string &folderStr)
void dump(cool::ChannelSelection selection)
cool::IFolderPtr coolFolderInstance(const std::string &folderStr)
int dumpCode(const std::string &channelName)
cool::IDatabasePtr getCoolDb()
cool::IFolderPtr m_coolFolder
Definition CoolRpc.h:63
coral::AttributeList createPayloadDataCondDB(const std::string &PanelRes, const std::string &StripStatus, const cool::RecordSpecification &spec)
cool::IFolderPtr getCoolFolder()
const std::string selection
int run(int argc, char *argv[])