ATLAS Offline Software
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 
18  const std::string& name,
19  const IInterface* parent):
20  Base(type,name,parent) {
21  }
22 
24  }
25 
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);
45  for(it=thv->begin();it<thv->end();++it)++rval;
46  return rval*digSize;
47  }
48 
50  const TileHitVector* thv=get(allowMissing);
51  if(!thv){
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 
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 }
TileHitVector
AtlasHitsVector< TileHit > TileHitVector
Definition: TileHitVector.h:28
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
AtlasHitsVector
Definition: AtlasHitsVector.h:33
skel.it
it
Definition: skel.GENtoEVGEN.py:423
D3PD::SGTileHitGetterTool::m_evtEnd
TileHitVector::const_iterator m_evtEnd
Definition: SGTileHitGetterTool.h:44
AtlasHitsVector::begin
const_iterator begin() const
Definition: AtlasHitsVector.h:131
D3PD::SGCollectionGetterTool< TileHitVector >
AtlasHitsVector::const_iterator
CONT::const_iterator const_iterator
Definition: AtlasHitsVector.h:43
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
D3PD::SGTileHitGetterTool::initialize
StatusCode initialize()
Standard Gaudi initialize method.
Definition: SGTileHitGetterTool.cxx:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::SGTileHitGetterTool::elementTypeinfo
const std::type_info & elementTypeinfo() const
Definition: SGTileHitGetterTool.cxx:35
D3PD::SGCollectionGetterTool< TileHitVector >::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
D3PD::SGTileHitGetterTool::reset
StatusCode reset(bool allowMissing=false)
Reset the iteration to the start of the collection.
Definition: SGTileHitGetterTool.cxx:49
TileHit.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
D3PD::SGTileHitGetterTool::~SGTileHitGetterTool
virtual ~SGTileHitGetterTool()
Definition: SGTileHitGetterTool.cxx:23
D3PD::SGTileHitGetterTool::m_evtItr
TileHitVector::const_iterator m_evtItr
Definition: SGTileHitGetterTool.h:44
TileHit
Definition: TileSimEvent/TileSimEvent/TileHit.h:30
D3PD::SGTileHitGetterTool::nextUntyped
const void * nextUntyped()
Return a pointer to the next element in the collection.
Definition: SGTileHitGetterTool.cxx:62
SGTileHitGetterTool.h
AtlasHitsVector::end
const_iterator end() const
Definition: AtlasHitsVector.h:134
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::SGTileHitGetterTool::typeinfo
const std::type_info & typeinfo() const
Return the type of object retrieved by this tool.
Definition: SGTileHitGetterTool.cxx:31
D3PD::SGCollectionGetterTool< TileHitVector >::get
virtual const TileHitVector * get(bool allowMissing=false)
Type-safe wrapper for get.