Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
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;
    }
}

 

Event Processing Hooks

Execution Order

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

 

...

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.

...