ATLAS Offline Software
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 
9 #ifndef MUONMDT_CABLING_MUONMDT_CABLINGALG_H
10 #define MUONMDT_CABLING_MUONMDT_CABLINGALG_H
11 
13 #include "AthenaKernel/IIOVDbSvc.h"
19 #include "nlohmann/json.hpp"
20 
21 
23 public:
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  virtual bool isReEntrant() const override final { return false; }
30 
32 
33 private:
34  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
35  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyMez{this, "MezzanineFolders", "/MDT/CABLING/MEZZANINE_SCHEMA"};
36  SG::ReadCondHandleKey<CondAttrListCollection> m_readKeyMap{this, "MapFolders", "/MDT/CABLING/MAP_SCHEMA"};
37  SG::WriteCondHandleKey<MuonMDT_CablingMap> m_writeKey{this, "WriteKey", "MuonMDT_CablingMap", "Key of output MDT cabling map"};
38 
39  Gaudi::Property<bool> m_isRun3{this, "isRun3", false, "Auxillary property to load the BIS78 cabling by hand"};
42  bool extractStationInfo(const coral::AttributeList& atr, CablingData& map_data) const;
44  bool extractLayerInfo(std::vector<std::string>&, CablingData& map_data) const;
45 
47  StatusCode loadMezzanineSchema(const EventContext& ctx,SG::WriteCondHandle<MuonMDT_CablingMap>& writeHandle,
48  MuonMDT_CablingMap& cabling_map) const;
49 
51 
53 
54  StatusCode loadCablingSchema(const EventContext& ctx,SG::WriteCondHandle<MuonMDT_CablingMap>& writeHandle,
55  MuonMDT_CablingMap& cabling_map) const;
56 
58 
59  Gaudi::Property<std::string> m_mezzJSON{this, "MezzanineJSON", "" ,
60  "External JSON file to read the mezzanine mapping from"};
61 
62  Gaudi::Property<std::string> m_chambJSON{this, "CablingJSON", "",
63  "External JSON file to read the MDT cabling from"};
64 
65  Gaudi::Property<bool> m_useJSONFormat{this, "UseJSONFormat", false,
66  "Read out the cabling database JSON based"};
67 
68 };
69 
70 #endif
MuonMDT_CablingAlg::MuonMDT_CablingAlg
MuonMDT_CablingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonMDT_CablingAlg.cxx:25
MuonMDT_CablingAlg::extractStationInfo
bool extractStationInfo(const coral::AttributeList &atr, CablingData &map_data) const
Retrieves the general MDT station info from the coral attribute.
Definition: MuonMDT_CablingAlg.cxx:208
MuonMDT_CablingAlg::m_writeKey
SG::WriteCondHandleKey< MuonMDT_CablingMap > m_writeKey
Definition: MuonMDT_CablingAlg.h:37
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
json
nlohmann::json json
Definition: HistogramDef.cxx:9
MuonMDT_CablingAlg::loadCablingSchema
StatusCode loadCablingSchema(const EventContext &ctx, SG::WriteCondHandle< MuonMDT_CablingMap > &writeHandle, MuonMDT_CablingMap &cabling_map) const
Load the cabling schema of the tubes.
Definition: MuonMDT_CablingAlg.cxx:82
WriteCondHandleKey.h
MuonMDT_CablingAlg::CablingData
MuonMDT_CablingMap::CablingData CablingData
Definition: MuonMDT_CablingAlg.h:31
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
IIOVDbSvc.h
Abstract interface to IOVDbSvc to access IOVRange and tag information.
MuonMDT_CablingAlg::~MuonMDT_CablingAlg
virtual ~MuonMDT_CablingAlg()=default
MuonMDT_CablingAlg::m_mezzJSON
Gaudi::Property< std::string > m_mezzJSON
Definition: MuonMDT_CablingAlg.h:59
MuonMDT_CablingAlg::initialize
virtual StatusCode initialize() override
Definition: MuonMDT_CablingAlg.cxx:28
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonMDT_CablingAlg::extractLayerInfo
bool extractLayerInfo(std::vector< std::string > &, CablingData &map_data) const
Retrieves the channel info from the coral attribute.
Definition: MuonMDT_CablingAlg.cxx:260
MuonMDT_CablingAlg::dbPayloadToJson
StatusCode dbPayloadToJson(SG::ReadCondHandle< CondAttrListCollection > &readHandle, nlohmann::json &json) const
Definition: MuonMDT_CablingAlg.cxx:62
MuonMDT_CablingMap
Definition: MuonMDT_CablingMap.h:28
MuonMDT_CablingAlg::m_readKeyMap
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyMap
Definition: MuonMDT_CablingAlg.h:36
MuonMDT_CablingMap.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonMDT_CablingAlg::isReEntrant
virtual bool isReEntrant() const override final
Definition: MuonMDT_CablingAlg.h:29
MdtCablingData
Definition: MdtCablingData.h:82
ReadCondHandleKey.h
AthReentrantAlgorithm.h
MuonMDT_CablingAlg::m_readKeyMez
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyMez
Definition: MuonMDT_CablingAlg.h:35
MuonMDT_CablingAlg::loadMezzanineSchema
StatusCode loadMezzanineSchema(const EventContext &ctx, SG::WriteCondHandle< MuonMDT_CablingMap > &writeHandle, MuonMDT_CablingMap &cabling_map) const
Load the mezzanine schema into the cabling.
Definition: MuonMDT_CablingAlg.cxx:293
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonMDT_CablingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: MuonMDT_CablingAlg.cxx:39
MuonMDT_CablingAlg
MuonMDT_CablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: MuonMDT_CablingAlg.h:22
PixelModuleFeMask_create_db.payload
string payload
Definition: PixelModuleFeMask_create_db.py:69
SG::ReadCondHandleKey< CondAttrListCollection >
MuonMDT_CablingAlg::m_isRun3
Gaudi::Property< bool > m_isRun3
Definition: MuonMDT_CablingAlg.h:39
MuonMDT_CablingAlg::loadMezzanineFromJSON
StatusCode loadMezzanineFromJSON(nlohmann::json &&payload, MuonMDT_CablingMap &cabling_map) const
Definition: MuonMDT_CablingAlg.cxx:345
MuonMDT_CablingAlg::m_useJSONFormat
Gaudi::Property< bool > m_useJSONFormat
Definition: MuonMDT_CablingAlg.h:65
SG::WriteCondHandleKey< MuonMDT_CablingMap >
MuonMDT_CablingAlg::loadCablingSchemaFromJSON
StatusCode loadCablingSchemaFromJSON(nlohmann::json &&payload, MuonMDT_CablingMap &cabling_map) const
Definition: MuonMDT_CablingAlg.cxx:357
MuonMDT_CablingAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonMDT_CablingAlg.h:34
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >
MuonMDT_CablingMap::CablingData
MdtCablingData CablingData
Definition: MuonMDT_CablingMap.h:79
MuonMDT_CablingAlg::m_chambJSON
Gaudi::Property< std::string > m_chambJSON
Definition: MuonMDT_CablingAlg.h:62