All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropagationTimeModel.h
Go to the documentation of this file.
1 #ifndef PROPAGATIONTIMEMODEL_H
2 #define PROPAGATIONTIMEMODEL_H
3 
4 // PropagationTimeModel
5 // - parameterized fast optical simulation of photon propagation times
6 // - contains functions to calculate the propagation times of direct and reflected photons incident
7 // each photo-detector, along with the necessary ultility functions
8 // - full description of model: Eur. Phys. J. C 81, 349 (2021)
9 
10 // Nov 2021 by P. Green
11 
12 // LArSoft libraries
16 
17 // fhicl
18 #include "fhiclcpp/ParameterSet.h"
19 
20 #include "CLHEP/Random/RandFlat.h"
21 
22 namespace CLHEP {
23  class HepRandomEngine;
24 }
25 
26 // other
27 #include "TVector3.h"
28 #include "TF1.h"
29 
30 #include <array>
31 #include <vector>
32 
33 
35 
36 public:
37 
38  // constructor
39  PropagationTimeModel(fhicl::ParameterSet VUVTimingParams,
40  fhicl::ParameterSet VISTimingParams,
41  CLHEP::HepRandomEngine& ScintTimeEngine,
42  bool doReflectedLight = false,
43  bool GeoPropTimeOnly = false);
44 
45  // propagation time
46  void propagationTime(std::vector<double>& arrival_time_dist,
47  geo::Point_t const& x0,
48  const size_t OpChannel,
49  bool Reflected = false);
50 
51 private:
52 
53  // parameter and geometry initialization
54  void Initialization();
55 
56  // direct / VUV light
57  void getVUVTimes(std::vector<double>& arrivalTimes,
58  const double distance_in_cm,
59  const size_t angle_bin);
60 
61  void getVUVTimesGeo(std::vector<double>& arrivalTimes,
62  const double distance_in_cm);
63 
64  void generateParam(const size_t index,
65  const size_t angle_bin);
66 
67  // reflected / visible light
68  void getVISTimes(std::vector<double>& arrivalTimes,
69  const TVector3 &ScintPoint,
70  const TVector3 &OpDetPoint);
71 
72  // utility functions
73  double fast_acos(double x) const;
74 
75  double interpolate(const std::vector<double>& xData,
76  const std::vector<double>& yData,
77  double x,
78  bool extrapolate,
79  size_t i = 0) const;
80 
81  void interpolate3(std::array<double, 3>& inter,
82  const std::vector<double>& xData,
83  const std::vector<double>& yData1,
84  const std::vector<double>& yData2,
85  const std::vector<double>& yData3,
86  double x,
87  bool extrapolate);
88 
89  static double finter_d(const double* x, const double* par);
90 
91  static double model_close(const double* x, const double* par);
92 
93  static double model_far(const double* x, const double* par);
94 
95  // fhicl parameter sets
96  const fhicl::ParameterSet fVUVTimingParams;
97  const fhicl::ParameterSet fVISTimingParams;
98 
99  // configuration
100  const bool fdoReflectedLight;
101  const bool fGeoPropTimeOnly;
102 
103  // ISTPC class
105 
106  // random numbers
107  CLHEP::HepRandomEngine& fScintTimeEngine;
108  CLHEP::RandFlat fUniformGen;
109 
110  // geometry properties
111  double fplane_depth;
112  TVector3 fcathode_centre;
113  std::vector<geo::BoxBoundedGeo> fActiveVolumes;
114 
115  // photodetector geometry properties
116  size_t nOpDets;
117  std::vector<geo::Point_t> fOpDetCenter;
118  std::vector<int> fOpDetOrientation;
119 
120  // For VUV propagation time parametrization
122  std::vector<std::vector<double>> fparameters[7];
123  // vector containing generated VUV timing parameterisations
124  std::vector<std::vector<TF1>> fVUV_timing;
125  // vector containing min and max range VUV timing parameterisations are sampled to
126  std::vector<std::vector<double>> fVUV_max;
127  std::vector<std::vector<double>> fVUV_min;
128 
129  // For VIS propagation time parameterisation
131  std::vector<double> fdistances_refl;
132  std::vector<double> fradial_distances_refl;
133  std::vector<std::vector<std::vector<double>>> fcut_off_pars;
134  std::vector<std::vector<std::vector<double>>> ftau_pars;
135 
136 };
137 
138 #endif
void propagationTime(std::vector< double > &arrival_time_dist, geo::Point_t const &x0, const size_t OpChannel, bool Reflected=false)
process_name opflash particleana ie x
CLHEP::HepRandomEngine & fScintTimeEngine
void getVUVTimes(std::vector< double > &arrivalTimes, const double distance_in_cm, const size_t angle_bin)
PropagationTimeModel(fhicl::ParameterSet VUVTimingParams, fhicl::ParameterSet VISTimingParams, CLHEP::HepRandomEngine &ScintTimeEngine, bool doReflectedLight=false, bool GeoPropTimeOnly=false)
static double model_close(const double *x, const double *par)
void getVISTimes(std::vector< double > &arrivalTimes, const TVector3 &ScintPoint, const TVector3 &OpDetPoint)
static double finter_d(const double *x, const double *par)
std::vector< geo::Point_t > fOpDetCenter
void interpolate3(std::array< double, 3 > &inter, const std::vector< double > &xData, const std::vector< double > &yData1, const std::vector< double > &yData2, const std::vector< double > &yData3, double x, bool extrapolate)
double interpolate(const std::vector< double > &xData, const std::vector< double > &yData, double x, bool extrapolate, size_t i=0) const
std::vector< std::vector< std::vector< double > > > ftau_pars
std::vector< double > fradial_distances_refl
static double model_far(const double *x, const double *par)
Definitions of geometry vector data types.
std::vector< geo::BoxBoundedGeo > fActiveVolumes
double fast_acos(double x) const
std::vector< int > fOpDetOrientation
std::vector< std::vector< double > > fVUV_max
Provides a base class aware of world box coordinates.
void getVUVTimesGeo(std::vector< double > &arrivalTimes, const double distance_in_cm)
std::vector< std::vector< double > > fparameters[7]
const fhicl::ParameterSet fVUVTimingParams
std::vector< std::vector< std::vector< double > > > fcut_off_pars
std::vector< std::vector< TF1 > > fVUV_timing
std::vector< std::vector< double > > fVUV_min
std::vector< double > fdistances_refl
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
void generateParam(const size_t index, const size_t angle_bin)
const fhicl::ParameterSet fVISTimingParams