ATLAS Offline Software
Loading...
Searching...
No Matches
MuPatCandidateTool.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 MUPATCANDIDATETOOL_H
6#define MUPATCANDIDATETOOL_H
7
8#include <mutex>
9#include <set>
10#include <vector>
11
13#include "GaudiKernel/ServiceHandle.h"
14#include "GaudiKernel/ToolHandle.h"
15#include "MuPatHitTool.h" // Needed to enfornce build order for reflex dict
26
27class MsgStream;
28
29namespace Trk {
30 class Track;
31 class MeasurementBase;
33} // namespace Trk
34
35namespace MuonGM {
37}
38
39namespace Muon {
40
41 class MuonSegment;
42 class MuPatTrack;
43 class MuPatSegment;
46
47
50 public:
51 using MeasVec = std::vector<const Trk::MeasurementBase*>;
52 typedef MeasVec::iterator MeasIt;
53 typedef MeasVec::const_iterator MeasCit;
54
55 public:
57 MuPatCandidateTool(const std::string&, const std::string&, const IInterface*);
58
60 virtual ~MuPatCandidateTool() = default;
61
63 virtual StatusCode initialize() override;
64
66 static const InterfaceID& interfaceID() {
67 static const InterfaceID IID_MuPatCandidateTool("Muon::MuPatCandidateTool", 1, 0);
68 return IID_MuPatCandidateTool;
69 }
70
77 bool extendWithSegment(MuPatTrack& can, MuPatSegment& segInfo, std::unique_ptr<Trk::Track>& track) const;
78
85 std::unique_ptr<MuPatTrack> createCandidate(MuPatSegment& segInfo, std::unique_ptr<Trk::Track>& track) const;
86
93 std::unique_ptr<MuPatTrack> createCandidate(MuPatSegment& segInfo1, MuPatSegment& segInfo2, std::unique_ptr<Trk::Track>& track) const;
94
99 std::unique_ptr<MuPatTrack> createCandidate(std::unique_ptr<Trk::Track>& track) const;
100
103 bool updateTrack(MuPatTrack& candidate, std::unique_ptr<Trk::Track>& track) const;
104
106 bool recalculateCandidateSegmentContent(MuPatTrack& candidate) const;
107
112 static std::unique_ptr<MuPatTrack> copyCandidate(MuPatTrack* canIn) ;
113
118 std::unique_ptr<MuPatSegment> createSegInfo(const EventContext& ctx, const MuonSegment& segment) const;
119
121 std::set<const MuonGM::MuonReadoutElement*> readoutElements(const MuPatCandidateBase& entry) const;
122
130
131 std::string print(const MuPatSegment& segment, int level = 0) const;
132
133 std::string print(const std::vector<MuPatSegment*>& segments, int level = 0) const;
134
135 std::string print(const MuPatCandidateBase& candidate, int level = 0) const;
136
137 std::string print(const MuPatTrack& track, int level = 0) const;
138
139 std::string print(const std::vector<std::unique_ptr<MuPatTrack> >& tracks, int level = 0) const;
140
141 private:
143 void updateHits(MuPatCandidateBase& entry, const MeasVec& measurements, bool recreateMDT = false,
144 bool recreateCSC = false, bool createComp = false) const;
145
147 void addCluster(const Trk::MeasurementBase& meas, std::vector<const MuonClusterOnTrack*>& rots) const;
148
150 void createAndAddCompetingROTs(const std::vector<const MuonClusterOnTrack*>& rots, MeasVec& hits, MeasVec& allHits,
151 MuPatCandidateBase& entry) const;
152
153 ToolHandle<IMdtDriftCircleOnTrackCreator> m_mdtRotCreator{
154 this, "MdtRotCreator", "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator", "tool to calibrate MDT hits"};
155 ToolHandle<IMuonClusterOnTrackCreator> m_cscRotCreator{
156 this, "CscRotCreator", "Muon::CscClusterOnTrackCreator/CscClusterOnTrackCreator", "tool to calibrate CSC hits"};
157 ToolHandle<IMuonCompetingClustersOnTrackCreator> m_compClusterCreator{
158 this, "CompetingClustersCreator", "Muon::TriggerChamberClusterOnTrackCreator/TriggerChamberClusterOnTrackCreator",
159 "tool to create competing clusters on track"};
160 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
161 ServiceHandle<IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
162 "Handle to the service providing the IMuonEDMHelperSvc interface"};
163 PublicToolHandle<MuonEDMPrinterTool> m_printer{this, "MuonPrinterTool", "Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
164 ToolHandle<MuPatHitTool> m_hitHandler{this, "HitTool", "Muon::MuPatHitTool/MuPatHitTool", "Tool to manipulate hit lists"};
165 ToolHandle<Muon::IMuonSegmentSelectionTool> m_segmentSelector{
166 this, "SegmentSelector", "Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool", "Tool to resolve track ambiguities"};
167
168 Gaudi::Property<bool> m_createCompetingROTsPhi{this, "CreateCompetingROTsPhi", false};
169 Gaudi::Property<bool> m_createCompetingROTsEta{this, "CreateCompetingROTsEta", true};
170 Gaudi::Property<bool> m_doMdtRecreation{this, "DoMdtRecreation", false};
171 Gaudi::Property<bool> m_doCscRecreation{this, "DoCscRecreation", true};
172 };
173
174} // namespace Muon
175
176#endif
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
track candidate entry object.
bool extendWithSegment(MuPatTrack &can, MuPatSegment &segInfo, std::unique_ptr< Trk::Track > &track) const
extend a track candidate with a segment
virtual ~MuPatCandidateTool()=default
destructor
std::unique_ptr< MuPatSegment > createSegInfo(const EventContext &ctx, const MuonSegment &segment) const
create a MuPatSegment object from a segment
ToolHandle< IMuonClusterOnTrackCreator > m_cscRotCreator
std::vector< const Trk::MeasurementBase * > MeasVec
ToolHandle< MuPatHitTool > m_hitHandler
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compClusterCreator
void createAndAddCompetingROTs(const std::vector< const MuonClusterOnTrack * > &rots, MeasVec &hits, MeasVec &allHits, MuPatCandidateBase &entry) const
create CompetingMuonClustersOnTracks from ROTs and add them to the MeasVec.
Gaudi::Property< bool > m_createCompetingROTsPhi
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
std::unique_ptr< MuPatTrack > createCandidate(MuPatSegment &segInfo, std::unique_ptr< Trk::Track > &track) const
create a track candidate from one segment
ToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
ToolHandle< IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
std::string print(const MuPatSegment &segment, int level=0) const
print the measurements on the track to string
static std::unique_ptr< MuPatTrack > copyCandidate(MuPatTrack *canIn)
copy a candidate without copying the track (lazy pointer copy)
virtual StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
Gaudi::Property< bool > m_createCompetingROTsEta
Gaudi::Property< bool > m_doCscRecreation
bool updateTrack(MuPatTrack &candidate, std::unique_ptr< Trk::Track > &track) const
set the new track in the candidate, and update candidate contents.
PublicToolHandle< MuonEDMPrinterTool > m_printer
MuPatCandidateTool(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
MeasVec::const_iterator MeasCit
std::set< const MuonGM::MuonReadoutElement * > readoutElements(const MuPatCandidateBase &entry) const
get list of the readout elements of the hits on the entry
bool recalculateCandidateSegmentContent(MuPatTrack &candidate) const
recalculate the chamber indices on the candidate and reset them.
void addCluster(const Trk::MeasurementBase &meas, std::vector< const MuonClusterOnTrack * > &rots) const
extract MuonClusterOnTrack('s) from measurement
Gaudi::Property< bool > m_doMdtRecreation
static const InterfaceID & interfaceID()
access to tool interface
void updateHits(MuPatCandidateBase &entry, const MeasVec &measurements, bool recreateMDT=false, bool recreateCSC=false, bool createComp=false) const
update hits for a MuPatCandidateBase
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
segment candidate object.
track candidate object.
Definition MuPatTrack.h:37
Base class for Muon cluster RIO_OnTracks.
This is the common class for 3D segments used in the muon spectrometer.
magnetic field properties to steer the behavior of the extrapolation
This class is the pure abstract base class for all fittable tracking measurements.
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
NSWSeed::MeasVec MeasVec
Stereo seeds can be formed using hits from 4 independent layers by solving the following system of eq...
Ensure that the ATLAS eigen extensions are properly loaded.