from __future__ import print_function

import Manyo.SAS as ms
import Manyo.Utsusemi as mu
import utsusemi.SAS.ana.Reduction.CalcEfficiencyParam
import sys
import os

###############################################################################
if __name__=='__main__':
	if (len(sys.argv)==2):
		#filepath = os.path.join( os.environ["UTSUSEMI_USR_DIR" ],"tmp", sys.argv[1] )
                filepath = os.path.join( mu.UtsusemiEnvGetInstDir(),"tmp", sys.argv[1] )
	else:
		raise UserWarning()
	mep = SAS.ana.Reduction.CalcEfficiencyParam.CalcEfficiencyParam()
	ret1 = mep.GetCalcEfficiencyParam("SUS304-3He")
	fde = ms.FtlCalcDetectorEffi()
	fde.SetPrm(
		ret1.size,
		ret1.outerThick[0],
		ret1.gasNumberDensity,
		ret1.gasAbs,
		ret1.outerNumberDensity,
		ret1.outerAbs,
		ret1.outerScatt)

	fde.makeData()
	print("####### makeData fin.")
	fde.saveData(filepath,"SUS304-3He")
