hep.physics.event.generator.diagnostic
Class DiagnosticEventGenerator

java.lang.Object
  extended by hep.physics.event.generator.diagnostic.DiagnosticEventGenerator
All Implemented Interfaces:
EventGenerator

public class DiagnosticEventGenerator
extends java.lang.Object
implements EventGenerator

Generates user specified particle type events with user specified ranges.

Version:
$Id: DiagnosticEventGenerator.java 8584 2006-08-10 23:06:37Z duns $
Author:
Gary Bower

Constructor Summary
DiagnosticEventGenerator()
          Create a diagnostic event generator with default particle property provider and object factory.
DiagnosticEventGenerator(ParticlePropertyProvider ppp)
          Create a diagnostic event generator with the default object factory.
DiagnosticEventGenerator(ParticlePropertyProvider ppp, GeneratorFactory factory)
          Create a diagnostic event generator with user supplied particle property provider and object factory.
DiagnosticEventGenerator(ParticlePropertyProvider ppp, GeneratorFactory factory, java.util.Random random)
          Create a diagnostic event generator with user supplied particle property provider and object factory.
 
Method Summary
 MCEvent generate()
          Generate a single event with nparts particles or nparts pairs of particles if angres is selected.
 int getNumberOfParticles()
           
 ParticlePropertyProvider getParticlePropertyProvider()
          Get the particle property provider being used by this generator
 ParticleType getParticleType()
           
 int getRunNumber()
           
 long getSeed()
           
 double getTwoParticleRes()
           
 double getXRange()
           
 double getYRange()
           
 double getZRange()
           
 boolean isRandomParticleAntiParticle()
           
 void printParameters()
          Print the parameters.
 void reset()
           
protected  double selectCosth()
           
protected  double selectMom()
           
protected  Hep3Vector selectOrigin()
           
protected  HepLorentzVector selectP()
           
protected  double selectPhi()
           
 void setCosthRange(double lowcosth, double highcosth)
          Select the cosine theta range between -1 and 1.
 void setMomentumRange(double lowp, double highp)
          Select the momentum range in GeV.
 void setNumberOfParticles(int nparts)
          Set the number of particles to generate in a single event.
 void setOrigin(double x, double y, double z)
          Select an origin for the particle.
 void setParticleType(ParticleType ptype)
          Set the particle type using a Java particle type.
 void setPhiRange(double lowphi, double highphi)
          Select the phi range between 0 and 2*PI in radians.
 void setRandomParticleAntiParticle(boolean ppbar)
          Randomly change between generating particles and anti-particles, if true.
 void setRunNumber(int nrun)
          Sets the run number.
 void setSeed(long seed)
          Set the seed for the random number generator.
 void setTwoParticleRes(double angres)
          For angular resolution studies.
 void setXRange(double dx)
          Randomly varies the x origin by +/-dx.
 void setYRange(double dy)
          Randomly varies the y origin by +/-dy.
 void setZRange(double dz)
          Randomly varies the z origin by +/-dz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagnosticEventGenerator

public DiagnosticEventGenerator()
Create a diagnostic event generator with default particle property provider and object factory.


DiagnosticEventGenerator

public DiagnosticEventGenerator(ParticlePropertyProvider ppp)
Create a diagnostic event generator with the default object factory.

Parameters:
ppp - The particle property provider to use.

DiagnosticEventGenerator

public DiagnosticEventGenerator(ParticlePropertyProvider ppp,
                                GeneratorFactory factory)
Create a diagnostic event generator with user supplied particle property provider and object factory. The object factory can be used to customize the particle and events created by the generator, for example to provide experiment specific classes.

Parameters:
ppp - The particle property provider to use
factory - The object factory to use.

DiagnosticEventGenerator

public DiagnosticEventGenerator(ParticlePropertyProvider ppp,
                                GeneratorFactory factory,
                                java.util.Random random)
Create a diagnostic event generator with user supplied particle property provider and object factory. The object factory can be used to customize the particle and events created by the generator, for example to provide experiment specific classes.

Parameters:
ppp - The particle property provider to use
factory - The object factory to use.
random - The random number generator to use.
Method Detail

getParticlePropertyProvider

public ParticlePropertyProvider getParticlePropertyProvider()
Get the particle property provider being used by this generator


reset

public void reset()
Specified by:
reset in interface EventGenerator

setRunNumber

public void setRunNumber(int nrun)
Sets the run number. Default = 1.


setParticleType

public void setParticleType(ParticleType ptype)
Set the particle type using a Java particle type.


getParticleType

public ParticleType getParticleType()

setNumberOfParticles

public void setNumberOfParticles(int nparts)
Set the number of particles to generate in a single event. If the angular resolution option is selected nparts pairs of particles will be generated. Default = 1.


getNumberOfParticles

public int getNumberOfParticles()

setMomentumRange

public void setMomentumRange(double lowp,
                             double highp)
Select the momentum range in GeV. Selecting lowp = highp sets lowp as the value to be used. Default = (5,5).


setCosthRange

public void setCosthRange(double lowcosth,
                          double highcosth)
Select the cosine theta range between -1 and 1. Setting lowcosth = highcosth sets lowcosth as the value to be used. Default = (-1,1).


setPhiRange

public void setPhiRange(double lowphi,
                        double highphi)
Select the phi range between 0 and 2*PI in radians. Setting lowphi = highphi sets lowphi as the value to be used. Default = (0,2*PI).


setOrigin

public void setOrigin(double x,
                      double y,
                      double z)
Select an origin for the particle. Default = (0,0,0).


setXRange

public void setXRange(double dx)
Randomly varies the x origin by +/-dx.


setYRange

public void setYRange(double dy)
Randomly varies the y origin by +/-dy.


setZRange

public void setZRange(double dz)
Randomly varies the z origin by +/-dz.


setRandomParticleAntiParticle

public void setRandomParticleAntiParticle(boolean ppbar)
Randomly change between generating particles and anti-particles, if true.


setTwoParticleRes

public void setTwoParticleRes(double angres)
For angular resolution studies. If angres is set non-negative then for each particle generated according to the selected parameters a second particle is generated with identical properties except it is rotated angres radians in a randomly chosen direction from the direction of the original particle. To disable this feature set angres < 0. Default = -1 (ie, disabled). Units = radians.


setSeed

public void setSeed(long seed)
Set the seed for the random number generator. If no seed is set the generator selects a seed based on the date and time, thus repeated runs will in general not give the same results. Default = not set. Units are long integers.


printParameters

public void printParameters()
Print the parameters.


generate

public MCEvent generate()
Generate a single event with nparts particles or nparts pairs of particles if angres is selected.

Specified by:
generate in interface EventGenerator

selectP

protected HepLorentzVector selectP()

selectOrigin

protected Hep3Vector selectOrigin()

selectMom

protected double selectMom()

selectCosth

protected double selectCosth()

selectPhi

protected double selectPhi()

getSeed

public long getSeed()

getRunNumber

public int getRunNumber()

getTwoParticleRes

public double getTwoParticleRes()

isRandomParticleAntiParticle

public boolean isRandomParticleAntiParticle()

getZRange

public double getZRange()

getYRange

public double getYRange()

getXRange

public double getXRange()


Copyright © 2000-2010 FreeHEP. All Rights Reserved.