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:
31  StatusCode attachDependencies(const EventContext& ctx,
38  StatusCode loadDataFromLegacy(const std::string& data, nlohmann::json& json, bool loadBLines) const;
43  ALineContainer& writeALineCdo,
44  BLineContainer& writeBLineCdo) const;
48  StatusCode loadCoolFolder(const EventContext& ctx,
50  ALineContainer& writeALineCdo,
51  BLineContainer& writeBLineCdo) const;
52 
53  // Read Handles
55  "/MUONALIGN/MDT/BARREL",
56  "/MUONALIGN/MDT/ENDCAP/SIDEA",
57  "/MUONALIGN/MDT/ENDCAP/SIDEC",
58  "/MUONALIGN/TGC/SIDEA",
59  "/MUONALIGN/TGC/SIDEC",
60  },
61  "Folder names where the alignment paramters are stored"};
62 
63  // Write Handles
64  SG::WriteCondHandleKey<ALineContainer> m_writeALineKey{this, "WriteALineKey", "ALineContainer",
65  "Key of output muon alignment ALine condition data"};
66  SG::WriteCondHandleKey<BLineContainer> m_writeBLineKey{this, "WriteBLineKey", "BLineContainer",
67  "Key of output muon alignment BLine condition data"};
68 
69  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
70 
71  // new folder format 2020
72  Gaudi::Property<bool> m_newFormat2020 {this, "NewFormat2020", false,
73  "The database folders are given in the new JSON format"};
75  Gaudi::Property<std::string> m_readFromJSON{this,"readFromJSON", "",
76  "Reads the A & B lines parameters from a JSON file instead from COOL"};
77 };
78 
79 #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:39
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:72
ALineContainer
std::set< ALinePar, std::less<> > ALineContainer
Definition: CorrContainer.h:16
CondHandleKeyArray.h
MuonAlignmentCondAlg::m_writeALineKey
SG::WriteCondHandleKey< ALineContainer > m_writeALineKey
Definition: MuonAlignmentCondAlg.h:64
MuonAlignmentCondAlg::m_writeBLineKey
SG::WriteCondHandleKey< BLineContainer > m_writeBLineKey
Definition: MuonAlignmentCondAlg.h:66
ReadCondHandleKey.h
AthReentrantAlgorithm.h
MuonAlignmentCondAlg::attachDependencies
StatusCode attachDependencies(const EventContext &ctx, SG::WriteCondHandle< ALineContainer > &alines, SG::WriteCondHandle< BLineContainer > &blines) const
Attaches the dependencies of the Alignment keys onto the A & Bline container.
Definition: MuonAlignmentCondAlg.cxx:84
MuonAlignmentCondAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonAlignmentCondAlg.h:69
MuonAlignmentCondAlg::m_alignKeys
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_alignKeys
Definition: MuonAlignmentCondAlg.h:54
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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:233
SG::ReadCondHandleKey< CondAttrListCollection >
MuonAlignmentCondAlg::m_readFromJSON
Gaudi::Property< std::string > m_readFromJSON
Load the alignment parameters from a JSON file.
Definition: MuonAlignmentCondAlg.h:75
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:143
blobaccess.h
SG::WriteCondHandleKey< ALineContainer >
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:102
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
IMuonIdHelperSvc.h
MuonAlignmentCondAlg::~MuonAlignmentCondAlg
virtual ~MuonAlignmentCondAlg()=default
ServiceHandle< Muon::IMuonIdHelperSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37