ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHG4CellContainer.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4CellContainer.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
3
#ifndef G4DETECTORS_PHG4CELLCONTAINER_H
4
#define G4DETECTORS_PHG4CELLCONTAINER_H
5
6
#include "
PHG4CellDefs.h
"
// for keytype
7
8
#include <
phool/PHObject.h
>
9
10
#include <iostream>
// for cout, ostream
11
#include <map>
12
#include <utility>
// for pair
13
14
class
PHG4Cell
;
15
16
class
PHG4CellContainer
:
public
PHObject
17
{
18
19
public
:
20
typedef
std::map<PHG4CellDefs::keytype,PHG4Cell *>
Map
;
21
typedef
Map::iterator
Iterator
;
22
typedef
Map::const_iterator
ConstIterator
;
23
typedef
std::pair<Iterator, Iterator>
Range
;
24
typedef
std::pair<ConstIterator, ConstIterator>
ConstRange
;
25
26
PHG4CellContainer
();
27
28
~PHG4CellContainer
()
override
{}
29
30
// from PHObject
31
void
Reset
()
override
;
32
void
identify
(std::ostream& os = std::cout)
const override
;
33
34
ConstIterator
AddCell
(
PHG4Cell
*newCell);
35
ConstIterator
AddCellSpecifyKey
(
const
PHG4CellDefs::keytype
key,
PHG4Cell
*newCell);
36
38
void
RemoveCell
(
PHG4CellDefs::keytype
key) {
39
cellmap
.erase(key);
40
}
41
43
void
RemoveCell
(
PHG4Cell
*cell)
44
{
45
Iterator
its =
cellmap
.begin();
46
Iterator
last =
cellmap
.end();
47
for
(; its != last;)
48
{
49
if
(its->second == cell)
50
{
51
cellmap
.erase(its++);
52
}
53
else
54
{
55
++its;
56
}
57
}
58
}
59
60
61
Iterator
findOrAddCell
(
PHG4CellDefs::keytype
key);
62
64
ConstRange
getCells
(
const
unsigned
short
int
detid)
const
;
65
67
ConstRange
getCells
(
void
)
const
;
68
69
PHG4Cell
*
findCell
(
PHG4CellDefs::keytype
key);
70
71
unsigned
int
size
(
void
)
const
72
{
return
cellmap
.size(); }
73
74
double
getTotalEdep
()
const
;
75
76
protected
:
77
Map
cellmap
;
78
ClassDefOverride(
PHG4CellContainer
,1)
79
};
80
81
#endif
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4CellContainer.h
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:40
using
1.8.2 with
ECCE GitHub integration