1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
19 // Stores user defined ion properties.
20 // Fluka allows only one user defined ion which can be used as a beam particle.
23 // andreas.morsch@cern.ch
26 #include "TFlukaIon.h"
27 #include <TDatabasePDG.h>
32 TFlukaIon::TFlukaIon() :
40 // Default constructor
44 TFlukaIon::TFlukaIon(const char* name, Int_t z, Int_t a, Int_t q, Double_t exE, Double_t mass) :
57 Int_t TFlukaIon::GetIonPdg(Int_t z, Int_t a, Int_t i)
60 // http://cepa.fnal.gov/psm/stdhep/pdg/montecarlorpp-2006.pdf
62 return 1000000000 + 10*1000*z + 10*a + i;
65 void TFlukaIon::AddIon(Int_t a, Int_t z)
69 TDatabasePDG *pdgDB = TDatabasePDG::Instance();
70 const Double_t kAu2Gev = 0.9314943228;
71 Int_t pdg = GetIonPdg(z, a);
72 if (pdgDB->GetParticle(pdg)) return;
74 pdgDB->AddParticle(Form("Iion A = %5d Z = %5d", a, z),"Ion", Float_t(a) * kAu2Gev + 8.071e-3, kTRUE,
75 0, 3 * z, "Ion", pdg);
78 void TFlukaIon::WriteUserInputCard(FILE* pFlukaVmcInp) const
80 // Write the user input card
82 fprintf(pFlukaVmcInp,"HI-PROPE %10.1f%10.1f%10.3f\n", (Float_t)GetZ(), (Float_t)GetA(), GetExcitationEnergy());