ATLAS Offline Software
MuonAlignmentErrorDbAlg.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 MUONCONDSVC_MUONALIGNMENTERRORDBALG_H
10 #define MUONCONDSVC_MUONALIGNMENTERRORDBALG_H
11 
12 #include <GaudiKernel/EventIDRange.h>
18 #include <Identifier/Identifier.h>
19 #include <unordered_map>
24 public:
25 
26  MuonAlignmentErrorDbAlg(const std::string& name, ISvcLocator* pSvcLocator);
27 
28  ~MuonAlignmentErrorDbAlg() override = default;
29 
30  StatusCode initialize() override;
31  StatusCode execute(const EventContext& ctx) const override;
32  bool isReEntrant() const override { return false; }
33 
34 private:
35  std::tuple<std::string, EventIDRange> getDbClobContent(const EventContext& ctx) const;
36  std::tuple<std::string, EventIDRange> getFileClobContent() const;
37 
38  SG::ReadCondHandleKey<CondAttrListCollection> m_readKey{this, "ReadKey", "/MUONALIGN/ERRS",
39  "Key of input muon alignment error condition data"};
40  SG::WriteCondHandleKey<MuonAlignmentErrorData> m_writeKey{this, "WriteKey", "MuonAlignmentErrorData",
41  "Key of output muon alignment error condition data"};
42  Gaudi::Property<std::string> m_clobFileOverride{this, "clobFileOverride", "",
43  "Set this to the location of a CLOB file to override the DB setting"};
44  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
45  ToolHandle<MuonCalib::IIdToFixedIdTool> m_idTool{this, "idTool", "MuonCalib::IdToFixedIdTool"};
46  // SOME USEFUL METHODS //
47  // GET STATION EXACT NAME, FROM:
48  // https://gitlab.cern.ch/Asap/AsapModules/Track/MuonAlignTrk/-/blob/master/MuonAlignTrk/MuonFixedLongId.h?ref_type=heads
49  std::string hardwareName(MuonCalib::MuonFixedLongId calibId) const;
50  std::string_view side(MuonCalib::MuonFixedLongId calibId) const;
51  std::string sectorString(MuonCalib::MuonFixedLongId calibId) const;
52  int sector(MuonCalib::MuonFixedLongId calibId) const;
53  int hardwareEta(MuonCalib::MuonFixedLongId calibId) const;
54  bool isSmallSector(MuonCalib::MuonFixedLongId calibId) const;
55  void generateMap(const auto & helper_obj, const auto & idTool, MuonAlignmentErrorData::MuonAlignmentErrorRuleCache& adev_new,
56  std::vector<MuonAlignmentErrorData::MuonAlignmentErrorRule>& devVec) const;
57 };
58 
59 #endif
MuonAlignmentErrorDbAlg::m_readKey
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey
Definition: MuonAlignmentErrorDbAlg.h:38
MuonIdHelper.h
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
MuonAlignmentErrorDbAlg::initialize
StatusCode initialize() override
Definition: MuonAlignmentErrorDbAlg.cxx:14
MuonAlignmentErrorDbAlg::m_idTool
ToolHandle< MuonCalib::IIdToFixedIdTool > m_idTool
Definition: MuonAlignmentErrorDbAlg.h:45
WriteCondHandleKey.h
MuonAlignmentErrorDbAlg::hardwareEta
int hardwareEta(MuonCalib::MuonFixedLongId calibId) const
Definition: MuonAlignmentErrorDbAlg.cxx:302
MuonAlignmentErrorDbAlg::sector
int sector(MuonCalib::MuonFixedLongId calibId) const
Definition: MuonAlignmentErrorDbAlg.cxx:269
MuonAlignmentErrorDbAlg::getDbClobContent
std::tuple< std::string, EventIDRange > getDbClobContent(const EventContext &ctx) const
Definition: MuonAlignmentErrorDbAlg.cxx:196
MuonAlignmentErrorDbAlg::~MuonAlignmentErrorDbAlg
~MuonAlignmentErrorDbAlg() override=default
MuonAlignmentErrorDbAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonAlignmentErrorDbAlg.h:44
MuonAlignmentErrorData::MuonAlignmentErrorRuleCache
Definition: MuonAlignmentErrorData.h:32
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonCalib::MuonFixedLongId
Definition: MuonFixedLongId.h:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonAlignmentErrorDbAlg::generateMap
void generateMap(const auto &helper_obj, const auto &idTool, MuonAlignmentErrorData::MuonAlignmentErrorRuleCache &adev_new, std::vector< MuonAlignmentErrorData::MuonAlignmentErrorRule > &devVec) const
Definition: MuonAlignmentErrorDbAlg.cxx:161
MuonAlignmentErrorDbAlg
MuonAlignmentErrorDbAlg reads raw condition data and writes derived condition data (MuonAlignmentErro...
Definition: MuonAlignmentErrorDbAlg.h:23
MuonAlignmentErrorDbAlg::m_writeKey
SG::WriteCondHandleKey< MuonAlignmentErrorData > m_writeKey
Definition: MuonAlignmentErrorDbAlg.h:40
MuonAlignmentErrorDbAlg::MuonAlignmentErrorDbAlg
MuonAlignmentErrorDbAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonAlignmentErrorDbAlg.cxx:11
ReadCondHandleKey.h
AthReentrantAlgorithm.h
MuonAlignmentErrorDbAlg::side
std::string_view side(MuonCalib::MuonFixedLongId calibId) const
Definition: MuonAlignmentErrorDbAlg.cxx:257
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonAlignmentErrorDbAlg::getFileClobContent
std::tuple< std::string, EventIDRange > getFileClobContent() const
Definition: MuonAlignmentErrorDbAlg.cxx:228
MuonAlignmentErrorDbAlg::hardwareName
std::string hardwareName(MuonCalib::MuonFixedLongId calibId) const
Definition: MuonAlignmentErrorDbAlg.cxx:242
SG::ReadCondHandleKey< CondAttrListCollection >
SG::WriteCondHandleKey< MuonAlignmentErrorData >
MuonAlignmentErrorData.h
MuonAlignmentErrorDbAlg::m_clobFileOverride
Gaudi::Property< std::string > m_clobFileOverride
Definition: MuonAlignmentErrorDbAlg.h:42
MuonAlignmentErrorDbAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MuonAlignmentErrorDbAlg.cxx:23
MuonAlignmentErrorDbAlg::sectorString
std::string sectorString(MuonCalib::MuonFixedLongId calibId) const
Definition: MuonAlignmentErrorDbAlg.cxx:261
MuonAlignmentErrorDbAlg::isReEntrant
bool isReEntrant() const override
Definition: MuonAlignmentErrorDbAlg.h:32
MuonAlignmentErrorDbAlg::isSmallSector
bool isSmallSector(MuonCalib::MuonFixedLongId calibId) const
Definition: MuonAlignmentErrorDbAlg.cxx:278
IMuonIdHelperSvc.h
IIdToFixedIdTool.h
ServiceHandle< Muon::IMuonIdHelperSvc >