79 #ifndef OpFastScintillation_h 80 #define OpFastScintillation_h 1 90 #include "Geant4/G4ForceCondition.hh" 91 #include "Geant4/G4ParticleDefinition.hh" 92 #include "Geant4/G4PhysicsOrderedFreeVector.hh" 93 #include "Geant4/G4PhysicsTable.hh" 94 #include "Geant4/G4ProcessType.hh" 95 #include "Geant4/G4String.hh" 96 #include "Geant4/G4ThreeVector.hh" 97 #include "Geant4/G4Types.hh" 98 #include "Geant4/G4VRestDiscreteProcess.hh" 101 #include "TVector3.h" 105 class G4EmSaturation;
108 class G4VParticleChange;
116 class PhotonVisibilityService;
145 G4ProcessType
type = fElectromagnetic);
158 virtual G4bool IsApplicable(
const G4ParticleDefinition& aParticleType);
162 G4double GetMeanFreePath(
const G4Track& aTrack, G4double, G4ForceCondition*);
167 G4double GetMeanLifeTime(
const G4Track& aTrack, G4ForceCondition*);
172 virtual G4VParticleChange* PostStepDoIt(
const G4Track& aTrack,
const G4Step& aStep);
173 virtual G4VParticleChange* AtRestDoIt(
const G4Track& aTrack,
const G4Step& aStep);
177 void SetTrackSecondariesFirst(
const G4bool state);
182 void SetFiniteRiseTime(
const G4bool state);
186 G4bool GetTrackSecondariesFirst()
const;
189 G4bool GetFiniteRiseTime()
const;
192 void SetScintillationYieldFactor(
const G4double yieldfactor);
197 G4double GetScintillationYieldFactor()
const;
200 void SetScintillationExcitationRatio(
const G4double excitationratio);
206 G4double GetScintillationExcitationRatio()
const;
209 G4PhysicsTable* GetFastIntegralTable()
const;
212 G4PhysicsTable* GetSlowIntegralTable()
const;
236 void SetScintillationByParticleType(
const G4bool);
243 return scintillationByParticleType;
248 void DumpPhysicsTable()
const;
255 void getVUVTimes(std::vector<double>& arrivalTimes,
const double distance_in_cm,
const size_t angle_bin);
256 void generateParam(
const size_t index,
const size_t angle_bin);
259 void getVISTimes(std::vector<double>& arrivalTimes,
const TVector3 &ScintPoint,
const TVector3 &OpDetPoint);
262 void detectedDirectHits(std::map<size_t, int>& DetectedNum,
265 void detectedReflecHits(std::map<size_t, int>& ReflDetectedNum,
270 void BuildThePhysicsTable();
274 bool RecordPhotonsProduced(
const G4Step& aStep,
double N);
304 bool usesSemiAnalyticModel()
const;
306 int VUVHits(
const double Nphotons_created,
313 const double cathode_hits_rec,
314 const std::array<double, 3> hotspot)
const;
317 G4double single_exp(
const G4double
t,
const G4double tau2)
const;
318 G4double bi_exp(
const G4double
t,
const G4double
tau1,
const G4double tau2)
const;
320 G4double scint_time(
const G4Step& aStep,
321 G4double ScintillationTime,
322 G4double ScintillationRiseTime)
const;
323 void propagationTime(std::vector<double>& arrival_time_dist,
326 bool Reflected =
false);
329 G4double sample_time(
const G4double
tau1,
const G4double tau2)
const;
332 double reemission_energy()
const;
334 std::unique_ptr<CLHEP::RandGeneral>
fTPBEm;
336 void average_position(G4Step
const& aStep,
double* xzyPos)
const;
351 double fstep_size, fmin_d, fmax_d,
fvuv_vgroup_mean, fvuv_vgroup_max, finflexion_point_distance, fangle_bin_timing_vuv;
352 std::vector<std::vector<double>> fparameters[7];
364 std::vector<std::vector<std::vector<double>>>
ftau_pars;
371 double Rectangle_SolidAngle(
const double a,
const double b,
const double d)
const;
372 double Rectangle_SolidAngle(
Dims const& o,
const std::array<double, 3> v)
const;
374 double Disk_SolidAngle(
const double d,
const double h,
const double b)
const;
376 double Omega_Dome_Model(
const double distance,
const double theta)
const;
380 G4double Gaisser_Hillas(
const double x,
const double* par)
const;
423 void ProcessStep(
const G4Step&
step);
431 bool const fUseNhitsModel =
false;
433 bool const fOnlyActiveVolume =
false;
436 bool const fOnlyOneCryostat =
false;
438 bool const fOpaqueCathode =
false;
441 bool isScintInActiveVolume(
geo::Point_t const& ScintPoint);
442 double interpolate(
const std::vector<double>& xData,
443 const std::vector<double>& yData,
447 void interpolate3(std::array<double, 3>& inter,
448 const std::vector<double>& xData,
449 const std::vector<double>& yData1,
450 const std::vector<double>& yData2,
451 const std::vector<double>& yData3,
453 bool extrapolate)
const;
455 static std::vector<geo::BoxBoundedGeo> extractActiveVolumes(
geo::GeometryCore const& geom);
472 OpFastScintillation::IsApplicable(
const G4ParticleDefinition& aParticleType)
474 if (aParticleType.GetParticleName() ==
"opticalphoton")
return false;
475 if (aParticleType.IsShortLived())
return false;
481 OpFastScintillation::SetTrackSecondariesFirst(
const G4bool state)
483 fTrackSecondariesFirst = state;
487 OpFastScintillation::SetFiniteRiseTime(
const G4bool state)
489 fFiniteRiseTime = state;
493 OpFastScintillation::GetTrackSecondariesFirst()
const 495 return fTrackSecondariesFirst;
499 OpFastScintillation::GetFiniteRiseTime()
const 501 return fFiniteRiseTime;
505 OpFastScintillation::SetScintillationYieldFactor(
const G4double yieldfactor)
507 YieldFactor = yieldfactor;
511 OpFastScintillation::GetScintillationYieldFactor()
const 517 OpFastScintillation::SetScintillationExcitationRatio(
const G4double excitationratio)
519 ExcitationRatio = excitationratio;
523 OpFastScintillation::GetScintillationExcitationRatio()
const 525 return ExcitationRatio;
528 inline G4PhysicsTable*
529 OpFastScintillation::GetSlowIntegralTable()
const 531 return theSlowIntegralTable.get();
534 inline G4PhysicsTable*
535 OpFastScintillation::GetFastIntegralTable()
const 537 return theFastIntegralTable.get();
541 OpFastScintillation::DumpPhysicsTable()
const 543 if (theFastIntegralTable) {
544 G4int PhysicsTableSize = theFastIntegralTable->entries();
545 G4PhysicsOrderedFreeVector* v;
546 for (G4int i = 0; i < PhysicsTableSize; i++) {
547 v = (G4PhysicsOrderedFreeVector*)(*theFastIntegralTable)[i];
551 if (theSlowIntegralTable) {
552 G4int PhysicsTableSize = theSlowIntegralTable->entries();
553 G4PhysicsOrderedFreeVector* v;
554 for (G4int i = 0; i < PhysicsTableSize; i++) {
555 v = (G4PhysicsOrderedFreeVector*)(*theSlowIntegralTable)[i];
561 template <
typename TReal>
562 inline constexpr
double 567 d += (*(x +
p) - *(y +
p)) * (*(x +
p) - *(y +
p));
572 template <
typename TVector3>
573 inline constexpr
double 574 dist(
const std::array<double, 3>
x,
const TVector3
y,
const unsigned int dimension,
const unsigned int start)
578 d += (x[
p] - y[
p]) * (x[
p] - y[
p]);
585 template <
typename TReal>
586 inline constexpr
static bool 589 TReal diff = std::fabs(a - b);
591 if (diff < std::fmax(std::fabs(a), std::fabs(b)) *
tolerance)
return true;
597 template <
typename TReal>
598 inline constexpr
static bool 601 if (std::fabs(a) <=
tolerance)
return true;
607 template <
typename TReal>
608 inline constexpr
static bool 613 if (diff < std::fmax(std::fabs(a), std::fabs(b)) *
tolerance)
return true;
617 template <
typename TReal>
618 inline constexpr
static bool 623 if (diff > std::fmax(std::fabs(a), std::fabs(b)) *
tolerance)
return true;
Index OpChannel(Index detNum, Index channel)
std::vector< std::vector< std::vector< double > > > fvispars_dome
G4bool scintillationByParticleType
G4EmSaturation * GetSaturation() const
std::vector< geo::Point_t > fOpDetCenter
std::vector< double > fOpDetHeight
std::map< double, double > tpbemission
std::vector< std::vector< std::vector< double > > > fvispars_flat
G4bool fTrackSecondariesFirst
constexpr double dist(const std::array< double, 3 > x, const TVector3 y, const unsigned int dimension, const unsigned int start)
std::vector< double > fvis_distances_r_flat
double finter_d(double *x, double *par)
std::vector< double > fdistances_refl
std::unique_ptr< G4PhysicsTable > theSlowIntegralTable
double model_far(double *x, double *par)
std::vector< std::vector< TF1 > > VUV_timing
std::vector< int > fOpDetType
double model_close(double *x, double *par)
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
constexpr double acos_table(const double x)
std::vector< double > fborder_corr_angulo_flat
std::vector< double > fOpDetLength
std::unique_ptr< CLHEP::RandGeneral > fTPBEm
std::vector< geo::BoxBoundedGeo > const fActiveVolumes
std::vector< std::vector< std::vector< double > > > ftau_pars
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
G4bool GetScintillationByParticleType() const
Description of 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
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
std::vector< double > fvis_distances_r_dome
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
Definitions of geometry vector data types.
void AddSaturation(G4EmSaturation *sat)
G4EmSaturation * emSaturation
static const size_t acos_bins
static constexpr bool isDefinitelyLessThan(TReal a, TReal b, TReal tolerance=std::numeric_limits< TReal >::epsilon())
phot::MappedFunctions_t ParPropTimeTF1
LArSoft geometry interface.
static constexpr bool isApproximatelyZero(TReal a, TReal tolerance=std::numeric_limits< TReal >::epsilon())
double LandauPlusExpoFinal(double *x, double *par)
double fast_acos(double x)
std::unique_ptr< G4PhysicsTable > theFastIntegralTable