public class Driver extends Object
It also allows controlling the histogram level of the processors being called and handles coordination of random numbers between Monte Carlo processors.
Modifier and Type | Class and Description |
---|---|
static class |
Driver.AbortRunException
If thrown during the process method of a driver, causes processing of events to be aborted.
|
private static class |
Driver.MotherOfAllDrivers |
static class |
Driver.NextEventException
If thrown during the process method of a driver, causes processing of the current event to be aborted.
|
Modifier and Type | Field and Description |
---|---|
private String |
driverName |
private int |
histogramLevel |
static int |
HLEVEL_DEFAULT |
static int |
HLEVEL_FULL |
static int |
HLEVEL_HIGH |
static int |
HLEVEL_NORMAL |
static int |
HLEVEL_OFF |
private static Driver |
mother |
private int |
nEvents |
private long |
nNanos |
private Driver |
parent |
private Random |
random |
private List<Driver> |
subDrivers |
Constructor and Description |
---|
Driver()
Creates a driver
|
Driver(String name) |
Modifier and Type | Method and Description |
---|---|
void |
add(Driver driver)
Add a sub-Driver to this Driver.
|
void |
clearStatistics()
Clear statistics
|
boolean |
contains(Driver driver)
Tests to see if a given Driver is already a child of this Driver
|
protected void |
detectorChanged(Detector detector)
Called by the framework before process method when the detector geometry changes.
|
(package private) void |
doProcess(EventHeader event) |
List<Driver> |
drivers()
Returns a List of all the drivers added to this Driver
|
protected void |
endOfData()
Called when all data processing is finished.
|
private static String |
formatName(int indent,
String name,
int width) |
private static String |
formatTime(long nanos) |
ConditionsManager |
getConditionsManager() |
int |
getHistogramLevel()
Get the default histogram level for this driver
|
Logger |
getLogger()
Returns a logger for logging diagnostic messages from this driver
|
String |
getName()
Get the name of this driver.
|
Random |
getRandom() |
(package private) String |
pathToMother() |
void |
printStatistics(PrintStream out)
Print statistics for this driver and its children
|
private void |
printStatistics(PrintStream out,
int indent,
long parentNanos) |
private static void |
printStatisticsLine(PrintStream out,
int indent,
String name,
int nEvents,
long time,
long parentTime) |
protected void |
process(EventHeader event)
Called by the framework to process an event.
|
void |
processChildren(EventHeader event)
Calls the sub-Drivers process() method.
|
void |
remove(Driver driver)
Removes a sub-Driver from this Driver
|
protected void |
resume()
Called by the framework when event processing is resumed.
|
void |
setHistogramLevel(int level)
Set the histogram level for this driver (and its child drivers)
|
void |
setLogLevel(String logLevel) |
void |
setRandom(Random random)
Set default random number generator for this driver and all child drivers.
|
protected void |
startOfData()
Called before the first event is processed, or after a rewind.
|
protected void |
suspend()
Called by the framework when event processing is suspended.
|
public static final int HLEVEL_DEFAULT
public static final int HLEVEL_OFF
public static final int HLEVEL_NORMAL
public static final int HLEVEL_HIGH
public static final int HLEVEL_FULL
private static Driver mother
private Driver parent
private int histogramLevel
private Random random
private final String driverName
private int nEvents
private long nNanos
public Driver()
Driver(String name)
public void add(Driver driver)
driver
- The Driver to be addedpublic void remove(Driver driver)
driver
- The Driver to be removedpublic boolean contains(Driver driver)
driver
- Driver to be checkedpublic Logger getLogger()
public String getName()
String pathToMother()
public int getHistogramLevel()
public void setHistogramLevel(int level)
public ConditionsManager getConditionsManager()
protected void suspend()
protected void resume()
protected void endOfData()
protected void startOfData()
protected void detectorChanged(Detector detector)
Detector
- The new detectorprotected void process(EventHeader event)
super.process(event)
to cause the child processes to be executed.
In addition the process event call can throw some special exceptions:
event
- The event to be processedDriver.NextEventException
,
Driver.AbortRunException
public void clearStatistics()
public void printStatistics(PrintStream out)
private void printStatistics(PrintStream out, int indent, long parentNanos)
private static void printStatisticsLine(PrintStream out, int indent, String name, int nEvents, long time, long parentTime)
private static String formatTime(long nanos)
void doProcess(EventHeader event)
public void processChildren(EventHeader event)
public Random getRandom()
public void setRandom(Random random)
random
- The random number generator, or null
to reset to defaultpublic void setLogLevel(String logLevel)
Copyright © 2016 Linear Collider Detector (LCD). All rights reserved.