14 FillAllRanges( p.
get< std::vector<fhicl::ParameterSet> >(
"SimPhotonCounterParams") );
25 for(
auto const& p : pv)
31 std::vector<float> time_range(4);
32 time_range[0] = p.
get<
float>(
"MinPromptTime");
33 time_range[1] = p.
get<
float>(
"MaxPromptTime");
34 time_range[2] = p.
get<
float>(
"MinLateTime");
35 time_range[3] = p.
get<
float>(
"MaxLateTime");
37 if( time_range[0]>time_range[1] || time_range[2]>time_range[3] || time_range[1]>time_range[2] )
38 throw std::runtime_error(
"ERROR in SimPhotonCounterAlg: Bad time range.");
42 std::vector<float> wavelength_range(2);
43 wavelength_range[0] = p.
get<
float>(
"MinWavelength");
44 wavelength_range[1] = p.
get<
float>(
"MaxWavelength");
46 if(wavelength_range[0] >= wavelength_range[1])
47 throw std::runtime_error(
"ERROR in SimPhotonCounterAlg: Bad wavelength range.");
67 if(ph_col.size() !=
fCounters.at(0).GetVectorSize())
68 throw std::runtime_error(
"ERROR in SimPhotonCounterAlg: Photon collection size and OpDet size not equal.");
70 for(
auto const& photons : ph_col)
72 counter.AddSimPhotons(photons.second);
77 for(
auto const& photons : spv)
79 counter.AddSimPhotons(photons);
85 counter.ClearVectors();
90 return fCounters.at(i).PromptPhotonVector();
95 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 &)
void AddSimPhotonsVector(std::vector< sim::SimPhotons > const &)
std::vector< SimPhotonCounter > fCounters
std::vector< std::vector< float > > fTimeRanges
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)
std::vector< std::vector< float > > fWavelengthRanges
void AddSimPhotonCollection(sim::SimPhotonsCollection const &)
Namespace collecting geometry-related classes utilities.
double QE() const
Returns quantum efficiency.