/////////////////////////////////////////////////////////////////////////////// // // 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 ); // Return results of last disc intersection test (used by PEnergy) G4bool GetLastTestResult() { return fLastResult; } 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 first attempt at a parameterization // This had not been tuned to data, but it was used for water-phase MC // normal: normal of the disc surface // position: position of the photon at the disc surface in local coordinates // direction: direction in local coordinates // polarisation: polarisation in local coordinates void DiscReflect( const G4ThreeVector& normal, G4ThreeVector& position, G4ThreeVector& direction, G4ThreeVector& polarisation, G4double& time); // Function will reflect a photon using a rather detailed model // For a full explanation see DocDB 6413 // normal: normal of the disc surface // direction: direction in local coordinates // polarisation: polarisation in local coordinates // time: time at which the photon hits the disc void DiscReflect2( const G4ThreeVector& normal, 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 G4int tableVersion; 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 fCollectionEfficiency; // Collection efficiency of the PMT // Parameters for V1 of grey disc reflections // 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 ; // Parameters for V2 of grey disc reflections G4double fThetaBreak ; //= 0.85; G4double fSpecProbAm ; // = 0.2; G4double fSpecProbAb ; // = 0. G4double fSpecProbBm ; //= 2.; G4double fPhiSba ; //= 4.1; G4double fPhiSbb ; //= 1.3; G4double fSpecStd ; //= 0.1; G4double fSpecProbF ; // 0.4; G4double fNonspecStd ; //= 0.3; G4double fNonspecProbF ; // 0.15; G4double fNonspecM ; //= -0.3875; G4double fNonspecB ; //= 0.61; // 35 deg in rad G4double fTdelMean ; //= 0.6; G4double fTdelStd ; //= 0.43; G4VSolid* fEnvelopeVolume; // The PMT envelope logical volume // Results of last disc intersection test G4bool fLastResult; }; } //::RAT #endif