//////////////////////////////////////////////////////////////////////// /// \class RAT::Co60SourceGen /// /// \brief Generates Co60 at the centre of the Co60 source plastic /// scintillator /// /// \author Logan Sibley /// /// REVISION HISTORY:\n /// 21 January 2014 : L. Sibley - First version. /// /// \detail Generates Co60 decays in the centre of the plastic /// scintillator of the Co60 source for any source position. /// To run this generator, first load the Co60 source geometry /// /// /rat/db/load geo/TaggedSource.geo /// /// then set any db values of interest (see Co60Source.geo). /// To run the generator, use /// /// /generator/add co60source /// /// This generator is completely internally specified, so /// there is no need to set a generator state. Additionally, /// the generator does not require a vertex, position or time /// generator to be set. Attempts to set a state are ignored. /// /// The generator may be run either setting /// /// /rat/run/start NEVENTS /// /// to specify the number of events required, or by doing /// /// /rat/run/duration TIME UNIT /// /rat/run/start /// /// which sets the duration of the run (in units UNIT). The /// latter method requires a source activity, which is /// calculated using a reference date and activity for the /// source from Co60Source.geo, and the run date from /// DATE.ratdb. If you wish to specify a particular rate and /// not have the code calculate it, then set /// /// /rat/db/set GEO[Co60Source] ref_activity activityinBq, /// /rat/db/set GEO[Co60Source] ref_date "", /// /// where activityinBq is the desired activity in Bq. If the /// reference date cannot be found, or is an empty string, it /// will be assumed to be equal to the run date. /// //////////////////////////////////////////////////////////////////////// #ifndef __RAT_Co60SourceGen__ #define __RAT_Co60SourceGen__ #include #include #include #include #include class G4Event; namespace RAT { class Co60SourceGen : public GLG4Gen_Combo { public: Co60SourceGen(); virtual ~Co60SourceGen() {}; virtual bool IsRepeatable() const { return true; }; virtual void SetState(G4String state); virtual G4String GetState() const {return fStateStr;}; virtual void SetVertexState(G4String /*state*/); virtual G4String GetVertexState() const {return fVertexStateStr;}; virtual void SetPosState(G4String /*state*/); virtual G4String GetPosState() const {return fPosStateStr;}; virtual void SetTimeState(G4String /*state*/); virtual G4String GetTimeState() const {return fTimeStateStr;}; G4String GetEvRate() {return fEvRate;}; protected: G4String fStateStr; G4String fSourceName; // Name of volume with source activity G4String fVertexStateStr; // Holds the vertex state G4String fPosStateStr; // Holds the position state G4String fTimeStateStr; // Holds the time state private: void BuildMonthMap(); // A map of month names to integers int GetMonthInt(std::string month); // Get the integer of the month from its name void SetEvRate(); // Calculate and set the event rate std::map< std::string, int > fMonth;// The month map G4String fEvRate; // String containing the event rate EventTime fEvTime; // EventTime object to handle universal times std::vector fPos; // The source position int fLCN; // The logical channel number for the source double fRefActivity; // The reference source activity std::string fRefDate; // The reference date for that activity std::vector fHalfLife; // The Co60 half-life double fActivity; // The calculated activity }; } // namespace RAT #endif