//////////////////////////////////////////////////////////////////// /// \class RAT::PosGen_FillExp /// /// \brief Generates exponential distribution of events in given volume(s). /// distribution depends on radius see documentation: SNO+-doc-2153-v1 /// /// \author Aleksandra Bialek -- contact person /// /// REVISION HISTORY: /// - 23 Aug 2013 : A.Bialek - new position generator that generates events /// within the volume with an exponential distribution /// that depends on the radius see documentation: SNO+-doc-2153-v1 /// - 26 Nov 2014 : Matt Strait -doxygen fixes /// - 21 Oct 2016 : Nuno Barros - Fixed position generator that incorrectly sampled the center /// if there were off-center daughter volumes like the NCD anchors in the inner_av. /// Closed issue #1392. /// - 10 Dec 2016 : Nuno Barros - Fixed a bug in the previous bug fix. A transformation to global coordinates was missing /// /// \details /// Arguments of the generator:\n /// /generator/pos/set x y z dr \n /// or \n /// /generator/pos/set volName dr \n /// if 'dr' not given it will take the default value /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_PosGen_FillExp__ #define __RAT_PosGen_FillExp__ #include #include #include #include #include class G4VPhysicalVolume; class G4VSolid; class G4Navigator; namespace RAT { class PosGen_FillExp : public GLG4PosGen { public: /// Constructor sets the default db name PosGen_FillExp(const std::string& dbname = std::string("fillexp")) : GLG4PosGen(dbname) {} /// Destructor virtual ~PosGen_FillExp() {} /// 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 std::vector fStateDR;///< List of decay rates of radial distribution per state std::vector fDecayRates; ///< List of decay rates of radial distributions ///exponential function TF1 *fRdecay; /// 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