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

#include <PtFromRadius.h>

Inheritance diagram for TrigL2MuonSA::PtFromRadius:
Collaboration diagram for TrigL2MuonSA::PtFromRadius:

Public Member Functions

 PtFromRadius (const std::string &type, const std::string &name, const IInterface *parent)
void setMCFlag (bool m_use_mcLUT, const TrigL2MuonSA::PtBarrelLUTSvc *ptBarrelLUTSvc)
StatusCode setPt (TrigL2MuonSA::TrackPattern &trackPattern) 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

bool m_use_mcLUT {false}
const ToolHandle< PtBarrelLUT > * m_ptBarrelLUT {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 PtFromRadius.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

◆ PtFromRadius()

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

Definition at line 14 of file PtFromRadius.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

◆ 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 }

◆ setMCFlag()

void TrigL2MuonSA::PtFromRadius::setMCFlag ( bool m_use_mcLUT,
const TrigL2MuonSA::PtBarrelLUTSvc * ptBarrelLUTSvc )

Definition at line 24 of file PtFromRadius.cxx.

26{
27 m_use_mcLUT = use_mcLUT;
28 m_ptBarrelLUT = ptBarrelLUTSvc->ptBarrelLUT();
29}
const ToolHandle< PtBarrelLUT > * ptBarrelLUT(void) const
const ToolHandle< PtBarrelLUT > * m_ptBarrelLUT

◆ setPt()

StatusCode TrigL2MuonSA::PtFromRadius::setPt ( TrigL2MuonSA::TrackPattern & trackPattern) const

Definition at line 34 of file PtFromRadius.cxx.

