ATLAS Offline Software
Loading...
Searching...
No Matches
MuFastTrackExtrapolator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
8
10
11// --------------------------------------------------------------------------------
12// --------------------------------------------------------------------------------
13
15 const std::string& name,
16 const IInterface* parent):
17 AthAlgTool(type,name,parent)
18{
19}
20
21// --------------------------------------------------------------------------------
22// --------------------------------------------------------------------------------
23
24StatusCode TrigL2MuonSA::MuFastTrackExtrapolator::extrapolateTrack(std::vector<TrigL2MuonSA::TrackPattern>& v_trackPatterns,
25 double winPt) const
26{
27 ATH_MSG_DEBUG("in extrapolateTrack");
28
29 StatusCode sc = StatusCode::SUCCESS;
30
31 for (TrigL2MuonSA::TrackPattern& track : v_trackPatterns) {
32
33 const int inner = (track.s_address==-1)? xAOD::L2MuonParameters::Chamber::EndcapInner:
35
37 muonSA->makePrivateStore();
38 muonSA->setSAddress(track.s_address);
39 muonSA->setPt(track.pt*track.charge);
40 muonSA->setEtaMS(track.etaMap);
41 muonSA->setPhiMS(track.phiMS);
42 muonSA->setRMS(track.superPoints[inner].R);
43 muonSA->setZMS(track.superPoints[inner].Z);
44
45 double etaVtx = 0.;
46 double phiVtx = 0.;
47 double sigEta = 0.;
48 double sigPhi = 0.;
49
50 const double eptinv = getMuFastRes(track.pt*track.charge, track.s_address, track.etaMap, track.phiMS);
51
53
54 sc = (*m_backExtrapolatorTool)->give_eta_phi_at_vertex(muonSA, etaVtx, sigEta, phiVtx, sigPhi, winPt);
55
56 if (sc.isFailure()) {
57 ATH_MSG_DEBUG ("BackExtrapolator problem: "
58 << "Pt of Muon Feature out of BackExtrapolator range.");
59 ATH_MSG_DEBUG ("Use Muon Feature position to fill the "
60 << "TrigRoiDescriptor for IDSCAN.");
61 etaVtx = track.etaMap;
62 phiVtx = track.phiMS;
63 }
64
65 } else {
66
67 ATH_MSG_ERROR("Null pointer to ITrigMuonBackExtrapolator");
68 return StatusCode::FAILURE;
69
70 }
71
72 track.deltaPt = (eptinv!=0.)? eptinv * track.pt * track.pt: 1.0e10;
73 track.etaVtx = etaVtx;
74 track.phiVtx = phiVtx;
75 track.deltaEtaVtx = sigEta;
76 track.deltaPhiVtx = sigPhi;
77
78 if (muonSA) delete muonSA;
79 }
80 return sc;
81}
82
83// --------------------------------------------------------------------------------
84// --------------------------------------------------------------------------------
85
86// Calculation of error on pT from L2 Muon SA
87// Original author: Stefano Giagu
88// Copied from TrigmuComb/muCombUtil.cxx
90 const double eta, const double phi) const
91{
92
93 if (pt == 0) return 1.0e30;
94
95 double AbsPtInv = std::abs(1./pt);
96 double AbsEta = std::abs(eta);
97
98 if ( add != -1) { // Barrel
99 const int N_PARAMS = 3;
100 // relative resolution terms; vparBR[0]=constant, vparBR[1]=proportional to AbsPt, vparBR[2]=proportional to AbsPtInv
101 const double vparBR1[N_PARAMS] = {0.0495619, 0.00180415, 0.307058}; // for AbsEta < 0.534
102 const double vparBR2[N_PARAMS] = {1., 0., 0.}; // for 0.534 < AbsEta < 0.687
103 const double vparBR3[N_PARAMS] = {0.0370408, 0.00142206, -0.492544}; // for 0.687 < AbsEta < 1.05
104 const double* vpar;
105
106 if ( AbsEta < 0.534) { vpar = vparBR1; }
107 else if( AbsEta < 0.687) { vpar = vparBR2; }
108 else { vpar = vparBR3; }
109
110 double fracRes = sqrt(pow(vpar[0],2) + pow(vpar[1]/AbsPtInv,2) + pow(vpar[2]*AbsPtInv,2));
111 return std::abs(fracRes * AbsPtInv);
112 }
113 else {//Takuya/Kunihiro updated numbers
114
115 const int N_PARAMS = 5;
116 const double vparEC1[N_PARAMS] = {0.291483, -6.11348, 65.1099, -285.664, 440.041};
117 const double vparEC2[N_PARAMS] = {0.286307, -4.6759, 43.2815, -163.185, 210.786};
118 const double vparEC3[N_PARAMS] = {0.330699, -6.70755, 70.4725, -291.85, 408.739};
119 const double vparEC4[N_PARAMS] = {0.261738, -4.69971, 47.4762, -183.98, 236.813};
120 const double vparEC5[N_PARAMS] = {0.196301, -3.57276, 38.3744, -159.808, 228.256};
121 const double vparEC6[N_PARAMS] = {0.172939, -3.10788, 33.3823, -142.996, 212.957};
122 const double vparEC7[N_PARAMS] = {0.233017, -4.377, 42.5691, -171.752, 245.702};
123 const double vparEC8[N_PARAMS] = {0.22389, -4.16259, 40.1369, -162.824, 236.39};
124 const double vparEC9[N_PARAMS] = {0.197992, -3.52117, 33.5997, -136.014, 197.474};
125 const double vparECA[N_PARAMS] = {0.417289, -0.852254,-31.9257, 308.873, -719.591};
126 const double vparECB[N_PARAMS] = {0.526612, -8.04087, 82.1906, -336.87, 462.973};
127
128 const double AbsPtInvMin = 5e-3; // 200 GeV
129 const double AbsPtInvMax = 0.25; // 4 GeV
130 if( AbsPtInv < AbsPtInvMin ) AbsPtInv = AbsPtInvMin;
131 if( AbsPtInv > AbsPtInvMax ) AbsPtInv = AbsPtInvMax;
132
133 const double* vpar;
135 if ( reg == xAOD::L2MuonParameters::ECRegions::WeakBFieldA ) { vpar = vparECA; }
136 else if( reg == xAOD::L2MuonParameters::ECRegions::WeakBFieldB ) { vpar = vparECB; }
137 else {
138 if ( AbsEta < 1.20) { vpar = vparEC1; }
139 else if( AbsEta < 1.35) { vpar = vparEC2; }
140 else if( AbsEta < 1.50) { vpar = vparEC3; }
141 else if( AbsEta < 1.65) { vpar = vparEC4; }
142 else if( AbsEta < 1.80) { vpar = vparEC5; }
143 else if( AbsEta < 1.95) { vpar = vparEC6; }
144 else if( AbsEta < 2.10) { vpar = vparEC7; }
145 else if( AbsEta < 2.35) { vpar = vparEC8; }
146 else { vpar = vparEC9; }
147 }
148
149 double fracRes = vpar[0] + vpar[1]*AbsPtInv
150 + vpar[2]*AbsPtInv*AbsPtInv
151 + vpar[3]*AbsPtInv*AbsPtInv*AbsPtInv
152 + vpar[4]*AbsPtInv*AbsPtInv*AbsPtInv*AbsPtInv;
153
154 return std::abs(fracRes * AbsPtInv);
155 }
156}
157
158// --------------------------------------------------------------------------------
159// --------------------------------------------------------------------------------
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
constexpr int pow(int base, int exp) noexcept
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
void makePrivateStore()
Create a new (empty) private store for this object.
double getMuFastRes(const double pt, const int add, const double eta, const double phi) const
const ToolHandle< ITrigMuonBackExtrapolator > * m_backExtrapolatorTool
StatusCode extrapolateTrack(std::vector< TrigL2MuonSA::TrackPattern > &v_trackPatterns, double winPt) const
MuFastTrackExtrapolator(const std::string &type, const std::string &name, const IInterface *parent)
void setEtaMS(float value)
Set the eta at muon spectrometer.
void setRMS(float value)
Set the R at muon spectrometer.
void setSAddress(int value)
Set the station address of the muon.
void setPhiMS(float value)
Set the phi at muon spectrometer.
void setPt(float pt)
Set the transverse momentum ( ) of the muon.
void setZMS(float value)
Set the Z at muon spectrometer.
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
@ BarrelInner
Inner station in the barrel spectrometer.
@ EndcapInner
Inner station in the endcap spectrometer.
ECRegions whichECRegion(const float eta, const float phi)
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.