Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

This little tutorial will help you build your own analysis code step-by-step. After finishing this section you should be able to write a complete analysis inside the JAS3 framework.
You will learn what components are necessary to make an analysis Driver. The Driver presented here will load an existing Driver that puts an object in the event, read that object back from the event and plot a property of that object.
Let's get started: Create a new file with File->New->Java File. Save it as MyExampleClass.java.
At first we need to create a class that inherits from the Driver class:

...

Code Block
import java.util.List;

import org.lcsim.event.EventHeader;
import org.lcsim.event.MCParticle;
import org.lcsim.util.Driver;
import org.lcsim.util.aida.AIDA;

public class MyExampleClass extends Driver {
    private AIDA aida = AIDA.defaultInstance();
    public MyExampleClass(){
        add(new MyJetFindingDriver());
        add(new Analysis101());
    };
    public void process(EventHeader event) {
        super.process(event); // this takes care that the child Drivers are loaded and processed.
        List<List<MCParticle>> jetList = (List<List<MCParticle>>) event.get("jetList");
        aida.cloud1D("nJets").fill(jetList.size());
    }
}

Save the file.
Open the file MyJetFindingDriver.java and compile it.
Open the Analysis101 example and compile it.
Compile and load the MyExampleClass example.