ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigL2MuonSA
src
MuFastTrackFitter.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuFastTrackFitter.h
"
6
7
#include "
AthenaBaseComps/AthMsgStreamMacros.h
"
8
9
// --------------------------------------------------------------------------------
10
// --------------------------------------------------------------------------------
11
12
TrigL2MuonSA::MuFastTrackFitter::MuFastTrackFitter
(
const
std::string&
type
,
13
const
std::string& name,
14
const
IInterface* parent):
15
AthAlgTool
(
type
,name,parent)
16
{
17
}
18
19
// --------------------------------------------------------------------------------
20
// --------------------------------------------------------------------------------
21
22
StatusCode
TrigL2MuonSA::MuFastTrackFitter::initialize
()
23
{
24
25
ATH_CHECK
(
m_sagittaRadiusEstimate
.retrieve() );
26
ATH_CHECK
(
m_alphaBetaEstimate
.retrieve() );
27
ATH_CHECK
(
m_ptFromRadius
.retrieve() );
28
ATH_CHECK
(
m_ptFromAlphaBeta
.retrieve() );
29
30
return
StatusCode::SUCCESS;
31
}
32
33
// --------------------------------------------------------------------------------
34
// --------------------------------------------------------------------------------
35
36
StatusCode
TrigL2MuonSA::MuFastTrackFitter::setMCFlag
(
bool
use_mcLUT)
37
{
38
m_use_mcLUT
= use_mcLUT;
39
40
if
(
m_use_mcLUT
) {
41
// Barrel
42
const
ServiceHandle<PtBarrelLUTSvc>
ptBarrelLUTSvc(
"PtBarrelLUTSvc_MC"
, name());
43
if
( ptBarrelLUTSvc.retrieve().isFailure() ) {
44
ATH_MSG_ERROR
(
"Could not find PtBarrelLUTSvc"
);
45
return
StatusCode::FAILURE;
46
}
47
// Endcap
48
const
ServiceHandle<PtEndcapLUTSvc>
ptEndcapLUTSvc(
"PtEndcapLUTSvc_MC"
, name());
49
if
( ptEndcapLUTSvc.retrieve().isFailure() ) {
50
ATH_MSG_ERROR
(
"Could not find PtEndcaplLUTSvc"
);
51
return
StatusCode::FAILURE;
52
}
53
54
m_alphaBetaEstimate
->setMCFlag(
m_use_mcLUT
, &*ptEndcapLUTSvc);
55
56
m_ptFromRadius
->setMCFlag(
m_use_mcLUT
, &*ptBarrelLUTSvc);
57
58
m_ptFromAlphaBeta
->setMCFlag(
m_use_mcLUT
, &*ptEndcapLUTSvc);
59
60
}
else
{
61
// Barrel
62
const
ServiceHandle<PtBarrelLUTSvc>
ptBarrelLUTSvc(
"PtBarrelLUTSvc"
, name());
63
if
( ptBarrelLUTSvc.retrieve().isFailure() ) {
64
ATH_MSG_ERROR
(
"Could not find PtBarrelLUTSvc"
);
65
return
StatusCode::FAILURE;
66
}
67
// Endcap
68
const
ServiceHandle<PtEndcapLUTSvc>
ptEndcapLUTSvc(
"PtEndcapLUTSvc"
, name());
69
if
( ptEndcapLUTSvc.retrieve().isFailure() ) {
70
ATH_MSG_ERROR
(
"Could not find PtEndcaplLUTSvc"
);
71
return
StatusCode::FAILURE;
72
}
73
74
m_alphaBetaEstimate
->setMCFlag(
m_use_mcLUT
, &*ptEndcapLUTSvc);
75
76
m_ptFromRadius
->setMCFlag(
m_use_mcLUT
, &*ptBarrelLUTSvc);
77
78
m_ptFromAlphaBeta
->setMCFlag(
m_use_mcLUT
, &*ptEndcapLUTSvc);
79
80
}
81
82
const
ServiceHandle<AlignmentBarrelLUTSvc>
alignmentBarrelLUTSvc(
"AlignmentBarrelLUTSvc"
, name());
83
if
( alignmentBarrelLUTSvc.retrieve().isFailure() ) {
84
ATH_MSG_ERROR
(
"Could not find AlignmentBarrelLUTSvc"
);
85
return
StatusCode::FAILURE;
86
}
87
88
// Calculation of sagitta and radius
89
// sc = m_sagittaRadiusEstimate.retrieve();
90
// if ( sc.isFailure() ) {
91
// ATH_MSG_ERROR("Could not retrieve " << m_sagittaRadiusEstimate);
92
// return sc;
93
// }
94
// ATH_MSG_DEBUG("Retrieved service " << m_sagittaRadiusEstimate);
95
96
m_sagittaRadiusEstimate
->setMCFlag(
m_use_mcLUT
, &*alignmentBarrelLUTSvc);
97
98
// Calculation of alpha and beta
99
// sc = m_alphaBetaEstimate.retrieve();
100
// if ( sc.isFailure() ) {
101
// ATH_MSG_ERROR("Could not retrieve " << m_alphaBetaEstimate);
102
// return sc;
103
// }
104
// ATH_MSG_DEBUG("Retrieved service " << m_alphaBetaEstimate);
105
106
107
// conversion: radius -> pT
108
// sc = m_ptFromRadius.retrieve();
109
// if ( sc.isFailure() ) {
110
// ATH_MSG_ERROR("Could not retrieve " << m_ptFromRadius);
111
// return sc;
112
// }
113
// ATH_MSG_DEBUG("Retrieved service " << m_ptFromRadius);
114
115
116
// conversion: alpha, beta -> pT
117
// sc = m_ptFromAlphaBeta.retrieve();
118
// if ( sc.isFailure() ) {
119
// ATH_MSG_ERROR("Could not retrieve " << m_ptFromAlphaBeta);
120
// return sc;
121
// }
122
// ATH_MSG_DEBUG("Retrieved service " << m_ptFromAlphaBeta);
123
124
ATH_MSG_DEBUG
(
"Completed tp set "
<< (
m_use_mcLUT
?
"MC"
:
"not MC"
) <<
" flag"
);
125
126
return
StatusCode::SUCCESS;
127
}
128
129
// --------------------------------------------------------------------------------
130
// --------------------------------------------------------------------------------
131
132
StatusCode
TrigL2MuonSA::MuFastTrackFitter::findTracks
(
const
TrigRoiDescriptor
* p_roids,
133
TrigL2MuonSA::RpcFitResult
& rpcFitResult,
134
std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns)
const
135
{
136
137
for
(
TrigL2MuonSA::TrackPattern
& itTrack : v_trackPatterns) {
138
139
ATH_CHECK
(
m_sagittaRadiusEstimate
->setSagittaRadius(p_roids, rpcFitResult, itTrack) );
140
141
ATH_CHECK
(
m_ptFromRadius
->setPt(itTrack) );
142
143
}
144
145
return
StatusCode::SUCCESS;
146
}
147
148
// --------------------------------------------------------------------------------
149
// --------------------------------------------------------------------------------
150
151
StatusCode
TrigL2MuonSA::MuFastTrackFitter::findTracks
(
const
TrigRoiDescriptor
* p_roids,
152
TrigL2MuonSA::TgcFitResult
& tgcFitResult,
153
std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns,
154
const
TrigL2MuonSA::MuonRoad
& muonRoad)
const
155
{
156
157
for
(
TrigL2MuonSA::TrackPattern
& itTrack : v_trackPatterns) {
158
159
ATH_CHECK
(
m_alphaBetaEstimate
->setAlphaBeta(p_roids, tgcFitResult, itTrack, muonRoad) );
160
161
if
( itTrack.etaBin < -1 ) {
162
itTrack.etaBin = (int)((std::abs(muonRoad.
extFtfMiddleEta
)-1.)/0.05);
// eta binning is the same as AlphaBetaEstimate
163
if
(itTrack.etaBin <= -1) itTrack.etaBin = 0;
164
}
165
166
ATH_CHECK
(
m_ptFromAlphaBeta
->setPt(itTrack,tgcFitResult) );
167
168
}
169
170
return
StatusCode::SUCCESS;
171
}
172
173
// --------------------------------------------------------------------------------
174
// --------------------------------------------------------------------------------
175
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
MuFastTrackFitter.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
ServiceHandle
Definition
ClusterMakerTool.h:36
TrigL2MuonSA::MuFastTrackFitter::m_use_mcLUT
bool m_use_mcLUT
Definition
MuFastTrackFitter.h:57
TrigL2MuonSA::MuFastTrackFitter::m_ptFromRadius
ToolHandle< PtFromRadius > m_ptFromRadius
Definition
MuFastTrackFitter.h:66
TrigL2MuonSA::MuFastTrackFitter::m_sagittaRadiusEstimate
ToolHandle< SagittaRadiusEstimate > m_sagittaRadiusEstimate
Definition
MuFastTrackFitter.h:61
TrigL2MuonSA::MuFastTrackFitter::setMCFlag
StatusCode setMCFlag(bool use_mcLUT)
Definition
MuFastTrackFitter.cxx:36
TrigL2MuonSA::MuFastTrackFitter::m_ptFromAlphaBeta
ToolHandle< PtFromAlphaBeta > m_ptFromAlphaBeta
Definition
MuFastTrackFitter.h:68
TrigL2MuonSA::MuFastTrackFitter::initialize
virtual StatusCode initialize() override
Definition
MuFastTrackFitter.cxx:22
TrigL2MuonSA::MuFastTrackFitter::m_alphaBetaEstimate
ToolHandle< AlphaBetaEstimate > m_alphaBetaEstimate
Definition
MuFastTrackFitter.h:63
TrigL2MuonSA::MuFastTrackFitter::findTracks
StatusCode findTracks(const TrigRoiDescriptor *p_roids, TrigL2MuonSA::RpcFitResult &rpcFitResult, std::vector< TrigL2MuonSA::TrackPattern > &v_trackPatterns) const
Definition
MuFastTrackFitter.cxx:132
TrigL2MuonSA::MuFastTrackFitter::MuFastTrackFitter
MuFastTrackFitter(const std::string &type, const std::string &name, const IInterface *parent)
Definition
MuFastTrackFitter.cxx:12
TrigL2MuonSA::MuonRoad
Definition
MuonRoad.h:20
TrigL2MuonSA::MuonRoad::extFtfMiddleEta
double extFtfMiddleEta
Definition
MuonRoad.h:92
TrigL2MuonSA::RpcFitResult
Definition
RpcFitResult.h:14
TrigL2MuonSA::TgcFitResult
Definition
TgcFitResult.h:11
TrigL2MuonSA::TrackPattern
Definition
TrackData.h:16
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits ifndef XAOD_ANA...
Definition
TrigRoiDescriptor.h:48
type
Generated on
for ATLAS Offline Software by
1.17.0