HPS-MC
hpsmc.func Namespace Reference

Miscellaneous math functions. More...

Functions

def lint (target_dz, num_electrons, density=6.306e-14)
 Calculate integrated luminosity. More...
 
def csection (filename)
 Extract cross-section from gzipped LHE file. More...
 
def mu (filename, target_dz, num_electrons)
 Calculate mu = number of events per bunch. More...
 
def nevents (filename, confirm=False)
 Read number of events in file from LHE header and optionally confirm by counting <event> blocks. More...
 
def nbunches (filename, target_dz, num_electrons)
 Get the approximate number of beam bunches represented by an LHE file from its event count. More...
 

Variables

 logger = logging.getLogger("hpsmc.func")
 

Detailed Description

Miscellaneous math functions.

Function Documentation

◆ csection()

def hpsmc.func.csection (   filename)

Extract cross-section from gzipped LHE file.

WARNING: This function does not work!

Todo:
remove or replace by more useful function
Parameters
filenamename of input file

Definition at line 20 of file func.py.

◆ lint()

def hpsmc.func.lint (   target_dz,
  num_electrons,
  density = 6.306e-14 
)

Calculate integrated luminosity.

Parameters
target_dztarget thickness in cm
num_electronsnumber of electrons in bunch
density1/(cm*pb), default value is for tungsten
Returns
integrated luminosity in 1/pb

Definition at line 9 of file func.py.

◆ mu()

def hpsmc.func.mu (   filename,
  target_dz,
  num_electrons 
)

Calculate mu = number of events per bunch.

WARNING: This function does not work properly because csection() is broken!

Parameters
filenamename of input LHE input file containing cross section
target_dztarget thickness in cm
num_electronsnumber of electrons in bunch
Returns
number of events per bunch (L_int[1/pb] * xsec[pb])

Definition at line 44 of file func.py.

◆ nbunches()

def hpsmc.func.nbunches (   filename,
  target_dz,
  num_electrons 
)

Get the approximate number of beam bunches represented by an LHE file from its event count.

Parameters
filenamename of input LHE file
target_dztarget thickness in cm
num_electronsnumber of electrons in bunch

Definition at line 84 of file func.py.

◆ nevents()

def hpsmc.func.nevents (   filename,
  confirm = False 
)

Read number of events in file from LHE header and optionally confirm by counting <event> blocks.

Parameters
filenamename of input LHE file
confirmset to True to confirm number of events

Definition at line 57 of file func.py.

Variable Documentation

◆ logger

logger = logging.getLogger("hpsmc.func")

Definition at line 6 of file func.py.