ATLAS Offline Software
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 
22 public:
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  virtual bool isReEntrant() const override { return false; }
28 
29 private:
32  template <class ContType>
33  StatusCode writeContainer(const EventContext& ctx,
34  const SG::WriteCondHandleKey<ContType>& writeKey,
35  std::unique_ptr<ContType>&& container) const;
36 
41  StatusCode loadDataFromLegacy(const std::string& data, nlohmann::json& json, bool loadBLines) const;
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"};
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
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
json
nlohmann::json json
Definition: HistogramDef.cxx:9
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
MuonAlignmentCondAlg::MuonAlignmentCondAlg
MuonAlignmentCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonAlignmentCondAlg.cxx:21
MuonAlignmentCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: MuonAlignmentCondAlg.cxx:42
MuonAlignmentCondAlg::initialize
virtual StatusCode initialize() override
Definition: MuonAlignmentCondAlg.cxx:26
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonAlignmentCondAlg::isReEntrant
virtual bool isReEntrant() const override
Definition: MuonAlignmentCondAlg.h:27
CorrContainer.h
CaloCondBlobAlgs_fillNoiseFromASCII.lines
lines
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:104
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonAlignmentCondAlg::m_newFormat2020
Gaudi::Property< bool > m_newFormat2020
Definition: MuonAlignmentCondAlg.h:78
ALineContainer
std::set< ALinePar, std::less<> > ALineContainer
Definition: CorrContainer.h:16
CondHandleKeyArray.h
MuonAlignmentCondAlg::m_writeALineKey
SG::WriteCondHandleKey< ALineContainer > m_writeALineKey
Definition: MuonAlignmentCondAlg.h:67
MuonAlignmentCondAlg::m_writeBLineKey
SG::WriteCondHandleKey< BLineContainer > m_writeBLineKey
Definition: MuonAlignmentCondAlg.h:69
ReadCondHandleKey.h
MuonAlignmentCondAlg::m_loadBLines
Gaudi::Property< bool > m_loadBLines
Definition: MuonAlignmentCondAlg.h:76
AthReentrantAlgorithm.h
MuonAlignmentCondAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonAlignmentCondAlg.h:72
MuonAlignmentCondAlg::writeContainer
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.
Definition: MuonAlignmentCondAlg.cxx:90
MuonAlignmentCondAlg::m_alignKeys
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_alignKeys
Definition: MuonAlignmentCondAlg.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonAlignmentCondAlg::loadDataFromLegacy
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...
Definition: MuonAlignmentCondAlg.cxx:243
SG::ReadCondHandleKey< CondAttrListCollection >
MuonAlignmentCondAlg::m_readFromJSON
Gaudi::Property< std::string > m_readFromJSON
Load the alignment parameters from a JSON file.
Definition: MuonAlignmentCondAlg.h:81
MuonAlignmentCondAlg::parseDataFromJSON
StatusCode parseDataFromJSON(const nlohmann::json &lines, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Parse the JSON blob to fill the A & B Line containers.
Definition: MuonAlignmentCondAlg.cxx:153
blobaccess.h
MuonAlignmentCondAlg::m_loadALines
Gaudi::Property< bool > m_loadALines
Definition: MuonAlignmentCondAlg.h:75
SG::WriteCondHandleKey
Definition: WriteCondHandleKey.h:20
MuonAlignmentCondAlg
Definition: MuonAlignmentCondAlg.h:21
BLineContainer
std::set< BLinePar, std::less<> > BLineContainer
Definition: CorrContainer.h:20
MuonAlignmentCondAlg::loadCoolFolder
StatusCode loadCoolFolder(const EventContext &ctx, const SG::ReadCondHandleKey< CondAttrListCollection > &key, ALineContainer &writeALineCdo, BLineContainer &writeBLineCdo) const
Retrieves the alignment parameters from a COOL folder.
Definition: MuonAlignmentCondAlg.cxx:112
IMuonIdHelperSvc.h
MuonAlignmentCondAlg::~MuonAlignmentCondAlg
virtual ~MuonAlignmentCondAlg()=default
ServiceHandle< Muon::IMuonIdHelperSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37