35{
36 const double ZERO_LIMIT = 1e-5;
37 const PtBarrelLUT::LUT& lut = (*m_ptBarrelLUT)->lut();
38 const PtBarrelLUT::LUTsp& lutSP = (*m_ptBarrelLUT)->lutSP();
39
40 TrigL2MuonSA::SuperPoint* superPoints[3];
41 for (int i_station=0; i_station<3; i_station++) {
42 superPoints[i_station] = &(trackPattern.superPoints[i_station]);
43 }
44
45 int etabin,phibin,neweta,newphi,ch,add;
46 float phistep,etastep,pstep,dist,distp,disteta,distphi;
47 float A0[6]={0.,0.,0.,0.,0.,0.},A1[6]={0.,0.,0.,0.,0.,0.};
48
49 const float scale = 0.1;
50
51 if(trackPattern.barrelRadius > ZERO_LIMIT) {
52 add = trackPattern.s_address;
53 etabin = (int)((trackPattern.etaMap - lut.EtaMin[add])/lut.EtaStep[add]);
54 phibin = (int)((trackPattern.phiMap - lut.PhiMin[add])/lut.PhiStep[add]);
55
56 if(etabin<=-1) etabin = 0;
57 if(etabin>=lut.NbinEta[add]) etabin = lut.NbinEta[add]-1;
58 if(phibin<=-1) phibin = 0;
59 if(phibin>=lut.NbinPhi[add]) phibin = lut.NbinPhi[add]-1;
60
61 trackPattern.etaBin = etabin;
62 trackPattern.phiBin = phibin;
63
64 disteta = trackPattern.etaMap - (etabin*lut.EtaStep[add] +
65 lut.EtaStep[add]/2. + lut.EtaMin[add]);
66 distphi = trackPattern.phiMap - (phibin*lut.PhiStep[add] +
67 lut.PhiStep[add]/2. + lut.PhiMin[add]);
68 neweta = (disteta >= 0.) ? etabin+1 : etabin-1;
69 newphi = (distphi >= 0.) ? phibin+1 : phibin-1;
70 etastep = (disteta >= 0.) ? lut.EtaStep[add] : -lut.EtaStep[add];
71 phistep = (distphi >= 0.) ? lut.PhiStep[add] : -lut.PhiStep[add];
72
73 ch = (trackPattern.charge>=0.)? 1 : 0;
74
75 if( add==1 ) {
76 // Use special table for Large-SP data
77
78 int iR = ( superPoints[0]->R > 5800 )? 1: 0;
79 int qeta = ( trackPattern.charge*trackPattern.etaMap >= 0.)? 1 : 0;
80
81 A0[0] = lutSP.table_LargeSP[qeta][iR][etabin][phibin][0];
82 A1[0] = lutSP.table_LargeSP[qeta][iR][etabin][phibin][1];
83
84 trackPattern.pt = trackPattern.barrelRadius*A0[0] + A1[0];
85
86 } else {
87
88 A0[0] = lut.table[add][ch][etabin][phibin][0];
89 A1[0] = lut.table[add][ch][etabin][phibin][1];
90 if((neweta<0||neweta>=lut.NbinEta[add])&&
91 (newphi<0||newphi>=lut.NbinPhi[add])) {
92 trackPattern.pt = trackPattern.barrelRadius*scale*A0[0] + A1[0];
93 } else if (neweta<0||neweta>=lut.NbinEta[add]) {
94 A0[1] = lut.table[add][ch][etabin][newphi][0];
95 A1[1] = lut.table[add][ch][etabin][newphi][1];
96 A0[2] = A0[0] + ((A0[1] - A0[0])/phistep)*distphi;
97 A1[2] = A1[0] + ((A1[1] - A1[0])/phistep)*distphi;
98 trackPattern.pt = trackPattern.barrelRadius*scale*A0[2] + A1[2];
99 } else if (newphi<0||newphi>=lut.NbinPhi[add]) {
100 A0[1] = lut.table[add][ch][neweta][phibin][0];
101 A1[1] = lut.table[add][ch][neweta][phibin][1];
102 A0[2] = A0[0] + ((A0[1] - A0[0])/etastep)*disteta;
103 A1[2] = A1[0] + ((A1[1] - A1[0])/etastep)*disteta;
104 trackPattern.pt = trackPattern.barrelRadius*scale*A0[2] + A1[2];
105 } else {
106 if(disteta >= distphi*lut.EtaStep[add]/lut.PhiStep[add]) {
107 A0[1] = lut.table[add][ch][neweta][phibin][0];
108 A1[1] = lut.table[add][ch][neweta][phibin][1];
109 A0[2] = lut.table[add][ch][neweta][newphi][0];
110 A1[2] = lut.table[add][ch][neweta][newphi][1];
111 A0[3] = A0[0] + ((A0[1] - A0[0])/etastep)*disteta;
112 A1[3] = A1[0] + ((A1[1] - A1[0])/etastep)*disteta;
113 dist = std::sqrt(phistep*phistep + etastep*etastep);
114 distp = std::sqrt(disteta*disteta + distphi*distphi);
115 A0[4] = A0[0] + ((A0[2] - A0[0])/dist)*distp;
116 A1[4] = A1[0] + ((A1[2] - A1[0])/dist)*distp;
117 pstep = (phistep/dist)*distp;
118 A0[5] = A0[3] + ((A0[4] - A0[3])/pstep)*distphi;
119 A1[5] = A1[3] + ((A1[4] - A1[3])/pstep)*distphi;
120 trackPattern.pt = trackPattern.barrelRadius*scale*A0[5] + A1[5];
121 } else {
122 A0[1] = lut.table[add][ch][etabin][newphi][0];
123 A1[1] = lut.table[add][ch][etabin][newphi][1];
124 A0[2] = lut.table[add][ch][neweta][newphi][0];
125 A1[2] = lut.table[add][ch][neweta][newphi][1];
126 A0[3] = A0[0] + ((A0[1] - A0[0])/phistep)*distphi;
127 A1[3] = A1[0] + ((A1[1] - A1[0])/phistep)*distphi;
128 dist = std::sqrt(phistep*phistep + etastep*etastep);
129 distp = std::sqrt(disteta*disteta + distphi*distphi);
130 A0[4] = A0[0] + ((A0[2] - A0[0])/dist)*distp;
131 A1[4] = A1[0] + ((A1[2] - A1[0])/dist)*distp;
132 pstep = (etastep/dist)*distp;
133 A0[5] = A0[3] + ((A0[4] - A0[3])/pstep)*disteta;
134 A1[5] = A1[3] + ((A1[4] - A1[3])/pstep)*disteta;
135 trackPattern.pt = trackPattern.barrelRadius*scale*A0[5] + A1[5];
136 }
137 }
138 }
139 }
140
141 ATH_MSG_DEBUG("pT determined from radius: barrelRadius/barrelSagitta/pT/charge/s_address="
142 << trackPattern.barrelRadius << "/" << trackPattern.barrelSagitta << "/"
143 << trackPattern.pt << "/" << trackPattern.charge << "/" << trackPattern.s_address);
144
145
146 return StatusCode::SUCCESS;
147}
#define ATH_MSG_DEBUG(x)
const float ZERO_LIMIT
TrigL2MuonSA::SuperPoint superPoints[s_NCHAMBER]
Definition TrackData.h:60
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
constexpr auto lut(Generator &&f)

◆ 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_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_ptBarrelLUT

const ToolHandle<PtBarrelLUT>* TrigL2MuonSA::PtFromRadius::m_ptBarrelLUT {nullptr}
private

Definition at line 37 of file PtFromRadius.h.

37{nullptr};

◆ m_use_mcLUT

bool TrigL2MuonSA::PtFromRadius::m_use_mcLUT {false}
private

Definition at line 35 of file PtFromRadius.h.

35{false};

◆ 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: