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 // fhicl
13 #include "fhiclcpp/ParameterSet.h"
14 
15 // LArSoft libraries
17 
18 // random numbers
19 #include "CLHEP/Random/RandFlat.h"
20 
21 // other
22 #include "TVector3.h"
23 #include "TF1.h"
24 
25 #include <vector>
26 
27 
29 
30 public:
31 
32  // constructor
34  fhicl::ParameterSet VISTimingParams,
35  CLHEP::HepRandomEngine& ScintTimeEngine,
36  bool doReflectedLight = false,
37  bool GeoPropTimeOnly = false);
38 
39  // propagation time
40  void propagationTime(std::vector<double>& arrival_time_dist,
41  geo::Point_t const& x0,
42  const size_t OpChannel,
43  bool Reflected = false);
44 
45 private:
46 
47  // parameter and geometry initialization
48  void Initialization();
49 
50  // direct / VUV light
51  void getVUVTimes(std::vector<double>& arrivalTimes,
52  const double distance_in_cm,
53  const size_t angle_bin);
54 
55  void getVUVTimesGeo(std::vector<double>& arrivalTimes,
56  const double distance_in_cm);
57 
58  void generateParam(const size_t index,
59  const size_t angle_bin);
60 
61  // reflected / visible light
62  void getVISTimes(std::vector<double>& arrivalTimes,
63  const TVector3 &ScintPoint,
64  const TVector3 &OpDetPoint);
65 
66  // utility functions
67  double fast_acos(double x) const;
68 
69  double interpolate(const std::vector<double>& xData,
70  const std::vector<double>& yData,
71  double x,
72  bool extrapolate,
73  size_t i = 0) const;
74 
75  void interpolate3(std::array<double, 3>& inter,
76  const std::vector<double>& xData,
77  const std::vector<double>& yData1,
78  const std::vector<double>& yData2,
79  const std::vector<double>& yData3,
80  double x,
81  bool extrapolate);
82 
83  static double finter_d(const double* x, const double* par);
84 
85  static double model_close(const double* x, const double* par);
86 
87  static double model_far(const double* x, const double* par);
88 
89  // fhicl parameter sets
92 
93  // configuration
96 
97  // ISTPC class
99 
100  // random numbers
101  CLHEP::HepRandomEngine& fScintTimeEngine;
102 
103  // geometry properties
104  double fplane_depth;
105  TVector3 fcathode_centre;
106  std::vector<geo::BoxBoundedGeo> fActiveVolumes;
107 
108  // photodetector geometry properties
109  size_t nOpDets;
110  std::vector<geo::Point_t> fOpDetCenter;
111  std::vector<int> fOpDetOrientation;
112 
113  // For VUV propagation time parametrization
115  std::vector<std::vector<double>> fparameters[7];
116  // vector containing generated VUV timing parameterisations
117  std::vector<std::vector<TF1>> VUV_timing;
118  // vector containing min and max range VUV timing parameterisations are sampled to
119  std::vector<std::vector<double>> VUV_max;
120  std::vector<std::vector<double>> VUV_min;
121 
122  // For VIS propagation time parameterisation
124  std::vector<double> fdistances_refl;
125  std::vector<double> fradial_distances_refl;
126  std::vector<std::vector<std::vector<double>>> fcut_off_pars;
127  std::vector<std::vector<std::vector<double>>> ftau_pars;
128 
129 };
130 
131 #endif
Index OpChannel(Index detNum, Index channel)
void propagationTime(std::vector< double > &arrival_time_dist, geo::Point_t const &x0, const size_t OpChannel, bool Reflected=false)
fhicl::ParameterSet fVISTimingParams
CLHEP::HepRandomEngine & fScintTimeEngine
void getVUVTimes(std::vector< double > &arrivalTimes, const double distance_in_cm, const size_t angle_bin)
std::vector< std::vector< double > > VUV_max
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)
std::vector< geo::BoxBoundedGeo > fActiveVolumes
double fast_acos(double x) const
std::vector< int > fOpDetOrientation
std::vector< std::vector< TF1 > > VUV_timing
fhicl::ParameterSet fVUVTimingParams
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 getVUVTimesGeo(std::vector< double > &arrivalTimes, const double distance_in_cm)
std::vector< std::vector< double > > fparameters[7]
std::vector< std::vector< double > > VUV_min
std::vector< std::vector< std::vector< double > > > fcut_off_pars
list x
Definition: train.py:276
std::vector< double > fdistances_refl
void generateParam(const size_t index, const size_t angle_bin)