ATLAS Offline Software
Loading...
Searching...
No Matches
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"
9
12#include <map>
13#include <cassert>
14#include <iostream>
15
16using std::ostream;
17using std::endl;
18
19//**********************************************************************
20// Local definitions
21//**********************************************************************
22
23//**********************************************************************
24// Member functions.
25//**********************************************************************
26
27// Default constructor.
28
33
34//**********************************************************************
35
38{
39}
40
41//**********************************************************************
42
43//**********************************************************************
44
49
50//**********************************************************************
51
52// Destructor.
53
55
56//**********************************************************************
58unsigned int
60{
61 return (hashFcn()(Identifier(Identifier32(id))));
62}
63
64//**********************************************************************
65const MdtCsmIdHash&
67{
68 static const MdtCsmIdHash hashFcn;
69 return (hashFcn);
70}
71
72
73//**********************************************************************
74
79
80
82{
83 static const CLID cid = classID();
84 return cid;
85}
86
87
88// Return the total number of digits in the container.
89
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
108ostream& 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//**********************************************************************
uint32_t CLID
The Class ID type.
IdentifiableContainerMT< T > IdentifiableContainer
ostream & operator<<(ostream &lhs, const MdtCsmContainer &rhs)
EventContainers::IdentifiableCache< MdtCsm > MdtCsm_Cache
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
#define max(a, b)
Definition cfImp.cxx:41
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
This container provides acces to the MDT RDOs.
static unsigned int idToHash(unsigned int id)
Convert identifier to idhash.
static const MdtCsmIdHash & hashFcn()
MdtCsm::size_type size_type
virtual const CLID & clID() const override
return class ID
size_type digit_size() const
static CLID classID()
Hash function for Mdt module Identifier to be used in MdtDigitContainer (IdentifiableContainer)
MDT RDOs : Chamber Service Module, container of AmtHits of a single Mdt chamber.
Definition MdtCsm.h:22
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146