All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 25 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 15 of file SimPhotonCounterAlg.cxx.

16 {
17  FillAllRanges( p.get< std::vector<fhicl::ParameterSet> >("SimPhotonCounterParams") );
18 }
pdgs p
Definition: selectors.fcl:22
void FillAllRanges(std::vector< fhicl::ParameterSet > const &)

Member Function Documentation

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

Definition at line 68 of file SimPhotonCounterAlg.cxx.

69 {
70  if(ph_col.size() != fCounters.at(0).GetVectorSize())
71  throw std::runtime_error("ERROR in SimPhotonCounterAlg: Photon collection size and OpDet size not equal.");
72 
73  for(auto const& photons : ph_col)
74  for(auto & counter : fCounters)
75  counter.AddSimPhotons(photons.second);
76 }
std::vector< SimPhotonCounter > fCounters
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
void opdet::SimPhotonCounterAlg::AddSimPhotonsVector ( std::vector< sim::SimPhotons > const &  spv)

Definition at line 78 of file SimPhotonCounterAlg.cxx.

79 {
80  for(auto const& photons : spv)
81  for(auto & counter : fCounters)
82  counter.AddSimPhotons(photons);
83 }
std::vector< SimPhotonCounter > fCounters
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
void opdet::SimPhotonCounterAlg::ClearCounters ( )

Definition at line 85 of file SimPhotonCounterAlg.cxx.

86 {
87  for(auto & counter : fCounters)
88  counter.ClearVectors();
89 }
std::vector< SimPhotonCounter > fCounters
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
void opdet::SimPhotonCounterAlg::FillAllRanges ( std::vector< fhicl::ParameterSet > const &  pv)
private

Definition at line 20 of file SimPhotonCounterAlg.cxx.

21 {
22  fTimeRanges.clear();
23  fWavelengthRanges.clear();
24 
25  fTimeRanges.reserve(pv.size());
26  fWavelengthRanges.reserve(pv.size());
27 
28  for(auto const& p : pv)
29  FillRanges(p);
30 }
pdgs p
Definition: selectors.fcl:22
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 32 of file SimPhotonCounterAlg.cxx.

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

Definition at line 101 of file SimPhotonCounterAlg.cxx.

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

Definition at line 56 of file SimPhotonCounterAlg.cxx.

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

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

Definition at line 91 of file SimPhotonCounterAlg.cxx.

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

Member Data Documentation

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

Definition at line 46 of file SimPhotonCounterAlg.h.

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

Definition at line 45 of file SimPhotonCounterAlg.h.

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

Definition at line 44 of file SimPhotonCounterAlg.h.


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