//////////////////////////////////////////////////////////////////////////////
//
// Extends the PMTOpticalModel and provides a PMT model that matches
// SNOMAN 5_0294. The extension comprises of: Overwriting the Aluminium
// refractive index, overwriting the Glass refractive index, introducing
// a modified collection efficiency.
//
// Author: Phil G Jones <p.jones22@physics.ox.ac.uk>
//
// REVISION HISTORY:
//     05/11/2010 : P G Jones - New file
//     2014-08-05 : P G Jones - Updated doxygen.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef __RAT_PMTSNOMANOpticalModel_hh__
#define __RAT_PMTSNOMANOpticalModel_hh__

#include <RAT/PMTOpticalModel.hh>

class G4Region;
class G4LogicalVolume;

namespace RAT
{

class PMTSNOMANOpticalModel : public PMTOpticalModel
{
public:
  // The constructor invoked with the model name, region of application and envelope flag.
  //
  // name: name of this model
  // region: region this model is applied in
  // params: parameters that control this models settings, index to RATDB
  // pmtVolume: PMT volume this model applies to
  // envelopeVolume: envelope volume this model applies to
  // photocathodeSurface: optical surface properties
  // mirrorSurface: optical surface properties
  PMTSNOMANOpticalModel( const G4String name, G4Region* const region,
                         const std::string params, G4LogicalVolume* const pmtVolume,
                         G4LogicalVolume* const envelopeVolume,
                         G4OpticalSurface* const photocathodeSurface,
                         G4OpticalSurface* const mirrorSurface );

  // The method that does the actual tracking
  //
  // fastTrack: track to track
  // fastStep: result of tracking
  virtual void DoIt( const G4FastTrack& fastTrack, G4FastStep& fastStep );

protected:
  // Returns the probability that an absorbed hit caused a pe signal
  //
  // pmtID: PMT ID
  // position: position in local coordinates
  // energy: energy of the photon
  // weight: weight of the track >0 to be alive
  virtual G4double GetSignalProbability( const G4int pmtID,
                                         const G4ThreeVector position,
                                         const G4double energy,
                                         const G4double weight );

  // MCE Parameters, see Optics6b
  G4double fA1; // Modified Collection Efficiency A1 parameter
  G4double fA2; // Modified Collection Efficiency A2 parameter
  G4double fA3; // Modified Collection Efficiency A3 parameter
  G4double fB1; // Modified Collection Efficiency B1 parameter
  G4double fB2; // Modified Collection Efficiency B2 parameter
};

} //::RAT
#endif