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

#include <AlignmentBarrelLUT.h>

Inheritance diagram for TrigL2MuonSA::AlignmentBarrelLUT:
Collaboration diagram for TrigL2MuonSA::AlignmentBarrelLUT:

Public Member Functions

 AlignmentBarrelLUT (const std::string &type, const std::string &name, const IInterface *parent)
StatusCode readLUT (const std::string &lut_fileName)
double GetDeltaZ (int &saddress, double &etaMap, double &phiMap, double &MFphi, float &sp1R) const
std::pair< int, int > GetBinNumber (int saddress, int innerR, double etaMap, double phiMap) 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

double m_dZ [s_saddress][s_innerR][s_eta][s_phi][s_etaQ] {}
int m_NbinEta [s_saddress][s_innerR] {}
float m_EtaMin [s_saddress][s_innerR] {}
float m_EtaMax [s_saddress][s_innerR] {}
float m_EtaStep [s_saddress][s_innerR] {}
int m_NbinPhi [s_saddress][s_innerR] {}
float m_PhiMin [s_saddress][s_innerR] {}
float m_PhiMax [s_saddress][s_innerR] {}
float m_PhiStep [s_saddress][s_innerR] {}
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

Static Private Attributes

static constexpr int s_saddress = 4
static constexpr int s_innerR = 2
static constexpr int s_eta = 15
static constexpr int s_phi = 30
static constexpr int s_etaQ = 2

Detailed Description

Definition at line 15 of file AlignmentBarrelLUT.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

◆ AlignmentBarrelLUT()

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

Definition at line 13 of file AlignmentBarrelLUT.cxx.

15 :
16 AthAlgTool(type, name, parent)
17{
18}
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

◆ GetBinNumber()

std::pair< int, int > TrigL2MuonSA::AlignmentBarrelLUT::GetBinNumber ( int saddress,
int innerR,
double etaMap,
double phiMap ) const

Definition at line 142 of file AlignmentBarrelLUT.cxx.

143{
144
145 if(saddress > 3 || saddress < 0 || innerR < 0 || innerR > 1) return std::make_pair(-5,-5);
146
147 int etaBin = (int)((etaMap - m_EtaMin[saddress][innerR])/m_EtaStep[saddress][innerR]);
148 int phiBin = (int)((phiMap - m_PhiMin[saddress][innerR])/m_PhiStep[saddress][innerR]);
149
150 if(etaBin <= -1) etaBin = 0;
151 if(etaBin >= m_NbinEta[saddress][innerR]) etaBin = m_NbinEta[saddress][innerR] - 1;
152
153 if(phiBin <= -1) phiBin = 0;
154 if(phiBin >= m_NbinPhi[saddress][innerR]) phiBin = m_NbinPhi[saddress][innerR] - 1;
155
156 return std::make_pair(etaBin,phiBin);
157}
float m_PhiMin[s_saddress][s_innerR]
float m_PhiStep[s_saddress][s_innerR]
int m_NbinEta[s_saddress][s_innerR]
float m_EtaMin[s_saddress][s_innerR]
int m_NbinPhi[s_saddress][s_innerR]
float m_EtaStep[s_saddress][s_innerR]
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin

◆ GetDeltaZ()

double TrigL2MuonSA::AlignmentBarrelLUT::GetDeltaZ ( int & saddress,
double & etaMap,
double & phiMap,
double & MFphi,
float & sp1R ) const

Definition at line 89 of file AlignmentBarrelLUT.cxx.

94{
95 if (saddress == 1) {
96
97 int innerR = (sp1R > 5800)? 1: 0;
98
99 std::pair<int, int> bins = GetBinNumber(saddress, innerR, etaMap, phiMap);
100 int iEta = bins.first;
101 int iPhi = bins.second;
102
103 int iChamber=( std::abs(MFphi)>90*TMath::DegToRad() ) ? 1:0;
104
105 int iEta_inv=29-iEta;
106 int iPhi_inv=29-iPhi;
107
108 int iEta_bin=iEta;
109 int iPhi_bin=iPhi;
110
111 if( iEta<15 ){
112 if( iChamber == 0 ){
113 //do nothing
114 }else{
115 iPhi_bin=iPhi_inv;
116 }
117 }else{
118 if( iChamber == 0 ){
119 iEta_bin=iEta_inv;
120 }else{
121 iEta_bin=iEta_inv;
122 iPhi_bin=iPhi_inv;
123 }
124 }
125
126 int sign_etam=(iEta>14)?-1:1;
127 int sign_etap=-sign_etam;
128
129 return (m_dZ[saddress][innerR][iEta_bin][iPhi_bin][0]*sign_etam
130 + m_dZ[saddress][innerR][iEta_bin][iPhi_bin][1]*sign_etap) / 2.;
131
132 } else {
133 ATH_MSG_INFO("Barrel alignment is implemented only for Large-SP");
134 return 0;
135 }
136
137}
#define ATH_MSG_INFO(x)
static const std::vector< std::string > bins
std::pair< int, int > GetBinNumber(int saddress, int innerR, double etaMap, double phiMap) const
double m_dZ[s_saddress][s_innerR][s_eta][s_phi][s_etaQ]
@ iPhi
Definition ParamDefs.h:47
setScale setgFexType iEta

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

◆ readLUT()

StatusCode TrigL2MuonSA::AlignmentBarrelLUT::readLUT ( const std::string & lut_fileName)

Definition at line 23 of file AlignmentBarrelLUT.cxx.

