ATLAS Offline Software
Loading...
Searching...
No Matches
CoolTgc.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 TGC interface with the COOL DB
7// copy of CoolMdt.cxx by Monica Verducci
8// author Akimasa Ishikawa
9//************************************************
10
11#ifndef dqutilsCoolTgc_h
12#define dqutilsCoolTgc_h
13
14// Protect CINT from some system definitions that cause problems
15#ifndef __CINT__
16//COOL API include files (CoolKernel)
17 #include "CoolKernel/pointers.h"
18 #include "CoolKernel/ValidityKey.h"
19#else
20namespace cool {
21 class IDatabasePtr {};
22 class IFolderPtr {};
23}
24#endif
25
26
27
28
29#include <TObject.h>
30
31//CORAL API include files
32#include "CoralBase/AttributeList.h"
33
34//COOL API include files (CoolApplication)
35#include "CoolApplication/Application.h"
36// --> limits.h is needed for CoolKernel/types.h
37#include <limits.h>
38#include "CoolKernel/types.h"
39#include "CoolKernel/ChannelId.h"
40#include "CoolKernel/RecordSpecification.h"
41#include "CoolKernel/ChannelSelection.h"
42
43#include <string>
44
45
46namespace coral {
47 class AttributeList;
48}
49
50namespace cool {
51 class RecordSpecification;
52 class ChannelSelection;
53}
54
55
56namespace dqutils {
57 class CoolTgc: public cool::Application, public TObject {
58 private:
59// Protect CINT from some system definitions that cause problems
60// CINT does not need to know about these private variables
61#ifndef __CINT__
62 cool::ValidityKey m_since {};
63 cool::ValidityKey m_until {};
64 cool::IDatabasePtr m_coolDb {};
65 cool::IFolderPtr m_coolFolder {};
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
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 run, 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 createSpecDataDead();
85 cool::RecordSpecification createSpecDataNoisy();
86 coral::AttributeList createPayloadDataNoisy(const std::string& ChamberName,
87 const std::string& NoisyMultilayer,
88 const std::string& NoisyTube,
89 const cool::RecordSpecification& spec);
90 coral::AttributeList createPayloadDataDead(const std::string& ChamberName,
91 const std::string& DeadMultilayer,
92 const std::string& DeadTube,
93 const cool::RecordSpecification& spec);
94
95 // Constructors and Destructors.
96 void CoolOpen(const std::string& dbStr);
97
98 //CoolTgc();
99 virtual ~CoolTgc ();
100
101
102 void dump(cool::ChannelSelection selection);
103 std::string dumpField(cool::ChannelId channelId, std::string field);
104 int dumpCode(const std::string& channelName);
105
106 void dumpall();
107
108 void insertNoisyFlag(cool::Int64 run,
109 cool::ChannelId channelId,
110 const std::string& ChamberName,
111 const std::string& NoisyMultilayer,
112 const std::string& NoisyTube);
113 void insertNoisyFlag_withTag(cool::Int64 run,
114 cool::ChannelId channelId,
115 const std::string& ChamberName,
116 const std::string& NoisyMultilayer,
117 const std::string& NoisyTube,
118 const std::string& cool_tag);
119
120 void insertDeadFlag(cool::Int64 run,
121 cool::ChannelId channelId,
122 const std::string& ChamberName,
123 const std::string& DeadMultilayer,
124 const std::string& DeadTube);
125 void insertDeadFlag_withTag(cool::Int64,
126 cool::ChannelId channelId,
127 const std::string& ChamberName,
128 const std::string& DeadMultilayer,
129 const std::string& DeadTube,
130 const std::string& cool_tag);
131
132 cool::IFolderPtr getCoolFolder();
133 cool::IDatabasePtr getCoolDb();
134
135
136 // Needed for the ROOT interface.
137 ClassDef(CoolTgc, 0) // A class for modifying DQ info in the COOL database
138 };
139}
140
141#endif
cool::IDatabasePtr m_coolDb
Definition CoolTgc.h:64
cool::RecordSpecification createSpecDataDead()
void CoolOpen(const std::string &dbStr)
std::string dumpField(cool::ChannelId channelId, std::string field)
void insertDeadFlag_withTag(cool::Int64, cool::ChannelId channelId, const std::string &ChamberName, const std::string &DeadMultilayer, const std::string &DeadTube, const std::string &cool_tag)
void coolDbFolder(const std::string &dbStr, const std::string &folderStr)
void setSince(cool::Int64 run, cool::Int64 lumi)
void setIOV(cool::Int64 run)
void insertNoisyFlag(cool::Int64 run, cool::ChannelId channelId, const std::string &ChamberName, const std::string &NoisyMultilayer, const std::string &NoisyTube)
cool::IFolderPtr m_coolFolder
Definition CoolTgc.h:65
cool::IFolderPtr getCoolFolder()
void dump(cool::ChannelSelection selection)
cool::IFolderPtr coolFolderInstance(const std::string &folderStr)
void insertDeadFlag(cool::Int64 run, cool::ChannelId channelId, const std::string &ChamberName, const std::string &DeadMultilayer, const std::string &DeadTube)
coral::AttributeList createPayloadDataNoisy(const std::string &ChamberName, const std::string &NoisyMultilayer, const std::string &NoisyTube, const cool::RecordSpecification &spec)
cool::ValidityKey m_since
Definition CoolTgc.h:62
cool::ValidityKey m_until
Definition CoolTgc.h:63
void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU)
cool::IDatabasePtr getCoolDb()
cool::RecordSpecification createSpecDataNoisy()
virtual ~CoolTgc()
coral::AttributeList createPayloadDataDead(const std::string &ChamberName, const std::string &DeadMultilayer, const std::string &DeadTube, const cool::RecordSpecification &spec)
void insertNoisyFlag_withTag(cool::Int64 run, cool::ChannelId channelId, const std::string &ChamberName, const std::string &NoisyMultilayer, const std::string &NoisyTube, const std::string &cool_tag)
void setUntil(cool::Int64 run, cool::Int64 lumi)
int dumpCode(const std::string &channelName)
cool::IDatabasePtr coolDbInstance(const std::string &dbStr, bool readOnly)
const std::string selection
int run(int argc, char *argv[])