#!/usr/bin/python3 # An example of how to use the wrapper to Atima # For questions to the wrapper: P.Boutachkov@gsi.de tel. 2436 # Import the Atima module and math in case we want to take some sqrt or pow import atima, math def main(): # Example 238U on Be with thickness of 10 mg/cm2 proj = [ 238.011, 92 ] # Projectile [Mass, Charge] targ = [[9.012, 4, 1]] # List of target components # [[mass number, charge, stochastic ratio],...] density = 1.85 # Target density on g/cm3 isgas = 0 # Is the target a gass 0/1 --> No/Yes targThickness = 10.0 # Target thickness in mg/cm2 Ein = 100.0 # Projectile energy in MeV/u # Atima returns a tuple with the calculated value, see below or # in atima.f for description (Eout, range ,dEdXin, dEdXout, RemainingRange, \ RangeStraggling , EnegergyStraggling, AngularStraggling, \ Tof, InterpolatedTargetThickness) \ = atima.calculate(proj, Ein, targ, density, isgas, targThickness) #-------------------------------------------------------- print ('Ein [MeV/u]: ' , Ein) print ('Eout [MeV/u]: ' ,Eout) print ('Range [mg/cm2]: ',range) print ('dEdX_in [MeV/mg/cm2]: ' ,dEdXin*proj[0]) # print ('dEdX out [MeV/mg/cm2]: ' ,dEdXout*proj[0]) # print ('Remaing Range[mg/cm2] : ' ,RemainingRange) print ('Range straggling [mg/cm2] : ' ,RangeStraggling) print ('Energy Straggling [MeV] : ' ,EnegergyStraggling*dEdXout) # print ('Angular Straggling [mrad] : ' ,AngularStraggling*1000.) # print ('Time of Flight [ns] : ' ,Tof) # print ('Interpolated Target thickness [mg/cm2]: ', InterpolatedTargetThickness) # print ('Energy Loss [MeV]:',(Ein-Eout)*proj[0]) print # Example 238U on Al with thickness of 100 mg/cm2 proj = [ 238.0, 92 ] # Projectile [Mass, Charge] targ = [[26.981541, 13, 1]] # List of target components # [[mass number, charge, stochastic ratio],...] density = 2.0 # Target density on g/cm3 isgas = 0 # Is the target a gass 0/1 --> No/Yes targThickness = 100.0 # Target thickness in mg/cm2 Ein = 100.0 # Projectile energy in MeV/u # Atima returns a tuple with the calculated value, see below or # in atima.f for description (Eout, range ,dEdXin, dEdXout, RemainingRange, \ RangeStraggling , EnegergyStraggling, AngularStraggling, \ Tof, InterpolatedTargetThickness) \ = atima.calculate(proj, Ein, targ, density, isgas, targThickness) print ('Ein [MeV/u]: ' , Ein) print ('Eout [MeV/u]: ' ,Eout) print ('Range [mg/cm2]: ',range) print ('dEdX_in [MeV/mg/cm2]: ' ,dEdXin*proj[0]) print # print ('dEdX out [MeV/mg/cm2]: ' ,dEdXout*proj[0]) # print ('Remaing Range[mg/cm2] : ' ,RemainingRange) # print ('Range straggling [mg/cm2] : ' ,RangeStraggling) # print ('Energy Straggling [MeV] : ' ,EnegergyStraggling*dEdXout) # print ('Angular Straggling [mrad] : ' ,AngularStraggling*1000.) # print ('Time of Flight [ns] : ' ,Tof) # print ('Interpolated Target thickness [mg/cm2]: ', InterpolatedTargetThickness) # print ('Energy Loss [MeV]:',(Ein-Eout)*proj[0]) # print ## An example of 1GeV/u 238U on SiO2, 100 mg/cm2 proj = [ 238.011, 92 ] Ein = 151.91 targ = [[28.0855, 14, 1], [15.99994, 8, 2]] density = 2.2 isgas = 0 targThickness = 100.0 # edata = atima.calculate(proj, Ein, targ, density, isgas, targThickness) # print '1GeV/u 238U on 100 mg/cm2 Ar(CO2) 20% Eout [MeV/u]:', edata[0] (Eout, range ,dEdXin, dEdXout, RemainingRange, \ RangeStraggling , EnegergyStraggling, AngularStraggling, \ Tof, InterpolatedTargetThickness) \ = atima.calculate(proj, Ein, targ, density, isgas, targThickness) print ('U -> SiO2 dEdX_in [MeV/mg/cm2]: ' ,dEdXin*proj[0]) ## An example of 400 MeV/u 12C on water, 100 mg/cm2 proj = [ 12.0, 6 ] Ein = 400. targ = [[1.0074, 1, 2], [15.99994, 8, 1]] density = 1.0 isgas = 0 targThickness = 100.0 # edata = atima.calculate(proj, Ein, targ, density, isgas, targThickness) # print ('1GeV/u 238U on 100 mg/cm2 Ar(CO2) 20% Eout [MeV/u]:', edata[0]) (Eout, range ,dEdXin, dEdXout, RemainingRange, \ RangeStraggling , EnegergyStraggling, AngularStraggling, \ Tof, InterpolatedTargetThickness) \ = atima.calculate(proj, Ein, targ, density, isgas, targThickness) print ('12C -> water R [mg/cm2]= ' ,range) if __name__ == "__main__": main()