ATLAS Offline Software
Loading...
Searching...
No Matches
TrigL2MuonSA::MuFastTrackExtrapolator Class Reference

#include <MuFastTrackExtrapolator.h>

Inheritance diagram for TrigL2MuonSA::MuFastTrackExtrapolator:
Collaboration diagram for TrigL2MuonSA::MuFastTrackExtrapolator:

Public Member Functions

 MuFastTrackExtrapolator (const std::string &type, const std::string &name, const IInterface *parent)
void setExtrapolatorTool (ToolHandle< ITrigMuonBackExtrapolator > *backExtrapolator)
StatusCode extrapolateTrack (std::vector< TrigL2MuonSA::TrackPattern > &v_trackPatterns, double winPt) const
double getMuFastRes (const double pt, const int add, const double eta, const double phi) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const ToolHandle< ITrigMuonBackExtrapolator > * m_backExtrapolatorTool {nullptr}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 18 of file MuFastTrackExtrapolator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuFastTrackExtrapolator()

TrigL2MuonSA::MuFastTrackExtrapolator::MuFastTrackExtrapolator ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 14 of file MuFastTrackExtrapolator.cxx.

16 :
17 AthAlgTool(type,name,parent)
18{
19}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extrapolateTrack()

StatusCode TrigL2MuonSA::MuFastTrackExtrapolator::extrapolateTrack ( std::vector< TrigL2MuonSA::TrackPattern > & v_trackPatterns,
double winPt ) const

Definition at line 24 of file MuFastTrackExtrapolator.cxx.

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:
34 xAOD::L2MuonParameters::Chamber::BarrelInner;
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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
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
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.
::StatusCode StatusCode
StatusCode definition for legacy code.
Chamber
Define chamber types and locations.
@ BarrelInner
Inner station in the barrel spectrometer.
@ EndcapInner
Inner station in the endcap spectrometer.
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.

◆ getMuFastRes()

double TrigL2MuonSA::MuFastTrackExtrapolator::getMuFastRes ( const double pt,
const int add,
const double eta,
const double phi ) const

Definition at line 89 of file MuFastTrackExtrapolator.cxx.

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}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
constexpr int pow(int base, int exp) noexcept
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
ECRegions whichECRegion(const float eta, const float phi)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setExtrapolatorTool()

void TrigL2MuonSA::MuFastTrackExtrapolator::setExtrapolatorTool ( ToolHandle< ITrigMuonBackExtrapolator > * backExtrapolator)
inline

Definition at line 25 of file MuFastTrackExtrapolator.h.

25{m_backExtrapolatorTool = backExtrapolator;};

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_backExtrapolatorTool

const ToolHandle<ITrigMuonBackExtrapolator>* TrigL2MuonSA::MuFastTrackExtrapolator::m_backExtrapolatorTool {nullptr}
private

Definition at line 33 of file MuFastTrackExtrapolator.h.

33{nullptr};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: