ATLAS Offline Software
Loading...
Searching...
No Matches
AlignmentCondAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCONDALG_MUONALIGNMENTCONDALG_H
6#define MUONCONDALG_MUONALIGNMENTCONDALG_H
7
10#include "CoralBase/Blob.h"
13// typedefs for A/BLineMapContainer
15#include "GaudiKernel/ServiceHandle.h"
18#include "nlohmann/json.hpp"
19
21namespace Muon {
23public:
24 using AthCondAlgorithm::AthCondAlgorithm;
25 virtual ~AlignmentCondAlg() = default;
26 virtual StatusCode initialize() override;
27 virtual StatusCode execute(const EventContext& ctx) const override;
28
29private:
31
32 template <class ContType>
33 StatusCode writeContainer(const EventContext& ctx,
35 std::unique_ptr<ContType>&& container) const;
36
41 StatusCode loadDataFromLegacy(const std::string& data, nlohmann::json& json, bool loadBLines) const;
45 StatusCode parseDataFromJSON(const nlohmann::json& lines,
46 ALineContainer& writeALineCdo,
47 BLineContainer& writeBLineCdo) const;
51 StatusCode loadCoolFolder(const EventContext& ctx,
53 ALineContainer& writeALineCdo,
54 BLineContainer& writeBLineCdo) const;
55
56 // Read Handles
58 "/MUONALIGN/MDT/BARREL",
59 "/MUONALIGN/MDT/ENDCAP/SIDEA",
60 "/MUONALIGN/MDT/ENDCAP/SIDEC",
61 "/MUONALIGN/TGC/SIDEA",
62 "/MUONALIGN/TGC/SIDEC",
63 },
64 "Folder names where the alignment paramters are stored"};
65
66 // Write Handles
67 SG::WriteCondHandleKey<ALineContainer> m_writeALineKey{this, "WriteALineKey", "ALineContainer",
68 "Key of output muon alignment ALine condition data"};
69 SG::WriteCondHandleKey<BLineContainer> m_writeBLineKey{this, "WriteBLineKey", "BLineContainer",
70 "Key of output muon alignment BLine condition data"};
71
72 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
73
74
75 Gaudi::Property<bool> m_loadALines{this, "LoadALines", true, "Setup whether Alines shall be written"};
76 Gaudi::Property<bool> m_loadBLines{this, "LoadBLines", true, "Setup whether BLines shall be written"};
77 // new folder format 2020
78 Gaudi::Property<bool> m_newFormat2020 {this, "NewFormat2020", false,
79 "The database folders are given in the new JSON format"};
80
81 Gaudi::Property<std::string> m_readFromJSON{this,"readFromJSON", "",
82 "Reads the A & B lines parameters from a JSON file instead from COOL"};
83};
84}
85#endif
Base class for conditions algorithms.
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
std::set< ALinePar, std::less<> > ALineContainer
std::set< BLinePar, std::less<> > BLineContainer
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
nlohmann::json json
Base class for conditions algorithms.
Gaudi::Property< bool > m_newFormat2020
StatusCode loadCoolFolder(const EventContext &ctx, const SG::ReadCondHandleKey< CondAttrListCollection > &key, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Retrieves the alignment parameters from a COOL folder.
Gaudi::Property< bool > m_loadALines
StatusCode parseDataFromJSON(const nlohmann::json &lines, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Parse the JSON blob to fill the A & B Line containers.
StatusCode loadDataFromLegacy(const std::string &data, nlohmann::json &json, bool loadBLines) const
Load the Alignment data from the legacy format where the channels are parsed line wise The data is th...
StatusCode writeContainer(const EventContext &ctx, const SG::WriteCondHandleKey< ContType > &writeKey, std::unique_ptr< ContType > &&container) const
Attaches the dependencies of the Alignment keys onto the A & Bline container.
SG::WriteCondHandleKey< ALineContainer > m_writeALineKey
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_alignKeys
Gaudi::Property< bool > m_loadBLines
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< std::string > m_readFromJSON
Load the alignment parameters from a JSON file.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual ~AlignmentCondAlg()=default
SG::WriteCondHandleKey< BLineContainer > m_writeBLineKey
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
HandleKeyArray< ReadCondHandle< T >, CondHandleDefault::Key< ReadCondHandleKey< T > >, Gaudi::DataHandle::Reader > ReadCondHandleKeyArray