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

#include <PtBarrelLUT.h>

Inheritance diagram for TrigL2MuonSA::PtBarrelLUT:
Collaboration diagram for TrigL2MuonSA::PtBarrelLUT:

Classes

struct  LUT
struct  LUTsp

Public Member Functions

 PtBarrelLUT (const std::string &type, const std::string &name, const IInterface *parent)
const LUTlut (void) const
const LUTsplutSP (void) const
StatusCode readLUT (const std::string &lut_fileName, const std::string &lutSP_fileName)
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

LUT m_lut {}
LUTsp m_lutSP {}
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 16 of file PtBarrelLUT.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

◆ PtBarrelLUT()

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

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

◆ lut()

const LUT & TrigL2MuonSA::PtBarrelLUT::lut ( void ) const
inline

Definition at line 42 of file PtBarrelLUT.h.

42{ return m_lut; };

◆ lutSP()

const LUTsp & TrigL2MuonSA::PtBarrelLUT::lutSP ( void ) const
inline

Definition at line 43 of file PtBarrelLUT.h.

43{ return m_lutSP; };

◆ 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::PtBarrelLUT::readLUT ( const std::string & lut_fileName,
const std::string & lutSP_fileName )

Definition at line 24 of file PtBarrelLUT.cxx.

26{
27 int charge,chamber;
28 float A0,A1,etamin,etamax,phimin,phimax;
29 std::ifstream file;
30
31 for (int i_saddress=0; i_saddress<4; i_saddress++) {
32 for(int i_charge=0; i_charge<2; i_charge++) {
33 for(int i_eta=0; i_eta<60; i_eta++) {
34 for(int i_phi=0; i_phi<60; i_phi++) {
35 for(int i_parms=0; i_parms<2; i_parms++) {
36 m_lut.table[i_saddress][i_charge][i_eta][i_phi][i_parms] = 0.;
37 }
38 }
39 }
40 }
41 }
42
43 for(int i_innerR=0; i_innerR<2; i_innerR++) {
44 for(int i_charge=0; i_charge<2; i_charge++) {
45 for(int i_eta=0; i_eta<30; i_eta++) {
46 for(int i_phi=0; i_phi<30; i_phi++) {
47 for(int i_parms=0; i_parms<2; i_parms++) {
48 m_lutSP.table_LargeSP[i_innerR][i_charge][i_eta][i_phi][i_parms] = 0;
49 }
50 }
51 }
52 }
53 }
54
55 file.open(lut_fileName.c_str());
56 if(!file) {
57 ATH_MSG_INFO("Failed to open barrel LUT file");
58 return StatusCode::FAILURE;
59 }
60
61 for(int nlut=0;nlut<8;++nlut) {
62 file >> charge >> chamber;
63 file >> etamin >> etamax >> phimin >> phimax
64 >> m_lut.NbinEta[chamber] >> m_lut.NbinPhi[chamber];
65 m_lut.EtaMin[chamber] = etamin;
66 m_lut.EtaMax[chamber] = etamax;
67 m_lut.PhiMin[chamber] = phimin;
68 m_lut.PhiMax[chamber] = phimax;
69 m_lut.PhiStep[chamber] = (phimax-phimin)/m_lut.NbinPhi[chamber];
70 m_lut.EtaStep[chamber] = (etamax-etamin)/m_lut.NbinEta[chamber];
71
72 for(int i=0;i<m_lut.NbinEta[chamber];i++) {
73 for(int j=0;j<m_lut.NbinPhi[chamber];j++) {
74
75 file >> A1 >> A0;
76
77 m_lut.table[chamber][charge][i][j][0] = A1;
78 m_lut.table[chamber][charge][i][j][1] = A0;
79 }
80 }
81 }
82
83 file.close();
84
85 std::ifstream fileSP;
86 fileSP.open(lutSP_fileName.c_str());
87 if(!fileSP) {
88 ATH_MSG_INFO("Failed to open barrel LUT file");
89 return StatusCode::FAILURE;
90 }
91
92 int ieta, iphi, iqeta, iR;
93 while( !fileSP.eof() ){
94 fileSP >> iqeta >> iR >> ieta >> iphi >> A1 >> A0;
95 m_lutSP.table_LargeSP[iqeta][iR][ieta][iphi][0] = A1;
96 m_lutSP.table_LargeSP[iqeta][iR][ieta][iphi][1] = A0;
97 }
98
99 return StatusCode::SUCCESS;
100}
#define ATH_MSG_INFO(x)
double charge(const T &p)
Definition AtlasPID.h:997
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_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_lut

LUT TrigL2MuonSA::PtBarrelLUT::m_lut {}
private

Definition at line 49 of file PtBarrelLUT.h.

49{};

◆ m_lutSP

LUTsp TrigL2MuonSA::PtBarrelLUT::m_lutSP {}
private

Definition at line 50 of file PtBarrelLUT.h.

50{};

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