1 package org.lcsim.plugin;
2
3 import org.freehep.record.loop.RecordLoop;
4 import org.freehep.util.FreeHEPLookup;
5 import org.lcsim.event.EventHeader;
6
7
8
9
10
11
12 public class LCSim
13 {
14 private final FreeHEPLookup lookup;
15
16 LCSim(FreeHEPLookup lookup)
17 {
18 this.lookup = lookup;
19 }
20
21
22
23
24 public EventHeader getCurrentEvent()
25 {
26 try
27 {
28 RecordLoop loop = (RecordLoop) lookup.lookup(RecordLoop.class);
29 Object event = loop.getRecordSource().getCurrentRecord();
30 return (event instanceof EventHeader) ? (EventHeader) event : null;
31 }
32 catch (Exception x)
33 {
34 return null;
35 }
36 }
37 }