ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
RegSelTool Class Reference

emacs: this is -*- c++ -*- More...

#include <RegSelTool.h>

Inheritance diagram for RegSelTool:
Collaboration diagram for RegSelTool:

Public Member Functions

 RegSelTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor for tool (obviously). More...
 
virtual ~RegSelTool () override
 Destructor. More...
 
virtual StatusCode initialize () override
 @method initialize, loads lookup tables for retrieve Identifier Hash and ROBID More...
 
void HashIDList (const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
 IRegSlTool interface ... More...
 
void HashIDList (long layer, const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
 standard roi for specific layer More...
 
void ROBIDList (const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
 ROB id access methods. More...
 
void ROBIDList (long layer, const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
 standard roi for specific layer More...
 

Protected Member Functions

const IRegSelLUTlookup () const
 @method lookup, actually retrieve the lookup table as conditions data - might combine with handle() More...
 
void cleanup (std::vector< IdentifierHash > &idvec) const
 

Private Attributes

bool m_initialised
 Flag to determine whether it has yet been initialised. More...
 
BooleanProperty m_dumpTable
 Flag to dump loaded table in data file. More...
 
SG::ReadCondHandleKey< IRegSelLUTCondDatam_tableKey { this, "RegSelLUT", "Tool_Not_Initalised", "Region Selector lookup table" }
 
bool m_rpcflag
 flag to avoid the need for a separate rpc lookup table class FixMe: this flag may be replaced by custom derived RegSelTool class for the RPC. More...
 

Detailed Description

emacs: this is -*- c++ -*-

   This is the Region Selector tool for the ID And muon spectrometer 
   tables
Author
Mark Sutton

Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration

Definition at line 38 of file RegSelTool.h.

Constructor & Destructor Documentation

◆ RegSelTool()

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

Standard constructor for tool (obviously).

Constructor.

Declare properties

Definition at line 21 of file RegSelTool.cxx.

22  : base_class( type, name, parent ),
23  m_initialised(false),
24  m_dumpTable(false),
25  m_rpcflag(false)
26 {
28  declareProperty( "WriteTable", m_dumpTable, "write out maps to files for debugging" );
29  declareProperty( "Initialised", m_initialised=false, "flag to determine whether the corresponding subsystem is initilised" );
30 }

◆ ~RegSelTool()

RegSelTool::~RegSelTool ( )
overridevirtual

Destructor.

Standard destructor.

Definition at line 34 of file RegSelTool.cxx.

34 { }

Member Function Documentation

◆ cleanup()

void RegSelTool::cleanup ( std::vector< IdentifierHash > &  idvec) const
protected

Definition at line 58 of file RegSelTool.cxx.

58  {
59  for ( size_t i=idvec.size() ; i-- ; ) idvec[i] = IdentifierHash( ((unsigned)idvec[i]) & 0xfff );
61 }

◆ HashIDList() [1/2]

void RegSelTool::HashIDList ( const IRoiDescriptor roi,
std::vector< IdentifierHash > &  idlist 
) const
override

IRegSlTool interface ...

hash id access methods

standard roi

Definition at line 72 of file RegSelTool.cxx.

72  {
73 
74  if ( !m_initialised ) return;
75 
76  if ( roi.composite() ) {
77  idlist.clear();
78  for ( unsigned iroi=roi.size() ; iroi-- ; ) HashIDList( *(roi.at(iroi)), idlist );
79  if ( roi.size()>1 ) RegSelSiLUT::removeDuplicates( idlist );
80  return;
81  }
82 
83  const IRegSelLUT* lookuptable = lookup();
84  if ( lookuptable ) lookuptable->HashIDList( roi, idlist );
85  if ( m_rpcflag ) cleanup( idlist );
86 
87 }

◆ HashIDList() [2/2]

void RegSelTool::HashIDList ( long  layer,
const IRoiDescriptor roi,
std::vector< IdentifierHash > &  idlist 
) const
override

standard roi for specific layer

Definition at line 93 of file RegSelTool.cxx.

93  {
94 
95  if ( !m_initialised ) return;
96 
97  if ( roi.composite() ) {
98  idlist.clear();
99  for ( unsigned iroi=roi.size() ; iroi-- ; ) HashIDList( layer, *(roi.at(iroi)), idlist );
100  if ( roi.size()>1 ) RegSelSiLUT::removeDuplicates( idlist );
101  return;
102  }
103 
104  const IRegSelLUT* lookuptable = lookup();
105  if ( lookuptable ) lookuptable->HashIDList( layer, roi, idlist );
106  if ( m_rpcflag ) cleanup( idlist );
107 
108 }

◆ initialize()

StatusCode RegSelTool::initialize ( )
overridevirtual

@method initialize, loads lookup tables for retrieve Identifier Hash and ROBID

Definition at line 45 of file RegSelTool.cxx.

45  {
46  ATH_MSG_DEBUG( "Initialising RegSelTool " << name() << "\ttable: " << m_tableKey );
47  if ( !m_initialised ) {
48  ATH_MSG_WARNING( "Lookup table will not be initialised " << name() << "\tkey " << m_tableKey );
49  }
50  ATH_CHECK( m_tableKey.initialize(m_initialised) );
51  if ( name().find( "RPC") != std::string::npos ) m_rpcflag = true;
52  return StatusCode::SUCCESS;
53 }

◆ lookup()

const IRegSelLUT * RegSelTool::lookup ( ) const
protected

@method lookup, actually retrieve the lookup table as conditions data - might combine with handle()

Definition at line 37 of file RegSelTool.cxx.

37  {
38  if ( !m_initialised ) return nullptr;
40  return (*table_handle)->payload();
41 }

◆ ROBIDList() [1/2]

void RegSelTool::ROBIDList ( const IRoiDescriptor roi,
std::vector< uint32_t > &  roblist 
) const
override

ROB id access methods.

standard roi

Definition at line 121 of file RegSelTool.cxx.

121  {
122 
123  if ( !m_initialised ) return;
124 
125  if ( roi.composite() ) {
126  roblist.clear();
127  for ( unsigned iroi=roi.size() ; iroi-- ; ) ROBIDList( *(roi.at(iroi)), roblist );
129  return;
130  }
131 
132  const IRegSelLUT* lookuptable = lookup();
133  if ( lookuptable ) lookuptable->ROBIDList( roi, roblist );
134 
135 }

◆ ROBIDList() [2/2]

void RegSelTool::ROBIDList ( long  layer,
const IRoiDescriptor roi,
std::vector< uint32_t > &  roblist 
) const
override

standard roi for specific layer

Definition at line 141 of file RegSelTool.cxx.

141  {
142 
143  if ( !m_initialised ) return;
144 
145  if ( roi.composite() ) {
146  roblist.clear();
147  for ( unsigned iroi=roi.size() ; iroi-- ; ) ROBIDList( layer, *(roi.at(iroi)), roblist );
149  return;
150  }
151 
152  const IRegSelLUT* lookuptable = lookup();
153  if ( lookuptable ) lookuptable->ROBIDList( layer, roi, roblist );
154 
155 }

Member Data Documentation

◆ m_dumpTable

BooleanProperty RegSelTool::m_dumpTable
private

Flag to dump loaded table in data file.

Definition at line 86 of file RegSelTool.h.

◆ m_initialised

bool RegSelTool::m_initialised
private

Flag to determine whether it has yet been initialised.

Definition at line 83 of file RegSelTool.h.

◆ m_rpcflag

bool RegSelTool::m_rpcflag
private

flag to avoid the need for a separate rpc lookup table class FixMe: this flag may be replaced by custom derived RegSelTool class for the RPC.

The tools are retrieved only via
the IRegSelTool interface so this would also be transaprent to the user

Definition at line 96 of file RegSelTool.h.

◆ m_tableKey

SG::ReadCondHandleKey<IRegSelLUTCondData> RegSelTool::m_tableKey { this, "RegSelLUT", "Tool_Not_Initalised", "Region Selector lookup table" }
private

Definition at line 88 of file RegSelTool.h.


The documentation for this class was generated from the following files:
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
RegSelTool::m_tableKey
SG::ReadCondHandleKey< IRegSelLUTCondData > m_tableKey
Definition: RegSelTool.h:88
RegSelTool::m_initialised
bool m_initialised
Flag to determine whether it has yet been initialised.
Definition: RegSelTool.h:83
IRoiDescriptor::size
virtual unsigned size() const =0
number of constituents
RegSelTool::m_rpcflag
bool m_rpcflag
flag to avoid the need for a separate rpc lookup table class FixMe: this flag may be replaced by cust...
Definition: RegSelTool.h:96
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IRegSelLUT
Definition: IRegSelLUT.h:25
RegSelTool::HashIDList
void HashIDList(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const override
IRegSlTool interface ...
Definition: RegSelTool.cxx:72
RegSelTool::cleanup
void cleanup(std::vector< IdentifierHash > &idvec) const
Definition: RegSelTool.cxx:58
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DetDescrDictionaryDict::idvec
DataVector< Identifier > idvec
Definition: DetDescrDictionaryDict.h:14
RegSelTool::m_dumpTable
BooleanProperty m_dumpTable
Flag to dump loaded table in data file.
Definition: RegSelTool.h:86
RegSelTool::ROBIDList
void ROBIDList(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const override
ROB id access methods.
Definition: RegSelTool.cxx:121
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IRegSelLUT::HashIDList
virtual void HashIDList(const IRoiDescriptor &roi, std::vector< IdentifierHash > &idlist) const =0
IdentifierHash methods.
RegSelSiLUT::removeDuplicates
static void removeDuplicates(std::vector< T > &vec)
useful for removing duplicates if required ...
Definition: RegSelSiLUT.h:222
IRegSelLUT::ROBIDList
virtual void ROBIDList(const IRoiDescriptor &roi, std::vector< uint32_t > &roblist) const =0
Rob identifier methods methods.
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
IRoiDescriptor::at
virtual const IRoiDescriptor * at(int i) const =0
find an RoiDescriptor constituent
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
RegSelTool::lookup
const IRegSelLUT * lookup() const
@method lookup, actually retrieve the lookup table as conditions data - might combine with handle()
Definition: RegSelTool.cxx:37
IRoiDescriptor::composite
virtual bool composite() const =0
Super RoI access methods.