You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

What is a Driver

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.

Driver Template

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 {
    
    public void process(EventHeader event) {        
    }

    protected void detectorChanged(Detector detector) {
    }
    
    protected void endOfData() {
    }

    protected void startOfData() {        
    }
}
OrderMethodExplanation
1Driver constructorno argument constructor activated when Driver created
2Driver setters calledset methods called individually for different parameters (by JobManager)
3startOfDatadata processing has started but detector conditions not initialized yet
4detectorChangedactivates after detector conditions are initialized so Driver can perform any necessary setup
5process

called once for every event in the job

default behavior of parent class executes child drivers

6endOfData

end of data processing hook

histograms can be normalized/scaled in this method

 

Event Processing Hooks

process method


The process method is called once for every event.  This method typically implements the main event processing algorithm of the Driver.  Collections can be read from the event and their data plotted, or new data collections can be added to the event using this method.  The default implementation of this method in the Driver class calls the process method of all the child Drivers.

startOfData method

The startOfData method is activated at the beginning of data processing but before detector conditions are initialized.  Any setup that needs to be performed which is independent of the detector information can be implemented here.

detectorChanged  method

The detectorChanged method is called after the conditions system is initialized.

creating with lcsim xml compatibility (setters etc.)

referencing a driver from xml (example snippet)

accessing event data
provide several examples with different types

adding event data

writing out LCIO

AIDA histogramming and histogram level

  • No labels