////////////////////////////////////////////////////////////////////
/// \class RAT::PosGen_Fill
///
/// \brief Generates events in set filled volume(s).
///
/// \author Phil G Jones
/// \author Matthew Mottram -- contact person
///
/// REVISION HISTORY:\n
/// 11 Jun 2012 : P.Jones - Refactor of GLG4PosGen.
/// 04 July 2012 : D.Resnick - Use VolumeList to store volumes.
/// Sep 2013: A.Bialek - included scaling factor for number of tries
/// to find point within the volume(for details see DocDB - )
/// Oct 2016 : N. Barros - Fixed bug in sampling the center if there were
/// off-center daughter volumes like the NCD anchors in the inner_av.
/// Closed issue #1392.
/// Dec 2016 : N. Barros - Fixed bug on bug fix transforming the local coordinates into global ones.
///
/// \details Multiple volume fills can be added by calling the
/// /generator/pos/set command multiple times e.g:
/// /generator/pos/set 0 0 0
/// /generator/pos/set 1000 0 0
/// For events in the volumes located at the centre and 1m
/// on x axis.
/// The number of generated positions in each physical
/// volume is proportional to the volume (size).
////////////////////////////////////////////////////////////////////
#ifndef __RAT_PosGen_Fill__
#define __RAT_PosGen_Fill__
#include
#include
#include
#include
class G4VPhysicalVolume;
class G4VSolid;
class G4Navigator;
namespace RAT
{
class PosGen_Fill : public GLG4PosGen
{
public:
/// Constructor sets the default db name
PosGen_Fill( const std::string& dbname = std::string( "fill" ) ) : GLG4PosGen( dbname ) {}
/// Destructor
virtual ~PosGen_Fill() {}
/// Abstract interface for generating the position
virtual void GeneratePosition( G4ThreeVector& argResult );
/// Abstract interface for setting the state
virtual void SetState( G4String newValues );
/// Abstract interface for getting the state
virtual G4String GetState() const;
protected:
VolumeList fVolumes; ///< List of volumes to generate events in
std::vector fStates; ///< List of states to build fVolumes
/// The total volume of all the physical volumes to fill, in mm^3
double fTotalVolume;
/// A flag marking whether the list of volumes needs to be regenerated
bool fListValid;
private:
};
} // namespace RAT
#endif