ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonRDO
src
MdtCsmContainer.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 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"
8
#include "
StoreGate/StoreGateSvc.h
"
9
10
#include "
MuonRDO/MdtCsmContainer.h
"
11
#include "
EventContainers/SelectAllObject.h
"
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
29
MdtCsmContainer::MdtCsmContainer
()
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
45
MdtCsmContainer::MdtCsmContainer
(
MdtCsm_Cache
* cache)
46
:
IdentifiableContainer
<
MdtCsm
>(cache)
47
{
48
}
49
50
//**********************************************************************
51
52
// Destructor.
53
54
MdtCsmContainer::~MdtCsmContainer
() =
default
;
55
56
//**********************************************************************
58
unsigned
int
59
MdtCsmContainer::idToHash
(
unsigned
int
id
)
60
{
61
return
(
hashFcn
()(
Identifier
(
Identifier32
(
id
))));
62
}
63
64
//**********************************************************************
65
const
MdtCsmIdHash
&
66
MdtCsmContainer::hashFcn
()
67
{
68
static
const
MdtCsmIdHash
hashFcn
;
69
return
(
hashFcn
);
70
}
71
72
73
//**********************************************************************
74
75
CLID
MdtCsmContainer::classID
()
76
{
77
return
ClassID_traits<MdtCsmContainer>::ID
();
78
}
79
80
81
const
CLID
&
MdtCsmContainer::clID
()
const
82
{
83
static
const
CLID
cid =
classID
();
84
return
cid;
85
}
86
87
88
// Return the total number of digits in the container.
89
90
MdtCsmContainer::size_type
MdtCsmContainer::digit_size
()
const
{
91
MdtCsmContainer::size_type
count
= 0;
92
MdtCsmContainer::const_iterator
it =
begin
();
93
MdtCsmContainer::const_iterator
iend =
end
();
94
95
for
(; it != iend; ++it ) {
96
count
+= (*it)->size();
97
}
98
return
count
;
99
}
100
101
102
//**********************************************************************
103
// Free functions.
104
//**********************************************************************
105
106
// Output stream.
107
108
ostream&
operator<<
(ostream& lhs,
const
MdtCsmContainer
& rhs) {
109
lhs <<
"MdtCsmContainer has "
<< rhs.
digit_size
() <<
" digits:"
<< endl;
110
typedef
SelectAllObject<MdtCsmContainer>
SELECTOR;
111
SELECTOR
sel
(&rhs);
112
SELECTOR::const_iterator it =
sel
.begin();
113
SELECTOR::const_iterator it_end =
sel
.end();
114
115
bool
first =
true
;
116
for
( ; it!=it_end;++it)
117
{
118
if
( first ) {
119
first =
false
;
120
}
else
{
121
lhs << endl;
122
}
123
lhs <<
" "
<< *it;
124
}
125
return
lhs;
126
}
127
128
//**********************************************************************
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
IdentifiableContainer
IdentifiableContainerMT< T > IdentifiableContainer
Definition
IdentifiableContainer.h:11
operator<<
ostream & operator<<(ostream &lhs, const MdtCsmContainer &rhs)
Definition
MdtCsmContainer.cxx:108
MdtCsmContainer.h
MdtCsm_Cache
EventContainers::IdentifiableCache< MdtCsm > MdtCsm_Cache
Definition
MdtCsm_Cache.h:10
sel
sel
Definition
SUSYToolsTester.cxx:92
SelectAllObject.h
SelectAllObject
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
Definition
SelectAllObject.h:11
StoreGateSvc.h
max
#define max(a, b)
Definition
cfImp.cxx:41
IdentifiableContainerMT::const_iterator
Definition
IdentifiableContainerMT.h:82
IdentifiableContainerMT::end
const_iterator end() const
return const_iterator for end of container
Definition
IdentifiableContainerMT.h:248
IdentifiableContainerMT::begin
const_iterator begin() const
return const_iterator for first entry
Definition
IdentifiableContainerMT.h:242
Identifier32
Definition
Identifier32.h:28
MdtCsmContainer
This container provides acces to the MDT RDOs.
Definition
MdtCsmContainer.h:22
MdtCsmContainer::idToHash
static unsigned int idToHash(unsigned int id)
Convert identifier to idhash.
Definition
MdtCsmContainer.cxx:59
MdtCsmContainer::hashFcn
static const MdtCsmIdHash & hashFcn()
Definition
MdtCsmContainer.cxx:66
MdtCsmContainer::MdtCsmContainer
MdtCsmContainer()
Definition
MdtCsmContainer.cxx:29
MdtCsmContainer::size_type
MdtCsm::size_type size_type
Definition
MdtCsmContainer.h:29
MdtCsmContainer::clID
virtual const CLID & clID() const override
return class ID
Definition
MdtCsmContainer.cxx:81
MdtCsmContainer::digit_size
size_type digit_size() const
Definition
MdtCsmContainer.cxx:90
MdtCsmContainer::~MdtCsmContainer
~MdtCsmContainer()
MdtCsmContainer::classID
static CLID classID()
Definition
MdtCsmContainer.cxx:75
MdtCsmIdHash
Hash function for Mdt module Identifier to be used in MdtDigitContainer (IdentifiableContainer).
Definition
MdtCsmIdHash.h:18
MdtCsm
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition
MdtCsm.h:22
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
Identifier
Definition
IdentifierFieldParser.cxx:14
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
Generated on
for ATLAS Offline Software by
1.17.0