""" .. module:: batchFarmServices :platform: Unix, Windows, OSX :synopsis: Utilities for doing PWA with the Jlab batch system. .. moduleauthor:: Joshua Pond <*****@*****.**> """ import os import sys sys.path.append(os.path.join(sys.argv[4], "pythonPWA")) import numpy from pythonPWA.fileHandlers.getWavesGen import getwaves from pythonPWA.model.normInt import normInt """ This is the program that does the work of calculating the normilization integral and returning it as a .npy file. """ dataDir = sys.argv[1] alphaList = numpy.loadtxt(os.path.join(dataDir, sys.argv[2])) waves = getwaves(dataDir) rInt = normInt(waves=waves, alphaList=alphaList, beamPolarization=sys.argv[3]) rInt.execute() rInt.save(dataDir)
""" .. module:: batchFarmServices :platform: Unix, Windows, OSX :synopsis: Utilities for doing PWA with the Jlab batch system. .. moduleauthor:: Joshua Pond <*****@*****.**> """ import os import sys sys.path.append(os.path.join(sys.argv[4],"pythonPWA")) import numpy from pythonPWA.fileHandlers.getWavesGen import getwaves from pythonPWA.model.normInt import normInt """ This is the program that does the work of calculating the normilization integral and returning it as a .npy file. """ dataDir=sys.argv[1] alphaList=numpy.loadtxt(os.path.join(dataDir,sys.argv[2])) waves=getwaves(dataDir) rInt=normInt(waves=waves,alphaList=alphaList,beamPolarization=sys.argv[3]) rInt.execute() rInt.save(dataDir)
maxNumberOfEvents=float(len(alphaList)) testMass=bisectedMasses[massBins.index(massBin)] print"using testMass=",testMass resonances=[resonance(cR=2.*maxNumberOfEvents/3.,wR=[1.,0.],w0=1320.,r0=107.),resonance(cR=maxNumberOfEvents/3.,wR=[0.,1.],w0=1895.,r0=235.)] print"loaded",len(resonances),"resonances" waves=getwaves(dataDir) print"loaded",len(waves),"waves" #normint.npy check print"checking normalization integral existance..." if os.path.exists(os.path.join(dataDir,"normint.npy"))==False: print"normalization integral not found, instantiating new normalization integrator" rInt=normInt(waves=waves,alphaList=alphaList) print"executing normalization integration, this may take some time" rInt.execute() print"finished, saving normalization integral" rInt.save(dataDir) if os.path.exists(os.path.join(dataDir,"normint.npy"))==True: print"loading normalization integral" normint=numpy.load(os.path.join(dataDir,"normint.npy")) dSimulator=dataSimulator(mass=testMass,waves=waves,resonances=resonances,normint=normint,alphaList=alphaList) inputGampFile=open(os.path.join(dataDir,"events.gamp"),'r') inputPfFile=open(os.path.join(dataDir,"events.pf"),'r') outputRawGampFile=open(os.path.join(dataDir,"selected_events.raw.gamp"),'w') outputAccGampFile=open(os.path.join(dataDir,"selected_events.acc.gamp"),'w')
alphaList = numpy.loadtxt(os.path.join(dataDir, "alphaevents.txt")) maxNumberOfEvents = float(len(alphaList)) testMass = 1025. #resonances=[resonance(cR=maxNumberOfEvents,wR=[1.],w0=1320.,r0=100000.)] resonances = [ resonance(cR=2. * maxNumberOfEvents / 3., wR=[0., 1.], w0=1320., r0=107.), resonance(cR=maxNumberOfEvents / 3., wR=[1., 0.], w0=1895., r0=235.) ] waves = getwaves(dataDir) rInt = normInt(waves=waves, alphaList=alphaList) rInt.execute() rInt.save(dataDir) normint = numpy.load(os.path.join(dataDir, "normint.npy")) dSimulator = dataSimulator(mass=testMass, waves=waves, resonances=resonances, normint=normint, alphaList=alphaList) inputGampFile = open(os.path.join(dataDir, "events.gamp"), 'r') inputPfFile = open(os.path.join(dataDir, "events.pf"), 'r') outputRawGampFile = open(os.path.join(dataDir, "seq_raw_events.gamp"), 'w') outputAccGampFile = open(os.path.join(dataDir, "selected_events.acc.gamp"), 'w')