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*);
172 virtual G4VParticleChange*
PostStepDoIt(
const G4Track& aTrack,
const G4Step& aStep);
173 virtual G4VParticleChange*
AtRestDoIt(
const G4Track& aTrack,
const G4Step& aStep);
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);
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;
321 G4double ScintillationTime,
322 G4double ScintillationRiseTime)
const;
325 const size_t OpChannel,
326 bool Reflected =
false);
329 G4double
sample_time(
const G4double tau1,
const G4double tau2)
const;
334 std::unique_ptr<CLHEP::RandGeneral>
fTPBEm;
364 std::vector<std::vector<std::vector<double>>>
ftau_pars;
374 double Disk_SolidAngle(
const double d,
const double h,
const double b)
const;
442 double interpolate(
const std::vector<double>& xData,
443 const std::vector<double>& yData,
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;
474 if (aParticleType.GetParticleName() ==
"opticalphoton")
return false;
475 if (aParticleType.IsShortLived())
return false;
528 inline G4PhysicsTable*
534 inline G4PhysicsTable*
545 G4PhysicsOrderedFreeVector* v;
546 for (G4int i = 0; i < PhysicsTableSize; i++) {
553 G4PhysicsOrderedFreeVector* v;
554 for (G4int i = 0; i < PhysicsTableSize; 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
587 isApproximatelyEqual(TReal
a, TReal b, TReal
tolerance = std::numeric_limits<TReal>::epsilon())
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
599 isApproximatelyZero(TReal a, TReal
tolerance = std::numeric_limits<TReal>::epsilon())
601 if (std::fabs(a) <=
tolerance)
return true;
607 template <
typename TReal>
608 inline constexpr
static bool
609 isDefinitelyLessThan(TReal a, TReal b, TReal
tolerance = std::numeric_limits<TReal>::epsilon())
613 if (diff < std::fmax(std::fabs(a), std::fabs(b)) *
tolerance)
return true;
617 template <
typename TReal>
618 inline constexpr
static bool
619 isDefinitelyGreaterThan(TReal a, TReal b, TReal
tolerance = std::numeric_limits<TReal>::epsilon())
623 if (diff > std::fmax(std::fabs(a), std::fabs(b)) *
tolerance)
return true;
std::vector< std::vector< std::vector< double > > > fvispars_dome
G4bool scintillationByParticleType
void detectedDirectHits(std::map< size_t, int > &DetectedNum, const double Num, geo::Point_t const &ScintPoint) const
G4PhysicsTable * GetSlowIntegralTable() const
G4EmSaturation * GetSaturation() const
void detectedReflecHits(std::map< size_t, int > &ReflDetectedNum, const double Num, geo::Point_t const &ScintPoint) const
void average_position(G4Step const &aStep, double *xzyPos) const
bool isScintInActiveVolume(geo::Point_t const &ScintPoint)
std::vector< geo::Point_t > fOpDetCenter
G4double bi_exp(const G4double t, const G4double tau1, const G4double tau2) const
G4bool GetFiniteRiseTime() const
double finflexion_point_distance
process_name opflash particleana ie x
G4double GetScintillationExcitationRatio() const
G4double Gaisser_Hillas(const double x, const double *par) const
std::vector< double > fOpDetHeight
static std::vector< geo::BoxBoundedGeo > extractActiveVolumes(geo::GeometryCore const &geom)
void propagationTime(std::vector< double > &arrival_time_dist, G4ThreeVector x0, const size_t OpChannel, bool Reflected=false)
G4bool GetTrackSecondariesFirst() const
bool const fOnlyActiveVolume
Whether photon propagation is performed only from active volumes.
int VISHits(geo::Point_t const &ScintPoint, OpticalDetector const &opDet, const double cathode_hits_rec, const std::array< double, 3 > hotspot) const
std::map< double, double > tpbemission
std::vector< std::vector< std::vector< double > > > fvispars_flat
G4bool fTrackSecondariesFirst
bool isOpDetInSameTPC(geo::Point_t const &ScintPoint, geo::Point_t const &OpDetPoint) const
std::vector< double > fvis_distances_r_flat
void ProcessStep(const G4Step &step)
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< std::vector< double > > fparameters[7]
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
G4double scint_time(const G4Step &aStep, G4double ScintillationTime, G4double ScintillationRiseTime) const
double fangle_bin_timing_vis
void getVISTimes(std::vector< double > &arrivalTimes, const TVector3 &ScintPoint, const TVector3 &OpDetPoint)
OpFastScintillation(const G4String &processName="Scintillation", G4ProcessType type=fElectromagnetic)
std::vector< std::vector< double > > fGHvuvpars_dome
int VUVHits(const double Nphotons_created, geo::Point_t const &ScintPoint, OpticalDetector const &opDet) const
std::vector< double > fborder_corr_angulo_dome
constexpr unsigned int dimension()
virtual G4VParticleChange * AtRestDoIt(const G4Track &aTrack, const G4Step &aStep)
bool const bPropagate
Whether propagation of photons is enabled.
std::vector< std::vector< double > > fborder_corr_dome
void SetScintillationYieldFactor(const G4double yieldfactor)
std::vector< std::vector< double > > fborder_corr_flat
void BuildThePhysicsTable()
std::vector< double > fvis_distances_x_flat
constexpr double acos_table(const double x)
bool usesSemiAnalyticModel() const
Returns whether the semi-analytic visibility parametrization is being used.
process_name opflash particleana ie ie y
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
std::vector< double > fborder_corr_angulo_flat
std::vector< double > fOpDetLength
void SetScintillationByParticleType(const G4bool)
Definitions of geometry vector data types.
bool RecordPhotonsProduced(const G4Step &aStep, double N)
std::unique_ptr< CLHEP::RandGeneral > fTPBEm
virtual G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
std::vector< geo::BoxBoundedGeo > const fActiveVolumes
std::vector< std::vector< std::vector< double > > > ftau_pars
void SetTrackSecondariesFirst(const G4bool state)
G4PhysicsTable * GetFastIntegralTable() const
G4bool GetScintillationByParticleType() const
Description of geometry of one entire detector.
G4double sample_time(const G4double tau1, const G4double tau2) const
Provides a base class aware of world box coordinates.
void DumpPhysicsTable() const
void SetScintillationExcitationRatio(const G4double excitationratio)
bool const fOnlyOneCryostat
std::vector< double > fradial_distances_refl
std::vector< double > fvis_distances_r_dome
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) const
std::vector< std::vector< std::vector< double > > > fcut_off_pars
void SetFiniteRiseTime(const G4bool state)
double fcathode_ydimension
bool const fUseNhitsModel
Whether the semi-analytic model is being used for photon visibility.
A container for photon visibility mapping data.
std::vector< double > fvis_distances_x_dome
Declaration of types related to photon visibility.
double Rectangle_SolidAngle(const double a, const double b, const double d) const
void getVUVTimes(std::vector< double > &arrivalTimes, const double distance_in_cm, const size_t angle_bin)
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
double Omega_Dome_Model(const double distance, const double theta) const
double reemission_energy() const
double Disk_SolidAngle(const double d, const double h, const double b) const
double interpolate(const std::vector< double > &xData, const std::vector< double > &yData, double x, bool extrapolate, size_t i=0) const
phot::MappedT0s_t ReflT0s
process_name largeant stream1 can override from command line with o or output physics producers generator N
void generateParam(const size_t index, const size_t angle_bin)
virtual G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep)
phot::PhotonVisibilityService const *const fPVS
Photon visibility service instance.
bool const fOpaqueCathode
Whether the cathodes are fully opaque; currently hard coded "no".
std::vector< std::vector< double > > VUV_max
void AddSaturation(G4EmSaturation *sat)
G4EmSaturation * emSaturation
static const size_t acos_bins
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
G4double GetMeanLifeTime(const G4Track &aTrack, G4ForceCondition *)
phot::MappedFunctions_t ParPropTimeTF1
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double fcathode_zdimension
double fangle_bin_timing_vuv
G4double GetScintillationYieldFactor() const
G4double single_exp(const G4double t, const G4double tau2) const
double LandauPlusExpoFinal(double *x, double *par)
double fast_acos(double x)
std::unique_ptr< G4PhysicsTable > theFastIntegralTable