hep.physics.generator.diagnostic
Class DiagnosticEventGenerator

java.lang.Object
  |
  +--hep.analysis.EventHandler
        |
        +--hep.analysis.EventGenerator
              |
              +--hep.physics.generator.diagnostic.DiagnosticEventGenerator
All Implemented Interfaces:
EventSource

public class DiagnosticEventGenerator
extends EventGenerator

Generates user specified particle type events with user specified ranges.


Fields inherited from class hep.analysis.EventHandler
out
 
Constructor Summary
DiagnosticEventGenerator()
           
 
Method Summary
 void addFakeMother(boolean doIt)
          Add a fake mother particle of HepEvt type (status DOCUMENTATION) to the event record for every simulated particle (pair).
 void beforeFirstEvent()
          Called before the first event is accessed.
 EventData generateEvent()
          Generate a single event with nparts particles or nparts pairs of particles if angres is selected.
 int getMaxEvents()
           
 java.lang.String getName()
          override to specify name of event generator
 int getNumberOfParticles()
           
 ParticleType getParticleType()
           
 void getSummary()
          Print run summary.
 int getTotalNumberOfEvents()
          Override if the number of events is known, and return that number.
 void printParameters()
          Print the parameters.
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 setMaxEvents(int n)
          Sets the maximum number of events to generate.
 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(int pdgid)
          Set the particle type using the PDG particle ID numbers.
 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 hep.analysis.EventGenerator
close, getEventDataClass, getNextEvent, toString
 
Methods inherited from class hep.analysis.EventHandler
afterLastEvent, histogram, histogram, sendMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface hep.analysis.EventSource
afterLastEvent
 

Constructor Detail

DiagnosticEventGenerator

public DiagnosticEventGenerator()
Method Detail

getName

public java.lang.String getName()
Description copied from class: EventGenerator
override to specify name of event generator
Overrides:
getName in class EventGenerator

beforeFirstEvent

public void beforeFirstEvent()
Description copied from interface: EventSource
Called before the first event is accessed.
Overrides:
beforeFirstEvent in class EventHandler

setMaxEvents

public void setMaxEvents(int n)
Sets the maximum number of events to generate.
Parameters:
n - The maximum number of events to generate, or 0 for no limit

getMaxEvents

public int getMaxEvents()

getTotalNumberOfEvents

public int getTotalNumberOfEvents()
Description copied from class: EventGenerator
Override if the number of events is known, and return that number.
Overrides:
getTotalNumberOfEvents in class EventGenerator

setRunNumber

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

setParticleType

public void setParticleType(int pdgid)
Set the particle type using the PDG particle ID numbers. Default = 13 (mu-).

setParticleType

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

addFakeMother

public void addFakeMother(boolean doIt)
Add a fake mother particle of HepEvt type (status DOCUMENTATION) to the event record for every simulated particle (pair).
This option needs to be set to get the origin of MC truth particles correct in the MC event record after the GISMO simulation step, if the particles simulated originate from a point other than (0,0,0).
Parameters:
doIt - = true (default): add fake mother particle(s).

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.

generateEvent

public EventData generateEvent()
                        throws EndOfDataException
Generate a single event with nparts particles or nparts pairs of particles if angres is selected.
Overrides:
generateEvent in class EventGenerator
Following copied from class: hep.analysis.EventGenerator
Throws:
EndOfDataException - when there are no more events available

getSummary

public void getSummary()
Print run summary. (Nothing implemented yet.)

selectP

protected HepLorentzVector selectP()

selectOrigin

protected Hep3Vector selectOrigin()

selectMom

protected double selectMom()

selectCosth

protected double selectCosth()

selectPhi

protected double selectPhi()