XSElements.h

Go to the documentation of this file.
00001 /*
00002  * $Header$
00003  * $Log$
00004  */
00005 
00006 #ifndef __XSELEMENTS_H
00007 #define __XSELEMENTS_H
00008 
00009 #include <TObject.h>
00010 #include <TObjArray.h>
00011 
00012 enum Element_State {
00013         Element_GroundState,
00014         Element_Metastable,
00015         Element_SecondMetastable
00016 };
00017 
00018 /* =================== XSElement ===================== */
00019 class XSElement : public TObject
00020 {
00021 protected:
00022         Int_t   z;
00023         char    *name;
00024         char    *symbol;
00025 
00026         char    *atomic_weight;
00027         char    *density;
00028         char    *melting_point;
00029         char    *boiling_point;
00030         char    *oxidation_states;
00031 
00032         Int_t   ni;
00033         char    **isotope;
00034         char    **isotope_info;
00035         Bool_t  *isotope_stable;
00036 
00037 public:
00038         XSElement();
00039         ~XSElement();
00040 
00041         inline  char*   Name()          const { return name; }
00042         inline  char*   Mnemonic()      const { return symbol; }
00043         inline  char*   Symbol()        const { return symbol; }
00044         inline  char*   AtomicWeight()  const { return atomic_weight; }
00045         inline  char*   Density()       const { return density; }
00046         inline  char*   MeltingPt()     const { return melting_point; }
00047         inline  char*   BoilingPt()     const { return boiling_point; }
00048         inline  char*   Oxidation()     const { return oxidation_states; }
00049         inline  Int_t   Isotopes()      const { return ni; }
00050         inline  char*   Isotope(int i)  const { return isotope[i]; }
00051                 const char*     IsotopeInfo(const char *isotope);
00052         inline  char*   IsotopeInfo(int i)
00053                                         const { return isotope_info[i]; }
00054         inline  Bool_t  IsStable(int i) const { return isotope_stable[i]; }
00055 
00056                 void    Read(FILE *f);
00057                 Int_t   Read(const char *name) { return TObject::Read(name); }
00058 protected:
00059                 char*   ReadLine(FILE *f);
00060         //ClassDef(XSElement,1)
00061 }; // XSElement
00062 
00063 /* =================== XSElements ===================== */
00064 class XSElements : public TObject
00065 {
00066 protected:
00067         UInt_t          NElements;
00068         TObjArray       *elements;
00069 
00070 public:
00071         XSElements( const char *filename );
00072         ~XSElements();
00073 
00074         inline  UInt_t  GetSize()       const   { return NElements; }
00075 
00076         inline  char*   Name(Int_t Z)
00077                 { return ((XSElement*)((*elements)[Z-1]))->Name(); }
00078 
00079         inline  char*   Mnemonic(Int_t Z)
00080                 { return ((XSElement*)((*elements)[Z-1]))->Mnemonic(); }
00081 
00082         inline  XSElement       *Elem(Int_t Z)
00083                 { return ((XSElement*)((*elements)[Z-1])); }
00084 
00085         // Search for element either by name or mnemonic
00086         UInt_t          Find(const char *str);
00087 
00088         //ClassDef(XSElements,1)
00089 }; // XSElements
00090 
00091 #endif

Generated on Tue Jul 5 15:15:04 2011 for ROOT_528-00b_version by  doxygen 1.5.1