20 #ifndef OpFastScintillation_h 21 #define OpFastScintillation_h 1 28 #include "Geant4/G4ForceCondition.hh" 29 #include "Geant4/G4ParticleDefinition.hh" 30 #include "Geant4/G4PhysicsOrderedFreeVector.hh" 31 #include "Geant4/G4PhysicsTable.hh" 32 #include "Geant4/G4ProcessType.hh" 33 #include "Geant4/G4String.hh" 34 #include "Geant4/G4ThreeVector.hh" 35 #include "Geant4/G4Types.hh" 36 #include "Geant4/G4VRestDiscreteProcess.hh" 46 class G4VParticleChange;
51 class PhotonVisibilityService;
59 G4ProcessType
type = fElectromagnetic);
67 virtual G4bool IsApplicable(
const G4ParticleDefinition& aParticleType);
71 G4double GetMeanFreePath(
const G4Track& aTrack, G4double, G4ForceCondition*);
75 G4double GetMeanLifeTime(
const G4Track& aTrack, G4ForceCondition*);
79 virtual G4VParticleChange* PostStepDoIt(
const G4Track& aTrack,
const G4Step& aStep);
80 virtual G4VParticleChange* AtRestDoIt(
const G4Track& aTrack,
const G4Step& aStep);
84 void SetTrackSecondariesFirst(
const G4bool state);
89 void SetFiniteRiseTime(
const G4bool state);
93 G4bool GetTrackSecondariesFirst()
const;
96 G4bool GetFiniteRiseTime()
const;
99 void SetScintillationYieldFactor(
const G4double yieldfactor);
104 G4double GetScintillationYieldFactor()
const;
107 void SetScintillationExcitationRatio(
const G4double excitationratio);
112 G4double GetScintillationExcitationRatio()
const;
115 G4PhysicsTable* GetFastIntegralTable()
const;
118 G4PhysicsTable* GetSlowIntegralTable()
const;
130 void SetScintillationByParticleType(
const G4bool);
137 void DumpPhysicsTable()
const;
140 void getVUVTimes(std::vector<double>& arrivalTimes,
141 const double distance_in_cm,
142 const size_t angle_bin);
143 void generateParam(
const size_t index,
const size_t angle_bin);
147 void getVISTimes(std::vector<double>& arrivalTimes,
148 const TVector3& ScintPoint,
149 const TVector3& OpDetPoint);
152 void detectedDirectHits(std::map<size_t, int>& DetectedNum,
155 void detectedReflecHits(std::map<size_t, int>& ReflDetectedNum,
160 void BuildThePhysicsTable();
163 bool RecordPhotonsProduced(
const G4Step& aStep,
double N);
188 bool usesSemiAnalyticModel()
const;
190 int VUVHits(
const double Nphotons_created,
197 const double cathode_hits_rec,
198 const std::array<double, 3> hotspot)
const;
201 G4double single_exp(
const G4double t,
const G4double tau2)
const;
202 G4double bi_exp(
const G4double t,
const G4double tau1,
const G4double tau2)
const;
204 G4double scint_time(
const G4Step& aStep,
205 G4double ScintillationTime,
206 G4double ScintillationRiseTime)
const;
207 void propagationTime(std::vector<double>& arrival_time_dist,
209 const size_t OpChannel,
210 bool Reflected =
false);
213 G4double sample_time(
const G4double tau1,
const G4double tau2)
const;
216 double reemission_energy()
const;
218 std::unique_ptr<CLHEP::RandGeneral>
fTPBEm;
220 void average_position(G4Step
const& aStep,
double* xzyPos)
const;
228 double fstep_size, fmin_d, fmax_d,
fvuv_vgroup_mean, fvuv_vgroup_max, finflexion_point_distance,
229 fangle_bin_timing_vuv;
230 std::vector<std::vector<double>> fparameters[7];
242 std::vector<std::vector<std::vector<double>>>
ftau_pars;
249 double Rectangle_SolidAngle(
const double a,
const double b,
const double d)
const;
250 double Rectangle_SolidAngle(
Dims const& o,
const std::array<double, 3> v)
const;
252 double Disk_SolidAngle(
const double d,
const double h,
const double b)
const;
254 double Omega_Dome_Model(
const double distance,
const double theta)
const;
258 G4double Gaisser_Hillas(
const double x,
const double* par)
const;
299 void ProcessStep(
const G4Step& step);
307 bool const fUseNhitsModel =
false;
309 bool const fOnlyActiveVolume =
false;
312 bool const fOnlyOneCryostat =
false;
314 bool const fOpaqueCathode =
false;
317 bool isScintInActiveVolume(
geo::Point_t const& ScintPoint);
318 double interpolate(
const std::vector<double>& xData,
319 const std::vector<double>& yData,
324 const std::vector<double>& xData,
325 const std::vector<double>& yData1,
326 const std::vector<double>& yData2,
327 const std::vector<double>& yData3,
329 bool extrapolate)
const;
331 static std::vector<geo::BoxBoundedGeo> extractActiveVolumes(
geo::GeometryCore const& geom);
335 inline G4bool OpFastScintillation::IsApplicable(
const G4ParticleDefinition& aParticleType)
337 if (aParticleType.GetParticleName() ==
"opticalphoton")
return false;
338 if (aParticleType.IsShortLived())
return false;
343 inline void OpFastScintillation::SetTrackSecondariesFirst(
const G4bool state)
345 fTrackSecondariesFirst = state;
348 inline void OpFastScintillation::SetFiniteRiseTime(
const G4bool state)
350 fFiniteRiseTime = state;
353 inline G4bool OpFastScintillation::GetTrackSecondariesFirst()
const 355 return fTrackSecondariesFirst;
358 inline G4bool OpFastScintillation::GetFiniteRiseTime()
const 360 return fFiniteRiseTime;
363 inline void OpFastScintillation::SetScintillationYieldFactor(
const G4double yieldfactor)
365 YieldFactor = yieldfactor;
368 inline G4double OpFastScintillation::GetScintillationYieldFactor()
const 373 inline void OpFastScintillation::SetScintillationExcitationRatio(
const G4double excitationratio)
375 ExcitationRatio = excitationratio;
378 inline G4double OpFastScintillation::GetScintillationExcitationRatio()
const 380 return ExcitationRatio;
383 inline G4PhysicsTable* OpFastScintillation::GetSlowIntegralTable()
const 385 return theSlowIntegralTable.get();
388 inline G4PhysicsTable* OpFastScintillation::GetFastIntegralTable()
const 390 return theFastIntegralTable.get();
393 inline void OpFastScintillation::DumpPhysicsTable()
const 395 if (theFastIntegralTable) {
396 G4int PhysicsTableSize = theFastIntegralTable->entries();
397 G4PhysicsOrderedFreeVector* v;
398 for (G4int i = 0; i < PhysicsTableSize; i++) {
399 v = (G4PhysicsOrderedFreeVector*)(*theFastIntegralTable)[i];
403 if (theSlowIntegralTable) {
404 G4int PhysicsTableSize = theSlowIntegralTable->entries();
405 G4PhysicsOrderedFreeVector* v;
406 for (G4int i = 0; i < PhysicsTableSize; i++) {
407 v = (G4PhysicsOrderedFreeVector*)(*theSlowIntegralTable)[i];
413 template <
typename TReal>
417 for (
unsigned int p = 0; p <
dimension; ++p) {
418 d += (*(x + p) - *(y + p)) * (*(x + p) - *(y + p));
423 template <
typename TVector3>
424 inline double dist(
const std::array<double, 3>
x,
427 const unsigned int start)
430 for (
unsigned int p = start; p <
dimension; ++p) {
431 d += (x[p] - y[p]) * (x[p] - y[p]);
438 template <
typename TReal>
439 inline constexpr
static bool 442 TReal diff = std::fabs(a - b);
443 if (diff <= tolerance)
return true;
444 if (diff < std::fmax(std::fabs(a), std::fabs(b)) * tolerance)
return true;
450 template <
typename TReal>
453 TReal tolerance = std::numeric_limits<TReal>::epsilon())
455 if (std::fabs(a) <= tolerance)
return true;
461 template <
typename TReal>
462 inline constexpr
static bool 466 if (diff < tolerance)
return true;
467 if (diff < std::fmax(std::fabs(a), std::fabs(b)) * tolerance)
return true;
471 template <
typename TReal>
472 inline constexpr
static bool 476 if (diff > tolerance)
return true;
477 if (diff > std::fmax(std::fabs(a), std::fabs(b)) * tolerance)
return true;
std::vector< std::vector< std::vector< double > > > fvispars_dome
G4bool scintillationByParticleType
G4EmSaturation * GetSaturation() const
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, const double x, const bool extrapolate)
std::vector< double > fOpDetHeight
std::map< double, double > tpbemission
std::vector< std::vector< std::vector< double > > > fvispars_flat
G4bool fTrackSecondariesFirst
std::vector< double > fvis_distances_r_flat
std::vector< double > fdistances_refl
std::unique_ptr< G4PhysicsTable > theSlowIntegralTable
std::vector< std::vector< TF1 > > VUV_timing
std::vector< int > fOpDetType
std::vector< std::vector< double > > fGHvuvpars_flat
std::vector< std::vector< double > > VUV_min
std::vector< std::vector< double > > fGHvuvpars_dome
std::vector< double > fborder_corr_angulo_dome
constexpr unsigned int dimension()
bool const bPropagate
Whether propagation of photons is enabled.
std::vector< std::vector< double > > fborder_corr_dome
std::vector< std::vector< double > > fborder_corr_flat
std::vector< double > fvis_distances_x_flat
std::vector< double > fborder_corr_angulo_flat
std::vector< double > fOpDetLength
geo::Point_t fcathode_centre
Definitions of geometry vector data types.
std::unique_ptr< CLHEP::RandGeneral > fTPBEm
std::vector< geo::BoxBoundedGeo > const fActiveVolumes
std::vector< std::vector< std::vector< double > > > ftau_pars
double dist(const std::array< double, 3 > x, const TVector3 y, const unsigned int dimension, const unsigned int start)
G4bool GetScintillationByParticleType() const
Description of the physical geometry of one entire detector.
static constexpr bool isDefinitelyGreaterThan(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
Provides a base class aware of world box coordinates.
std::vector< double > fradial_distances_refl
std::vector< double > fvis_distances_r_dome
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
General LArSoft Utilities.
std::vector< std::vector< std::vector< double > > > fcut_off_pars
A container for photon visibility mapping data.
static constexpr bool isApproximatelyEqual(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
std::vector< double > fvis_distances_x_dome
Declaration of types related to photon visibility.
phot::MappedT0s_t ReflT0s
phot::PhotonVisibilityService const *const fPVS
Photon visibility service instance.
std::vector< std::vector< double > > VUV_max
void AddSaturation(G4EmSaturation *sat)
G4EmSaturation * emSaturation
static constexpr bool isDefinitelyLessThan(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
phot::MappedFunctions_t ParPropTimeTF1
double interpolate(const std::vector< double > &xData, const std::vector< double > &yData, const double x, const bool extrapolate, size_t i)
static constexpr bool isApproximatelyZero(TReal a, TReal tolerance=std::numeric_limits< TReal >::epsilon())
std::unique_ptr< G4PhysicsTable > theFastIntegralTable