public class OverlayDriver extends Driver
Driver.AbortRunException, Driver.NextEventException
Modifier and Type | Field and Description |
---|---|
protected List<MCParticle> |
allMcParticles |
protected org.apache.commons.math.distribution.PoissonDistribution |
backgroundDistribution |
protected int |
bunchCrossings |
protected double |
bunchSpacing |
protected static double |
c |
protected Map<String,Map<Long,SimCalorimeterHit>> |
caloHitMap |
protected boolean |
fullCaloProcessing |
protected static SpacePoint |
interactionPoint |
protected String |
mcOverlayName |
protected Map<MCParticle,MCParticle> |
mcParticleReferences |
protected String |
mcSignalName |
protected LCIOEventSource |
overlayEvents |
protected List<Integer> |
overlayList |
protected List<MCParticle> |
overlayMcParticles |
protected double |
overlayWeight |
protected boolean |
randomizeOverlay |
protected boolean |
randomizeTrainOverlay |
protected boolean |
randomSignal |
protected Map<String,Double> |
readoutTimes |
protected boolean |
signalAtZero |
protected int |
signalBunchCrossing |
protected double |
signalTime |
protected double |
tofCaloOffset |
HLEVEL_DEFAULT, HLEVEL_FULL, HLEVEL_HIGH, HLEVEL_NORMAL, HLEVEL_OFF
Constructor and Description |
---|
OverlayDriver()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addOverlayMcParticle(MCParticle particle)
Copies an mc particle and stores it together with the copy in a map.
|
void |
clearReadoutTimes()
Removes all readout times that were set.
|
static MCParticle |
copyMcParticle(MCParticle mcParticle)
Deep copy of an mc particle.
|
protected SimCalorimeterHit |
copySimCalorimeterHit(SimCalorimeterHit hit,
EventHeader.LCMetaData meta,
boolean hasPDG)
Deep copy of an SimCalorimeterHit.
|
protected SimTrackerHit |
copySimTrackerHit(SimTrackerHit hit,
EventHeader.LCMetaData meta)
Deep copy of an SimTrackerHit.
|
protected void |
detectorChanged(Detector detector)
Called by the framework before process method when the detector geometry changes.
|
protected void |
endOfData()
Called when all data processing is finished.
|
protected static double |
getLosTof(Hit hit)
Calculates the time of flight from the interaction point to
the position of the given hit along a straight line.
|
protected static EventHeader |
getNextEvent(LCIOEventSource lcio)
Goes to the next event in the LCIOEventSource and returns it.
|
protected boolean |
mergeCollections(EventHeader.LCMetaData collection,
EventHeader.LCMetaData overlayCollection,
double overlayTime)
Merges two collections and applies a time offset to all entries in
the overlay collection.
|
protected void |
mergeEvents(EventHeader event,
EventHeader overlayEvent,
double overlayTime)
Merges all collections from the given events and applies a time offset
to all entries in all collections of the overlay event.
|
protected List |
moveCollectionToTime(EventHeader.LCMetaData collection,
double time)
Shifts a collection in time.
|
protected void |
moveEventToTime(EventHeader event,
double time)
Shifts an event in time.
|
protected void |
process(EventHeader event)
Called by the framework to process an event.
|
protected void |
putCollection(EventHeader.LCMetaData collection,
List entries,
EventHeader event)
Adds a collection to an event using the meta data information from the
given collection and the entries from the given list.
|
void |
setBunchCrossings(int n)
Sets the number of bunch crossings in a train.
|
void |
setBunchSpacing(double t)
Sets the time between two bunch crossings.
|
void |
setFullCaloProcessing(boolean fullCaloProcessing)
Selects if calorimeter hits are treated in full detail or simplified.
|
void |
setOverlayFiles(String[] fileList) |
void |
setOverlayName(String name)
Sets a name as an identifier for the overlaid events.
|
void |
setOverlayWeight(double weight)
Sets the number of overlay event used per bunch crossing.
|
void |
setRandomizeOverlay(boolean randomizeOverlay)
Selects if overlay events are read in random order from the overlay event source.
|
void |
setRandomizeTrainOverlay(boolean randomizeTrainOverlay)
Selects if the overlay events are randomly placed within the bunch train instead of
in a serial way
|
void |
setReadoutTime(String[] collection)
Sets the readout time window for an LCCollection.
|
void |
setShuffleOverlay(boolean shuffleOverlay)
Deprecated.
replaced by setShuffleTrainOverlay
|
void |
setSignalAtZero(boolean signalAtZero)
Selects if the time of the signal event is placed at time 0, so that all other
bunch crossings are shifted accordingly.
|
void |
setSignalBunchCrossing(int bunchCrossing)
Sets the bunch crossing of the signal event.
|
void |
setSignalName(String name)
Sets a name as an identifier for the signal events.
|
protected static EventHeader |
skipEvents(LCIOEventSource lcio,
int nEvents)
Returns the event from the LCIOEventSource after skipping a given
number of events.
|
protected void |
startOfData()
Called before the first event is processed, or after a rewind.
|
protected void |
suspend()
Called by the framework when event processing is suspended.
|
add, clearStatistics, contains, doProcess, drivers, getConditionsManager, getHistogramLevel, getLogger, getName, getRandom, pathToMother, printStatistics, processChildren, remove, resume, setHistogramLevel, setLogLevel, setRandom
protected static double c
protected static SpacePoint interactionPoint
protected double tofCaloOffset
protected int bunchCrossings
protected double bunchSpacing
protected boolean randomSignal
protected boolean fullCaloProcessing
protected boolean randomizeTrainOverlay
protected boolean randomizeOverlay
protected boolean signalAtZero
protected double signalTime
protected int signalBunchCrossing
protected String mcOverlayName
protected String mcSignalName
protected LCIOEventSource overlayEvents
protected double overlayWeight
protected org.apache.commons.math.distribution.PoissonDistribution backgroundDistribution
protected Map<String,Map<Long,SimCalorimeterHit>> caloHitMap
protected List<MCParticle> overlayMcParticles
protected List<MCParticle> allMcParticles
protected Map<MCParticle,MCParticle> mcParticleReferences
public void setBunchCrossings(int n)
n
- the number of bunch crossings in a bunch train, default is 1public void setBunchSpacing(double t)
t
- the time between two bunch crossings in ns, default is 1 nspublic void setSignalBunchCrossing(int bunchCrossing)
bunchCrossing
- the bunch crossing of the signal eventpublic void setOverlayName(String name)
name
- identifier for the overlay eventspublic void setSignalName(String name)
name
- identifier for the overlay eventspublic void setOverlayWeight(double weight)
weight
- the most probable number of overlay events added per bunch crossingpublic void setOverlayFiles(String[] fileList)
public void setReadoutTime(String[] collection)
collection
- a string of the form "CollectionName time"public void clearReadoutTimes()
public void setFullCaloProcessing(boolean fullCaloProcessing)
fullCaloProcessing
- use full detailed mode (default false)public void setShuffleOverlay(boolean shuffleOverlay)
shuffleOverlay
- public void setRandomizeTrainOverlay(boolean randomizeTrainOverlay)
shuffleOverlay
- shuffle the overlay events (default true)public void setRandomizeOverlay(boolean randomizeOverlay)
randomizeOverlay
- public void setSignalAtZero(boolean signalAtZero)
signalAtZero
- set time of signal to 0 (default true)protected void startOfData()
Driver
startOfData
in class Driver
protected void detectorChanged(Detector detector)
Driver
detectorChanged
in class Driver
protected void process(EventHeader event)
Driver
super.process(event)
to cause the child processes to be executed.
In addition the process event call can throw some special exceptions:
process
in class Driver
event
- The event to be processedDriver.NextEventException
,
Driver.AbortRunException
protected void suspend()
Driver
protected void endOfData()
Driver
protected static EventHeader getNextEvent(LCIOEventSource lcio)
lcio
- The LCIO sourceprotected static EventHeader skipEvents(LCIOEventSource lcio, int nEvents)
lcio
- The LCIO sourcenEvents
- The number of events to skipprotected static double getLosTof(Hit hit)
hit
- protected void putCollection(EventHeader.LCMetaData collection, List entries, EventHeader event)
collection
- the collection to take the meta data fromentries
- the list of entries to put into the eventevent
- the event to put the collectionprotected void moveEventToTime(EventHeader event, double time)
event
- the event to move in timetime
- the time shift applied to all entries in all collectionsprotected List moveCollectionToTime(EventHeader.LCMetaData collection, double time)
collection
- the collection to move in timetime
- the time shift applied to all entries in the collectionprotected void mergeEvents(EventHeader event, EventHeader overlayEvent, double overlayTime)
event
- the event where everything is merged intooverlayEvent
- the event overlaidoverlayTime
- the time offset for the overlay eventprotected void addOverlayMcParticle(MCParticle particle)
event
- particle
- public static MCParticle copyMcParticle(MCParticle mcParticle)
mcParticle
- The mc particle to be copiedprotected SimTrackerHit copySimTrackerHit(SimTrackerHit hit, EventHeader.LCMetaData meta)
hit
- The hit to be copiedmeta
- The meta data that will be attached to the hitprotected SimCalorimeterHit copySimCalorimeterHit(SimCalorimeterHit hit, EventHeader.LCMetaData meta, boolean hasPDG)
hit
- The hit to be copiedmeta
- The meta data that will be attached to the hithasPDG
- Flag if the pdg code of the mc contriutions should be savedprotected boolean mergeCollections(EventHeader.LCMetaData collection, EventHeader.LCMetaData overlayCollection, double overlayTime)
collection
- the collection where the overlay collection is merged intooverlayCollection
- the collection overlaidoverlayTime
- the time offset for the overlay collectionCopyright © 2016 Linear Collider Detector (LCD). All rights reserved.