ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
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
103ostream& 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//**********************************************************************
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
size_type digit_size() const
static const 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:19
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146