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#include <iostream>
27#include <string>
28#include <cstdlib>
29
30#include <TObject.h>
31
32//CORAL API include files
33#include "CoralBase/AttributeList.h"
34
35//COOL API include files (CoolApplication)
36#include "CoolApplication/Application.h"
37// --> limits.h is needed for CoolKernel/types.h
38#include <limits.h>
39#include "CoolKernel/types.h"
40#include "CoolKernel/ChannelId.h"
41#include "CoolKernel/RecordSpecification.h"
42#include "CoolKernel/ChannelSelection.h"
43
44
45
46#include <sstream>
47#include <fstream>
48#include <TCanvas.h>
49#include <TDirectory.h>
50#include <TFile.h>
51#include <TGraph.h>
52#include <TGraphErrors.h>
53#include <TH1.h>
54#include <TH2.h>
55#include <TIterator.h>
56#include <TKey.h>
57#include <TLegend.h>
58#include <TProfile.h>
59#include <TROOT.h>
60#include <TStyle.h>
61#include <TLatex.h>
62#include <TMath.h>
63#include <TTree.h>
64
65
66namespace coral {
67 class AttributeList;
68}
69
70namespace cool {
71 class RecordSpecification;
72 class ChannelSelection;
73}
74
75
76namespace dqutils {
77 class CoolRpc: public cool::Application, public TObject {
78 private:
79// Protect CINT from some system definitions that cause problems
80// CINT does not need to know about these private variables
81#ifndef __CINT__
82 cool::ValidityKey m_since {};
83 cool::ValidityKey m_until {};
84 cool::IDatabasePtr m_coolDb {};
85 cool::IFolderPtr m_coolFolder {};
86#endif
87 public:
88 // Connects to the database. Throws a "DatabaseDoesNotExis" exception if database does not exist.
89 cool::IDatabasePtr coolDbInstance(const std::string& dbStr, bool readOnly);
90 //cool::IDatabasePtr write(std::string stringa);
91 //cool::IDatabasePtr coolDbInstance(std::string dbStr);
92
93
94 // Browses the COOL folder. Throws a "FolderNotFound" exception if folder does not exist.
95 cool::IFolderPtr coolFolderInstance(const std::string& folderStr);
96 // Various methods to set and print the intervall of validity.
97
98 void coolDbFolder(const std::string& dbStr, const std::string& folderStr);
99 void setSince(cool::Int64 run, cool::Int64 lumi);
100 void setUntil(cool::Int64 iovmax, cool::Int64 lumi);
101 void printIOV();
102 void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU);
103 void setIOV(cool::Int64 run);
104
105 // Methods needed to come up to COOL framework.
106 cool::RecordSpecification createSpecData();
107 coral::AttributeList createPayloadData(const std::string& recEta,
108 const std::string& DetEta,
109 const std::string& recPhi1,
110 const std::string& recPhi2,
111 const std::string& detPhi1,
112 const std::string& detPhi2,
113 const cool::RecordSpecification& spec);
114
115 cool::RecordSpecification createSpecDataCondDB();
116 coral::AttributeList createPayloadDataCondDB(const std::string& PanelRes, const std::string& StripStatus,
117 const cool::RecordSpecification& spec);
118
119 // Constructors and Destructors.
120 void CoolOpen(const std::string& dbStr);
121
122 //CoolRpc();
123 virtual ~CoolRpc ();
124
125
126 void dump(cool::ChannelSelection selection);
127 std::string dumpField(cool::ChannelId channelId, std::string field);
128 int dumpCode(const std::string& channelName);
129
130 void dumpall();
131
132 void insert(cool::Int64 run,
133 cool::ChannelId channelId,
134 const std::string& recEta,
135 const std::string& DetEta,
136 const std::string& recPhi1,
137 const std::string& recPhi2,
138 const std::string& detPhi1,
139 const std::string& detPhi2);
140 void insert_withTag(cool::Int64 run,
141 cool::ChannelId channelId,
142 const std::string& recEta,
143 const std::string& DetEta,
144 const std::string& recPhi1,
145 const std::string& recPhi2,
146 const std::string& detPhi1,
147 const std::string& detPhi2,
148 const std::string& cool_tag);
149 void insertCondDB_withTag(cool::Int64 run,
150 cool::ChannelId channelId,
151 const std::string& PanelRes,
152 const std::string& StringStatus,
153 const std::string& cool_tag);
154
155 cool::IFolderPtr getCoolFolder();
156 cool::IDatabasePtr getCoolDb();
157
158
159 // Needed for the ROOT interface.
160 ClassDef(CoolRpc, 0) // A class for modifying DQ info in the COOL database
161 };
162}
163
164#endif
cool::ValidityKey m_until
Definition CoolRpc.h:83
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:82
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:84
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:85
coral::AttributeList createPayloadDataCondDB(const std::string &PanelRes, const std::string &StripStatus, const cool::RecordSpecification &spec)
cool::IFolderPtr getCoolFolder()
std::string dumpField(cool::ChannelId channelId, std::string field)
const std::string selection
Definition run.py:1