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#include <iostream>
22#include <string>
23#include <cstdlib>
24
25#include <TObject.h>
26
27//CORAL API include files
28#include "CoralBase/AttributeList.h"
29
30//COOL API include files (CoolApplication)
31#include "CoolApplication/Application.h"
32// --> limits.h is needed for CoolKernel/types.h
33#include <limits.h>
34#include "CoolKernel/types.h"
35#include "CoolKernel/ChannelId.h"
36#include "CoolKernel/RecordSpecification.h"
37#include "CoolKernel/ChannelSelection.h"
38
40
41#include <sstream>
42#include <fstream>
43#include <TCanvas.h>
44#include <TDirectory.h>
45#include <TFile.h>
46#include <TGraph.h>
47#include <TGraphErrors.h>
48#include <TH1.h>
49#include <TH2.h>
50#include <TIterator.h>
51#include <TKey.h>
52#include <TLegend.h>
53#include <TProfile.h>
54#include <TROOT.h>
55#include <TStyle.h>
56#include <TLatex.h>
57#include <TMath.h>
58#include <TTree.h>
59
60namespace coral {
61 class AttributeList;
62}
63
64namespace cool {
65 class RecordSpecification;
66 class ChannelSelection;
67}
68
69
70namespace dqutils {
71 class ATLAS_NOT_THREAD_SAFE HistogramDataCOOL: public cool::Application, public TObject {
72 private:
73// Protect CINT from some system definitions that cause problems
74// CINT does not need to know about these private variables
75#ifndef __CINT__
76 cool::ValidityKey m_since {};
77 cool::ValidityKey m_until {};
78 cool::IDatabasePtr m_coolDb {};
79 cool::IFolderPtr m_coolFolder {};
80 cool::IFolderPtr m_coolFolderH {};
81#endif
82 public:
83 // Connects to the database. Throws a "DatabaseDoesNotExis" exception if database does not exist.
84 cool::IDatabasePtr coolDbInstance(const std::string& dbStr, bool readOnly);
85
86 // Browses the COOL folder. Throws a "FolderNotFound" exception if folder does not exist.
87 cool::IFolderPtr coolFolderInstance(const std::string& folderStr);
88
89 // Various methods to set and print the intervall of validity.
90 void setSince(cool::Int64 run, cool::Int64 lumi);
91 void setUntil(cool::Int64 run, cool::Int64 lumi);
92 void printIOV();
93 void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU);
94 void setIOV(cool::Int64 run);
95
96 // Methods needed to come up to COOL framework.
97 cool::RecordSpecification createSpec();
98 coral::AttributeList createPayload(int colourCode, float dfrac, float thrust, const
99 cool::RecordSpecification& spec);
100 cool::RecordSpecification createSpecH();
101 coral::AttributeList createPayloadH(int colourCode,
102 const std::string& algo,
103 int entries, float par1, float par2, float par3, float par4, float par5, const
104 cool::RecordSpecification& specH);
105
106 // Constructors and Destructors.
107 HistogramDataCOOL(const std::string& dbStr, const std::string& folderStr, int runS, int lumiS, int runU, int lumiU);
108 HistogramDataCOOL(int runS, int lumiS, int runU, int lumiU);
111
112 // Methods of "interest". To insert a status flag you can use either ChannelId or ChannelName.
113 void dump(cool::ChannelSelection selection, std::string tag_name);
114 std::string dumpHisto(cool::ChannelId channelId, std::string field, std::string tag_name);
115 int dumpCode(const std::string& channelName, const std::string& tag_name);
116 void dumpall(const std::string& tag_name);
117
118 void insertH(cool::ChannelId channelId, int code,
119 const std::string& algo,
120 int entries, float par1, float par2, float par3, float par4, float par5,
121 const std::string& tag_name);
122 void insertH(std::string channelName, int code, std::string algo, int entries, float par1, float par2, float par3,
123 float par4, float par5, std::string tag_name);
124
125 virtual void ntupleDB(int HistoId, const std::string& nameHisto, const std::string& configuration, int Irun,
126 int Frun);
127 virtual void historyDB(int HistoId, const std::string& nameHisto, const std::string& tag_name);
128 std::string defParName(const std::string& Algorithm, const std::string& nameHisto, int i);
129 virtual void formatGraph(TCanvas* c, TGraphErrors* gr) const;
130
131 // Some further getters.
132 cool::IFolderPtr getCoolFolderH();
133 cool::IDatabasePtr getCoolDb();
134
135
136 // Needed for the ROOT interface.
137 ClassDef(HistogramDataCOOL, 0) // A class for modifying DQ info in the COOL database
138 };
139}
140
141#endif
#define gr
Define macros for attributes used to control the static checker.
void insertH(std::string channelName, int code, std::string algo, int entries, float par1, float par2, float par3, float par4, float par5, std::string tag_name)
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, std::string tag_name)
std::string dumpHisto(cool::ChannelId channelId, std::string field, 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)
HistogramDataCOOL(const std::string &dbStr, const std::string &folderStr, int runS, int lumiS, int runU, int lumiU)
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)
Definition run.py:1