ATLAS Offline Software
Loading...
Searching...
No Matches
StatusFlagCOOLBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4
5#ifndef dqutilsStatusFlagCOOLBase_h
6#define dqutilsStatusFlagCOOLBase_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
39
40namespace coral {
41 class AttributeList;
42}
43
44namespace cool {
45 class RecordSpecification;
46 class ChannelSelection;
47}
48
49
50namespace dqutils {
51 class StatusFlagCOOLBase: public cool::Application, public TObject {
52 protected:
53// Protect CINT from some system definitions that cause problems
54// CINT does not need to know about these private variables
55#ifndef __CINT__
56 cool::ValidityKey m_since;
57 cool::ValidityKey m_until;
58 cool::IDatabasePtr m_coolDb;
59 cool::IFolderPtr m_coolFolder;
60#endif
61
62 void insert_helper(cool::ChannelId channelId,
63 coral::AttributeList& payload,
64 const std::string& tag_name);
65 void Initialize(const std::string& dbStr, const std::string& folderStr,
66 int runS, int lumiS, int runU, int lumiU);
67 public:
68 // Connects to the database. Throws a "DatabaseDoesNotExist" 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 // to flush after insertions!
82 void flush();
83
84 // Constructors and Destructors.
85 StatusFlagCOOLBase(const std::string& dbStr, const std::string& folderStr, int runS, int lumiS, int runU,
86 int lumiU);
87 StatusFlagCOOLBase(int runS, int lumiS, int runU, int lumiU);
90
91 // Methods of "interest". To insert a status flag you can use either ChannelId or ChannelName.
92 void dump(cool::ChannelSelection selection, std::string tag_name);
93 std::string dumpField(cool::ChannelId channelId, std::string field, std::string tag_name);
94 int dumpCode(const std::string& channelName, const std::string& tag_name);
95 void dumpall(const std::string& tag_name);
96
97 // Some further getters.
98 cool::IFolderPtr getCoolFolder();
99 cool::IDatabasePtr getCoolDb();
100
101
102 // Needed for the ROOT interface.
103 ClassDef(StatusFlagCOOLBase, 0) // A class for modifying DQ info in the COOL database
104 };
105}
106
107#endif
StatusFlagCOOLBase(int runS, int lumiS, int runU, int lumiU)
void Initialize(const std::string &dbStr, const std::string &folderStr, int runS, int lumiS, int runU, int lumiU)
std::string dumpField(cool::ChannelId channelId, std::string field, std::string tag_name)
void setSince(cool::Int64 run, cool::Int64 lumi)
StatusFlagCOOLBase(const std::string &dbStr, const std::string &folderStr, int runS, int lumiS, int runU, int lumiU)
void setUntil(cool::Int64 run, cool::Int64 lumi)
void setIOV(cool::Int64 run)
cool::IDatabasePtr coolDbInstance(const std::string &dbStr, bool readOnly)
void dumpall(const std::string &tag_name)
int dumpCode(const std::string &channelName, const std::string &tag_name)
cool::IDatabasePtr getCoolDb()
cool::IFolderPtr getCoolFolder()
void insert_helper(cool::ChannelId channelId, coral::AttributeList &payload, const std::string &tag_name)
cool::IFolderPtr coolFolderInstance(const std::string &folderStr)
void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU)
void dump(cool::ChannelSelection selection, std::string tag_name)
const std::string selection
Definition run.py:1