ATLAS Offline Software
Loading...
Searching...
No Matches
MuonAlignmentCondAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 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
20
22public:
23 MuonAlignmentCondAlg(const std::string& name, ISvcLocator* pSvcLocator);
24 virtual ~MuonAlignmentCondAlg() = default;
25 virtual StatusCode initialize() override;
26 virtual StatusCode execute(const EventContext& ctx) const override;
27
28private:
30
31 template <class ContType>
32 StatusCode writeContainer(const EventContext& ctx,
34 std::unique_ptr<ContType>&& container) const;
35
40 StatusCode loadDataFromLegacy(const std::string& data, nlohmann::json& json, bool loadBLines) const;
44 StatusCode parseDataFromJSON(const nlohmann::json& lines,
45 ALineContainer& writeALineCdo,
46 BLineContainer& writeBLineCdo) const;
50 StatusCode loadCoolFolder(const EventContext& ctx,
52 ALineContainer& writeALineCdo,
53 BLineContainer& writeBLineCdo) const;
54
55 // Read Handles
57 "/MUONALIGN/MDT/BARREL",
58 "/MUONALIGN/MDT/ENDCAP/SIDEA",
59 "/MUONALIGN/MDT/ENDCAP/SIDEC",
60 "/MUONALIGN/TGC/SIDEA",
61 "/MUONALIGN/TGC/SIDEC",
62 },
63 "Folder names where the alignment paramters are stored"};
64
65 // Write Handles
66 SG::WriteCondHandleKey<ALineContainer> m_writeALineKey{this, "WriteALineKey", "ALineContainer",
67 "Key of output muon alignment ALine condition data"};
68 SG::WriteCondHandleKey<BLineContainer> m_writeBLineKey{this, "WriteBLineKey", "BLineContainer",
69 "Key of output muon alignment BLine condition data"};
70
71 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
72
73
74 Gaudi::Property<bool> m_loadALines{this, "LoadALines", true, "Setup whether Alines shall be written"};
75 Gaudi::Property<bool> m_loadBLines{this, "LoadBLines", true, "Setup whether BLines shall be written"};
76 // new folder format 2020
77 Gaudi::Property<bool> m_newFormat2020 {this, "NewFormat2020", false,
78 "The database folders are given in the new JSON format"};
79
80 Gaudi::Property<std::string> m_readFromJSON{this,"readFromJSON", "",
81 "Reads the A & B lines parameters from a JSON file instead from COOL"};
82};
83
84#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.
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteCondHandleKey< BLineContainer > m_writeBLineKey
virtual StatusCode initialize() override
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 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...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< std::string > m_readFromJSON
Load the alignment parameters from a JSON file.
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
Gaudi::Property< bool > m_newFormat2020
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_alignKeys
virtual ~MuonAlignmentCondAlg()=default
MuonAlignmentCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode parseDataFromJSON(const nlohmann::json &lines, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Parse the JSON blob to fill the A & B Line containers.
Gaudi::Property< bool > m_loadBLines
HandleKeyArray< ReadCondHandle< T >, CondHandleDefault::Key< ReadCondHandleKey< T > >, Gaudi::DataHandle::Reader > ReadCondHandleKeyArray