ATLAS Offline Software
Loading...
Searching...
No Matches
CaloHelpersTest Class Reference

Helper to initialize ID helpers for unit tests. More...

#include <CaloHelpersTest.h>

Collaboration diagram for CaloHelpersTest:

Public Member Functions

 CaloHelpersTest ()
 ~CaloHelpersTest ()
const LArEM_IDemID () const
const LArHEC_IDhecID () const
const LArFCAL_IDfcalID () const
const LArMiniFCAL_IDminifcalID () const
const TileIDtileID () const
const CaloCell_IDcaloID () const

Private Attributes

std::unique_ptr< IdDictParserm_parser
LArEM_ID m_em_idHelper
LArHEC_ID m_hec_idHelper
LArFCAL_ID m_fcal_idHelper
LArMiniFCAL_ID m_minifcal_idHelper
TileID m_tile_idHelper
std::unique_ptr< CaloCell_IDm_calo_idHelper

Detailed Description

Helper to initialize ID helpers for unit tests.

An object of this class can be created in a unit test in order to provide initialized instances of the ID helpers.

Definition at line 37 of file CaloHelpersTest.h.

Constructor & Destructor Documentation

◆ CaloHelpersTest()

CaloHelpersTest::CaloHelpersTest ( )

Definition at line 18 of file CaloHelpersTest.cxx.

19 : m_parser (std::make_unique<IdDictParser>())
20{
21 m_parser->register_external_entity("LArCalorimeter", "IdDictLArCalorimeter.xml");
22 IdDictMgr& idd = m_parser->parse("IdDictParser/ATLAS_IDS.xml");
23 m_em_idHelper.set_do_neighbours(false);
24 if (m_em_idHelper.initialize_from_dictionary(idd) != 0) {
25 std::abort();
26 }
27
28 if (m_hec_idHelper.initialize_from_dictionary(idd) != 0) {
29 std::abort();
30 }
31
32 m_fcal_idHelper.set_do_neighbours(false);
33 if (m_fcal_idHelper.initialize_from_dictionary(idd) != 0) {
34 std::abort();
35 }
36
37 m_minifcal_idHelper.set_do_neighbours(false);
38 if (m_minifcal_idHelper.initialize_from_dictionary(idd) != 0) {
39 std::abort();
40 }
41
42 m_tile_idHelper.set_do_neighbours(false);
43 if (m_tile_idHelper.initialize_from_dictionary(idd) != 0) {
44 std::abort();
45 }
46
47 m_calo_idHelper = std::make_unique<CaloCell_ID> (&m_em_idHelper,
52 if (m_calo_idHelper->initialize_from_dictionary(idd) != 0) {
53 std::abort();
54 }
55}
std::unique_ptr< IdDictParser > m_parser
LArHEC_ID m_hec_idHelper
std::unique_ptr< CaloCell_ID > m_calo_idHelper
LArFCAL_ID m_fcal_idHelper
LArMiniFCAL_ID m_minifcal_idHelper

◆ ~CaloHelpersTest()

CaloHelpersTest::~CaloHelpersTest ( )
default

Member Function Documentation

◆ caloID()

const CaloCell_ID & CaloHelpersTest::caloID ( ) const

Definition at line 92 of file CaloHelpersTest.cxx.

93{
94 return *m_calo_idHelper;
95}

◆ emID()

const LArEM_ID & CaloHelpersTest::emID ( ) const

Definition at line 62 of file CaloHelpersTest.cxx.

63{
64 return m_em_idHelper;
65}

◆ fcalID()

const LArFCAL_ID & CaloHelpersTest::fcalID ( ) const

Definition at line 74 of file CaloHelpersTest.cxx.

75{
76 return m_fcal_idHelper;
77}

◆ hecID()

const LArHEC_ID & CaloHelpersTest::hecID ( ) const

Definition at line 68 of file CaloHelpersTest.cxx.

69{
70 return m_hec_idHelper;
71}

◆ minifcalID()

const LArMiniFCAL_ID & CaloHelpersTest::minifcalID ( ) const

Definition at line 80 of file CaloHelpersTest.cxx.

81{
83}

◆ tileID()

const TileID & CaloHelpersTest::tileID ( ) const

Definition at line 86 of file CaloHelpersTest.cxx.

87{
88 return m_tile_idHelper;
89}

Member Data Documentation

◆ m_calo_idHelper

std::unique_ptr<CaloCell_ID> CaloHelpersTest::m_calo_idHelper
private

Definition at line 57 of file CaloHelpersTest.h.

◆ m_em_idHelper

LArEM_ID CaloHelpersTest::m_em_idHelper
private

Definition at line 52 of file CaloHelpersTest.h.

◆ m_fcal_idHelper

LArFCAL_ID CaloHelpersTest::m_fcal_idHelper
private

Definition at line 54 of file CaloHelpersTest.h.

◆ m_hec_idHelper

LArHEC_ID CaloHelpersTest::m_hec_idHelper
private

Definition at line 53 of file CaloHelpersTest.h.

◆ m_minifcal_idHelper

LArMiniFCAL_ID CaloHelpersTest::m_minifcal_idHelper
private

Definition at line 55 of file CaloHelpersTest.h.

◆ m_parser

std::unique_ptr<IdDictParser> CaloHelpersTest::m_parser
private

Definition at line 51 of file CaloHelpersTest.h.

◆ m_tile_idHelper

TileID CaloHelpersTest::m_tile_idHelper
private

Definition at line 56 of file CaloHelpersTest.h.


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