ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
CaloSysD3PDMaker
src
SGTileHitGetterTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* File: SGTileHitGetterTool.cxx
7
* Author: Stephen Cole <stephen.cole@cern.ch>
8
*
9
* Created on January 13, 2012, 1:11 PM
10
*/
11
12
#include "
SGTileHitGetterTool.h
"
13
#include "
TileSimEvent/TileHit.h
"
14
15
namespace
D3PD
{
16
17
SGTileHitGetterTool::SGTileHitGetterTool
(
const
std::string&
type
,
18
const
std::string& name,
19
const
IInterface* parent):
20
Base
(
type
,name,parent) {
21
}
22
23
SGTileHitGetterTool::~SGTileHitGetterTool
() {
24
}
25
26
StatusCode
SGTileHitGetterTool::initialize
(){
27
CHECK
(
Base::initialize
());
28
return
StatusCode::SUCCESS;
29
}
30
31
const
std::type_info&
SGTileHitGetterTool::typeinfo
()
const
{
32
return
typeid
(
TileHitVector
);
33
}
34
35
const
std::type_info&
SGTileHitGetterTool::elementTypeinfo
()
const
{
36
return
typeid
(
TileHit
);
37
}
38
39
size_t
SGTileHitGetterTool::sizeHint
(
bool
allowMissing){
40
const
TileHitVector
* thv=
get
(allowMissing);
41
if
(!thv)
return
0;
42
size_t
rval=0;
43
size_t
digSize=
sizeof
(
TileHit
);
44
TileHitVector::const_iterator
it;
45
for
(it=thv->
begin
();it<thv->end();++it)++rval;
46
return
rval*digSize;
47
}
48
49
StatusCode
SGTileHitGetterTool::reset
(
bool
allowMissing){
50
const
TileHitVector
* thv=
get
(allowMissing);
51
if
(!thv){
52
m_evtItr
=
m_evtEnd
;
53
return
StatusCode::FAILURE;
54
}
55
m_evtItr
=thv->
begin
();
56
m_evtEnd
=thv->
end
();
57
if
(
m_evtItr
==
m_evtEnd
)
return
StatusCode::SUCCESS;
58
59
return
StatusCode::SUCCESS;
60
}
61
62
const
void
*
SGTileHitGetterTool::nextUntyped
(){
63
const
TileHit
* tileD=0;
64
do
{
65
if
(
m_evtItr
==
m_evtEnd
)
return
0;
66
tileD=&(*m_evtItr);
67
++
m_evtItr
;
68
}
while
(!tileD);
69
70
return
tileD;
71
}
72
73
}
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
SGTileHitGetterTool.h
TileHitVector
AtlasHitsVector< TileHit > TileHitVector
Definition
TileHitVector.h:28
TileHit.h
AtlasHitsVector< TileHit >::const_iterator
CONT::const_iterator const_iterator
Definition
AtlasHitsVector.h:42
AtlasHitsVector::begin
const_iterator begin() const
Definition
AtlasHitsVector.h:130
AtlasHitsVector::end
const_iterator end() const
Definition
AtlasHitsVector.h:133
D3PD::SGCollectionGetterTool< TileHitVector >::get
virtual const TileHitVector * get(bool allowMissing=false)
D3PD::SGCollectionGetterTool< TileHitVector >::initialize
virtual StatusCode initialize()
D3PD::SGTileHitGetterTool::elementTypeinfo
const std::type_info & elementTypeinfo() const
Return the element type of the collection.
Definition
SGTileHitGetterTool.cxx:35
D3PD::SGTileHitGetterTool::m_evtEnd
TileHitVector::const_iterator m_evtEnd
Definition
SGTileHitGetterTool.h:44
D3PD::SGTileHitGetterTool::initialize
StatusCode initialize()
Standard Gaudi initialize method.
Definition
SGTileHitGetterTool.cxx:26
D3PD::SGTileHitGetterTool::m_evtItr
TileHitVector::const_iterator m_evtItr
Definition
SGTileHitGetterTool.h:44
D3PD::SGTileHitGetterTool::SGTileHitGetterTool
SGTileHitGetterTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
SGTileHitGetterTool.cxx:17
D3PD::SGTileHitGetterTool::sizeHint
size_t sizeHint(bool allowMissing=false)
Return an estimate of the number of elements in the iteration.
Definition
SGTileHitGetterTool.cxx:39
D3PD::SGTileHitGetterTool::reset
StatusCode reset(bool allowMissing=false)
Reset the iteration to the start of the collection.
Definition
SGTileHitGetterTool.cxx:49
D3PD::SGTileHitGetterTool::Base
D3PD::SGCollectionGetterTool< TileHitVector > Base
Definition
SGTileHitGetterTool.h:24
D3PD::SGTileHitGetterTool::typeinfo
const std::type_info & typeinfo() const
Return the type of object retrieved by this tool.
Definition
SGTileHitGetterTool.cxx:31
D3PD::SGTileHitGetterTool::nextUntyped
const void * nextUntyped()
Return a pointer to the next element in the collection.
Definition
SGTileHitGetterTool.cxx:62
D3PD::SGTileHitGetterTool::~SGTileHitGetterTool
virtual ~SGTileHitGetterTool()
Definition
SGTileHitGetterTool.cxx:23
TileHit
Definition
TileSimEvent/TileSimEvent/TileHit.h:30
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
type
Generated on
for ATLAS Offline Software by
1.17.0