hep.lcd.util.driver
Class Driver

java.lang.Object
  |
  +--hep.lcd.util.aida.HistogramManager
        |
        +--hep.analysis.EventHandler
              |
              +--hep.analysis.EventAnalyzer
                    |
                    +--hep.lcd.util.driver.Driver
All Implemented Interfaces:
IHistogramManager, Processor

public class Driver
extends EventAnalyzer
implements Processor

A driver is a steering routine which can call a number of processors It also allows controlling the debug level of the processors being called and handles coordination of random numbers between Monte Carlo processors. Driver also implements Processor, so Drivers can be nested as Processors within other Drivers. When used as a nested driver all parameters such as histogramLevel and debugLevel are inherited from the parent driver.

See Also:
Processor, ProcessorContext, hep.lcd.recon.ReconDriver

Field Summary
 
Fields inherited from class hep.analysis.EventHandler
out
 
Constructor Summary
Driver()
           
 
Method Summary
 void add(Processor p)
          Add a Processor to this Driver
 void afterLastEvent()
          Called after the last event is handled.
 void beforeFirstEvent()
          Called before the first event is handled.
 void clearContext()
          Called by the Driver when this processor is removed from the Driver
 boolean contains(Processor p)
          Tests to see if a given Processor is already added to this Driver
 int getDebugLevel()
           
 java.lang.String getEventPrefix()
          Get the prefix to be prepended to anything added to the event.
 int getHistogramLevel()
           
 java.lang.String getName()
          Called by the Driver to get the name of this processor
 long getSeed()
           
 void process(hep.lcd.event.LCDEvent event)
          Called by the driver when this processor should process an event.
 void processEvent(EventData data)
          When implementing this method, use the given EventData object to access data for an event and use the data appropriately.
 java.util.Iterator processors()
          Returns an iterator over all the processors added to this Driver
 void remove(Processor p)
          Removes a Processor from this Driver
 void setContext(ProcessorContext value)
          Called by the Driver when this processor is added to the Driver
 void setDebugLevel(int level)
           
 void setDetector(hep.lcd.geometry.Detector det)
          Called by the driver when a new detector geometry is set.
 void setEventPrefix(java.lang.String prefix)
          Set the prefix to prepend to anything added to the event.
 void setHistogramLevel(int level)
           
 void setSeed(long newSeed)
           
 void start()
          Called at the beginning of processing
 void stop()
          Called at the end of processing
 
Methods inherited from class hep.analysis.EventHandler
histogram, sendMessage
 
Methods inherited from class hep.lcd.util.aida.HistogramManager
analysisFactory, cloud1D, cloud1D, cloud2D, cloud2D, cloud3D, cloud3D, histogram1D, histogram1D, histogram2D, histogram2D, histogram3D, histogram3D, histogramFactory, profile1D, profile1D, profile2D, profile2D, tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hep.lcd.util.aida.IHistogramManager
analysisFactory, cloud1D, cloud1D, cloud2D, cloud2D, cloud3D, cloud3D, histogram1D, histogram1D, histogram2D, histogram2D, histogram3D, histogram3D, histogramFactory, profile1D, profile1D, profile2D, profile2D, tree
 

Constructor Detail

Driver

public Driver()
Method Detail

add

public void add(Processor p)
Add a Processor to this Driver

Parameters:
p - The Processor to be added

remove

public void remove(Processor p)
Removes a Processor from this Driver

Parameters:
p - The Processor to be removed

processors

public java.util.Iterator processors()
Returns an iterator over all the processors added to this Driver


contains

public boolean contains(Processor p)
Tests to see if a given Processor is already added to this Driver

Parameters:
p - Processor to be checked

processEvent

public void processEvent(EventData data)
Description copied from class: EventAnalyzer
When implementing this method, use the given EventData object to access data for an event and use the data appropriately.

Specified by:
processEvent in class EventAnalyzer

setDetector

public void setDetector(hep.lcd.geometry.Detector det)
Description copied from interface: Processor
Called by the driver when a new detector geometry is set. This will always be called before the first call to process(), and subsequently each time the Detector geometry changes.

Specified by:
setDetector in interface Processor

beforeFirstEvent

public void beforeFirstEvent()
Description copied from class: EventHandler
Called before the first event is handled. Does nothing by default. Override to have something happen.

Overrides:
beforeFirstEvent in class EventHandler

afterLastEvent

public void afterLastEvent()
Description copied from class: EventHandler
Called after the last event is handled. Does nothing by default. Override to have something happen.

Overrides:
afterLastEvent in class EventHandler

getSeed

public long getSeed()

setSeed

public void setSeed(long newSeed)

getDebugLevel

public int getDebugLevel()

setDebugLevel

public void setDebugLevel(int level)

getHistogramLevel

public int getHistogramLevel()

setHistogramLevel

public void setHistogramLevel(int level)

setEventPrefix

public void setEventPrefix(java.lang.String prefix)
Set the prefix to prepend to anything added to the event.


getEventPrefix

public java.lang.String getEventPrefix()
Get the prefix to be prepended to anything added to the event.


process

public void process(hep.lcd.event.LCDEvent event)
Description copied from interface: Processor
Called by the driver when this processor should process an event. If the processor produces new output it should add it to the event.

Specified by:
process in interface Processor
Parameters:
event - The event to process

start

public void start()
Description copied from interface: Processor
Called at the beginning of processing

Specified by:
start in interface Processor

stop

public void stop()
Description copied from interface: Processor
Called at the end of processing

Specified by:
stop in interface Processor

setContext

public void setContext(ProcessorContext value)
Description copied from interface: Processor
Called by the Driver when this processor is added to the Driver

Specified by:
setContext in interface Processor
Parameters:
value - the new ProcessorContext

clearContext

public void clearContext()
Description copied from interface: Processor
Called by the Driver when this processor is removed from the Driver

Specified by:
clearContext in interface Processor

getName

public java.lang.String getName()
Description copied from interface: Processor
Called by the Driver to get the name of this processor

Specified by:
getName in interface Processor
Returns:
The name of the processor