EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairIon.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairIon.cxx
1 // -------------------------------------------------------------------------
2 // ----- FairIon source file -----
3 // -------------------------------------------------------------------------
4 #include "FairIon.h"
5 #include "FairLogger.h"
6 
7 #include "TDatabasePDG.h"
8 #include "TParticlePDG.h"
9 
10 const Double_t FairIon::amu=0.931494028 ; // Gev/c**2
11 
12 
13 // ----- Default constructor -------------------------------------------
15  :TNamed(),
16  fZ(0),
17  fA(0),
18  fQ(0),
19  fExcEnergy(0),
20  fMass(0),
21  fLogger(FairLogger::GetLogger())
22 {
23 
24 }
25 // -------------------------------------------------------------------------
26 
27 
28 // ----- Standard constructor ------------------------------------------
29 FairIon::FairIon(const char* name, Int_t z, Int_t a, Int_t q, Double_t e,
30  Double_t mass)
31  : TNamed(name, "User defined ion"),
32  fZ(z),
33  fA(a),
34  fQ(q),
35  fExcEnergy(e),
36  fMass(0),
37  fLogger(FairLogger::GetLogger())
38 {
39 
40  TDatabasePDG* pdgDB = TDatabasePDG::Instance();
41  TParticlePDG* kProton = pdgDB->GetParticle(2212);
42  Double_t kProtonMass=kProton->Mass();
43 
44  if (mass == 0.) { fMass = kProtonMass * Double_t(a); }
45  else { fMass = mass; }
46  fLogger->Info(MESSAGE_ORIGIN, "New Ion %s Z = %f A =%f Charge=%f Mass=%f GeV ", name, z, a , q, fMass );
47 
48 }
49 // -------------------------------------------------------------------------
50 
51 
52 // ----- Destructor ----------------------------------------------------
54 {
55 };
56 // -------------------------------------------------------------------------
57 
58 
59