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