///////////////////////////////////////////////////////////////////////////////
//
// Tracks photons to a disc and decides if photoelectrons are created.
// Replaces complex PMT geometry with a disc and look-up tables for code
// run time improvements.
//
// Author: Phil G Jones
//
// REVISION HISTORY:
// 05/11/2010 : P G Jones - New file
// 2014-08-05 : P G Jones - Updated doxygen.
// 2016-10-23 : N Barros - Added a history word to the photoelectron.
// 2017-04-11 : J P Yanez - Added a reflection model
//
///////////////////////////////////////////////////////////////////////////////
#ifndef __RAT_DiscOpticalModel_hh__
#define __RAT_DiscOpticalModel_hh__
#include
#include
class G4Region;
class G4FastTrack;
namespace RAT
{
class DiscOpticalModel : public G4VFastSimulationModel,
public OpticalModelBase
{
public:
// The constructor invoked with the model name and applicable region
//
// name: name of this model
// region: region this model is applied in
// params: parameter that control this models settings, index to RATDB
// volume: volume this model applies to
// discZ: position in the envelope in local co-ords, there is little power
// to distinguish these two isotopes
DiscOpticalModel( const G4String name, G4Region* const region,
const std::string params, G4LogicalVolume* const volume,
const G4double discZ );
// The destructor, does nothing at the moment
~DiscOpticalModel();
// Returns true if this model applies to the particle type
//
// type: type of particle this model applies to
// Returns true if the type is an optical photon
G4bool IsApplicable( const G4ParticleDefinition& type );
// Returns true if this model should be invoked
//
// fastTrack: track to consider
// Returns true if the fastTrack triggers this model
G4bool ModelTrigger( const G4FastTrack & fastTrack );
// The method that does the actual tracking
//
// fastTrack: track to track
// fastStep: result of tracking
virtual void DoIt( const G4FastTrack& fastTrack, G4FastStep& fastStep );
private:
// Track the photon, i.e. reflect or absorb the photon
//
// fastTrack: photon track information
// ipmt: PMT ID
// position: position in local coordinates
// direction: direction in local coordinates
// polarisation: polarisation in local coordinates
// time: time in global MC units
// weight: weight of the track >0 to be alive
void TrackPhoton( const G4FastTrack& fastTrack, const G4int ipmt,
G4ThreeVector& position, G4ThreeVector& direction,
G4ThreeVector& polarisation, G4double& time,
G4double& weight );
// Function will reflect a photon using a Gaussian spread as in vxpmt_hit.for,
// This code has a hardwired bounce distribution with a Gaussian distribution with a sigma of 0.1 in
// the cosine of the polar angle with respect to the PMT and a random
// azimuthal distribution (this is selected to give crude agreement with
// the distribution created by the full PMT simulation)
//
// normal: normal of the disc surface
// direction: direction in local coordinates
// polarisation: polarisation in local coordinates
void DiscReflect( const G4ThreeVector& normal, G4ThreeVector& position,
G4ThreeVector& direction,
G4ThreeVector& polarisation,
G4double& time);
// Return the reflection probability for the angle and wavelength.
//
// Note DB table is in 10nm blocks from 220nm to 710nm with each block
// having 90 elements for 0-89 degrees
//
// theta: theta in radians
// wavelength: wavelength in nm
// Returns reflection probability
G4double GetReflectionProb( const G4double theta, const G4double wavelength ) const;
// Return the absorption probability for the angle and wavelength.
//
// Note DB table is in 10nm blocks from 220nm to 710nm with each block
// having 90 elements for 0-89 degrees
//
// theta: theta in radians
// wavelength: wavelength in nm
// Returns reflection probability
G4double GetPMTContactTime(G4ThreeVector& position,
G4ThreeVector& direction) const;
// Returns the contact "time" of the photon and the PMT surface
// Used to determine if a photon would have hit the PMT or the concentrator
bool IsPMTReflectionSingle( const G4double radius,
G4ThreeVector& direction) const ;
// Returns true if the photon is expected to leave after touching only the PMT surface
bool IsPetalReflectionSingle( const G4double radius) const ;
// Returns true if the photon is expected to leave after touching only concentrator surface
G4double GetAbsorptionProb( const G4double theta, const G4double wavelength ) const;
std::vector fAbsorption; // Lookup table for absorption probabilities
std::vector fReflection; // Lookup table for reflection probabilities
G4double fTravelTime; // Minimum photon travel time across the PMT Geometry (if absorbed)
G4double fDecayConstant; // Width of travel time spread
G4double fDiscZ; // Z position of disc in PMT co-ord system
G4double fDiscRadius; // Radius of disc in PMT co-ord system
G4double fBounceSpread; // Spread of reflected angles
G4double fCollectionEfficiency; // Collection efficiency of the PMT
// Parameters for full reflection model of the GREYDISC
// Single reflections, hitting the PMT first
G4double fPMTOneReflRotationTheta ;
G4double fPMTOneReflMean;
G4double fPMTOneReflSpread;
G4double fPMTOneReflPhiFlatProb ;
G4double fPMTOneReflPhiSpread;
G4double fTDelaySpread;
G4double fPMTOneDelayFactor;
// Multiple reflections, hitting the PMT first
G4double fPMTMultReflRotationTheta ;
G4double fPMTMultReflMean;
G4double fPMTMultReflSpread;
std::vector fPMTMultReflPhiSpread ;
std::vector fPMTMultReflPhiMean ;
G4double fPMTMultDelayFactor ;
// Hitting PETALS first
G4double fCONCThetaSpread ;
// Single reflections
std::vector fCONCPhiCoeffs ;
std::vector fCONCOneDelay ;
std::vector fCONCOneDelayMax ;
// Multiple reflections
G4double fCONCMultPhiSpread ;
G4double fCONCMultPhiDiffuse;
std::vector fCONCMultDelay ;
// Parameters that determine the type of reflection
std::vector fCONCReflCoeffs;
G4double fPMTReflRotation ;
std::vector fPMTReflCoeffs;
// Description of the PMT (ellipsoid)
G4double fPMTEllipsoidA;
G4double fPMTEllipsoidB ;
G4double fPMTZMinContact ;
G4VSolid* fEnvelopeVolume; // The PMT envelope logical volume
};
} //::RAT
#endif