ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MuonCalibDbOperations
MuonCalibDbOperations
CoolInserter.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 MuonCalib_CoolInserter_h
6
#define MuonCalib_CoolInserter_h
7
8
#include "
AthenaBaseComps/AthAlgorithm.h
"
9
#include "CoolApplication/Application.h"
10
#include "CoolApplication/DatabaseSvcFactory.h"
11
#include "CoolKernel/Exception.h"
12
#include "CoolKernel/IDatabase.h"
13
#include "CoolKernel/IDatabaseSvc.h"
14
#include "CoolKernel/IFolder.h"
15
#include "CoolKernel/IObject.h"
16
#include "CoolKernel/IObjectIterator.h"
17
#include "CoolKernel/Record.h"
18
#include "CoolKernel/StorageType.h"
19
#include "CoolKernel/types.h"
20
#include "GaudiKernel/ServiceHandle.h"
21
#include "GaudiKernel/ToolHandle.h"
22
#include "
MuonCalibDbOperations/IConditionsStorage.h
"
23
#include "
MuonCalibDbOperations/IMuonCalibConditionsSource.h
"
24
#include "
MuonCalibStandAloneBase/NtupleStationId.h
"
25
#include "
MuonIdHelpers/IMuonIdHelperSvc.h
"
26
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
27
28
class
RegionSelectionSvc
;
29
30
namespace
MuonCalib
{
31
32
class
CoolInserter
:
public
AthAlgorithm
{
33
public
:
34
//====================destructor - constructor=================================
35
CoolInserter
(
const
std::string &name, ISvcLocator *pSvcLocator);
36
inline
~CoolInserter
() =
default
;
38
StatusCode
initialize
();
40
StatusCode
execute
(
const
EventContext& ctx);
42
StatusCode
finalize
();
43
bool
CoolConnect
(
const
std::string &connection_string,
const
std::string &tag_t0);
44
45
bool
StartT0Chamber
(
const
NtupleStationId
&sid);
46
bool
AppendT0
(
float
t0
,
int
validflag,
float
adc0);
47
bool
StoreT0Chamber
(
const
NtupleStationId
&
id
,
const
std::string &
file
,
unsigned
int
creation_flags = 0);
48
bool
StoreRtChamber
(
const
NtupleStationId
&
id
,
const
std::map<int, SamplePoint> &points,
const
std::string &
file
,
49
unsigned
int
creation_flags = 0);
50
//====================interface functions======================================
51
private
:
52
//====================private data=============================================
53
// version string - job option
54
std::string
m_version
;
55
// tags - job options
56
std::vector<std::string>
m_tagt0
;
// tag of the folder
57
std::vector<std::string>
m_tagrt
;
// tag of the folder
58
// overwirte iov - job-option
59
int
m_iov_start
= 0,
m_iov_end
= 0;
60
long
long
m_iovt_start
,
m_iovt_end
;
61
// cool connection string - job option job option
62
std::string
m_cool_connection_string
;
63
// cool folders - job options
64
std::vector<std::string>
m_t0_folder
;
65
std::vector<std::string>
m_rt_folder
;
66
// indicate if cool folders should be compressed if they are created
67
std::vector<bool>
m_compressed_t0
;
68
std::vector<bool>
m_compressed_rt
;
69
// calibration source tools - jo
70
ToolHandleArray<IMuonCalibConditionsSource>
m_calibration_sources
{
this
,
"CalibrationSources"
, {}};
71
// region selection service - copy part of the calibration
72
ServiceHandle<RegionSelectionSvc>
m_reg_sel_svc
;
73
// cool
74
cool::IDatabasePtr
m_db
;
75
std::vector<cool::IFolderPtr>
m_mdtt0_fld
;
76
std::vector<cool::IFolderPtr>
m_mdtrt_fld
;
77
cool::Application
m_app
;
78
std::map<bool, coral::AttributeList>
m_mdtt0_cool_row
;
79
std::map<bool, coral::AttributeList>
m_mdtrt_cool_row
;
80
// flags for cool status
81
bool
m_cool_connect
,
m_t0_created
,
m_rt_created
;
82
// already filled chambers - do not double fill
83
std::set<NtupleStationId>
m_t0_filled
,
m_rt_filled
;
84
ServiceHandle<Muon::IMuonIdHelperSvc>
m_idHelperSvc
{
this
,
"MuonIdHelperSvc"
,
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"
};
85
86
// MuonDetectorManager from the conditions store
87
SG::ReadCondHandleKey<MuonGM::MuonDetectorManager>
m_DetectorManagerKey
{
this
,
"DetectorManagerKey"
,
"MuonDetectorManager"
,
88
"Key of input MuonDetectorManager condition data"
};
89
90
std::ostringstream
m_data_string
;
91
int
m_n_tubes_added
;
92
int
m_n_tubes_chamber
;
93
float
m_aver_t0
,
m_aver_adc
;
94
NtupleStationId
m_sid
;
95
// create a new cool folder
96
inline
bool
create_folder
(
const
unsigned
int
&fldr_nr,
const
bool
&is_rt);
97
};
98
99
}
// namespace MuonCalib
100
101
#endif
AthAlgorithm.h
IConditionsStorage.h
IMuonCalibConditionsSource.h
IMuonIdHelperSvc.h
t0
static Double_t t0
Definition
LArPhysWaveHECTool.cxx:38
MuonDetectorManager.h
NtupleStationId.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
MuonCalib::CoolInserter::m_t0_folder
std::vector< std::string > m_t0_folder
Definition
CoolInserter.h:64
MuonCalib::CoolInserter::m_tagrt
std::vector< std::string > m_tagrt
Definition
CoolInserter.h:57
MuonCalib::CoolInserter::~CoolInserter
~CoolInserter()=default
MuonCalib::CoolInserter::m_n_tubes_chamber
int m_n_tubes_chamber
Definition
CoolInserter.h:92
MuonCalib::CoolInserter::m_iovt_end
long long m_iovt_end
Definition
CoolInserter.h:60
MuonCalib::CoolInserter::CoolInserter
CoolInserter(const std::string &name, ISvcLocator *pSvcLocator)
Definition
CoolInserter.cxx:39
MuonCalib::CoolInserter::m_calibration_sources
ToolHandleArray< IMuonCalibConditionsSource > m_calibration_sources
Definition
CoolInserter.h:70
MuonCalib::CoolInserter::m_rt_created
bool m_rt_created
Definition
CoolInserter.h:81
MuonCalib::CoolInserter::m_t0_created
bool m_t0_created
Definition
CoolInserter.h:81
MuonCalib::CoolInserter::m_mdtrt_cool_row
std::map< bool, coral::AttributeList > m_mdtrt_cool_row
Definition
CoolInserter.h:79
MuonCalib::CoolInserter::finalize
StatusCode finalize()
finalize functions
Definition
CoolInserter.cxx:131
MuonCalib::CoolInserter::AppendT0
bool AppendT0(float t0, int validflag, float adc0)
Definition
CoolInserter.cxx:184
MuonCalib::CoolInserter::m_db
cool::IDatabasePtr m_db
Definition
CoolInserter.h:74
MuonCalib::CoolInserter::StartT0Chamber
bool StartT0Chamber(const NtupleStationId &sid)
Definition
CoolInserter.cxx:155
MuonCalib::CoolInserter::m_compressed_rt
std::vector< bool > m_compressed_rt
Definition
CoolInserter.h:68
MuonCalib::CoolInserter::m_mdtt0_fld
std::vector< cool::IFolderPtr > m_mdtt0_fld
Definition
CoolInserter.h:75
MuonCalib::CoolInserter::m_version
std::string m_version
Definition
CoolInserter.h:54
MuonCalib::CoolInserter::m_iov_end
int m_iov_end
Definition
CoolInserter.h:59
MuonCalib::CoolInserter::m_mdtt0_cool_row
std::map< bool, coral::AttributeList > m_mdtt0_cool_row
Definition
CoolInserter.h:78
MuonCalib::CoolInserter::m_rt_filled
std::set< NtupleStationId > m_rt_filled
Definition
CoolInserter.h:83
MuonCalib::CoolInserter::create_folder
bool create_folder(const unsigned int &fldr_nr, const bool &is_rt)
Definition
CoolInserter.cxx:319
MuonCalib::CoolInserter::m_iov_start
int m_iov_start
Definition
CoolInserter.h:59
MuonCalib::CoolInserter::initialize
StatusCode initialize()
Is called at the beginning of the analysis.
Definition
CoolInserter.cxx:64
MuonCalib::CoolInserter::m_t0_filled
std::set< NtupleStationId > m_t0_filled
Definition
CoolInserter.h:83
MuonCalib::CoolInserter::StoreT0Chamber
bool StoreT0Chamber(const NtupleStationId &id, const std::string &file, unsigned int creation_flags=0)
Definition
CoolInserter.cxx:193
MuonCalib::CoolInserter::m_cool_connection_string
std::string m_cool_connection_string
Definition
CoolInserter.h:62
MuonCalib::CoolInserter::m_sid
NtupleStationId m_sid
Definition
CoolInserter.h:94
MuonCalib::CoolInserter::m_cool_connect
bool m_cool_connect
Definition
CoolInserter.h:81
MuonCalib::CoolInserter::m_compressed_t0
std::vector< bool > m_compressed_t0
Definition
CoolInserter.h:67
MuonCalib::CoolInserter::m_aver_adc
float m_aver_adc
Definition
CoolInserter.h:93
MuonCalib::CoolInserter::StoreRtChamber
bool StoreRtChamber(const NtupleStationId &id, const std::map< int, SamplePoint > &points, const std::string &file, unsigned int creation_flags=0)
Definition
CoolInserter.cxx:250
MuonCalib::CoolInserter::m_data_string
std::ostringstream m_data_string
Definition
CoolInserter.h:90
MuonCalib::CoolInserter::m_n_tubes_added
int m_n_tubes_added
Definition
CoolInserter.h:91
MuonCalib::CoolInserter::CoolConnect
bool CoolConnect(const std::string &connection_string, const std::string &tag_t0)
MuonCalib::CoolInserter::m_iovt_start
long long m_iovt_start
Definition
CoolInserter.h:60
MuonCalib::CoolInserter::m_app
cool::Application m_app
Definition
CoolInserter.h:77
MuonCalib::CoolInserter::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
CoolInserter.h:84
MuonCalib::CoolInserter::m_reg_sel_svc
ServiceHandle< RegionSelectionSvc > m_reg_sel_svc
Definition
CoolInserter.h:72
MuonCalib::CoolInserter::execute
StatusCode execute(const EventContext &ctx)
execute function NOTE: This will read all events at once
Definition
CoolInserter.cxx:143
MuonCalib::CoolInserter::m_DetectorManagerKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
Definition
CoolInserter.h:87
MuonCalib::CoolInserter::m_mdtrt_fld
std::vector< cool::IFolderPtr > m_mdtrt_fld
Definition
CoolInserter.h:76
MuonCalib::CoolInserter::m_tagt0
std::vector< std::string > m_tagt0
Definition
CoolInserter.h:56
MuonCalib::CoolInserter::m_aver_t0
float m_aver_t0
Definition
CoolInserter.h:93
MuonCalib::CoolInserter::m_rt_folder
std::vector< std::string > m_rt_folder
Definition
CoolInserter.h:65
MuonCalib::NtupleStationId
Station Identifier for sorting calibration data.
Definition
NtupleStationId.h:36
RegionSelectionSvc
Seolect calibration region.
Definition
RegionSelectionSvc.h:35
SG::ReadCondHandleKey
Definition
ReadCondHandleKey.h:21
ServiceHandle
Definition
ClusterMakerTool.h:36
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition
CscCalcPed.cxx:21
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0