LArSoft  v10_04_05
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
18 
19 // fhicl
20 #include "fhiclcpp/fwd.h"
21 
22 #include "TVector3.h"
23 
24 #include "boost/math/policies/policy.hpp"
25 
26 #include <map>
27 #include <vector>
28 
29 // Define a new policy *not* internally promoting RealType to double:
30 typedef boost::math::policies::policy<boost::math::policies::promote_double<false>>
32 
33 namespace phot {
35 
36  public:
37  // constructor
39  const fhicl::ParameterSet& VISHits,
40  const bool doReflectedLight = false,
41  const bool includeAnodeReflections = false,
42  const bool useXeAbsorption = false);
43 
44  // direct / VUV light
45  void detectedDirectVisibilities(std::vector<double>& DetectedVisibilities,
46  geo::Point_t const& ScintPoint) const;
47 
48  // reflected / visible light
49  void detectedReflectedVisibilities(std::vector<double>& ReflDetectedVisibilities,
50  geo::Point_t const& ScintPoint,
51  bool AnodeMode = false) const;
52 
53  private:
54  double VUVAbsorptionLength() const;
55 
56  // structure for rectangular solid angle calculation
57  struct Dims {
58  double h, w; // height, width
59  };
60 
61  // structure for optical detector information
62  struct OpticalDetector {
63  double h; // height
64  double w; // width
66  int type;
68  };
69 
70  // direct light photo-detector visibility calculation
71  double VUVVisibility(geo::Point_t const& ScintPoint, OpticalDetector const& opDet) const;
72 
73  // reflected light photo-detector visibility calculation
74  double VISVisibility(geo::Point_t const& ScintPoint,
75  OpticalDetector const& opDet,
76  const double cathode_visibility,
77  geo::Point_t const& hotspot,
78  bool AnodeMode = false) const;
79 
80  // Gaisser-Hillas
81  double Gaisser_Hillas(const double x, const double* par) const;
82 
83  // solid angle calculations
84  // rectangular aperture
85  double Rectangle_SolidAngle(const double a, const double b, const double d) const;
86  double Rectangle_SolidAngle(Dims const& o,
87  geo::Vector_t const& v,
88  const int OpDetOrientation) const;
89  // circular aperture
90  double Disk_SolidAngle(const double d, const double h, const double b) const;
91  // dome aperture calculation
92  double Omega_Dome_Model(const double distance, const double theta) const;
93 
94  bool isOpDetInSameTPC(geo::Point_t const& ScintPoint, geo::Point_t const& OpDetPoint) const;
95  std::vector<OpticalDetector> opticalDetectors() const;
96 
97  // geometry properties
101  const int fNTPC;
102  const std::vector<geo::BoxBoundedGeo> fActiveVolumes;
106 
107  // photodetector geometry properties
108  const size_t fNOpDets;
109  const std::vector<OpticalDetector> fOpDetector;
110  double fradius;
113 
114  // For VUV semi-analytic hits
116  // flat PDs
118  std::vector<std::vector<double>> fGHvuvpars_flat;
119  std::vector<double> fborder_corr_angulo_flat;
120  std::vector<std::vector<double>> fborder_corr_flat;
121  // lateral PDs
123  std::vector<std::vector<double>> fGHvuvpars_flat_lateral;
124  std::vector<double> fborder_corr_angulo_flat_lateral;
125  std::vector<std::vector<double>> fborder_corr_flat_lateral;
126 
127  // dome PDs
129  std::vector<std::vector<double>> fGHvuvpars_dome;
130  std::vector<double> fborder_corr_angulo_dome;
131  std::vector<std::vector<double>> fborder_corr_dome;
132  // Field cage scaling
136 
137  // For VIS semi-analytic hits
138  const bool fDoReflectedLight;
140  // correction parameters for VIS Nhits estimation
143  // flat PDs
144  std::vector<double> fvis_distances_x_flat;
145  std::vector<double> fvis_distances_r_flat;
146  std::vector<std::vector<std::vector<double>>> fvispars_flat;
147  // lateral PDs
148  std::vector<double> fvis_distances_x_flat_lateral;
149  std::vector<double> fvis_distances_r_flat_lateral;
150  std::vector<std::vector<std::vector<double>>> fvispars_flat_lateral;
151  // dome PDs
152  std::vector<double> fvis_distances_x_dome;
153  std::vector<double> fvis_distances_r_dome;
154  std::vector<std::vector<std::vector<double>>> fvispars_dome;
155 
156  // absorption length
157  const bool fUseXeAbsorption;
159 
160  // maximum distance
162  };
163 
164 } // namespace phot
165 
166 #endif
Float_t x
Definition: compare.C:6
std::vector< double > fvis_distances_x_dome
std::vector< std::vector< double > > fborder_corr_flat_lateral
geo::WireReadoutGeom const & fChannelMap
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.
Interface for a class providing readout channel mapping to geometry.
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 the physical geometry of one entire detector.
Definition: GeometryCore.h:91
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