#ifndef _utl_Particle_h_ #define _utl_Particle_h_ #include #include #include #include #include #include #include #include namespace utl { /** \class Particle \brief Describes a particle for Simulation \author Stefano Argiro' \date 27 January 2003 \version $Id: Particle.h 20562 2012-03-16 10:42:18Z javierg $ \ingroup particles */ class Particle { public: // Enumerations enum Source { eShower, eBackground, eShowerFromMuonDecay }; /** \brief Particle types Enumeration of type codes of the particles appearing in Auger simulations. The codes com from the PDG http://pdg.lbl.gov/. For an extension to nuclei, see utl::NucleusProperties. */ enum Type { eUndefined = 0, eElectron = 11, ePositron = -11, eNuElectron = 12, eAntiNuElectron = -12, eMuon = 13, eAntiMuon = -13, eNuMuon = 14, eAntiNuMuon = -14, eTau = 15, eAntiTau = -15, eNuTau = 16, eAntiNuTau = -16, ePhoton = 22, ePiZero = 111, eRhoZero = 113, ePiPlus = 211, ePiMinus = -211, eRhoPlus = 213, eRhoMinus = -213, eEta = 221, eOmegaMeson = 223, eKaon0L = 130, eKaon0S = 310, eKaonPlus = 321, eKaonMinus = -321, eDeltaMinus = 1114, eLambda = 3122, eAntiLambda = -3122, eSigmaPlus = 3222, eSigmaZero = 3212, eSigmaMinus = 3112, eAntiSigmaPlus = -3222, eAntiSigmaZero = -3212, eAntiSigmaMinus = -3112, eXiZero = 3322, eXiMinus = 3312, eAntiXiZero = -3322, eAntiXiMinus = -3312, eOmegaMinus = 3332, eAntiOmegaMinus = -3332, eLambdac = 4122, eNeutron = 2112, eAntiNeutron = -2112, eDeltaZero = 2114, eProton = 2212, eAntiProton = -2212, eDeltaPlus = 2214, eDeltaPlusPlus = 2224, // Selected nuclei. // Note: This is an inconsistency left in for hysterical raisins only. // Cf. utl::NucleusProperties instead! // Usage example thereof can be found in CONEXFile.cc. eIron = 1000026056 }; /// Constructor using kinetic energy Particle(const int type, const Source& source, const Point& position, const Vector& direction, const TimeInterval& time, const double weight, const double kineticEnergy); /// Constructor using momentum Particle(const int type, const Source& source, const Point& position, const Vector& momentum, const TimeInterval& time, const double weight); // why not return by enum?? int GetType() const { return fProperties->GetType(); } /// string with particle name std::string GetName() const { return fProperties->GetName(); } /// Source of the particle (eg. shower or background) Source GetSource() const { return fSource; } /// Position of the particle const Point& GetPosition() const { return fPosition; } void SetPosition(const utl::Point& position) { fPosition = position; } /// Unit vector giving particle direction const Vector& GetDirection() const { return fDirection; } void SetDirection(const utl::Vector& direction) { fDirection = direction; } /// Vector giving particle momentum Vector GetMomentum() const; void SetMomentum(const utl::Vector& momentum); /// Arrival time delay at the ground const TimeInterval& GetTime() const { return fTime; } void SetTime(const TimeInterval& time) { fTime = time; } /// Particle weight (assigned by shower generator thinning algorithms) double GetWeight() const { return fWeight; } void SetWeight(const double weight) { fWeight = weight; } /// Get kinetic energy of the particle double GetKineticEnergy() const { return fKineticEnergy; } /// Set kinetic energy of the particle void SetKineticEnergy(const double ke) { fKineticEnergy = ke; } /// Get Total (relativistic) energy double GetTotalEnergy() const { return fKineticEnergy + GetMass(); } /// Set Total (relativistic) energy void SetTotalEnergy(const double totE) { fKineticEnergy = totE - GetMass(); } /// Mass of the particle double GetMass() const { return fProperties->GetMass(); } /// Calculate particle type code for a given (A, Z) static int NucleusCode(const int theCharge, const int theAtomicNumber); bool HasParent() const { return fParent; } const Particle& GetParent() const { return *fParent.get(); } Particle& GetParent() { return *fParent.get(); } void SetParent(Particle& parent) { fParent.reset(new Particle(parent)); } bool HasProductionPoint() const { return fProductionPoint; } const utl::Point& GetProductionPoint() const { return *fProductionPoint.get(); } void SetProductionPoint(const utl::Point& point) { fProductionPoint.reset(new utl::Point(point)); } private: // This is to handle Corsika's history option. boost::shared_ptr fParent; boost::shared_ptr fProductionPoint; // General information ParticlePropertiesPtr fProperties; Source fSource; // Position and direction utl::Point fPosition; utl::Vector fDirection; // Time, weighting and energy TimeInterval fTime; double fWeight; double fKineticEnergy; // this is the KINETIC energy }; /** \class ParticleTypeException Particle.h "utl/Particle.h" \brief Base class to report non-existing particle id's. */ class ParticleTypeException : public AugerException { public: /// Construct Particle Type exception with message ParticleTypeException(const std::string message = std::string()) : AugerException(message) { } /// Retrieve verbose exception name virtual std::string GetExceptionName() const { return "Unknown Particle Type exception"; } }; } // namespace #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // End: