ATLAS Offline Software
Loading...
Searching...
No Matches
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"
14
15namespace D3PD{
16
18 const std::string& name,
19 const IInterface* parent):
20 Base(type,name,parent) {
21 }
22
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
49 StatusCode SGTileHitGetterTool::reset(bool allowMissing){
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}
#define CHECK(...)
Evaluate an expression and check for errors.
AtlasHitsVector< TileHit > TileHitVector
CONT::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
virtual const TileHitVector * get(bool allowMissing=false)
const std::type_info & elementTypeinfo() const
Return the element type of the collection.
TileHitVector::const_iterator m_evtEnd
StatusCode initialize()
Standard Gaudi initialize method.
TileHitVector::const_iterator m_evtItr
SGTileHitGetterTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
size_t sizeHint(bool allowMissing=false)
Return an estimate of the number of elements in the iteration.
StatusCode reset(bool allowMissing=false)
Reset the iteration to the start of the collection.
D3PD::SGCollectionGetterTool< TileHitVector > Base
const std::type_info & typeinfo() const
Return the type of object retrieved by this tool.
const void * nextUntyped()
Return a pointer to the next element in the collection.
Block filler tool for noisy FEB information.