ATLAS Offline Software
Loading...
Searching...
No Matches
SGTileModuleBitsGetterTool.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: SGTileModuleBitsGetterTool.cxx
7 * Author: Stephen Cole <stephen.cole@cern.ch>
8 *
9 * Created on March 15, 2012, 2:52 PM
10 */
11
13
14namespace D3PD{
16 const std::string& name,
17 const IInterface* parent):
18 Base(type,name,parent) {
19 }
20
21
24
26 MsgStream log(msgSvc(), name());
27 log << MSG::INFO << " in SGTileModuleBitsGetterTool::initialize()" << endmsg;
29 return StatusCode::SUCCESS;
30 }
31
32 const std::type_info& SGTileModuleBitsGetterTool::typeinfo() const {
33 return typeid(TileRawChannelContainer);
34 }
35
36 const std::type_info& SGTileModuleBitsGetterTool::elementTypeinfo() const {
37 return typeid(TileRawChannelCollection);
38 }
39
40 size_t SGTileModuleBitsGetterTool::sizeHint(bool allowMissing){
41 const TileRawChannelContainer* tdc=get(allowMissing);
42 if(!tdc)return 0;
43 const TileRawChannelCollection* col=*(tdc->begin());
44 size_t rval=0;
45 size_t digSize=sizeof(TileRawChannel);
47 for(it=col->begin();it<col->end();++it)++rval;
48 return rval*digSize;
49 }
50
51 StatusCode SGTileModuleBitsGetterTool::reset(bool allowMissing){
52 const TileRawChannelContainer* tdc=get(allowMissing);
53 if(!tdc){
55 return StatusCode::FAILURE;
56 }
57 m_evtItr=tdc->begin();
58 m_evtEnd=tdc->end();
59 if(m_evtItr==m_evtEnd){
60 return StatusCode::SUCCESS;
61 }
62
63 return StatusCode::SUCCESS;
64 }
65
67 const TileRawChannelCollection* col=0;
68 do{
69 if(m_evtItr==m_evtEnd)return 0;
70 col=*m_evtItr;
71 ++m_evtItr;
72 }while(!col);
73
74 return col;
75 }
76
77}
#define endmsg
#define CHECK(...)
Evaluate an expression and check for errors.
virtual const TileRawChannelContainer * get(bool allowMissing=false)
TileRawChannelContainer::const_iterator m_evtItr
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.
const std::type_info & typeinfo() const
Return the type of object retrieved by this tool.
const std::type_info & elementTypeinfo() const
Return the element type of the collection.
const void * nextUntyped()
Return a pointer to the next element in the collection.
SGTileModuleBitsGetterTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
TileRawChannelContainer::const_iterator m_evtEnd
StatusCode initialize()
Standard Gaudi initialize method.
D3PD::SGCollectionGetterTool< TileRawChannelContainer > Base
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:838
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
Block filler tool for noisy FEB information.