LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
opdet::SimPhotonCounterAlg Class Reference

#include "SimPhotonCounterAlg.h"

Public Member Functions

 SimPhotonCounterAlg (fhicl::ParameterSet const &)
 
void InitializeCounters (geo::GeometryCore const &, opdet::OpDigiProperties const &)
 
void AddSimPhotonCollection (sim::SimPhotonsCollection const &)
 
void AddSimPhotonsVector (std::vector< sim::SimPhotons > const &)
 
void ClearCounters ()
 
SimPhotonCounter const & GetSimPhotonCounter (size_t)
 
std::vector< float > const & PromptPhotonVector (size_t)
 
std::vector< float > const & LatePhotonVector (size_t)
 

Private Member Functions

void FillAllRanges (std::vector< fhicl::ParameterSet > const &)
 
void FillRanges (fhicl::ParameterSet const &)
 

Private Attributes

std::vector< std::vector< float > > fWavelengthRanges
 
std::vector< std::vector< float > > fTimeRanges
 
std::vector< SimPhotonCounterfCounters
 

Detailed Description

Definition at line 21 of file SimPhotonCounterAlg.h.

Constructor & Destructor Documentation

opdet::SimPhotonCounterAlg::SimPhotonCounterAlg ( fhicl::ParameterSet const &  p)

Title: SimPhotonCounterALG Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Alg class that counts up sim photons, leading towards comparisons with flashes and flash hypotheses.

Definition at line 12 of file SimPhotonCounterAlg.cxx.

References FillAllRanges(), and fhicl::ParameterSet::get().

13 {
14  FillAllRanges( p.get< std::vector<fhicl::ParameterSet> >("SimPhotonCounterParams") );
15 }
void FillAllRanges(std::vector< fhicl::ParameterSet > const &)

Member Function Documentation

void opdet::SimPhotonCounterAlg::AddSimPhotonCollection ( sim::SimPhotonsCollection const &  ph_col)

Definition at line 65 of file SimPhotonCounterAlg.cxx.

References fCounters.

66 {
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.");
69 
70  for(auto const& photons : ph_col)
71  for(auto & counter : fCounters)
72  counter.AddSimPhotons(photons.second);
73 }
std::vector< SimPhotonCounter > fCounters
void opdet::SimPhotonCounterAlg::AddSimPhotonsVector ( std::vector< sim::SimPhotons > const &  spv)

Definition at line 75 of file SimPhotonCounterAlg.cxx.

References fCounters.

Referenced by opdet::FlashHypothesisAnaAlg::RunComparison().

76 {
77  for(auto const& photons : spv)
78  for(auto & counter : fCounters)
79  counter.AddSimPhotons(photons);
80 }
std::vector< SimPhotonCounter > fCounters
void opdet::SimPhotonCounterAlg::ClearCounters ( )

Definition at line 82 of file SimPhotonCounterAlg.cxx.

References fCounters.

83 {
84  for(auto & counter : fCounters)
85  counter.ClearVectors();
86 }
std::vector< SimPhotonCounter > fCounters
void opdet::SimPhotonCounterAlg::FillAllRanges ( std::vector< fhicl::ParameterSet > const &  pv)
private

Definition at line 17 of file SimPhotonCounterAlg.cxx.

References FillRanges(), fTimeRanges, and fWavelengthRanges.

Referenced by SimPhotonCounterAlg().

18 {
19  fTimeRanges.clear();
20  fWavelengthRanges.clear();
21 
22  fTimeRanges.reserve(pv.size());
23  fWavelengthRanges.reserve(pv.size());
24 
25  for(auto const& p : pv)
26  FillRanges(p);
27 }
void FillRanges(fhicl::ParameterSet const &)
std::vector< std::vector< float > > fTimeRanges
std::vector< std::vector< float > > fWavelengthRanges
void opdet::SimPhotonCounterAlg::FillRanges ( fhicl::ParameterSet const &  p)
private

Definition at line 29 of file SimPhotonCounterAlg.cxx.

References fTimeRanges, fWavelengthRanges, and fhicl::ParameterSet::get().

Referenced by FillAllRanges().

30 {
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");
36 
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.");
39 
40  fTimeRanges.push_back(time_range);
41 
42  std::vector<float> wavelength_range(2);
43  wavelength_range[0] = p.get<float>("MinWavelength");
44  wavelength_range[1] = p.get<float>("MaxWavelength");
45 
46  if(wavelength_range[0] >= wavelength_range[1])
47  throw std::runtime_error("ERROR in SimPhotonCounterAlg: Bad wavelength range.");
48 
49  fWavelengthRanges.push_back(wavelength_range);
50 
51 }
std::vector< std::vector< float > > fTimeRanges
std::vector< std::vector< float > > fWavelengthRanges
opdet::SimPhotonCounter const & opdet::SimPhotonCounterAlg::GetSimPhotonCounter ( size_t  i)

Definition at line 98 of file SimPhotonCounterAlg.cxx.

References fCounters.

Referenced by opdet::FlashHypothesisAnaAlg::RunComparison().

99 {
100  return fCounters.at(i);
101 }
std::vector< SimPhotonCounter > fCounters
void opdet::SimPhotonCounterAlg::InitializeCounters ( geo::GeometryCore const &  geo,
opdet::OpDigiProperties const &  opdigip 
)

Definition at line 53 of file SimPhotonCounterAlg.cxx.

References fCounters, fTimeRanges, fWavelengthRanges, opdet::OpDetResponseInterface::NOpChannels(), and opdet::OpDigiProperties::QE().

Referenced by opdet::FlashHypothesisAnaAlg::RunComparison().

55 {
56  fCounters.resize(fTimeRanges.size());
58  for(size_t i=0; i<fCounters.size(); i++)
59  fCounters[i] = SimPhotonCounter(fTimeRanges[i][0],fTimeRanges[i][1],
60  fTimeRanges[i][2],fTimeRanges[i][3],
62  std::vector<float>(odresponse->NOpChannels(),opdigip.QE()));
63 }
std::vector< SimPhotonCounter > fCounters
std::vector< std::vector< float > > fTimeRanges
std::vector< std::vector< float > > fWavelengthRanges
std::vector< float > const & opdet::SimPhotonCounterAlg::LatePhotonVector ( size_t  i)

Definition at line 93 of file SimPhotonCounterAlg.cxx.

References fCounters.

94 {
95  return fCounters.at(i).LatePhotonVector();
96 }
std::vector< SimPhotonCounter > fCounters
std::vector< float > const & opdet::SimPhotonCounterAlg::PromptPhotonVector ( size_t  i)

Definition at line 88 of file SimPhotonCounterAlg.cxx.

References fCounters.

89 {
90  return fCounters.at(i).PromptPhotonVector();
91 }
std::vector< SimPhotonCounter > fCounters

Member Data Documentation

std::vector<SimPhotonCounter> opdet::SimPhotonCounterAlg::fCounters
private
std::vector< std::vector<float> > opdet::SimPhotonCounterAlg::fTimeRanges
private

Definition at line 41 of file SimPhotonCounterAlg.h.

Referenced by FillAllRanges(), FillRanges(), and InitializeCounters().

std::vector< std::vector<float> > opdet::SimPhotonCounterAlg::fWavelengthRanges
private

Definition at line 40 of file SimPhotonCounterAlg.h.

Referenced by FillAllRanges(), FillRanges(), and InitializeCounters().


The documentation for this class was generated from the following files: