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< StoreGateSvc > StoreGateSvc_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 376 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 delete muonSA;
69 return StatusCode::FAILURE;
70
71 }
72
73 track.deltaPt = (eptinv!=0.)? eptinv * track.pt * track.pt: 1.0e10;
74 track.etaVtx = etaVtx;
75 track.phiVtx = phiVtx;
76 track.deltaEtaVtx = sigEta;
77 track.deltaPhiVtx = sigPhi;
78
79 delete muonSA;
80 }
81 return sc;
82}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
static Double_t sc
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 90 of file MuFastTrackExtrapolator.cxx.

92{
93
94 if (pt == 0) return 1.0e30;
95
96 double AbsPtInv = std::abs(1./pt);
97 double AbsEta = std::abs(eta);
98
99 if ( add != -1) { // Barrel
100 const int N_PARAMS = 3;
101 // relative resolution terms; vparBR[0]=constant, vparBR[1]=proportional to AbsPt, vparBR[2]=proportional to AbsPtInv
102 const double vparBR1[N_PARAMS] = {0.0495619, 0.00180415, 0.307058}; // for AbsEta < 0.534
103 const double vparBR2[N_PARAMS] = {1., 0., 0.}; // for 0.534 < AbsEta < 0.687
104 const double vparBR3[N_PARAMS] = {0.0370408, 0.00142206, -0.492544}; // for 0.687 < AbsEta < 1.05
105 const double* vpar;
106
107 if ( AbsEta < 0.534) { vpar = vparBR1; }
108 else if( AbsEta < 0.687) { vpar = vparBR2; }
109 else { vpar = vparBR3; }
110
111 double fracRes = sqrt(pow(vpar[0],2) + pow(vpar[1]/AbsPtInv,2) + pow(vpar[2]*AbsPtInv,2));
112 return std::abs(fracRes * AbsPtInv);
113 }
114 else {//Takuya/Kunihiro updated numbers
115
116 const int N_PARAMS = 5;
117 const double vparEC1[N_PARAMS] = {0.291483, -6.11348, 65.1099, -285.664, 440.041};
118 const double vparEC2[N_PARAMS] = {0.286307, -4.6759, 43.2815, -163.185, 210.786};
119 const double vparEC3[N_PARAMS] = {0.330699, -6.70755, 70.4725, -291.85, 408.739};
120 const double vparEC4[N_PARAMS] = {0.261738, -4.69971, 47.4762, -183.98, 236.813};
121 const double vparEC5[N_PARAMS] = {0.196301, -3.57276, 38.3744, -159.808, 228.256};
122 const double vparEC6[N_PARAMS] = {0.172939, -3.10788, 33.3823, -142.996, 212.957};
123 const double vparEC7[N_PARAMS] = {0.233017, -4.377, 42.5691, -171.752, 245.702};
124 const double vparEC8[N_PARAMS] = {0.22389, -4.16259, 40.1369, -162.824, 236.39};
125 const double vparEC9[N_PARAMS] = {0.197992, -3.52117, 33.5997, -136.014, 197.474};
126 const double vparECA[N_PARAMS] = {0.417289, -0.852254,-31.9257, 308.873, -719.591};
127 const double vparECB[N_PARAMS] = {0.526612, -8.04087, 82.1906, -336.87, 462.973};
128
129 const double AbsPtInvMin = 5e-3; // 200 GeV
130 const double AbsPtInvMax = 0.25; // 4 GeV
131 if( AbsPtInv < AbsPtInvMin ) AbsPtInv = AbsPtInvMin;
132 if( AbsPtInv > AbsPtInvMax ) AbsPtInv = AbsPtInvMax;
133
134 const double* vpar;
136 if ( reg == xAOD::L2MuonParameters::ECRegions::WeakBFieldA ) { vpar = vparECA; }
137 else if( reg == xAOD::L2MuonParameters::ECRegions::WeakBFieldB ) { vpar = vparECB; }
138 else {
139 if ( AbsEta < 1.20) { vpar = vparEC1; }
140 else if( AbsEta < 1.35) { vpar = vparEC2; }
141 else if( AbsEta < 1.50) { vpar = vparEC3; }
142 else if( AbsEta < 1.65) { vpar = vparEC4; }
143 else if( AbsEta < 1.80) { vpar = vparEC5; }
144 else if( AbsEta < 1.95) { vpar = vparEC6; }
145 else if( AbsEta < 2.10) { vpar = vparEC7; }
146 else if( AbsEta < 2.35) { vpar = vparEC8; }
147 else { vpar = vparEC9; }
148 }
149
150 double fracRes = vpar[0] + vpar[1]*AbsPtInv
151 + vpar[2]*AbsPtInv*AbsPtInv
152 + vpar[3]*AbsPtInv*AbsPtInv*AbsPtInv
153 + vpar[4]*AbsPtInv*AbsPtInv*AbsPtInv*AbsPtInv;
154
155 return std::abs(fracRes * AbsPtInv);
156 }
157}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
constexpr int pow(int x)
Definition conifer.h:27
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 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ 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 >, and AthCheckedComponent<::AthAlgTool >.

◆ 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 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
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 381 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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