Ejemplo n.º 1
0
def get_propagators():
    """
	Set up a stable of propagators for muons, taus, and cascades.
	"""
    from icecube import sim_services, phys_services
    from icecube.PROPOSAL import I3PropagatorServicePROPOSAL
    from icecube.cmc import I3CascadeMCService
    propagators = sim_services.I3ParticleTypePropagatorServiceMap()
    muprop = I3PropagatorServicePROPOSAL(type=dataclasses.I3Particle.MuMinus)
    tauprop = I3PropagatorServicePROPOSAL(type=dataclasses.I3Particle.TauMinus)
    cprop = I3CascadeMCService(
        phys_services.I3GSLRandomService(1))  # dummy RNG
    for pt in 'MuMinus', 'MuPlus':
        propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = muprop
    for pt in 'TauMinus', 'TauPlus':
        propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = tauprop
    for pt in 'DeltaE', 'Brems', 'PairProd', 'NuclInt', 'Hadrons', 'EMinus', 'EPlus':
        propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = cprop
    return propagators
Ejemplo n.º 2
0
def make_propagators():
	"""
	Set up a stable of propagators for all the kinds of particles we're going to see.
	"""
	from icecube.PROPOSAL import I3PropagatorServicePROPOSAL
	from icecube.cmc import I3CascadeMCService
	propagators = sim_services.I3ParticleTypePropagatorServiceMap()
	muprop = I3PropagatorServicePROPOSAL(type=dataclasses.I3Particle.MuMinus)
	cprop = I3CascadeMCService(phys_services.I3GSLRandomService(1)) # dummy RNG
	for pt in 'MuMinus', 'MuPlus':
		propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = muprop
	for pt in 'DeltaE', 'Brems', 'PairProd', 'NuclInt', 'Hadrons', 'EMinus', 'EPlus':
		propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = cprop
	return propagators
Ejemplo n.º 3
0
def make_propagators():
    from icecube.sim_services import I3ParticleTypePropagatorServiceMap
    from icecube.PROPOSAL import I3PropagatorServicePROPOSAL
    from icecube.cmc import I3CascadeMCService
    propagators = I3ParticleTypePropagatorServiceMap()
    muprop = I3PropagatorServicePROPOSAL(type=dataclasses.I3Particle.MuMinus,
                                         cylinderHeight=1200,
                                         cylinderRadius=700)
    cprop = I3CascadeMCService(
        phys_services.I3GSLRandomService(1))  # dummy RNG
    for pt in 'MuMinus', 'MuPlus':
        propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = muprop
    for pt in 'DeltaE', 'Brems', 'PairProd', 'NuclInt', 'Hadrons', 'EMinus', 'EPlus':
        propagators[getattr(dataclasses.I3Particle.ParticleType, pt)] = cprop
    return propagators
Ejemplo n.º 4
0
#!/usr/bin/env python

import os

from icecube.dataclasses import I3Particle
from icecube.PROPOSAL import I3PropagatorServicePROPOSAL

I3PropagatorServicePROPOSAL(type=I3Particle.MuMinus)
I3PropagatorServicePROPOSAL(type=I3Particle.TauMinus)

# This should have generated all data files.
# Generate a marker file to tell the build system this task
# has been successfully completed.
f = open(os.path.expandvars("$I3_BUILD/PROPOSAL/resources/tables/.tables.auto_generated"), "w")
f.close()
Ejemplo n.º 5
0
#         It would be nice then to be able to instantiate an
#         I3PropagatorServicePROPOSAL object, figure out what
#         path settled on so we can make these checkes here.
#         1) Add a 'generate_tables' method to I3PropagatorServicePROPOSAL
#         2) Don't include expensive, blocking processes in constructors.
#         3) Expose the path it expects to find tables in, so
#            we can instantiate multiple services in different processes
#            without them wrestling with each other.

# This should have generated all data files.
# Generate a marker file to tell the build system this task
# has been successfully completed.
file_lock_path = os.path.expandvars(
    "$I3_BUILD/PROPOSAL/resources/tables/.tables.auto_generated")
if not os.path.exists(file_lock_path):
    with open(file_lock_path, 'w') as f:
        try:
            I3PropagatorServicePROPOSAL()
        except:
            # something went wrong and table generation was not successful
            os.remove(file_lock_path)
        f.write(
            'success'
        )  # need to be able to communicate to other objects instantiated
        # in different processes whether the tables it needs are good to go.  if not, it
        # should probably emit an error message "tables are not ready yet."
else:
    print(
        "%s exists already, indicating the tables are already (or in the process of being) generated."
        % file_lock_path)