public final class EvioToLcio extends Object
This class converts EVIO to LCIO, performing an LCSim job in the same session. The processed events are then (optionally) written to disk using an LCIOWriter.
To run this class from the command line:
java -cp hps-distribution-bin.jar EvioToLcio [options] [evioFiles]
The available arguments can be printed using:
java -cp hps-distribution-bin.jar EvioToLcio -h
Extra arguments are treated as paths to EVIO files.
This class attempts to automatically configure itself for Test Run or Engineering Run based on the run numbers in the EVIO file. It will use an appropriate default detector unless one is given on the command line, and it will also use the correct event builder. It will not handle jobs correctly with files from both the Test and Engineering Run, so don't do this!
The run number in the conditions system can be initialized in one of three ways.
In the case where a file has no PRESTART event and there are header banks present, the "-m" command line option can be used to buffer a number of EVIO events. If there is a head bank found while adding these events to queue, the conditions system will be initialized from it.
Modifier and Type | Field and Description |
---|---|
private String |
detectorName
The detector name for conditions.
|
private LCSimEventBuilder |
eventBuilder
The LCSim event builder used to convert from EVIO.
|
private Long |
eventPrintInterval |
private List<String> |
evioFileList |
private JobManager |
jobManager |
private String |
lcioFileName |
private static Logger |
LOGGER
Setup logging for this class.
|
private int |
maxBufferSize |
private int |
maxEvents |
private int |
nEvents
The run number for conditions.
|
private static org.apache.commons.cli.Options |
OPTIONS
The command line options which will be defined in the constructor.
|
private boolean |
printXml |
private Integer |
runNumber |
private int |
skipEvents |
private InputStream |
steeringStream |
private boolean |
useMemoryMapping |
private org.lcsim.lcio.LCIOWriter |
writer |
Constructor and Description |
---|
EvioToLcio()
The default constructor, which defines command line arguments and sets the default log level.
|
Modifier and Type | Method and Description |
---|---|
private void |
bufferEvents(org.jlab.coda.jevio.EvioReader reader,
EvioEventQueue eventQueue,
int maxBufferSize)
Buffer up to
maxBufferSize events in the eventQueue . |
private void |
checkConditions(int runNumber,
boolean freeze)
Check if the conditions system and event builder need to be initialized or updated given a run number.
|
static void |
main(String[] args)
Run the EVIO to LCIO converter from the command line.
|
void |
parse(String[] args) |
private void |
printUsage()
Print the CLI usage and exit.
|
void |
run()
This method will execute the EVIO to LCIO conversion and optionally process the events with LCSim Drivers from a
steering file.
|
private void |
setupEventBuilder(int runNumber)
Setup the LCSimEventBuilder based on the current detector name and run number.
|
private static Logger LOGGER
private String detectorName
private LCSimEventBuilder eventBuilder
private static org.apache.commons.cli.Options OPTIONS
private int nEvents
private int maxEvents
private int skipEvents
private int maxBufferSize
private Long eventPrintInterval
private Integer runNumber
private boolean printXml
private boolean useMemoryMapping
private JobManager jobManager
private String lcioFileName
private org.lcsim.lcio.LCIOWriter writer
private InputStream steeringStream
public EvioToLcio()
public static void main(String[] args)
args
- The command line arguments.private void bufferEvents(org.jlab.coda.jevio.EvioReader reader, EvioEventQueue eventQueue, int maxBufferSize)
maxBufferSize
events in the eventQueue
. This method will also initialize
the conditions system using a run number if a header bank is found.reader
- the EVIO readereventQueue
- the event queuemaxBufferSize
- the maximum number of records to bufferprivate void checkConditions(int runNumber, boolean freeze)
runNumber
- The run number.freeze
- True to freeze conditions system after it is setup.private void printUsage()
public void parse(String[] args)
public void run()
private void setupEventBuilder(int runNumber)
detectorName
- The detector name to be assigned to the event builder.runNumber
- The run number which determines which event builder to use.Copyright © 2019. All rights reserved.