//////////////////////////////////////////////////////////////////// /// \class RAT::DS::MCParticle /// /// \brief This class represents a primary particle for the event. /// /// \author Stan Seibert \n /// Phil G Jones /// /// REVISION HISTORY:\n /// 2013-1-21 : P. Jones - Refactor as part of ds review. /// /// \details This class describes the state of one of the initial particles in this event. /// Secondaries created during simulation are not included here. /// //////////////////////////////////////////////////////////////////// #ifndef __RAT_DS_MCParticle__ #define __RAT_DS_MCParticle__ #include #include #include namespace RAT { namespace DS { class MCParticle : public TObject { public: /// Construct a MCParticle MCParticle(): TObject(), pdgCode(0), mcTime(0), kineticEnergy(0), vertexID(0), metaInfo("") { } /// Set the position of the particle /// /// @param[in] pos of the particle void SetPosition( const TVector3& pos ) { position = ROOT::Math::XYZVectorF(pos.X(), pos.Y(), pos.Z()); } /// Get the position of the particle /// /// @return position of the particle TVector3 GetPosition() const { return TVector3(position.X(), position.Y(), position.Z()); } /// Set the polarisation of the particle /// /// @param[in] pol of the particle void SetPolarisation( const TVector3& pol ) { polarisation = ROOT::Math::XYZVectorF(pol.X(), pol.Y(), pol.Z()); } /// Get the polarisation of the particle /// /// @return polarisation of the particle TVector3 GetPolarisation() const { return TVector3(polarisation.X(), polarisation.Y(), polarisation.Z()); } /// Set the momentum of the particle /// /// @param[in] mom of the particle void SetMomentum( const TVector3& mom ) { momentum = ROOT::Math::XYZVectorF(mom.X(), mom.Y(), mom.Z()); } /// Get the momentum of the particle /// /// @return momentum of the particle TVector3 GetMomentum() const { return TVector3(momentum.X(), momentum.Y(), momentum.Z()); } /// Set the Particle Data Group, PDG, code of the particle /// /// @param[in] code void SetPDGCode( const Int_t code ) { pdgCode = code; } /// Get the Particle Data Group, PDG, Code of the particle /// /// @return code Int_t GetPDGCode() const { return pdgCode; } /// Set the time of the particle /// /// @param[in] time of the particle void SetTime( const Double_t time ) { mcTime = time; } /// Get the time of the particle /// /// @return time of the particle Double_t GetTime() const { return mcTime; } /// Set the kinetic energy of the particle /// /// @param[in] energy (kinetic) of the particle void SetKineticEnergy( const Double_t energy ) { kineticEnergy = energy; } /// Get the kinetic energy of the particle /// /// @return kinetic energy of the particle Double_t GetKineticEnergy() const { return kineticEnergy; } /// Set the Vertex ID to which this particle belongs /// /// @param[in] id of the vertex void SetVertexID( const Int_t id ) { vertexID = id; } /// Get the Vertex ID to which this particle belongs /// /// @return id Int_t GetVertexID() const { return vertexID; } /// Set the meta information of this particle /// /// @param[in] info of the vertex void SetMetaInfo( const std::string info ) { metaInfo = info; } /// Get the meta information (general purpose user string) of this particle /// /// @return metaInfo std::string GetMetaInfo() const { return metaInfo; } // This ROOT macro adds dictionary methods to this class. // The number should be incremented whenever this class's members are changed. // It assumes this class has no virtual methods, use ClassDef if change this. ClassDefNV( MCParticle, 6 ); protected: ROOT::Math::XYZVectorF position; ///< Initial position ROOT::Math::XYZVectorF polarisation; ///< Initial polarisation ROOT::Math::XYZVectorF momentum; ///< Initial momentum Int_t pdgCode; ///< Particle Data Group code Double_t mcTime; ///< Initial time in the event mc system Double32_t kineticEnergy; ///< Initial Kinetic energy Int_t vertexID; ///< Vertex to which this particle belongs std::string metaInfo; }; } // namespace DS } // namespace RAT #endif