Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 14 of file SimPhotonCounterAlg.cxx.

15 {
16  FillAllRanges( p.get< std::vector<fhicl::ParameterSet> >("SimPhotonCounterParams") );
17 }
void FillAllRanges(std::vector< fhicl::ParameterSet > const &)
p
Definition: test.py:223

Member Function Documentation

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

Definition at line 67 of file SimPhotonCounterAlg.cxx.

68 {
69  if(ph_col.size() != fCounters.at(0).GetVectorSize())
70  throw std::runtime_error("ERROR in SimPhotonCounterAlg: Photon collection size and OpDet size not equal.");
71 
72  for(auto const& photons : ph_col)
73  for(auto & counter : fCounters)
74  counter.AddSimPhotons(photons.second);
75 }
std::vector< SimPhotonCounter > fCounters
void opdet::SimPhotonCounterAlg::AddSimPhotonsVector ( std::vector< sim::SimPhotons > const &  spv)

Definition at line 77 of file SimPhotonCounterAlg.cxx.

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

Definition at line 84 of file SimPhotonCounterAlg.cxx.

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

Definition at line 19 of file SimPhotonCounterAlg.cxx.

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

Definition at line 31 of file SimPhotonCounterAlg.cxx.

32 {
33  std::vector<float> time_range(4);
34  time_range[0] = p.get<float>("MinPromptTime");
35  time_range[1] = p.get<float>("MaxPromptTime");
36  time_range[2] = p.get<float>("MinLateTime");
37  time_range[3] = p.get<float>("MaxLateTime");
38 
39  if( time_range[0]>time_range[1] || time_range[2]>time_range[3] || time_range[1]>time_range[2] )
40  throw std::runtime_error("ERROR in SimPhotonCounterAlg: Bad time range.");
41 
42  fTimeRanges.push_back(time_range);
43 
44  std::vector<float> wavelength_range(2);
45  wavelength_range[0] = p.get<float>("MinWavelength");
46  wavelength_range[1] = p.get<float>("MaxWavelength");
47 
48  if(wavelength_range[0] >= wavelength_range[1])
49  throw std::runtime_error("ERROR in SimPhotonCounterAlg: Bad wavelength range.");
50 
51  fWavelengthRanges.push_back(wavelength_range);
52 
53 }
std::vector< std::vector< float > > fTimeRanges
p
Definition: test.py:223
std::vector< std::vector< float > > fWavelengthRanges
opdet::SimPhotonCounter const & opdet::SimPhotonCounterAlg::GetSimPhotonCounter ( size_t  i)

Definition at line 100 of file SimPhotonCounterAlg.cxx.

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

Definition at line 55 of file SimPhotonCounterAlg.cxx.

57 {
58  fCounters.resize(fTimeRanges.size());
60  for(size_t i=0; i<fCounters.size(); i++)
61  fCounters[i] = SimPhotonCounter(fTimeRanges[i][0],fTimeRanges[i][1],
62  fTimeRanges[i][2],fTimeRanges[i][3],
64  std::vector<float>(odresponse->NOpChannels(),opdigip.QE()));
65 }
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 95 of file SimPhotonCounterAlg.cxx.

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

Definition at line 90 of file SimPhotonCounterAlg.cxx.

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

Member Data Documentation

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

Definition at line 42 of file SimPhotonCounterAlg.h.

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

Definition at line 41 of file SimPhotonCounterAlg.h.

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

Definition at line 40 of file SimPhotonCounterAlg.h.


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