Analysis Software
Documentation for sPHENIX simulation 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 <iostream> // for cout, ostream
11 #include <map>
12 #include <set>
13 #include <utility> // for pair
14 
16 
18 {
19  public:
20  typedef std::map<PHG4ScintillatorSlatDefs::keytype, PHG4ScintillatorSlat *> 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  typedef std::set<int>::const_iterator LayerIter;
26  typedef std::pair<LayerIter, LayerIter> LayerRange;
27 
29 
31 
32  // from PHObject
33  void identify(std::ostream &os = std::cout) const override;
34  void Reset() override;
35 
37 
40  {
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 
63  ConstRange getScintillatorSlats(const short icolumn) const;
64 
66  ConstRange getScintillatorSlats(void) const;
67 
69 
70  unsigned int size(void) const
71  {
72  return slatmap.size();
73  }
74 
75  double getTotalEdep() const;
76 
77  protected:
79 
80  ClassDefOverride(PHG4ScintillatorSlatContainer, 1)
81 };
82 
83 #endif