VGM Version 5.3
Loading...
Searching...
No Matches
Isotope.cxx
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
12//
13// Class Isotope
14// ---------------
15// VGM implementations for Root Isotope.
16//
17// Author: Ivana Hrivnacova; IPN Orsay
18
20#include "RootGM/common/Units.h"
22
23#include "TGeoElement.h"
24
25#include <math.h>
26
27//_____________________________________________________________________________
28RootGM::Isotope::Isotope(const std::string& name, int z, int n, double a)
29 : VGM::IIsotope(),
30 fIsotope(
31 new TGeoIsotope(name.data(), z, n, a / RootGM::Units::AtomicWeight()))
32{
39
40 // Register Isotope in the map
41 IsotopeMap::Instance()->AddIsotope(this, fIsotope);
42}
43
44//_____________________________________________________________________________
45RootGM::Isotope::Isotope(TGeoIsotope* tgeoIsotope)
46 : VGM::IIsotope(), fIsotope(tgeoIsotope)
47{
49
50 // Register Isotope in the map
51 IsotopeMap::Instance()->AddIsotope(this, fIsotope);
52}
53
54//_____________________________________________________________________________
59
60//
61// public functions
62//
63
64//_____________________________________________________________________________
65std::string RootGM::Isotope::Name() const { return fIsotope->GetName(); }
66
67//_____________________________________________________________________________
68int RootGM::Isotope::Z() const { return fIsotope->GetZ(); }
69
70//_____________________________________________________________________________
71int RootGM::Isotope::N() const { return fIsotope->GetN(); }
72
73//_____________________________________________________________________________
74double RootGM::Isotope::A() const
75{
76 return fIsotope->GetA() * RootGM::Units::AtomicWeight();
77}
static IsotopeMap * Instance()
void AddIsotope(VGM::IIsotope *, TGeoIsotope *)
virtual int N() const
Return the effective number of nucleons.
Definition Isotope.cxx:71
virtual std::string Name() const
Return the name of this element.
Definition Isotope.cxx:65
virtual double A() const
Return the effective effective mass of a mole in g/mole.
Definition Isotope.cxx:74
virtual int Z() const
Return the effective atomic number.
Definition Isotope.cxx:68
Isotope(const std::string &name, int z, int n, double a)
Definition Isotope.cxx:28
virtual ~Isotope()
Definition Isotope.cxx:55
Conversion from Root physical units to VGM units.
Definition Units.h:28
static double AtomicWeight()
Return Root atomic weight unit in VGM units.
Definition Units.h:87
VGM implementation for Root.
Definition axis.h:28
VGM interfaces.
Definition VMedium.h:28