LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SemiAnalyticalModel.h
Go to the documentation of this file.
1 #ifndef SEMIANALYTICALMODEL_H
2 #define SEMIANALYTICALMODEL_H
3 
4 // SemiAnalyticalModel
5 // - fast optical simulation using semi-analytical model
6 // - contains functions to calculate the number of direct and reflected photons
7 // incident
8 // each photo-detector, along with the necessary ultility functions (geometry
9 // calculations etc.)
10 // - full description of model: Eur. Phys. J. C 81, 349 (2021)
11 
12 // Nov 2021 by P. Green
13 
14 // LArSoft Libraries
17 
18 // fhicl
19 #include "fhiclcpp/ParameterSet.h"
20 
21 #include "TVector3.h"
22 
23 #include "boost/math/policies/policy.hpp"
24 
25 #include <map>
26 #include <vector>
27 
28 // Define a new policy *not* internally promoting RealType to double:
29 typedef boost::math::policies::policy<boost::math::policies::promote_double<false>>
31 
32 namespace phot {
34 
35  public:
36  // constructor
38  const fhicl::ParameterSet& VISHits,
39  const bool doReflectedLight = false,
40  const bool includeAnodeReflections = false,
41  const bool useXeAbsorption = false);
42 
43  // direct / VUV light
44  void detectedDirectVisibilities(std::vector<double>& DetectedVisibilities,
45  geo::Point_t const& ScintPoint) const;
46 
47  // reflected / visible light
48  void detectedReflectedVisibilities(std::vector<double>& ReflDetectedVisibilities,
49  geo::Point_t const& ScintPoint,
50  bool AnodeMode = false) const;
51 
52  private:
53  double VUVAbsorptionLength() const;
54 
55  // structure for rectangular solid angle calculation
56  struct Dims {
57  double h, w; // height, width
58  };
59 
60  // structure for optical detector information
61  struct OpticalDetector {
62  double h; // height
63  double w; // width
65  int type;
67  };
68 
69  // direct light photo-detector visibility calculation
70  double VUVVisibility(geo::Point_t const& ScintPoint, OpticalDetector const& opDet) const;
71 
72  // reflected light photo-detector visibility calculation
73  double VISVisibility(geo::Point_t const& ScintPoint,
74  OpticalDetector const& opDet,
75  const double cathode_visibility,
76  geo::Point_t const& hotspot,
77  bool AnodeMode = false) const;
78 
79  // Gaisser-Hillas
80  double Gaisser_Hillas(const double x, const double* par) const;
81 
82  // solid angle calculations
83  // rectangular aperture
84  double Rectangle_SolidAngle(const double a, const double b, const double d) const;
85  double Rectangle_SolidAngle(Dims const& o,
86  geo::Vector_t const& v,
87  const int OpDetOrientation) const;
88  // circular aperture
89  double Disk_SolidAngle(const double d, const double h, const double b) const;
90  // dome aperture calculation
91  double Omega_Dome_Model(const double distance, const double theta) const;
92 
93  // TODO: replace with geometry service
94  bool isOpDetInSameTPC(geo::Point_t const& ScintPoint, geo::Point_t const& OpDetPoint) const;
95  std::vector<OpticalDetector> opticalDetectors() const;
96 
97  // geometry properties
100  const int fNTPC;
101  const std::vector<geo::BoxBoundedGeo> fActiveVolumes;
104 
105  // photodetector geometry properties
106  const size_t fNOpDets;
107  const std::vector<OpticalDetector> fOpDetector;
108  double fradius;
111 
112  // For VUV semi-analytic hits
114  // flat PDs
116  std::vector<std::vector<double>> fGHvuvpars_flat;
117  std::vector<double> fborder_corr_angulo_flat;
118  std::vector<std::vector<double>> fborder_corr_flat;
119  // lateral PDs
121  std::vector<std::vector<double>> fGHvuvpars_flat_lateral;
122  std::vector<double> fborder_corr_angulo_flat_lateral;
123  std::vector<std::vector<double>> fborder_corr_flat_lateral;
124 
125  // dome PDs
127  std::vector<std::vector<double>> fGHvuvpars_dome;
128  std::vector<double> fborder_corr_angulo_dome;
129  std::vector<std::vector<double>> fborder_corr_dome;
130  // Field cage scaling
134 
135  // For VIS semi-analytic hits
136  const bool fDoReflectedLight;
138  // correction parameters for VIS Nhits estimation
141  // flat PDs
142  std::vector<double> fvis_distances_x_flat;
143  std::vector<double> fvis_distances_r_flat;
144  std::vector<std::vector<std::vector<double>>> fvispars_flat;
145  // lateral PDs
146  std::vector<double> fvis_distances_x_flat_lateral;
147  std::vector<double> fvis_distances_r_flat_lateral;
148  std::vector<std::vector<std::vector<double>>> fvispars_flat_lateral;
149  // dome PDs
150  std::vector<double> fvis_distances_x_dome;
151  std::vector<double> fvis_distances_r_dome;
152  std::vector<std::vector<std::vector<double>>> fvispars_dome;
153 
154  // absorption length
155  const bool fUseXeAbsorption;
157  };
158 
159 } // namespace phot
160 
161 #endif
Float_t x
Definition: compare.C:6
std::vector< double > fvis_distances_x_dome
std::vector< std::vector< double > > fborder_corr_flat_lateral
double VISVisibility(geo::Point_t const &ScintPoint, OpticalDetector const &opDet, const double cathode_visibility, geo::Point_t const &hotspot, bool AnodeMode=false) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:160
bool isOpDetInSameTPC(geo::Point_t const &ScintPoint, geo::Point_t const &OpDetPoint) const
boost::math::policies::policy< boost::math::policies::promote_double< false > > noLDoublePromote
double VUVVisibility(geo::Point_t const &ScintPoint, OpticalDetector const &opDet) const
double Rectangle_SolidAngle(const double a, const double b, const double d) const
std::vector< std::vector< std::vector< double > > > fvispars_dome
std::vector< std::vector< double > > fGHvuvpars_flat_lateral
std::vector< double > fvis_distances_r_flat
const std::vector< geo::BoxBoundedGeo > fActiveVolumes
std::vector< std::vector< double > > fborder_corr_dome
geo::GeometryCore const & fGeom
SemiAnalyticalModel(const fhicl::ParameterSet &VUVHits, const fhicl::ParameterSet &VISHits, const bool doReflectedLight=false, const bool includeAnodeReflections=false, const bool useXeAbsorption=false)
Definitions of geometry vector data types.
std::vector< double > fborder_corr_angulo_flat
std::vector< double > fvis_distances_r_dome
Float_t d
Definition: plot.C:235
std::vector< double > fborder_corr_angulo_dome
std::vector< std::vector< std::vector< double > > > fvispars_flat_lateral
double Gaisser_Hillas(const double x, const double *par) const
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
std::vector< double > fvis_distances_x_flat_lateral
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:180
General LArSoft Utilities.
std::vector< std::vector< double > > fGHvuvpars_flat
void detectedDirectVisibilities(std::vector< double > &DetectedVisibilities, geo::Point_t const &ScintPoint) const
double Omega_Dome_Model(const double distance, const double theta) const
std::vector< std::vector< double > > fGHvuvpars_dome
double Disk_SolidAngle(const double d, const double h, const double b) const
std::vector< double > fvis_distances_x_flat
void detectedReflectedVisibilities(std::vector< double > &ReflDetectedVisibilities, geo::Point_t const &ScintPoint, bool AnodeMode=false) const
std::vector< std::vector< std::vector< double > > > fvispars_flat
std::vector< double > fvis_distances_r_flat_lateral
std::vector< OpticalDetector > opticalDetectors() const
const std::vector< OpticalDetector > fOpDetector
std::vector< std::vector< double > > fborder_corr_flat
std::vector< double > fborder_corr_angulo_flat_lateral