ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
MuonIdentification
MuonCombinedTrackFindingTools
src
MuonCandidateTrackBuilderTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUON_MUONCANDIDATETRACKBUILDER_H
6
#define MUON_MUONCANDIDATETRACKBUILDER_H
7
8
#include <vector>
9
10
#include "
AthenaBaseComps/AthAlgTool.h
"
11
#include "GaudiKernel/ServiceHandle.h"
12
#include "GaudiKernel/ToolHandle.h"
13
#include "
MuidInterfaces/ICombinedMuonTrackBuilder.h
"
14
#include "
MuonCombinedToolInterfaces/IMuonCandidateTrackBuilderTool.h
"
15
#include "
MuonIdHelpers/IMuonIdHelperSvc.h
"
16
#include "
MuonRecHelperTools/IMuonEDMHelperSvc.h
"
17
#include "
MuonRecHelperTools/MuonEDMPrinterTool.h
"
18
#include "
TrkMeasurementBase/MeasurementBase.h
"
19
20
namespace
Muon
{
21
22
struct
MuonCandidate
;
23
24
class
SortMeas
{
25
public
:
26
bool
operator()
(
const
Trk::MeasurementBase
* mst1,
const
Trk::MeasurementBase
* mst2)
const
{
27
if
(
isEndcap
) {
28
return
std::abs(mst1->
globalPosition
().z()) < std::abs(mst2->
globalPosition
().z());
29
}
else
{
30
Identifier
id1 =
m_edmHelperSvc
->getIdentifier(*mst1);
31
Identifier
id2 =
m_edmHelperSvc
->getIdentifier(*mst2);
32
// for pseudomeasurements
33
if
(!id1.
is_valid
() || !id2.
is_valid
())
34
return
std::abs(mst1->
globalPosition
().perp()) < std::abs(mst2->
globalPosition
().perp());
35
// use r value if both are mdts or if they belong to different chambers
36
// for the case where it's rpc and mdt from the same chamber, use the doublet R
37
if
((
m_idHelperSvc
->isMdt(id1) &&
m_idHelperSvc
->isMdt(id2)) ||
38
m_idHelperSvc
->chamberIndex(id1) !=
m_idHelperSvc
->chamberIndex(id2))
39
return
mst1->
globalPosition
().perp() < mst2->
globalPosition
().perp();
40
else
if
(
m_idHelperSvc
->isRpc(id1) &&
m_idHelperSvc
->isMdt(id2)) {
41
if
(
m_idHelperSvc
->rpcIdHelper().doubletR(id1) == 1) {
42
if
(
m_idHelperSvc
->stationIndex(id2) == MuonStationIndex::StIndex::BM ||
m_idHelperSvc
->isSmallChamber(id2))
43
return
true
;
44
else
45
return
false
;
46
}
else
47
return
false
;
48
}
else
if
(
m_idHelperSvc
->isRpc(id2) &&
m_idHelperSvc
->isMdt(id1)) {
49
if
(
m_idHelperSvc
->rpcIdHelper().doubletR(id2) == 1) {
50
if
(
m_idHelperSvc
->stationIndex(id1) == MuonStationIndex::StIndex::BM ||
m_idHelperSvc
->isSmallChamber(id1))
51
return
false
;
52
else
53
return
true
;
54
}
else
55
return
true
;
56
}
else
{
57
if
(
m_idHelperSvc
->rpcIdHelper().doubletR(id1) !=
m_idHelperSvc
->rpcIdHelper().doubletR(id2)) {
58
return
m_idHelperSvc
->rpcIdHelper().doubletR(id1) <
m_idHelperSvc
->rpcIdHelper().doubletR(id2);
59
}
else
if
(
m_idHelperSvc
->rpcIdHelper().doubletZ(id1) !=
m_idHelperSvc
->rpcIdHelper().doubletZ(id2)) {
60
return
m_idHelperSvc
->rpcIdHelper().doubletZ(id1) <
m_idHelperSvc
->rpcIdHelper().doubletZ(id2);
61
}
else
if
(
m_idHelperSvc
->rpcIdHelper().doubletPhi(id1) !=
m_idHelperSvc
->rpcIdHelper().doubletPhi(id2)) {
62
return
m_idHelperSvc
->rpcIdHelper().doubletPhi(id1) <
m_idHelperSvc
->rpcIdHelper().doubletPhi(id2);
63
}
else
64
return
mst1->
globalPosition
().perp() < mst2->
globalPosition
().perp();
65
}
66
}
67
}
68
SortMeas
(
const
IMuonEDMHelperSvc
*
h
,
const
IMuonIdHelperSvc
* idh,
bool
end) :
69
m_edmHelperSvc
(
h
),
m_idHelperSvc
(idh),
isEndcap
(end) {}
70
71
const
IMuonEDMHelperSvc
*
m_edmHelperSvc
;
72
const
IMuonIdHelperSvc
*
m_idHelperSvc
;
73
bool
isEndcap
;
74
};
75
76
class
MuonCandidateTrackBuilderTool
:
virtual
public
IMuonCandidateTrackBuilderTool
,
public
AthAlgTool
{
77
public
:
79
MuonCandidateTrackBuilderTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent);
80
virtual
~MuonCandidateTrackBuilderTool
() =
default
;
81
virtual
StatusCode
initialize
()
override
;
82
84
virtual
std::unique_ptr<Trk::Track>
buildCombinedTrack
(
const
EventContext& ctx,
const
Trk::Track
& idTrack,
85
const
MuonCandidate
& candidate)
const override
;
86
87
private
:
88
PublicToolHandle<MuonEDMPrinterTool>
m_printer
{
this
,
"MuonEDMPrinterTool"
,
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"
};
89
ServiceHandle<Muon::IMuonIdHelperSvc>
m_idHelperSvc
{
this
,
"MuonIdHelperSvc"
,
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"
};
90
ServiceHandle<IMuonEDMHelperSvc>
m_edmHelperSvc
{
this
,
"edmHelper"
,
"Muon::MuonEDMHelperSvc/MuonEDMHelperSvc"
,
91
"Handle to the service providing the IMuonEDMHelperSvc interface"
};
92
ToolHandle<Rec::ICombinedMuonTrackBuilder>
m_trackFitter
{
this
,
"MuonTrackBuilder"
,
93
"Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"
};
94
95
Gaudi::Property<bool>
m_reOrderMeasurements
{
this
,
"ReOrderMeasurements"
,
true
};
96
};
97
}
// namespace Muon
98
99
#endif
AthAlgTool.h
ICombinedMuonTrackBuilder.h
IMuonCandidateTrackBuilderTool.h
IMuonEDMHelperSvc.h
IMuonIdHelperSvc.h
MeasurementBase.h
MuonEDMPrinterTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
h
Header file for AthHistogramAlgorithm.
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
Muon::IMuonCandidateTrackBuilderTool
Interface for a tool to build tracks out of a MuonCandidate.
Definition
IMuonCandidateTrackBuilderTool.h:18
Muon::IMuonEDMHelperSvc
Helper tool containing functionality needed by multiple tools.
Definition
IMuonEDMHelperSvc.h:33
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition
IMuonIdHelperSvc.h:27
Muon::MuonCandidateTrackBuilderTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition
MuonCandidateTrackBuilderTool.h:90
Muon::MuonCandidateTrackBuilderTool::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition
MuonCandidateTrackBuilderTool.h:88
Muon::MuonCandidateTrackBuilderTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MuonCandidateTrackBuilderTool.h:89
Muon::MuonCandidateTrackBuilderTool::m_trackFitter
ToolHandle< Rec::ICombinedMuonTrackBuilder > m_trackFitter
Definition
MuonCandidateTrackBuilderTool.h:92
Muon::MuonCandidateTrackBuilderTool::~MuonCandidateTrackBuilderTool
virtual ~MuonCandidateTrackBuilderTool()=default
Muon::MuonCandidateTrackBuilderTool::m_reOrderMeasurements
Gaudi::Property< bool > m_reOrderMeasurements
Definition
MuonCandidateTrackBuilderTool.h:95
Muon::MuonCandidateTrackBuilderTool::initialize
virtual StatusCode initialize() override
Definition
MuonCandidateTrackBuilderTool.cxx:21
Muon::MuonCandidateTrackBuilderTool::MuonCandidateTrackBuilderTool
MuonCandidateTrackBuilderTool(const std::string &type, const std::string &name, const IInterface *parent)
Default AlgTool functions.
Definition
MuonCandidateTrackBuilderTool.cxx:15
Muon::MuonCandidateTrackBuilderTool::buildCombinedTrack
virtual std::unique_ptr< Trk::Track > buildCombinedTrack(const EventContext &ctx, const Trk::Track &idTrack, const MuonCandidate &candidate) const override
IMuonCandidateTrackBuilderTool interface: buildCombinedTrack.
Definition
MuonCandidateTrackBuilderTool.cxx:29
Muon::SortMeas::SortMeas
SortMeas(const IMuonEDMHelperSvc *h, const IMuonIdHelperSvc *idh, bool end)
Definition
MuonCandidateTrackBuilderTool.h:68
Muon::SortMeas::operator()
bool operator()(const Trk::MeasurementBase *mst1, const Trk::MeasurementBase *mst2) const
Definition
MuonCandidateTrackBuilderTool.h:26
Muon::SortMeas::isEndcap
bool isEndcap
Definition
MuonCandidateTrackBuilderTool.h:73
Muon::SortMeas::m_edmHelperSvc
const IMuonEDMHelperSvc * m_edmHelperSvc
Definition
MuonCandidateTrackBuilderTool.h:71
Muon::SortMeas::m_idHelperSvc
const IMuonIdHelperSvc * m_idHelperSvc
Definition
MuonCandidateTrackBuilderTool.h:72
ServiceHandle
Definition
ClusterMakerTool.h:36
Trk::MeasurementBase
This class is the pure abstract base class for all fittable tracking measurements.
Definition
MeasurementBase.h:58
Trk::MeasurementBase::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.
Trk::Track
The ATLAS Track class.
Definition
Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
type
Muon::MuonCandidate
Definition
MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonLayerEvent/MuonLayerEvent/MuonCandidate.h:14
Generated on
for ATLAS Offline Software by
1.17.0