ATLAS Offline Software
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
20 namespace 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 
67 namespace coral {
68  class AttributeList;
69 }
70 
71 namespace cool {
72  class RecordSpecification;
73  class ChannelSelection;
74 }
75 
76 
77 namespace 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
dqutils::CoolTgc::coolDbInstance
cool::IDatabasePtr coolDbInstance(const std::string &dbStr, bool readOnly)
dqutils::CoolTgc::~CoolTgc
virtual ~CoolTgc()
dqutils::CoolTgc::dumpall
void dumpall()
dqutils::CoolTgc::createPayloadDataNoisy
coral::AttributeList createPayloadDataNoisy(const std::string &ChamberName, const std::string &NoisyMultilayer, const std::string &NoisyTube, const cool::RecordSpecification &spec)
dqutils::CoolTgc::setUntil
void setUntil(cool::Int64 run, cool::Int64 lumi)
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
dqutils::CoolTgc::dumpCode
int dumpCode(const std::string &channelName)
dqutils::CoolTgc::getCoolFolder
cool::IFolderPtr getCoolFolder()
dqutils::CoolTgc::createPayloadDataDead
coral::AttributeList createPayloadDataDead(const std::string &ChamberName, const std::string &DeadMultilayer, const std::string &DeadTube, const cool::RecordSpecification &spec)
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
dqutils::CoolTgc::createSpecDataNoisy
cool::RecordSpecification createSpecDataNoisy()
dqutils::CoolTgc::m_since
cool::ValidityKey m_since
Definition: CoolTgc.h:83
cool
Definition: CoolTagInfo.h:12
dqutils::CoolTgc::dump
void dump(cool::ChannelSelection selection)
dqutils::CoolTgc::coolFolderInstance
cool::IFolderPtr coolFolderInstance(const std::string &folderStr)
coral
Definition: ISecondaryEventSelector.h:19
dqutils::CoolTgc::insertDeadFlag
void insertDeadFlag(cool::Int64 run, cool::ChannelId channelId, const std::string &ChamberName, const std::string &DeadMultilayer, const std::string &DeadTube)
dqutils::CoolTgc
Definition: CoolTgc.h:78
CalibDbCompareRT.cool_tag
cool_tag
Definition: CalibDbCompareRT.py:12
dqutils::CoolTgc::m_coolDb
cool::IDatabasePtr m_coolDb
Definition: CoolTgc.h:85
run
Definition: run.py:1
dqutils
Definition: CoolMdt.h:76
dqutils::CoolTgc::dumpField
std::string dumpField(cool::ChannelId channelId, std::string field)
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
selection
std::string selection
Definition: fbtTestBasics.cxx:75
dqutils::CoolTgc::insertDeadFlag_withTag
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)
dqutils::CoolTgc::coolDbFolder
void coolDbFolder(const std::string &dbStr, const std::string &folderStr)
dqutils::CoolTgc::m_coolFolder
cool::IFolderPtr m_coolFolder
Definition: CoolTgc.h:86
dqutils::CoolTgc::setIOV
void setIOV(cool::Int64 run)
dqutils::CoolTgc::setSince
void setSince(cool::Int64 run, cool::Int64 lumi)
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
dqutils::CoolTgc::printIOV
void printIOV()
dqutils::CoolTgc::createSpecDataDead
cool::RecordSpecification createSpecDataDead()
dqutils::CoolTgc::getCoolDb
cool::IDatabasePtr getCoolDb()
dqutils::CoolTgc::CoolOpen
void CoolOpen(const std::string &dbStr)
dqutils::CoolTgc::insertNoisyFlag
void insertNoisyFlag(cool::Int64 run, cool::ChannelId channelId, const std::string &ChamberName, const std::string &NoisyMultilayer, const std::string &NoisyTube)
dqutils::CoolTgc::m_until
cool::ValidityKey m_until
Definition: CoolTgc.h:84
dqutils::CoolTgc::setIOV
void setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU)
dqutils::CoolTgc::insertNoisyFlag_withTag
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)