SimPhotons.cxx
Go to the documentation of this file.
1 /**
2  * @file lardataobj/Simulation/SimPhotons.cxx
3  * @brief Simulation objects for optical detectors (implementation file).
4  * @author Ben Jones
5  * @date 06/04/2010
6  * @see `lardataobj/Simulation/SimPhotons.h`
7  */
8 
9 // library header
11 
12 
13 // -----------------------------------------------------------------------------
14 // --- sim::SimPhotons
15 // -----------------------------------------------------------------------------
17 
18  this->insert(this->begin(), rhs.cbegin(), rhs.cend());
19  return *this;
20 
21 } // sim::SimPhotons::operator+=()
22 
23 
24 //----------------------------------------------------------------------------
26  { return sim::SimPhotons(*this) += rhs; }
27 
28 
29 // -----------------------------------------------------------------------------
30 // --- sim::SimPhotonsLite
31 // -----------------------------------------------------------------------------
32 sim::SimPhotonsLite& sim::SimPhotonsLite::operator+=
33  (const sim::SimPhotonsLite &rhs)
34 {
35 
36  for(auto const& phot: rhs.DetectedPhotons)
37  DetectedPhotons[phot.first] += phot.second;
38 
39  return *this;
40 } // sim::SimPhotonsLite::operator+=()
41 
42 
43 //----------------------------------------------------------------------------
44 sim::SimPhotonsLite sim::SimPhotonsLite::operator+
45  (const sim::SimPhotonsLite &rhs) const
46  { return sim::SimPhotonsLite(*this) += rhs; }
47 
48 
49 // -----------------------------------------------------------------------------
50 // --- sim::SimPhotonsCollection
51 // -----------------------------------------------------------------------------
52 
SimPhotons & operator+=(const SimPhotons &rhs)
Add all photons from rhs to this ones; no sorting is applied.
Definition: SimPhotons.cxx:16
Simulation objects for optical detectors.
General LArSoft Utilities.
Collection of photons which recorded on one channel.
Definition: SimPhotons.h:136
Compact representation of photons on a channel.
Definition: SimPhotons.h:103
SimPhotons operator+(const SimPhotons &rhs) const
Definition: SimPhotons.cxx:25
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72