ATLAS Offline Software
Loading...
Searching...
No Matches
HistogramDataCOOL.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#ifndef dqutilsHistogramDataCOOL_h
6#define dqutilsHistogramDataCOOL_h
7
8// Protect CINT from some system definitions that cause problems
9#ifndef __CINT__
10//COOL API include files (CoolKernel)
11 #include "CoolKernel/pointers.h"
12 #include "CoolKernel/ValidityKey.h"
13#else
14namespace cool {
15 class IDatabasePtr {};
16 class IFolderPtr {};
17}
18#endif
19
20
21
22
23
24#include <TObject.h>
25
26//CORAL API include files
27#include "CoralBase/AttributeList.h"
28
29//COOL API include files (CoolApplication)
30#include "CoolApplication/Application.h"
31// --> limits.h is needed for CoolKernel/types.h
32#include <limits.h>
33#include "CoolKernel/types.h"
34#include "CoolKernel/ChannelId.h"
35#include "CoolKernel/RecordSpecification.h"
36#include "CoolKernel/ChannelSelection.h"
37
39
40#include <string>
41
42class TGraphErrors;
43class TCanvas;
44
45namespace coral {
46 class AttributeList;
47}
48
49namespace cool {
50 class RecordSpecification;
51 class ChannelSelection;
52}
53
54
55namespace dqutils {
56 class ATLAS_NOT_THREAD_SAFE HistogramDataCOOL: public cool::Application, public TObject {
57 private:
58// Protect CINT from some system definitions that cause problems
59// CINT does not need to know about these private variables
60#ifndef __CINT__
61 cool::ValidityKey m_since {};
62 cool::ValidityKey m_until {};
63 cool::IDatabasePtr m_coolDb {};
64 cool::IFolderPtr m_coolFolder {};
65 cool::IFolderPtr m_coolFolderH {};
66#endif
67 public:
68 // Connects to the database. Throws a "DatabaseDoesNotExis" exception if database does not exist.
69 cool::IDatabasePtr coolDbInstance(const std::string& dbStr, bool readOnly);
70
71 // Browses the COOL folder. Throws a "FolderNotFound" exception if folder does not exist.
72 cool::IFolderPtr coolFolderInstance(const std::string& folderStr);
73
74 // Various methods to set and print the intervall of validity.
75 void setSince(cool::Int64 run, cool::Int64 lumi);
76 void setUntil(cool::Int64 run, cool::Int64 lumi);
77 void printIOV();
78 void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU);
79 void setIOV(cool::Int64 run);
80
81 // Methods needed to come up to COOL framework.
82 cool::RecordSpecification createSpec();
83 coral::AttributeList createPayload(int colourCode, float dfrac, float thrust, const
84 cool::RecordSpecification& spec);
85 cool::RecordSpecification createSpecH();
86 coral::AttributeList createPayloadH(int colourCode,
87 const std::string& algo,
88 int entries, float par1, float par2, float par3, float par4, float par5, const
89 cool::RecordSpecification& specH);
90
91 // Constructors and Destructors.
92 HistogramDataCOOL(const std::string& dbStr, const std::string& folderStr, int runS, int lumiS, int runU, int lumiU);
93 HistogramDataCOOL(int runS, int lumiS, int runU, int lumiU);
96
97 // Methods of "interest". To insert a status flag you can use either ChannelId or ChannelName.
98 void dump(cool::ChannelSelection selection, const std::string & tag_name);
99 std::string dumpHisto(cool::ChannelId channelId, const std::string &field, const std::string &tag_name);
100 int dumpCode(const std::string& channelName, const std::string& tag_name);
101 void dumpall(const std::string& tag_name);
102
103 void insertH(cool::ChannelId channelId, int code,
104 const std::string& algo,
105 int entries, float par1, float par2, float par3, float par4, float par5,
106 const std::string& tag_name);
107 void insertH(const std::string & channelName, int code, const std::string & algo, int entries, float par1, float par2, float par3,
108 float par4, float par5, const std::string & tag_name);
109
110 virtual void ntupleDB(int HistoId, const std::string& nameHisto, const std::string& configuration, int Irun,
111 int Frun);
112 virtual void historyDB(int HistoId, const std::string& nameHisto, const std::string& tag_name);
113 std::string defParName(const std::string& Algorithm, const std::string& nameHisto, int i);
114 virtual void formatGraph(TCanvas* c, TGraphErrors* gr) const;
115
116 // Some further getters.
117 cool::IFolderPtr getCoolFolderH();
118 cool::IDatabasePtr getCoolDb();
119
120
121 // Needed for the ROOT interface.
122 ClassDef(HistogramDataCOOL, 0) // A class for modifying DQ info in the COOL database
123 };
124}
125
126#endif
#define gr
Define macros for attributes used to control the static checker.
std::string defParName(const std::string &Algorithm, const std::string &nameHisto, int i)
void dumpall(const std::string &tag_name)
void dump(cool::ChannelSelection selection, const std::string &tag_name)
cool::IFolderPtr coolFolderInstance(const std::string &folderStr)
void setIOV(cool::Int64 run)
void insertH(cool::ChannelId channelId, int code, const std::string &algo, int entries, float par1, float par2, float par3, float par4, float par5, const std::string &tag_name)
cool::IDatabasePtr getCoolDb()
void setUntil(cool::Int64 run, cool::Int64 lumi)
virtual void historyDB(int HistoId, const std::string &nameHisto, const std::string &tag_name)
cool::IDatabasePtr coolDbInstance(const std::string &dbStr, bool readOnly)
void insertH(const std::string &channelName, int code, const std::string &algo, int entries, float par1, float par2, float par3, float par4, float par5, const std::string &tag_name)
HistogramDataCOOL(const std::string &dbStr, const std::string &folderStr, int runS, int lumiS, int runU, int lumiU)
std::string dumpHisto(cool::ChannelId channelId, const std::string &field, const std::string &tag_name)
HistogramDataCOOL(int runS, int lumiS, int runU, int lumiU)
void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU)
cool::RecordSpecification createSpec()
virtual void ntupleDB(int HistoId, const std::string &nameHisto, const std::string &configuration, int Irun, int Frun)
int dumpCode(const std::string &channelName, const std::string &tag_name)
cool::RecordSpecification createSpecH()
void setSince(cool::Int64 run, cool::Int64 lumi)
virtual void formatGraph(TCanvas *c, TGraphErrors *gr) const
cool::IFolderPtr getCoolFolderH()
coral::AttributeList createPayloadH(int colourCode, const std::string &algo, int entries, float par1, float par2, float par3, float par4, float par5, const cool::RecordSpecification &specH)
coral::AttributeList createPayload(int colourCode, float dfrac, float thrust, const cool::RecordSpecification &spec)
const std::string selection
double entries
Definition listroot.cxx:49
void getImageBuffer ATLAS_NOT_THREAD_SAFE(TImage **img, TCanvas *myC, char **x, int *y)
int run(int argc, char *argv[])