17 FillAllRanges(p.
get<std::vector<fhicl::ParameterSet>>(
"SimPhotonCounterParams"));
28 for (
auto const& p : pv)
34 std::vector<float> time_range(4);
35 time_range[0] = p.
get<
float>(
"MinPromptTime");
36 time_range[1] = p.
get<
float>(
"MaxPromptTime");
37 time_range[2] = p.
get<
float>(
"MinLateTime");
38 time_range[3] = p.
get<
float>(
"MaxLateTime");
40 if (time_range[0] > time_range[1] || time_range[2] > time_range[3] ||
41 time_range[1] > time_range[2])
42 throw std::runtime_error(
"ERROR in SimPhotonCounterAlg: Bad time range.");
46 std::vector<float> wavelength_range(2);
47 wavelength_range[0] = p.
get<
float>(
"MinWavelength");
48 wavelength_range[1] = p.
get<
float>(
"MaxWavelength");
50 if (wavelength_range[0] >= wavelength_range[1])
51 throw std::runtime_error(
"ERROR in SimPhotonCounterAlg: Bad wavelength range.");
61 for (
size_t i = 0; i <
fCounters.size(); i++)
73 if (ph_col.size() !=
fCounters.at(0).GetVectorSize())
74 throw std::runtime_error(
75 "ERROR in SimPhotonCounterAlg: Photon collection size and OpDet size not equal.");
77 for (
auto const& photons : ph_col)
79 counter.AddSimPhotons(photons.second);
84 for (
auto const& photons : spv)
97 return fCounters.at(i).PromptPhotonVector();
102 return fCounters.at(i).LatePhotonVector();
void InitializeCounters(geo::GeometryCore const &, opdet::OpDigiProperties const &)
std::vector< float > const & LatePhotonVector(size_t)
void FillRanges(fhicl::ParameterSet const &)
SimPhotonCounter const & GetSimPhotonCounter(size_t)
void FillAllRanges(std::vector< fhicl::ParameterSet > const &)
std::vector< std::vector< float > > fWavelengthRanges
void AddSimPhotonsVector(std::vector< sim::SimPhotons > const &)
std::vector< SimPhotonCounter > fCounters
double QE() const noexcept
Returns quantum efficiency.
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
virtual int NOpChannels() const
T get(std::string const &key) const
SimPhotonCounterAlg(fhicl::ParameterSet const &)
Description of geometry of one entire detector.
std::vector< float > const & PromptPhotonVector(size_t)
void AddSimPhotonCollection(sim::SimPhotonsCollection const &)
Namespace collecting geometry-related classes utilities.
std::vector< std::vector< float > > fTimeRanges
Collection of sim::SimPhotons, indexed by channel number.