ATLAS Offline Software
TBCondRunParTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TBCONDRUNPAR_TBCONDRUNPARTOOL_H
6 #define TBCONDRUNPAR_TBCONDRUNPARTOOL_H
7 // TBCondRunParTool.h
8 // an AlgTool to provide access to testbeam conditions RunParams information
9 // via GenericDbTable
10 // Richard Hawkings, started 2/7/04
11 
12 // This AlgTool provides the following methods
13 // <fill me in>
14 
15 #include <string>
17 #include "GaudiKernel/MsgStream.h"
18 
20  public:
21  TBCondRunParTool(const std::string& type, const std::string& name,
22  const IInterface* parent);
24 
25  static const InterfaceID& interfaceID();
28 
29  // access functions
30  int status();
31  int run_number();
32  int trigger_type();
33  int det_mask();
34  int beam_type();
35  int beam_energy();
36  std::string& file_tag();
37  std::string& time_SOR();
38  // utility functions
39  StatusCode getTable(const std::string& table,const int irow,
40  const void* tblptr,
41  int& ncol,int& nrow, std::vector<std::string>& names,
42  std::vector<std::string>& rows) const;
44  const std::vector<std::string>& names, const std::vector<std::string>& rows,
45  const std::string& name,int& ival) const;
47  const std::vector<std::string>& names, const std::vector<std::string>& rows,
48  const std::string& name,float& fval) const;
50  const std::vector<std::string>& names, const std::vector<std::string>& rows,
51  const std::string& name,std::string& sval) const;
52  void printTable(const std::vector<std::string>& names,
53  const std::vector<std::string>& rows) const;
54  StatusCode getVal(const std::string& folder, const unsigned int chnum, float& fval);
55 
56  private:
57  bool checkcache();
58  bool extractCool(const int run);
59  bool extractCoolTest(const std::string& folder, int run) const;
60 
61  int m_crun;
62  int m_cevent;
63  std::string m_runpfolder;
64  // cached data
65  int m_status;
71  std::string m_file_tag;
72  std::string m_time_SOR;
73 };
74 
75 // inline access functions
77  { checkcache(); return m_status;}
79  { checkcache(); return m_run_number;}
81  { checkcache(); return m_trigger_type;}
83  { checkcache(); return m_det_mask;}
85  { checkcache(); return m_beam_type;}
87  { checkcache(); return m_beam_energy;}
88 inline std::string& TBCondRunParTool::file_tag()
89  { checkcache(); return m_file_tag; }
90 inline std::string& TBCondRunParTool::time_SOR()
91  { checkcache(); return m_time_SOR; }
92 
93 #endif // TBCONDRUNPAR_TBCONDRUNPARTOOL_H
TBCondRunParTool::m_beam_type
int m_beam_type
Definition: TBCondRunParTool.h:69
TBCondRunParTool::status
int status()
Definition: TBCondRunParTool.h:76
TBCondRunParTool::beam_energy
int beam_energy()
Definition: TBCondRunParTool.h:86
TBCondRunParTool::run_number
int run_number()
Definition: TBCondRunParTool.h:78
TBCondRunParTool::getTable
StatusCode getTable(const std::string &table, const int irow, const void *tblptr, int &ncol, int &nrow, std::vector< std::string > &names, std::vector< std::string > &rows) const
Definition: TBCondRunParTool.cxx:71
TBCondRunParTool::m_status
int m_status
Definition: TBCondRunParTool.h:65
TBCondRunParTool::file_tag
std::string & file_tag()
Definition: TBCondRunParTool.h:88
TBCondRunParTool::TBCondRunParTool
TBCondRunParTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TBCondRunParTool.cxx:17
TBCondRunParTool::checkcache
bool checkcache()
Definition: TBCondRunParTool.cxx:47
WriteCellNoiseToCool.ival
ival
Definition: WriteCellNoiseToCool.py:337
TBCondRunParTool::interfaceID
static const InterfaceID & interfaceID()
Definition: TBCondRunParTool.cxx:29
TBCondRunParTool::extractCool
bool extractCool(const int run)
Definition: TBCondRunParTool.cxx:165
TBCondRunParTool::m_file_tag
std::string m_file_tag
Definition: TBCondRunParTool.h:71
TBCondRunParTool::printTable
void printTable(const std::vector< std::string > &names, const std::vector< std::string > &rows) const
Definition: TBCondRunParTool.cxx:137
TBCondRunParTool::time_SOR
std::string & time_SOR()
Definition: TBCondRunParTool.h:90
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
python.subdetectors.mmg.names
names
Definition: mmg.py:8
AthAlgTool.h
TBCondRunParTool::finalize
StatusCode finalize()
Definition: TBCondRunParTool.cxx:42
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TBCondRunParTool::m_crun
int m_crun
Definition: TBCondRunParTool.h:61
run
Definition: run.py:1
beamspotnt.rows
list rows
Definition: bin/beamspotnt.py:1112
TBCondRunParTool::m_beam_energy
int m_beam_energy
Definition: TBCondRunParTool.h:70
TBCondRunParTool::m_runpfolder
std::string m_runpfolder
Definition: TBCondRunParTool.h:63
TBCondRunParTool::m_run_number
int m_run_number
Definition: TBCondRunParTool.h:66
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.ext.table_printer.table
list table
Definition: table_printer.py:81
TBCondRunParTool::getVal
StatusCode getVal(const std::string &folder, const unsigned int chnum, float &fval)
Definition: TBCondRunParTool.cxx:143
TBCondRunParTool::m_cevent
int m_cevent
Definition: TBCondRunParTool.h:62
TBCondRunParTool::beam_type
int beam_type()
Definition: TBCondRunParTool.h:84
TBCondRunParTool::extractVal
StatusCode extractVal(const std::vector< std::string > &names, const std::vector< std::string > &rows, const std::string &name, int &ival) const
Definition: TBCondRunParTool.cxx:89
TBCondRunParTool::det_mask
int det_mask()
Definition: TBCondRunParTool.h:82
TBCondRunParTool
Definition: TBCondRunParTool.py:1
TBCondRunParTool::m_time_SOR
std::string m_time_SOR
Definition: TBCondRunParTool.h:72
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TBCondRunParTool::m_det_mask
int m_det_mask
Definition: TBCondRunParTool.h:68
TBCondRunParTool::trigger_type
int trigger_type()
Definition: TBCondRunParTool.h:80
TBCondRunParTool::initialize
StatusCode initialize()
Definition: TBCondRunParTool.cxx:32
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
AthAlgTool
Definition: AthAlgTool.h:26
TBCondRunParTool::m_trigger_type
int m_trigger_type
Definition: TBCondRunParTool.h:67
TBCondRunParTool::extractCoolTest
bool extractCoolTest(const std::string &folder, int run) const
Definition: TBCondRunParTool.cxx:196
TBCondRunParTool::~TBCondRunParTool
~TBCondRunParTool()
Definition: TBCondRunParTool.cxx:26