FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairIon.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- FairIon source file -----
10 // -------------------------------------------------------------------------
11 #include "FairIon.h"
12 
13 #include "FairLogger.h"
14 
15 #include <TDatabasePDG.h>
16 #include <TParticlePDG.h>
17 
19  : TNamed()
20  , fZ(0)
21  , fA(0)
22  , fQ(0)
23  , fExcEnergy(0)
24  , fMass(0)
25  , fLogger(FairLogger::GetLogger())
26 {}
27 
28 FairIon::FairIon(const char* name, Int_t z, Int_t a, Int_t q, Double_t e, Double_t mass)
29  : TNamed(name, "User defined ion")
30  , fZ(z)
31  , fA(a)
32  , fQ(q)
33  , fExcEnergy(e)
34  , fMass(0)
35  , fLogger(FairLogger::GetLogger())
36 {
37  TDatabasePDG* pdgDB = TDatabasePDG::Instance();
38  TParticlePDG* kProton = pdgDB->GetParticle(2212);
39  Double_t kProtonMass = kProton->Mass();
40 
41  if (mass == 0.) {
42  fMass = kProtonMass * Double_t(a);
43  } else {
44  fMass = mass;
45  }
46  LOG(info) << "New Ion " << name << " Z=" << z << " A=" << a << " Charge=" << q << " Mass=" << fMass << " GeV ";
47 }
48 
50 
virtual ~FairIon()
Definition: FairIon.cxx:49
ClassImp(FairEventBuilder)
Double_t fZ
FairIon()
Definition: FairIon.cxx:18