Search/Navigation:
Related:
SLAC/EPP
/HPS Public
Jefferson Lab/Hall B
/HPS Run Wiki
S30XL-LESA/LDMX
...
In HPS Java terminology, a Driver processes events and can read or add collection data. A Driver can create histograms from physics data or implement a step of physics reconstruction. Drivers are executed in order, and a Driver can have child Drivers to implement complex behavior. A chain of Drivers is activated by the "mother of all drivers" which contains a list of the top level Drivers as children.
...
Code Block | ||
---|---|---|
| ||
package org.hps.users.jeremym; import org.lcsim.event.EventHeader; import org.lcsim.geometry.Detector; import org.lcsim.util.Driver; public class ExampleDriver extends Driver { private int value; public void process(EventHeader event) { } protected void detectorChanged(Detector detector) { } protected void endOfData() { } protected void startOfData() { } public void setValue(int value) { this.value = value; } } |
Order | Method | Explanation |
---|---|---|
1 | Driver constructor | no argument constructor activated when Driver created |
2 | Driver setters called | set methods called individually for different parameters (by JobManager) |
3 | startOfData | data processing has started but detector conditions not initialized yet |
4 | detectorChanged | activates after detector conditions are initialized so Driver can perform any necessary setup |
5 | process | called once for every event in the job default behavior of parent class executes child drivers |
6 | endOfData | end of data processing hook histograms can be normalized/scaled in this method |
...
The lcsim xml format can describe drivers and their parameters at runtime using an XML data description. The Guidelines for Creating Compatible Drivers describes how to write a Driver so that it can be using in the XML steering files.
Here is sample XML which calls the ExampleDriver and sets a parameter value on it.
Code Block | ||||
---|---|---|---|---|
| ||||
<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
<execute>
<driver name="ExampleDriver"/>
</execute>
<drivers>
<driver name="ExampleDriver" type="org.hps.users.jeremym.ExampleDriver">
<value>1234</value>
</driver>
</drivers>
</lcsim> |
...