Line data Source code
1 : #ifndef CRPROPA_BREAKCONDITION_H 2 : #define CRPROPA_BREAKCONDITION_H 3 : 4 : #include "crpropa/Module.h" 5 : 6 : namespace crpropa { 7 : /** 8 : * \addtogroup Condition 9 : * @{ 10 : */ 11 : 12 : /** 13 : @class MaximumTrajectoryLength 14 : @brief Deactivates the candidate beyond a maximum trajectory length 15 : 16 : This module deactivates the candidate at a given maximum trajectory length. 17 : In that case the property ("Deactivated", module::description) is set. 18 : It also limits the candidates next step size to ensure the maximum trajectory length is not exceeded. 19 : */ 20 : class MaximumTrajectoryLength: public AbstractCondition { 21 : double maxLength; 22 : std::vector<Vector3d> observerPositions; 23 : public: 24 : MaximumTrajectoryLength(double length = 0); 25 : void setMaximumTrajectoryLength(double length); 26 : double getMaximumTrajectoryLength() const; 27 : void addObserverPosition(const Vector3d &position); 28 : const std::vector<Vector3d>& getObserverPositions() const; 29 : std::string getDescription() const; 30 : void process(Candidate *candidate) const; 31 : }; 32 : 33 : /** 34 : @class MinimumEnergy 35 : @brief Deactivates the candidate below a minimum energy 36 : 37 : This module deactivates the candidate below a given minimum energy. 38 : In that case the property ("Deactivated", module::description) is set. 39 : */ 40 1 : class MinimumEnergy: public AbstractCondition { 41 : double minEnergy; 42 : public: 43 : MinimumEnergy(double minEnergy = 0); 44 : void setMinimumEnergy(double energy); 45 : double getMinimumEnergy() const; 46 : std::string getDescription() const; 47 : void process(Candidate *candidate) const; 48 : }; 49 : 50 : 51 : /** 52 : @class MinimumRigidity 53 : @brief Deactivates the candidate below a minimum rigidity 54 : 55 : This module deactivates the candidate below a given minimum rigidity (E/Z in EeV). 56 : In that case the property ("Deactivated", module::description) is set. 57 : */ 58 : class MinimumRigidity: public AbstractCondition { 59 : double minRigidity; 60 : public: 61 : MinimumRigidity(double minRigidity = 0); 62 : void setMinimumRigidity(double minRigidity); 63 : double getMinimumRigidity() const; 64 : std::string getDescription() const; 65 : void process(Candidate *candidate) const; 66 : }; 67 : 68 : /** 69 : @class MinimumRedshift 70 : @brief Deactivates the candidate below a minimum redshift 71 : 72 : This module deactivates the candidate below a given minimum redshift. 73 : In that case the property ("Deactivated", module::description) is set. 74 : */ 75 1 : class MinimumRedshift: public AbstractCondition { 76 : double zmin; 77 : public: 78 : MinimumRedshift(double zmin = 0); 79 : void setMinimumRedshift(double z); 80 : double getMinimumRedshift(); 81 : std::string getDescription() const; 82 : void process(Candidate *candidate) const; 83 : }; 84 : 85 : /** 86 : @class MinimumChargeNumber 87 : @brief Deactivates the candidate below a minimum number 88 : 89 : This module deactivates the candidate below a given minimum charge number. 90 : A minimum charge number of 26 deactivates all (anti-) isotopes which 91 : are ranked in the periodic table before iron (Fe). 92 : In that case the property ("Deactivated", module::description) is set. 93 : */ 94 1 : class MinimumChargeNumber: public AbstractCondition { 95 : int minChargeNumber; 96 : public: 97 : MinimumChargeNumber(int minChargeNumber = 0); 98 : void setMinimumChargeNumber(int chargeNumber); 99 : int getMinimumChargeNumber() const; 100 : std::string getDescription() const; 101 : void process(Candidate *candidate) const; 102 : }; 103 : 104 : /** 105 : @class MinimumEnergyPerParticleId 106 : @brief Deactivates the candidate below a minimum energy for specific particle Ids. 107 : 108 : This module deactivates the candidate below a given minimum energy for specific particle types. 109 : In that case the property ("Deactivated", module::description) is set. 110 : All particles whose minimum energy is not specified follow the more general minEnergyOthers condition. 111 : */ 112 : class MinimumEnergyPerParticleId: public AbstractCondition { 113 : std::vector<double> minEnergies; 114 : std::vector<int> particleIds; 115 : double minEnergyOthers; 116 : public: 117 : MinimumEnergyPerParticleId(double minEnergyOthers = 0); 118 : void setMinimumEnergyOthers(double energy); 119 : double getMinimumEnergyOthers() const; 120 : void add(int id, double energy); 121 : std::string getDescription() const; 122 : void process(Candidate *candidate) const; 123 : }; 124 : 125 : 126 : /** 127 : @class DetectionLength 128 : @brief Detects the candidate at a given trajectoryLength 129 : 130 : This break condition can be used for non-regular time observation of the particle density. See also ObserverTimeEvolution. 131 : */ 132 1 : class DetectionLength: public AbstractCondition { 133 : double detLength; 134 : public: 135 : DetectionLength(double length = 0); 136 : void setDetectionLength(double length); 137 : double getDetectionLength() const; 138 : std::string getDescription() const; 139 : void process(Candidate *candidate) const; 140 : }; 141 : /** @}*/ 142 : 143 : } // namespace crpropa 144 : 145 : #endif // CRPROPA_BREAKCONDITION_H