public final class ScalerData extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ARRAY_SIZE
Fixed array size of scaler data in the EVIO bank.
|
private int[] |
data
The scaler data values.
|
private static String |
DEFAULT_COLLECTION_NAME
Default name of scaler data collection in LCSim events.
|
private static Map<String,float[]> |
DUMMY_FLOAT_MAP
Dummy float parameters to make LCIO persistency work.
|
private static Map<String,String[]> |
DUMMY_STRING_MAP
Dummy int parameters to make LCIO persistency work.
|
private Integer |
eventId
The event ID of the data.
|
private static Logger |
LOGGER |
private Integer |
timestamp
The timestamp of the scaler event.
|
private static String |
TIMESTAMP
Name of timestamp field in collection parameters.
|
Constructor and Description |
---|
ScalerData()
This is the no argument constructor which is for package internal use only.
|
ScalerData(int[] data,
int eventId,
int timestamp)
Create from provided scaler data values.
|
Modifier and Type | Method and Description |
---|---|
private void |
fromGenericObject(org.lcsim.event.GenericObject object)
Load data into this object from an
GenericObject read from an LCIO event. |
Integer |
getEventId()
Get the event ID of the scaler data.
|
static ScalerData |
getScalerData(org.jlab.coda.jevio.EvioEvent evioEvent)
Get scaler data from an EVIO event.
|
int |
getTimestamp()
Get the scaler data's Unix timestamp.
|
Integer |
getValue(int index)
Get the scaler data value at the index.
|
Integer |
getValue(ScalerDataIndex scalarDataIndex)
Get the value using a
ScalerDataIndex enum. |
static ScalerData |
read(org.lcsim.event.EventHeader event)
Create a new
ScalerData object from an LCIO event, using the default collection name. |
static ScalerData |
read(org.lcsim.event.EventHeader event,
String collectionName)
Create a new object from the data in an LCIO event, using the default collection name.
|
(package private) void |
setEventId(int eventId)
Set the event ID of the scaler data.
|
int |
size()
Get the number of scalers.
|
private org.lcsim.event.GenericObject |
toGenericObject()
Convert this object to an LCSim
GenericObject for persistency to LCIO. |
String |
toString()
Convert this object to a readable string, which is a list of integer values enclosed in braces and separated by
commas.
|
void |
write(org.lcsim.event.EventHeader event)
Write this object out to an LCIO event using the default collection name.
|
private void |
write(org.lcsim.event.EventHeader event,
String collectionName)
Write this object out to an LCIO event using the given collection name.
|
private static Logger LOGGER
public static final int ARRAY_SIZE
private static final String DEFAULT_COLLECTION_NAME
private static final Map<String,float[]> DUMMY_FLOAT_MAP
private static final Map<String,String[]> DUMMY_STRING_MAP
private static final String TIMESTAMP
private int[] data
private Integer eventId
private Integer timestamp
ScalerData()
public ScalerData(int[] data, int eventId, int timestamp)
data
- the scaler datapublic static ScalerData read(org.lcsim.event.EventHeader event)
ScalerData
object from an LCIO event, using the default collection name.event
- the LCIO event dataScalerData
object or null
if there's no scaler data in the eventpublic static ScalerData read(org.lcsim.event.EventHeader event, String collectionName)
event
- the LCIO event dataScalerData
object or null
if does not exist in eventprivate void fromGenericObject(org.lcsim.event.GenericObject object)
GenericObject
read from an LCIO event.object
- the GenericObject
with the scaler datapublic Integer getEventId()
This information is not persisted to the LCIO.
public int getTimestamp()
public Integer getValue(int index)
index
- the scaler data indexpublic Integer getValue(ScalerDataIndex scalarDataIndex)
ScalerDataIndex
enum.void setEventId(int eventId)
eventId
- the event ID of the scaler datapublic int size()
private org.lcsim.event.GenericObject toGenericObject()
GenericObject
for persistency to LCIO.GenericObject
containing scaler datapublic String toString()
public void write(org.lcsim.event.EventHeader event)
event
- the output LCIO eventprivate void write(org.lcsim.event.EventHeader event, String collectionName)
event
- the output LCIO eventcollectionName
- the name of the output collectionpublic static ScalerData getScalerData(org.jlab.coda.jevio.EvioEvent evioEvent)
evioEvent
- the EVIO eventnull
if it does not exist in the eventCopyright © 2019. All rights reserved.