Below is the standard ExampleVTX, rewritten in Java:
import hep.ilc.marlin.jni.Parameters; import hep.ilc.marlin.jni.ProcessorMgr; import hep.lcio.event.LCEvent; import hep.lcio.event.LCRunHeader; import hep.lcio.implementation.io.LCFactory; import hep.lcio.io.LCEventListener; import hep.lcio.io.LCReader; import hep.lcio.io.LCRunListener; public class ExampleVTX { private ProcessorMgr mgr; public ExampleVTX() { mgr = ProcessorMgr.instance(); } private void setup() { System.out.println("Start Setup ExampleVTX"); Parameters vtxParameters = new Parameters(); vtxParameters.add("CollectionName", "vxd01_VXD"); vtxParameters.add("Debug", false); vtxParameters.add("PixelSizeX", 0.025); vtxParameters.add("PixelSizeY", 0.025); vtxParameters.add("LayerThickness", 0.05); vtxParameters.add("Threshold", 200); vtxParameters.add("CutOnDeltaRays", 0.05); vtxParameters.add("TanLorentz", 0.8); vtxParameters.add("ElectronicNoise", 100); vtxParameters.add("ElectronsPerKeV", 270); vtxParameters.add("EnergyLoss", 370); vtxParameters.add("SegmentLength", 0.005); vtxParameters.add("GenerateBackground", false); // Parameters for 50 um thick layer // vtxParameters.add("LadderRadius", new double[] { 15.3072, 26.3072, 38.3072, 49.3072, 60.3072 }); // vtxParameters.add("ActiveLadderOffset", new double[] { 1.46756, 1.41122, 2.59339, 3.62327, 4.46110 }); // Parameters for 450 um vtxParameters.add("LadderRadius", new double[] { 15.5072, 26.5072, 38.5072, 49.5072, 60.5072 }); vtxParameters.add("ActiveLadderOffset", new double[] { 1.8676, 1.8112, 3.2862, 4.5890, 5.6922 }); mgr.addActiveProcessor("VTXDigitizer", "MyVTXDigitizer", vtxParameters); Parameters trkParameters = new Parameters(); trkParameters.add("Chi2WRphiTriplet", 10); trkParameters.add("Chi2WRphiQuartet", 10); trkParameters.add("Chi2WRphiSeptet", 10); trkParameters.add("Chi2WZTriplet", 10); trkParameters.add("Chi2WZQuartet", 10); trkParameters.add("Chi2WZSeptet", 10 ); trkParameters.add("NDivisionsInPhi", 60 ); trkParameters.add("NDivisionsInTheta", 60 ); trkParameters.add("LayerCombinations", new int[] { 4, 3, 2, 4, 3, 1, 4, 2, 1, 3, 2, 1 }); mgr.addActiveProcessor("VertexTracking", "MyVertexTracking", trkParameters); System.out.println("End Setup ExampleVTX"); } private void run(String file) throws Exception { System.out.println("Start Run ExampleVTX"); LCReader lcReader = LCFactory.getInstance().createLCReader() ; lcReader.registerLCRunListener( new LCRunListener() { public void processRunHeader(LCRunHeader rh) { System.err.println("Run "+rh.getDescription()); mgr.processRunHeader(rh); } public void modifyRunHeader(LCRunHeader rh) { System.err.println("Modify Run "+rh); } }) ; lcReader.registerLCEventListener( new LCEventListener() { public void processEvent(LCEvent evt) { System.err.println("Event "); String[] n = evt.getCollectionNames(); for (int i=0; i<n.length; i++) { System.err.println(n[i]); } mgr.processEvent(evt); } public void modifyEvent(LCEvent evt) { System.err.println("Modify Event "); } }) ; lcReader.open( file ) ; mgr.init(); lcReader.readStream(11); mgr.end(); lcReader.close(); System.out.println("End Run ExampleVTX"); } public static void main(String[] args) throws Exception { ExampleVTX ex = new ExampleVTX(); ex.setup(); ex.run("MarlinReco/examples/top_vxd01.slcio"); } }