24{
25
26 int saddress, innerR;
27 int N0, N1, N2;
28 double A0, A1, A2;
29 std::ifstream file;
30
31
32 for(int i_saddress=0; i_saddress<s_saddress; i_saddress++) {
33 for(int i_innerR=0; i_innerR<s_innerR; i_innerR++) {
34 m_NbinEta[i_saddress][i_innerR]=0;
35 m_EtaMin[i_saddress][i_innerR]=0;
36 m_EtaMax[i_saddress][i_innerR]=0;
37 m_EtaStep[i_saddress][i_innerR]=0;
38 m_NbinPhi[i_saddress][i_innerR]=0;
39 m_PhiMin[i_saddress][i_innerR]=0;
40 m_PhiMax[i_saddress][i_innerR]=0;
41 m_PhiStep[i_saddress][i_innerR]=0;
42
43 for(int i_eta=0; i_eta<s_eta; i_eta++) {
44 for(int i_phi=0; i_phi<s_phi; i_phi++) {
45 for(int i_etaQ=0; i_etaQ<s_etaQ; i_etaQ++) {
46 m_dZ[i_saddress][i_innerR][i_eta][i_phi][i_etaQ] = 0;
47 }
48 }
49 }
50 }
51 }
52
53 file.open(lut_fileName.c_str());
54 if (!file) {
55 ATH_MSG_INFO("Failed to open barrel alignment LUT file");
56 return StatusCode::FAILURE;
57 }
58
59 for(int i_lut=0; i_lut<2; i_lut++) {
60
61 file >> saddress >> innerR;
62 file >> m_EtaMin[saddress][innerR] >> m_EtaMax[saddress][innerR]
63 >> m_PhiMin[saddress][innerR] >> m_PhiMax[saddress][innerR]
64 >> m_NbinEta[saddress][innerR] >> m_NbinPhi[saddress][innerR];
65
66 m_EtaStep[saddress][innerR] = (m_EtaMax[saddress][innerR] - m_EtaMin[saddress][innerR]) / (float)m_NbinEta[saddress][innerR];
67 m_PhiStep[saddress][innerR] = (m_PhiMax[saddress][innerR] - m_PhiMin[saddress][innerR]) / (float)m_NbinPhi[saddress][innerR];
68
69 for (int i_eta=0; i_eta<s_eta; i_eta++) {
70 for (int i_phi=0; i_phi<s_phi; i_phi++) {
71 for (int i_etaQ=0; i_etaQ<s_etaQ; i_etaQ++) {
72
73 file >> N0 >> N1 >> N2 >> A0 >> A1 >> A2;
74
75 m_dZ[saddress][innerR][i_eta][i_phi][i_etaQ] = A0;
76
77 } // etaQ loop
78 } // phi loop
79 } // eta loop
80 } // nlut loop
81
82 file.close();
83 return StatusCode::SUCCESS;
84}
float m_EtaMax[s_saddress][s_innerR]
float m_PhiMax[s_saddress][s_innerR]
TFile * file

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

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

double TrigL2MuonSA::AlignmentBarrelLUT::m_dZ[s_saddress][s_innerR][s_eta][s_phi][s_etaQ] {}
private

Definition at line 38 of file AlignmentBarrelLUT.h.

38{};

◆ m_EtaMax

float TrigL2MuonSA::AlignmentBarrelLUT::m_EtaMax[s_saddress][s_innerR] {}
private

Definition at line 42 of file AlignmentBarrelLUT.h.

42{};

◆ m_EtaMin

float TrigL2MuonSA::AlignmentBarrelLUT::m_EtaMin[s_saddress][s_innerR] {}
private

Definition at line 41 of file AlignmentBarrelLUT.h.

41{};

◆ m_EtaStep

float TrigL2MuonSA::AlignmentBarrelLUT::m_EtaStep[s_saddress][s_innerR] {}
private

Definition at line 43 of file AlignmentBarrelLUT.h.

43{};

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

int TrigL2MuonSA::AlignmentBarrelLUT::m_NbinEta[s_saddress][s_innerR] {}
private

Definition at line 40 of file AlignmentBarrelLUT.h.

40{};

◆ m_NbinPhi

int TrigL2MuonSA::AlignmentBarrelLUT::m_NbinPhi[s_saddress][s_innerR] {}
private

Definition at line 44 of file AlignmentBarrelLUT.h.

44{};

◆ m_PhiMax

float TrigL2MuonSA::AlignmentBarrelLUT::m_PhiMax[s_saddress][s_innerR] {}
private

Definition at line 46 of file AlignmentBarrelLUT.h.

46{};

◆ m_PhiMin

float TrigL2MuonSA::AlignmentBarrelLUT::m_PhiMin[s_saddress][s_innerR] {}
private

Definition at line 45 of file AlignmentBarrelLUT.h.

45{};

◆ m_PhiStep

float TrigL2MuonSA::AlignmentBarrelLUT::m_PhiStep[s_saddress][s_innerR] {}
private

Definition at line 47 of file AlignmentBarrelLUT.h.

47{};

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

◆ s_eta

int TrigL2MuonSA::AlignmentBarrelLUT::s_eta = 15
staticconstexprprivate

Definition at line 34 of file AlignmentBarrelLUT.h.

◆ s_etaQ

int TrigL2MuonSA::AlignmentBarrelLUT::s_etaQ = 2
staticconstexprprivate

Definition at line 36 of file AlignmentBarrelLUT.h.

◆ s_innerR

int TrigL2MuonSA::AlignmentBarrelLUT::s_innerR = 2
staticconstexprprivate

Definition at line 33 of file AlignmentBarrelLUT.h.

◆ s_phi

int TrigL2MuonSA::AlignmentBarrelLUT::s_phi = 30
staticconstexprprivate

Definition at line 35 of file AlignmentBarrelLUT.h.

◆ s_saddress

int TrigL2MuonSA::AlignmentBarrelLUT::s_saddress = 4
staticconstexprprivate

Definition at line 32 of file AlignmentBarrelLUT.h.


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