ATLAS Offline Software
Loading...
Searching...
No Matches
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
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"
27
29
30namespace 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();
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;
61 // cool connection string - job option job option
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
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
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;
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
static Double_t t0
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::vector< std::string > m_t0_folder
std::vector< std::string > m_tagrt
CoolInserter(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandleArray< IMuonCalibConditionsSource > m_calibration_sources
std::map< bool, coral::AttributeList > m_mdtrt_cool_row
StatusCode finalize()
finalize functions
StatusCode execute()
execute function NOTE: This will read all events at once
bool AppendT0(float t0, int validflag, float adc0)
cool::IDatabasePtr m_db
bool StartT0Chamber(const NtupleStationId &sid)
std::vector< bool > m_compressed_rt
std::vector< cool::IFolderPtr > m_mdtt0_fld
std::map< bool, coral::AttributeList > m_mdtt0_cool_row
std::set< NtupleStationId > m_rt_filled
bool create_folder(const unsigned int &fldr_nr, const bool &is_rt)
StatusCode initialize()
Is called at the beginning of the analysis.
std::set< NtupleStationId > m_t0_filled
bool StoreT0Chamber(const NtupleStationId &id, const std::string &file, unsigned int creation_flags=0)
std::string m_cool_connection_string
NtupleStationId m_sid
std::vector< bool > m_compressed_t0
bool StoreRtChamber(const NtupleStationId &id, const std::map< int, SamplePoint > &points, const std::string &file, unsigned int creation_flags=0)
std::ostringstream m_data_string
bool CoolConnect(const std::string &connection_string, const std::string &tag_t0)
cool::Application m_app
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ServiceHandle< RegionSelectionSvc > m_reg_sel_svc
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
std::vector< cool::IFolderPtr > m_mdtrt_fld
std::vector< std::string > m_tagt0
std::vector< std::string > m_rt_folder
Station Identifier for sorting calibration data.
Seolect calibration region.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
TFile * file