batchFarmSerivices

This module contains the programs associated with running pythonPWA in the JLab batch farm system

GUI_alpha_main

This is the submition program for the alpha calculation.

GUI_gamp_main

This is the submition program for Gamp.

GUI_subPyNormInt_main

This is the submition program for the normint calculation.

PWA_GUI

This is the main user interface for the whole PyPWA framework. All functions for fitting and simulation can be accessed from here.

dataSimulatorNPY

class batchFarmServices.dataSimulatorNPY.dataSimulator(mass=1010.0, waves=[], normint=None, productionAmplitudes=[], alphaList=[], dataDir=None, rhoAA=None, iList=None, iMax=0)

This is the program that does the work of simulation for PyPWA simulaton.

__init__(mass=1010.0, waves=[], normint=None, productionAmplitudes=[], alphaList=[], dataDir=None, rhoAA=None, iList=None, iMax=0)

Default FASTLikelihood constructor

Kwargs:

mass (float): Test mass at the center of the bin.

waves (array): Array of all waves in this pwa fit/simulation.

normint (array): PyPWA normalization integral object.

productionAmplitudes (list): List of all production amplitudes/ V values.

alphaList (list): List of all alpha values for that bin.

dataDir (string): File path to the mass bin directory that is being simulated.

rhoAA (numpy ndarray): The PyPWA rhoAA object.

iList (numpy array): List of all intensities.

iMax (float): The maximum intensity for the whole mass range.

__weakref__

list of weak references to the object (if defined)

calcIList()

Calculates the list of intensities.

Returns:

iList; Note, does NOT save it. Must be saved after returning.

execute(inputGampFile, outputRawGampFile, outputAccGampFile, inputPfFile, outputPFGampFile)

This function does the bulk of the simulation work for PyPWA simulation.

Args:

inputGampFile (file): Open file with the flat .gamp events.

outputRawGampFile (file): Open file for the events that only pass the weight filter.

outputAccGampFile (file): Open file for the events that pass both the weight and p/f filter.

inputPfFile (file): Open file with the acceptance of the events (p/f).

outputPFGampFile (file): Open file for the events that only pass the p/f filter.

batchFarmServices.dataSimulatorNPY.random() → x in the interval [0, 1).

fast_like

class batchFarmServices.fast_like.FASTLikelihood(waves=[], productionAmplitudes=[], alphaList=[], acceptedPath=os.getcwd(), generatedPath=os.getcwd(), rhoAA=None, accNormInt=None)

This is the mathmatical class of the likelihood calculation and the calculation of the intensity.

__init__(waves=[], productionAmplitudes=[], alphaList=[], acceptedPath=os.getcwd(), generatedPath=os.getcwd(), rhoAA=None, accNormInt=None)

Default FASTLikelihood constructor

Kwargs:

waves (array): Array of all waves in this pwa fit/simulation.

productionAmplitudes (list): List of all production amplitudes/ V values.

alphaList (list): List of all alpha values for that bin.

acceptedPath (string): Full file path to the accepted MC alpha file.

generatedPath (string): Full file path to the generated MC alpha file.

rhoAA (numpy ndarray array): PyPWA rhoAA array.

accNormInt (numpy array): The normalization integral from the accepted MC.

__weakref__

list of weak references to the object (if defined)

calcInt()

Calculates the list of intensities for a mass bin.

Returns:

iList (numpy array)

calcetaX()

Sets the self.etaX variable.

calclnL()

Calculates the value of the negative of the log likelihood function.

Returns:

Value of the negative of the log likelihood function. (float)

calcneglnL(paramsList)

Sets the production Amplitudes from Minuit and calculates the value of the negative of the log likelihood function.

Returns:

Value of the negative of the log likelihood function. (float)

countAlphas(path)

Returns the length of an alpha file.

Args:

path (string): Path to the alpha file to be measured.

Returns:

Length of file. (float)

fitting_Install

This program is the first step for the PyPWA fitting process. It sets up all directories and files needed for fitting as well as all binning in mass as prescribed by the pwa_controls GUI.

fnGenerator

class batchFarmServices.fnGenerator.generator

Writes out a file containing a wrapper function for minuitLn.calcneglnL, simply give this function the number of terms (which should be equivalent to 2*number of waves) and it will write the needed wrapper function to the file specified by self.filename.

__weakref__

list of weak references to the object (if defined)

generateAlphaNPY

class batchFarmServices.generateAlphaNPY.generateAlphas(mode, indir, gfile)

This program calculates the value of alpha for every event in a .gamp file and saves it to a .txt list, one event per line.

__init__(mode, indir, gfile)

Default generatAlphas constructor

Kwargs:

mode (int): 8 = p pi+ pi- pi0, 22 = p p+ p-, 24 = p k+ k-, 42 = gamma p –> p Ks Ks (pi+ pi- pi+ pi-)

indir (string): Full file path to directory of file

gfile (string): File name without .gamp extension.

__weakref__

list of weak references to the object (if defined)

analyze22()

p p+ p-

analyze24()

p k+ k-

analyze42()

gamma p –> p Ks Ks (pi+ pi- pi+ pi-)

analyze8()

p pi+ pi- pi0

toFile()

Saves the list to a file.

getImax

This program runs in the interactive farm to retrieve the maximum intensity value among the whole mass range.

graphicPlot

This is the graphicPlot GUI optimized for fitting.

graphicPlotSim

This is the graphicPlot GUI optimized for simulation.

likelihoodTest

This is the main program for running the calculation of the log likelihood fitter/minuit.

massBinner

This is the PyPWA mass binning utility that simulation/fitting install uses to bin .gamp files in mass.

mvBAMP_GUI

This is the program used by the PWA_GUI’s wave function to move .bamp files between the fit/simulation and the /overflow directory.

pwa_controls

This program is the pwa_controls GUI, or the gui the user uses to specify environment variables for PyPWA.

rhoAA

class batchFarmServices.rhoAA.rhoAA(waves=[], alphaList=[], Q=[1], beamPolarization=0.4)

This class calculates the 3D numpy array, rhoAA. Each value is the spin density matrix times a wave times the complex conjugate of another wave and possibly times Q.

__init__(waves=[], alphaList=[], Q=[1], beamPolarization=0.4)

Default rhoAA constructor.

Kwargs:

waves (array): Array of all waves in this pwa fit/simulation.

alphaList (list): List of all alpha values for this mass bin.

Q (list): List of all Q values for this mass bin.

beamPolarization (float): Value of beam polarization; 0.0 for no polarization.

__weakref__

list of weak references to the object (if defined)

calc()

Function that does the work of calculating rhoAA

Return: rhoAA (numpy ndarray): Note, this class does NOT save the array and must be saved after returning.

run_normintFARM

This is the program that does the work of calculating the normilization integral and returning it as a .npy file.

simulation_Install

This program is the first step for the PyPWA simulation process. It sets up all directories and files needed for simulation as well as all binning in mass as prescribed by the pwa_controls GUI.

simulatorMain

This is the main simulation program for PyPWA simulation. It creates the iList and the simulated gamp files. It can do this using the fitted V values or from the pre chosen waves and resonences.

subLikelihood

This is the submition program for the likelihood program.

subSimulator

This is the submition program for the simulator.

subWalkNTrue

This is the submition program for the nTrue calculation.

walkingNTrue

This function calculates the value of the total nTrue and the nTrue values for each wave for a single mass bin directory.