ATLAS Offline Software
MdtCsmContainer.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 #include "GaudiKernel/Bootstrap.h"
6 #include "GaudiKernel/ISvcLocator.h"
7 #include "GaudiKernel/IMessageSvc.h"
9 
12 #include <map>
13 #include <cassert>
14 #include <iostream>
15 
16 using std::ostream;
17 using std::endl;
18 
19 //**********************************************************************
20 // Local definitions
21 //**********************************************************************
22 
23 //**********************************************************************
24 // Member functions.
25 //**********************************************************************
26 
27 // Default constructor.
28 
30 : IdentifiableContainer<MdtCsm>(hashFcn().max())
31 {
32 }
33 
34 //**********************************************************************
35 
36 MdtCsmContainer::MdtCsmContainer(unsigned int hashmax)
37 : IdentifiableContainer<MdtCsm>(hashmax)
38 {
39 }
40 
41 //**********************************************************************
42 
43 //**********************************************************************
44 
47 {
48 }
49 
50 //**********************************************************************
51 
52 // Destructor.
53 
55 
56 //**********************************************************************
58 unsigned int
59 MdtCsmContainer::idToHash(unsigned int id)
60 {
61  return (hashFcn()(Identifier(Identifier32(id))));
62 }
63 
64 //**********************************************************************
65 const MdtCsmIdHash&
67 {
68  static const MdtCsmIdHash hashFcn;
69  return (hashFcn);
70 }
71 
72 
73 //**********************************************************************
74 
76 {
78  // static const CLID CLID_MdtCsmContainer= 4187;
79  // return CLID_MdtCsmContainer ;
80 }
81 
82 
83 // Return the total number of digits in the container.
84 
89 
90  for (; it != iend; ++it ) {
91  count += (*it)->size();
92  }
93  return count;
94 }
95 
96 
97 //**********************************************************************
98 // Free functions.
99 //**********************************************************************
100 
101 // Output stream.
102 
103 ostream& operator<<(ostream& lhs, const MdtCsmContainer& rhs) {
104  lhs << "MdtCsmContainer has " << rhs.digit_size() << " digits:" << endl;
105  typedef SelectAllObject<MdtCsmContainer> SELECTOR;
106  SELECTOR sel(&rhs);
107  SELECTOR::const_iterator it = sel.begin();
108  SELECTOR::const_iterator it_end = sel.end();
109 
110  bool first = true;
111  for ( ; it!=it_end;++it)
112  {
113  if ( first ) {
114  first = false;
115  } else {
116  lhs << endl;
117  }
118  lhs << " " << *it;
119  }
120  return lhs;
121 }
122 
123 //**********************************************************************
Identifier32
Definition: Identifier32.h:25
max
#define max(a, b)
Definition: cfImp.cxx:41
MdtCsmContainer::hashFcn
static const MdtCsmIdHash & hashFcn()
Definition: MdtCsmContainer.cxx:66
skel.it
it
Definition: skel.GENtoEVGEN.py:423
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition: MdtCsmContainer.h:22
MdtCsm
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition: MdtCsm.h:19
MdtCsmContainer.h
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
MdtCsmContainer::classID
static const CLID & classID()
Definition: MdtCsmContainer.cxx:75
ClassID_traits::ID
static const CLID & ID()
the CLID of T
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:50
MdtCsmContainer::size_type
MdtCsm::size_type size_type
Definition: MdtCsmContainer.h:29
SelectAllObjectMT
Definition: SelectAllObjectMT.h:11
MdtCsmIdHash
Hash function for Mdt module Identifier to be used in MdtDigitContainer (IdentifiableContainer)
Definition: MdtCsmIdHash.h:17
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
sel
sel
Definition: SUSYToolsTester.cxx:92
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition: IdentifiableContainerMT.h:242
IdentifiableContainerMT::const_iterator
Definition: IdentifiableContainerMT.h:82
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition: IdentifiableContainerMT.h:236
MdtCsmContainer::digit_size
size_type digit_size() const
Definition: MdtCsmContainer.cxx:85
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
operator<<
ostream & operator<<(ostream &lhs, const MdtCsmContainer &rhs)
Definition: MdtCsmContainer.cxx:103
MdtCsmContainer::MdtCsmContainer
MdtCsmContainer()
Definition: MdtCsmContainer.cxx:29
MdtCsmContainer::idToHash
static unsigned int idToHash(unsigned int id)
Convert identifier to idhash.
Definition: MdtCsmContainer.cxx:59
DeMoScan.first
bool first
Definition: DeMoScan.py:534
IdentifiableContainerMT
Definition: IdentifiableContainerMT.h:30
SelectAllObject.h
MdtCsmContainer::~MdtCsmContainer
~MdtCsmContainer()
StoreGateSvc.h
EventContainers::IdentifiableCache
Definition: IdentifiableCache.h:29