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

#include <PtFromAlphaBeta.h>

Inheritance diagram for TrigL2MuonSA::PtFromAlphaBeta:
Collaboration diagram for TrigL2MuonSA::PtFromAlphaBeta:

Public Member Functions

 PtFromAlphaBeta (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
void setMCFlag (bool use_mcLUT, const TrigL2MuonSA::PtEndcapLUTSvc *ptEndcapLUTSvc)
StatusCode setPt (TrigL2MuonSA::TrackPattern &trackPattern, TrigL2MuonSA::TgcFitResult &tgcFitResult) const
double compute_radius (double InnerSlope, double InnerR, double InnerZ, double MiddleSlope, double MiddleR, double MiddleZ, double sign)
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

float f (float x, float c0, float c1, float c2, float c3) const
float fp (float x, float c33, float c22, float c1) const
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}
Gaudi::Property< bool > m_use_cscpt
Gaudi::Property< bool > m_avoid_misaligned_cscs
const ToolHandle< PtEndcapLUT > * m_ptEndcapLUT {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 19 of file PtFromAlphaBeta.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

◆ PtFromAlphaBeta()

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

Definition at line 14 of file PtFromAlphaBeta.cxx.

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

Member Function Documentation

◆ compute_radius()

double TrigL2MuonSA::PtFromAlphaBeta::compute_radius ( double InnerSlope,
double InnerR,
double InnerZ,
double MiddleSlope,
double MiddleR,
double MiddleZ,
double sign )

◆ 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

◆ f()

float TrigL2MuonSA::PtFromAlphaBeta::f ( float x,
float c0,
float c1,
float c2,
float c3 ) const
private

◆ fp()

float TrigL2MuonSA::PtFromAlphaBeta::fp ( float x,
float c33,
float c22,
float c1 ) const
private

◆ initialize()

StatusCode TrigL2MuonSA::PtFromAlphaBeta::initialize ( )
overridevirtual

Definition at line 24 of file PtFromAlphaBeta.cxx.

25{
27 //
28 return StatusCode::SUCCESS;
29}
#define ATH_MSG_DEBUG(x)
Gaudi::Property< bool > m_use_cscpt

◆ 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::PtFromAlphaBeta::setMCFlag ( bool use_mcLUT,
const TrigL2MuonSA::PtEndcapLUTSvc * ptEndcapLUTSvc )

Definition at line 34 of file PtFromAlphaBeta.cxx.

36{
37 m_use_mcLUT = use_mcLUT;
38 m_ptEndcapLUT = ptEndcapLUTSvc->ptEndcapLUT();
39}
const ToolHandle< PtEndcapLUT > * ptEndcapLUT(void) const
const ToolHandle< PtEndcapLUT > * m_ptEndcapLUT

◆ setPt()

StatusCode TrigL2MuonSA::PtFromAlphaBeta::setPt ( TrigL2MuonSA::TrackPattern & trackPattern,
TrigL2MuonSA::TgcFitResult & tgcFitResult ) const

Definition at line 44 of file PtFromAlphaBeta.cxx.

46{
47
48 if (trackPattern.etaBin < -1)
49 return StatusCode::SUCCESS;
50
51 const float ZERO_LIMIT = 1e-5;
52
53 // use the TGC PT if the MDT fit is not available
54 if ( std::abs(trackPattern.slope)<ZERO_LIMIT && std::abs(trackPattern.intercept)<ZERO_LIMIT )
55 return StatusCode::SUCCESS;
56
57 const float tgcPt = tgcFitResult.tgcPT ;
58
59 // MDT pT by alpha
60 const int side = (trackPattern.etaMap <= 0.0) ? 0 : 1;
61 const int charge = (trackPattern.intercept * trackPattern.etaMap) < 0.0 ? 0 : 1;
62
63 float mdtPt = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::ALPHAPOL2, trackPattern.etaBin,
64 trackPattern.phiBin, trackPattern.endcapAlpha) / 1000;
65
66 if (charge == 0) mdtPt = -mdtPt;
67 trackPattern.ptEndcapAlpha = mdtPt;//pt calculated by alpha
68 //
69 const float ALPHA_TO_BETA_PT = 10;
70 const float ALPHA_TO_BETA_RATIO = 0.5;
71 const float ALPHA_TO_CSC_RATIO = 0.3;
72 const float ALPHA_TO_CSC_RATIO_PT = 0.025;
73
74 // use MDT beta if condition allows
75 if (std::abs(mdtPt) > ALPHA_TO_BETA_PT && std::abs(trackPattern.endcapBeta)>ZERO_LIMIT) {
76 float betaPt = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::BETAPOL2, trackPattern.etaBin,
77 trackPattern.phiBin, trackPattern.endcapBeta) / 1000;
78
79 if (charge == 0) betaPt = -betaPt;
80 trackPattern.ptEndcapBeta = betaPt;//pt calculated by beta
81
83 if ( std::abs((betaPt - mdtPt) / mdtPt) < ALPHA_TO_BETA_RATIO ) {
84 mdtPt = betaPt;
85 } else if ( std::abs(trackPattern.superPoints[outer].Z) < ZERO_LIMIT) {
86 if( std::abs(betaPt) > std::abs(mdtPt) || (std::abs((tgcPt-mdtPt)/mdtPt) > std::abs((tgcPt-betaPt)/betaPt)) ) mdtPt = betaPt;
87 }
88 }
89 if (trackPattern.endcapRadius3P>0) {//calculate pt from radius
90 ATH_MSG_DEBUG("calculate pt from Radius");
91 const float invR = 1. / trackPattern.endcapRadius3P;
92
93 if (trackPattern.etaBin<8){
94 trackPattern.ptEndcapRadius = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::INVRADIUSPOL2,
95 trackPattern.etaBin, trackPattern.phiBinEE, invR) / 1000;
96 }
97 }
98 if ( std::abs(trackPattern.cscGamma)>ZERO_LIMIT ){
99
100 float cscPt = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::CSCPOL2, trackPattern.etaBin,
101 trackPattern.phiBin, trackPattern.cscGamma) / 1000;
102 if (charge == 0) cscPt = -cscPt;
103 trackPattern.ptCSC = cscPt;
104 }
105 if(mdtPt!=0.0) {
106 trackPattern.pt = std::abs(mdtPt);
107 trackPattern.charge = mdtPt / std::abs(mdtPt);
108 }
109
110 if (trackPattern.ptEndcapRadius>0 && trackPattern.ptEndcapRadius<500)
111 trackPattern.pt = trackPattern.ptEndcapRadius;//use pt calculated from endcap radius
112
113 if(m_use_cscpt){
114 const float &cscPt = trackPattern.ptCSC;
115 const int &etabin = trackPattern.etaBin;
116 const bool validrange = (20<=etabin && etabin<=27) || (etabin==20 && std::abs(side-charge)!=1);//side-charge==0 <=> Qeta==1
117 const bool validchamber = !m_avoid_misaligned_cscs || (16!=trackPattern.hashID_CSC && 17!=trackPattern.hashID_CSC);
118 if( etabin !=23 && etabin!=24 && validrange && validchamber){
119 if(std::abs(trackPattern.ptEndcapBeta)<ZERO_LIMIT && std::abs(cscPt)>ZERO_LIMIT
120 && std::abs((cscPt - mdtPt) / mdtPt)<ALPHA_TO_CSC_RATIO && std::abs(1./cscPt-1./mdtPt)<ALPHA_TO_CSC_RATIO_PT ){
121 trackPattern.pt = std::abs(cscPt);
122 //trackPattern.charge = cscPt/std::abs(cscPt);//not need
123 }
124 }
125 }//use pt calculated from CSC-gamma
126
127
128 bool pTCB = false;
129 if( pTCB ){
130 double Co_APt = 0.;
131 double Co_BPt = 0.;
132
133 double tmpalphaPt = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::ALPHAPOL2, trackPattern.etaBin, trackPattern.phiBin, trackPattern.endcapAlpha) / 1000;
134 trackPattern.ptEndcapAlpha = tmpalphaPt;
135
136 double tmpbetaPt = 0.;
137 if(std::abs(trackPattern.endcapBeta)>ZERO_LIMIT) tmpbetaPt = (*m_ptEndcapLUT)->lookup(side, charge, PtEndcapLUT::BETAPOL2, trackPattern.etaBin, trackPattern.phiBin, trackPattern.endcapBeta) / 1000;
138 trackPattern.ptEndcapBeta = tmpbetaPt;
139
140 double tmp_pt = (*m_ptEndcapLUT)->ptcombined(trackPattern.etaBin, trackPattern.phiBin, tmpalphaPt,tmpbetaPt, Co_APt, Co_BPt);
141
142 float final_pt = 0.;
143 if(std::abs(Co_APt)>ZERO_LIMIT && std::abs(Co_BPt)>ZERO_LIMIT && std::abs(Co_BPt-Co_APt)/std::abs(Co_APt) < 0.5){
144 final_pt = tmp_pt;
145 }else{
146 final_pt = Co_APt;
147 }
148 if(final_pt == 0.)final_pt = tgcPt;
149 }
150
151 ATH_MSG_DEBUG("pT determined from alpha and beta: endcapAlpha/endcapBeta/endcapRadius3P/cscGamma/pT/charge/s_address="
152 << trackPattern.endcapAlpha << "/" << trackPattern.endcapBeta << "/" << trackPattern.endcapRadius3P << "/" << trackPattern.cscGamma << "/"
153 << trackPattern.pt
154 << "/" << trackPattern.charge << "/" << trackPattern.s_address);
155 ATH_MSG_DEBUG("ptEndcapAlpha/ptEndcapBeta/tgcPt/ptEndcapRadius/ptCSC="
156 << trackPattern.ptEndcapAlpha << "/" << trackPattern.ptEndcapBeta << "/"
157 << tgcPt << "/" << trackPattern.ptEndcapRadius << "/" << trackPattern.ptCSC);
158
159 return StatusCode::SUCCESS;
160}
double charge(const T &p)
Definition AtlasPID.h:997
const float ZERO_LIMIT
Gaudi::Property< bool > m_avoid_misaligned_cscs
TrigL2MuonSA::SuperPoint superPoints[s_NCHAMBER]
Definition TrackData.h:60
@ EndcapOuter
Outer station in the endcap spectrometer.
setTeId setLumiBlock setRoiId setRoiSubsystem setRoiNumber setRoiEta tgcPt

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

Gaudi::Property< bool > TrigL2MuonSA::PtFromAlphaBeta::m_avoid_misaligned_cscs
private
Initial value:
{
this, "AvoidMisalignedCSCs", true, "avoid using the 2 new chambers, whose alignment is not completed"}

Definition at line 49 of file PtFromAlphaBeta.h.

49 {
50 this, "AvoidMisalignedCSCs", true, "avoid using the 2 new chambers, whose alignment is not completed"};

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

const ToolHandle<PtEndcapLUT>* TrigL2MuonSA::PtFromAlphaBeta::m_ptEndcapLUT {nullptr}
private

Definition at line 52 of file PtFromAlphaBeta.h.

52{nullptr};

◆ m_use_cscpt

Gaudi::Property< bool > TrigL2MuonSA::PtFromAlphaBeta::m_use_cscpt
private
Initial value:
{
this, "useCscPt", false, ""}

Definition at line 47 of file PtFromAlphaBeta.h.

47 {
48 this, "useCscPt", false, ""};

◆ m_use_mcLUT

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

Definition at line 46 of file PtFromAlphaBeta.h.

46{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: