diff --git a/include/crpropa/Source.h b/include/crpropa/Source.h index e5fdcc765..ad20e4a26 100644 --- a/include/crpropa/Source.h +++ b/include/crpropa/Source.h @@ -77,6 +77,20 @@ class SourceList: public SourceInterface { std::string getDescription() const; }; +/** + @class SourceListNumbered + @brief List of sources with a fixed number of candidates emitted per source + +class SourceListNumbered: public SourceInterface { +private: + std::vector > sources; // + int nSource; //< number of candidates from each source + int alreadyDrawn; //< number of candidates which have already been drawn + +public: + void add(Source* source); + ref_ptr getCandidate() const; +};*/ /** @class SourceParticleType @@ -952,6 +966,25 @@ class SourceMassDistribution: public SourceFeature { std::string getDescription(); }; +class SourceStartTime: public SourceFeature { +private: + double time; //< starting time for the particle + +public: + SourceStartTime(double time); + void prepareCandidate(Candidate& cand) const; +}; + +class SourceAddProperty: public SourceFeature { +private: + std::string key; //< property key + int value; //< property + +public: + SourceAddProperty(std::string key, int value); + void prepareCandidate(Candidate& cand) const; +}; + /** @} */ // end of group SourceFeature } // namespace crpropa diff --git a/src/Source.cpp b/src/Source.cpp index 0b9b8a9bb..89b436f54 100644 --- a/src/Source.cpp +++ b/src/Source.cpp @@ -1204,4 +1204,20 @@ std::string SourceMassDistribution::getDescription() { return ss.str(); } +// ---------------------------------------------------------------------------- + +SourceStartTime::SourceStartTime(double time) : time(time) {} + +void SourceStartTime::prepareCandidate(Candidate& cand) const { + cand.setTrajectoryLength(time); +} + +// ---------------------------------------------------------------------------- + +SourceAddProperty::SourceAddProperty(std::string key, int value) : key(key), value(value) {} + +void SourceAddProperty::prepareCandidate(Candidate& cand) const { + cand.setProperty(key, value); +} + } // namespace crpropa