ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawDataNonConstContainer.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
4*/
5/*
6 */
7// $Id$
14
15
16#ifndef TILEEVENT_TILERAWDATANONCONSTCONTAINER_H
17#define TILEEVENT_TILERAWDATANONCONSTCONTAINER_H
18
19
22#include <vector>
23
24
33template <typename COLLECTION>
35{
36public:
37 typedef typename COLLECTION::TElement element_t;
38
41
42 typedef typename std::vector<std::unique_ptr<COLLECTION> >::iterator iterator;
43 iterator begin() { return m_colls.begin(); }
44 iterator end() { return m_colls.end(); }
45
46
47private:
49 std::vector<std::unique_ptr<COLLECTION> > m_colls;
50};
51
52
53template <typename COLLECTION>
55{
56 m_hashFunc.initialize(TileCablingService::getInstance()->getTileHWID(),
58 size_t ncoll = m_hashFunc.max();
59 m_colls.reserve (ncoll);
60 for (size_t i = 0; i < ncoll; i++) {
61 TileFragHash::ID frag = m_hashFunc.identifier(i);
62 m_colls.push_back (std::make_unique<COLLECTION> (frag, ownPolicy));
63 }
64}
65
66
67template <typename COLLECTION>
69{
70 int frag = rc->frag_ID();
71 IdentifierHash fragHash = static_cast<IdentifierHash>(m_hashFunc(frag));
72 assert (fragHash < m_colls.size());
73 m_colls[fragHash]->push_back (rc);
74}
75
76
77#endif // not TILEEVENT_TILERAWDATANONCONSTCONTAINER_H
static Double_t rc
This is a "hash" representation of an Identifier.
static const TileCablingService * getInstance()
get pointer to service instance
Hash table for Tile fragments (==drawers ==collections in StoreGate)
TileRawDataNonConstContainer(SG::OwnershipPolicy ownPolicy)
std::vector< std::unique_ptr< COLLECTION > >::iterator iterator
std::vector< std::unique_ptr< COLLECTION > > m_colls
OwnershipPolicy