ATLAS Offline Software
Loading...
Searching...
No Matches
MuonMDT_CablingAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9#ifndef MUONMDT_CABLING_MUONMDT_CABLINGALG_H
10#define MUONMDT_CABLING_MUONMDT_CABLINGALG_H
11
19#include "nlohmann/json.hpp"
20
21
23public:
24 MuonMDT_CablingAlg(const std::string& name, ISvcLocator* pSvcLocator);
25 virtual ~MuonMDT_CablingAlg() = default;
26 virtual StatusCode initialize() override;
27 virtual StatusCode execute(const EventContext& ctx) const override;
28
29
31
32private:
33 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
34 SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyMez{this, "MezzanineFolders", "/MDT/CABLING/MEZZANINE_SCHEMA"};
35 SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyMap{this, "MapFolders", "/MDT/CABLING/MAP_SCHEMA"};
36 SG::WriteCondHandleKey<MuonMDT_CablingMap> m_writeKey{this, "WriteKey", "MuonMDT_CablingMap", "Key of output MDT cabling map"};
37
38 Gaudi::Property<bool> m_isRun3{this, "isRun3", false, "Auxillary property to load the BIS78 cabling by hand"};
39 StatusCode dbPayloadToJson(SG::ReadCondHandle<CondAttrListCollection>& readHandle, nlohmann::json& json) const;
41 bool extractStationInfo(const coral::AttributeList& atr, CablingData& map_data) const;
43 bool extractLayerInfo(std::vector<std::string>&, CablingData& map_data) const;
44
46 StatusCode loadMezzanineSchema(const EventContext& ctx,SG::WriteCondHandle<MuonMDT_CablingMap>& writeHandle,
47 MuonMDT_CablingMap& cabling_map) const;
48
49 StatusCode loadMezzanineFromJSON(nlohmann::json&& payload, MuonMDT_CablingMap& cabling_map) const;
50
52
53 StatusCode loadCablingSchema(const EventContext& ctx,SG::WriteCondHandle<MuonMDT_CablingMap>& writeHandle,
54 MuonMDT_CablingMap& cabling_map) const;
55
56 StatusCode loadCablingSchemaFromJSON(nlohmann::json&& payload, MuonMDT_CablingMap& cabling_map) const;
57
58 Gaudi::Property<std::string> m_mezzJSON{this, "MezzanineJSON", "" ,
59 "External JSON file to read the mezzanine mapping from"};
60
61 Gaudi::Property<std::string> m_chambJSON{this, "CablingJSON", "",
62 "External JSON file to read the MDT cabling from"};
63
64 Gaudi::Property<bool> m_useJSONFormat{this, "UseJSONFormat", false,
65 "Read out the cabling database JSON based"};
66
67};
68
69#endif
Base class for conditions algorithms.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
nlohmann::json json
Abstract interface to IOVDbSvc to access IOVRange and tag information.
Base class for conditions algorithms.
Gaudi::Property< bool > m_useJSONFormat
StatusCode loadCablingSchema(const EventContext &ctx, SG::WriteCondHandle< MuonMDT_CablingMap > &writeHandle, MuonMDT_CablingMap &cabling_map) const
Load the cabling schema of the tubes.
StatusCode dbPayloadToJson(SG::ReadCondHandle< CondAttrListCollection > &readHandle, nlohmann::json &json) const
virtual ~MuonMDT_CablingAlg()=default
StatusCode loadCablingSchemaFromJSON(nlohmann::json &&payload, MuonMDT_CablingMap &cabling_map) const
SG::WriteCondHandleKey< MuonMDT_CablingMap > m_writeKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual StatusCode execute(const EventContext &ctx) const override
StatusCode loadMezzanineSchema(const EventContext &ctx, SG::WriteCondHandle< MuonMDT_CablingMap > &writeHandle, MuonMDT_CablingMap &cabling_map) const
Load the mezzanine schema into the cabling.
Gaudi::Property< bool > m_isRun3
bool extractStationInfo(const coral::AttributeList &atr, CablingData &map_data) const
Retrieves the general MDT station info from the coral attribute.
MuonMDT_CablingAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyMap
Gaudi::Property< std::string > m_chambJSON
StatusCode loadMezzanineFromJSON(nlohmann::json &&payload, MuonMDT_CablingMap &cabling_map) const
bool extractLayerInfo(std::vector< std::string > &, CablingData &map_data) const
Retrieves the channel info from the coral attribute.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyMez
MuonMDT_CablingMap::CablingData CablingData
Gaudi::Property< std::string > m_mezzJSON
virtual StatusCode initialize() override
MdtCablingData CablingData