ATLAS Offline Software
MuonLayerHoughAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONLAYERHOUGHALG_H
6 #define MUONLAYERHOUGHALG_H
7 
9 #include "GaudiKernel/ToolHandle.h"
13 
15 public:
16  MuonLayerHoughAlg(const std::string& name, ISvcLocator* pSvcLocator);
17 
18  virtual ~MuonLayerHoughAlg() = default;
19 
20  virtual StatusCode initialize() override;
21  virtual StatusCode execute(const EventContext& ctx) const override;
22 
23 private:
24  template <class T> const T* GetObject(const SG::ReadHandleKey<T>& key, const EventContext& ctx) const;
25 
26  SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_keyTgc{this, "TgcPrepDataContainer", "TGC_Measurements"};
27  SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_keyRpc{this, "RpcPrepDataContainer", "RPC_Measurements"};
28  SG::ReadHandleKey<Muon::CscPrepDataContainer> m_keyCsc{this, "CscPrepDataContainer", "CSC_Clusters"};
29  SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_keyMdt{this, "MdtPrepDataContainer", "MDT_DriftCircles"};
30  SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_keysTgc{this, "sTgcPrepDataContainer", "STGC_Measurements"};
31  SG::ReadHandleKey<Muon::MMPrepDataContainer> m_keyMM{this, "MMPrepDataContainer", "MM_Measurements"};
32 
33  SG::WriteHandleKey<MuonPatternCombinationCollection> m_combis{this, "MuonPatternCombinationCollection", "MuonLayerHoughCombis"};
34  SG::WriteHandleKey<Muon::HoughDataPerSectorVec> m_houghDataPerSectorVecKey{this, "Key_MuonLayerHoughToolHoughDataPerSectorVec",
35  "HoughDataPerSectorVec", "HoughDataPerSectorVec key"};
36  ToolHandle<Muon::MuonEDMPrinterTool> m_printer{this, "printerTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
37  ToolHandle<Muon::IMuonHoughPatternFinderTool> m_layerTool{this, "MuonLayerScanTool", "Muon::MuonLayerHoughTool/MuonLayerHoughTool"};
38  Gaudi::Property<bool> m_printSummary{this, "PrintSummary", false};
39 };
40 
41 template <class T> const T* MuonLayerHoughAlg::GetObject(const SG::ReadHandleKey<T>& key, const EventContext& ctx) const {
42  SG::ReadHandle<T> handle(key, ctx);
43  if (handle.isPresent() && !handle.isValid()) {
44  ATH_MSG_WARNING("MuonLayerHoughAlg Cannot retrieve " << handle.key());
45  return nullptr;
46  }
47  return handle.cptr();
48 }
49 
50 #endif
MuonLayerHoughAlg::m_keyCsc
SG::ReadHandleKey< Muon::CscPrepDataContainer > m_keyCsc
Definition: MuonLayerHoughAlg.h:28
MuonLayerHoughAlg::m_keysTgc
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_keysTgc
Definition: MuonLayerHoughAlg.h:30
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
MuonEDMPrinterTool.h
MuonLayerHoughAlg::m_keyMM
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_keyMM
Definition: MuonLayerHoughAlg.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
MuonLayerHoughAlg::m_keyRpc
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
Definition: MuonLayerHoughAlg.h:27
MuonLayerHoughAlg::m_printer
ToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonLayerHoughAlg.h:36
MuonLayerHoughAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: MuonLayerHoughAlg.cxx:36
MuonLayerHoughAlg::GetObject
const T * GetObject(const SG::ReadHandleKey< T > &key, const EventContext &ctx) const
Definition: MuonLayerHoughAlg.h:41
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonLayerHoughAlg::initialize
virtual StatusCode initialize() override
Definition: MuonLayerHoughAlg.cxx:17
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
MuonLayerHoughAlg::m_keyMdt
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_keyMdt
Definition: MuonLayerHoughAlg.h:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonLayerHoughAlg::m_houghDataPerSectorVecKey
SG::WriteHandleKey< Muon::HoughDataPerSectorVec > m_houghDataPerSectorVecKey
Definition: MuonLayerHoughAlg.h:34
MuonLayerHoughAlg::m_printSummary
Gaudi::Property< bool > m_printSummary
Definition: MuonLayerHoughAlg.h:38
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
MuonLayerHoughAlg::m_keyTgc
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
Definition: MuonLayerHoughAlg.h:26
MuonLayerHoughAlg::m_layerTool
ToolHandle< Muon::IMuonHoughPatternFinderTool > m_layerTool
Definition: MuonLayerHoughAlg.h:37
AthReentrantAlgorithm.h
MuonLayerHoughAlg::MuonLayerHoughAlg
MuonLayerHoughAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonLayerHoughAlg.cxx:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
MuonLayerHoughAlg
Definition: MuonLayerHoughAlg.h:14
IMuonHoughPatternFinderTool.h
HoughDataPerSec.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::isPresent
bool isPresent() const
Is the referenced object present in SG?
Definition: StoreGate/src/VarHandleBase.cxx:397
MuonLayerHoughAlg::m_combis
SG::WriteHandleKey< MuonPatternCombinationCollection > m_combis
Definition: MuonLayerHoughAlg.h:33
MuonLayerHoughAlg::~MuonLayerHoughAlg
virtual ~MuonLayerHoughAlg()=default
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37