/** * \file LitMaterialInfo.h * \brief Material info data class. * \author Andrey Lebedev * \date 2009 */ #ifndef LITMATERIALINFO_H_ #define LITMATERIALINFO_H_ #include "LitTypes.h" #include "LitUtils.h" namespace lit { namespace parallel { /** * \class LitMaterialInfo * \brief Properties of material. * \author Andrey Lebedev * \date 2009 */ template class LitMaterialInfo { public: /** * \brief Calculate some material properties to speed up reconstruction. */ // void CalculateValues() { //RadThick = Thickness / X0; // Length/X0 //SqrtRadThick = sqrt(RadThick); // std::sqrt(Length/X0) //LogRadThick = log(RadThick); // std::log(Length/X0) //ElLoss = exp(RadThick * log(3.) / log (2.)) - exp(-2. * RadThick); // } /** * \brief Returns std::string representation of the class. * \return Class representation as std::string. */ std::string ToString() const { return std::string("LitMaterialinfo:") + " Thickness=" + lit::parallel::ToString(Thickness) + ", X0=" + lit::parallel::ToString(X0) + ", Rho=" + lit::parallel::ToString(Rho) + ", Z=" + lit::parallel::ToString(Z) + ", A=" + lit::parallel::ToString(A) + ", I=" + lit::parallel::ToString(I) + "\n"; } /** * \brief Operator << for convenient output to std::ostream. * \return Insertion stream in order to be able to call a succession of insertion operations. */ friend std::ostream& operator<<(std::ostream& strm, const LitMaterialInfo& mat) { strm << mat.ToString(); return strm; } public: T Thickness; // Thickness of the material [cm] T X0; // Radiation length [cm] T Rho; // Density [g/cm^3] T Z; // Atomic number T A; // Atomic mass // T RadThick; // Thickness/X0 // T SqrtRadThick; // std::sqrt(Thickness/X0) // T LogRadThick; // std::log(Thickness/X0) // approximation of the mean excitation energy in GeV // I = (Z > 16) ? 10 * Z * 1e-9 : 16 * std::pow(Z, 0.9) * 1e-9; T I; // T ElLoss; // (exp(radThick * log(THREE) / log (TWO)) - exp(-TWO * radThick)); } _fvecalignment; /** * \typedef LitMaterialInfo LitMaterialInfoVec * \brief Vector version of LitMaterialInfo. */ typedef LitMaterialInfo LitMaterialInfoVec; /** * \typedef LitMaterialInfo LitMaterialInfoScal * \brief Scalar version of LitMaterialInfo. */ typedef LitMaterialInfo LitMaterialInfoScal; } // namespace parallel } // namespace lit #endif /* LITMATERIALINFO_H_ */