ATLAS Offline Software
Loading...
Searching...
No Matches
CaloTopoTmpHashClusterBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5//-----------------------------------------------------------------------
6// File and Version Information:
7//
8// Description: base class for temporary Cluster Container for
9// topological cluster making tools
10//
11// Environment:
12// Software developed for the ATLAS Detector at the CERN LHC
13//
14// Author List:
15// Sven Menke
16//
17//-----------------------------------------------------------------------
18
19#ifndef CALOTOPOTMPHASHCLUSTERBASE_H
20#define CALOTOPOTMPHASHCLUSTERBASE_H
21
22#include <vector>
23#include "CaloTopoTmpHashCell.h"
25
26
27template <class T>
29{
30protected:
33
34 // Friends
35
36 // Data members
37
40 // Helper functions
41
42public:
44
47 {
48 public:
49 typedef T* value_type;
52
56
58 {
59 return reinterpret_cast<reference> (pointer_list::iterator::operator*());
60 }
61
63 {
64 return reinterpret_cast<reference> (pointer_list::iterator::operator*());
65 }
66 };
67
68
69 // Constructors
75
76 // Operators
77
78 // Selectors
79
80 inline float getMaxRatio() const
81 {
82 return m_maxRatio;
83 }
84
85 inline int size() const
86 {
87 return m_members.size();
88 }
89
90 iterator begin()
91 {
92 return iterator (m_members.begin());
93 }
94
95 iterator end()
96 {
97 return iterator (m_members.end());
98 }
99
100 void removeAll()
101 {
102 m_members.clear();
103 m_maxRatio=0;
104 }
105
106 void add(HashCell& hashCell);
107
108 void add(CaloTopoTmpHashClusterBase& hashCluster);
109
110};
111
112
113template <class T>
115{
116 T* cell = hashCell.getCaloTopoTmpClusterCell();
117 m_members.push_back (cell);
118
119 float ratio = cell->getSignedRatio();
120 if ( ratio > m_maxRatio ) {
121 m_maxRatio = ratio;
122 }
123}
124
125template <class T>
127 (CaloTopoTmpHashClusterBase& hashCluster)
128{
129 pointer_list::iterator beg = hashCluster.m_members.begin();
130 pointer_list::iterator end = hashCluster.m_members.end();
131 while (beg != end) {
132 m_members.push_back (*beg);
133 ++beg;
134 }
135 if ( hashCluster.m_maxRatio > m_maxRatio) {
136 m_maxRatio = hashCluster.m_maxRatio;
137 }
138}
139
140#endif // CALOTOPOTMPHASHCLUSTERBASE_H
141
const T * getCaloTopoTmpClusterCell() const
void add(CaloTopoTmpHashClusterBase &hashCluster)
CaloTopoTmpHashCell< CaloTopoSplitterClusterCell > HashCell
Forward iterator over the list.
A fast way to store a variable-sized collection of pointers.
iterator end()
Iterator at the end of the container.
iterator begin()
Iterator at the beginning of the container.
pool namespace
Definition libname.h:15
A fast way to store a variable-sized collection of pointers.