#ifndef MATERIAL_HPP #define MATERIAL_HPP // // $Id: Material.hpp,v 1.4 1999/10/01 17:22:04 hobbs Exp $ // // File: Material.hpp // Purpose: Represent a material // Created: 03-SEP-1998 Harry L. Melanson // // $Revision: 1.4 $ // // This code was orginally based on the beta 01 release of Geant4 // G4Element. It is a greatly simplified version which currently only // supports radiation lengths. // // Code commented using doc++ format. // // Include files #include #include namespace D0Material { /** The D0 Material Class. This class is used to represent material as needed by the D0 reconstruction program. */ class Material { //------------------ Public Methods -------------------// public: /** Constructor -- calculates radiation length from (A,Z). This constructor creates a {\bf Material} with the user specified name, symbold, effective atomic number (Z), number of nucleons (A) and density (rho) in gm/cm$^3$. It calculates the radiation length of the material, using Tsai's expression (Phys Rev. D50 3-1 (1994) page 1254). @param name Name of material @param symbol Symbol to represent material @param zeff Effective atomic number @param aeff Effective number of nucleons @param rho Density (gm/cm$^3$) */ Material(const std::string& name, const std::string& symbol, double zeff, double aeff, double rho); /** Constructor -- user specified radiation length. This constructor creates a {\bf Material} with the user specified name, symbold, effective atomic number (Z), number of nucleons (A), density (rho) in gm/cm$^3$ and radiation length (X0) in gm/cm$^2$. @param name Name of material @param symbol Symbol to represent material @param zeff Effective atomic number @param aeff Effective number of nucleons @param rho Density (gm/cm$^3$) @param x0 Radiation length (gm/cm$^2$) */ Material(const std::string& name, const std::string& symbol, double zeff, double aeff, double rho, double x0); /// Default constructor. Needed for use in STL. Material(): d_name("DUMMY MATERIAL"), d_symbol("XXX"), d_zeff(1.0), d_aeff(1.0), d_rho(1.0), d_x0(1.0) {} /// Returns name of Material. std::string getName() const {return d_name;}; /// Returns symbol representing Material. std::string getSymbol() const {return d_symbol;}; /// Returns effective atomic number of Material. double getZ() const {return d_zeff;}; /// Returns effective number of nucleons of Material. double getA() const {return d_aeff;}; /// Returns density of Material (gm/cm$^3$). double getDensity() const {return d_rho;}; /// Returns radiation length of Material, in cm. double getX0_cm() const {return d_x0 / d_rho;}; /// Returns radiation length of Material, in gm/cm$^2$. double getX0_gm() const {return d_x0;}; /// Stream insertion operator. friend std::ostream& operator<<(std::ostream&, const Material*); /// Stream insertion operator. friend std::ostream& operator<<(std::ostream&, const Material&); /** Equality operator. Two {\bf Materials} are {\em equal} if their properties are equal (ignoring their {\bf names} and {\bf symbols}). */ bool operator==(const Material&) const; /** Inequality operator. Two {\bf Materials} are {\em unequal} if their properties are are not the same (ignoring their {\bf names} and {\bf symbols}). */ bool operator!=(const Material&) const; /// Assignment operator. const Material& operator=(const Material &right); /// Copy constructor. Material(const Material &right); //------------------ Private Methods -------------------// private: /// Method used to compute radiation length. void ComputeLradTsaiFactor(); //------------------ Public Data Members -------------------// protected: /// Material name. std::string d_name; /// Material symbol. std::string d_symbol; /// Effective atomic number of Material. double d_zeff; /// Effective number of nucleons of Material. double d_aeff; /// Density of Material (gm/cm$^3$). double d_rho; /// Radiation length of material (gm/cm$^2$). double d_x0; }; // class Material } // namespace D0Material #endif // MATERIAL_HPP