ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4ScintillatorSlatContainer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4ScintillatorSlatContainer.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4SCINTILLATORSLATCONTAINER_H
4 #define G4DETECTORS_PHG4SCINTILLATORSLATCONTAINER_H
5 
6 #include "PHG4ScintillatorSlatDefs.h" // for keytype
7 
8 #include <phool/PHObject.h>
9 
10 #include <map>
11 #include <set>
12 #include <iostream> // for cout, ostream
13 #include <utility> // for pair
14 
16 
18 {
19 
20  public:
21  typedef std::map<PHG4ScintillatorSlatDefs::keytype,PHG4ScintillatorSlat *> Map;
22  typedef Map::iterator Iterator;
23  typedef Map::const_iterator ConstIterator;
24  typedef std::pair<Iterator, Iterator> Range;
25  typedef std::pair<ConstIterator, ConstIterator> ConstRange;
26  typedef std::set<int>::const_iterator LayerIter;
27  typedef std::pair<LayerIter, LayerIter> LayerRange;
28 
30 
32 
33 // from PHObject
34  void identify(std::ostream& os = std::cout) const override;
35  void Reset() override;
36 
38 
41  slatmap.erase(key);
42  }
43 
46  {
47  Iterator its = slatmap.begin();
48  Iterator last = slatmap.end();
49  for (; its != last;)
50  {
51  if (its->second == slat)
52  {
53  slatmap.erase(its++);
54  }
55  else
56  {
57  ++its;
58  }
59  }
60  }
61 
62 
64  ConstRange getScintillatorSlats(const short icolumn) const;
65 
67  ConstRange getScintillatorSlats( void ) const;
68 
70 
71  unsigned int size( void ) const
72  { return slatmap.size(); }
73 
74  double getTotalEdep() const;
75 
76  protected:
78 
79  ClassDefOverride(PHG4ScintillatorSlatContainer,1)
80 };
81 
82 #endif