public class EcalRawConverterDriver
extends org.lcsim.util.Driver
Driver
converts raw ECal data collections to CalorimeterHit
collections
with energy and time information. The EcalRawConverter
does most of the low-level work.
The following input collections are used:
The results are by default written to the EcalCalHits output collection.
Modifier and Type | Field and Description |
---|---|
private boolean |
applyBadCrystalMap
Whether to reject bad crystals.
|
private EcalRawConverter |
converter |
private boolean |
debug |
private boolean |
display |
private boolean |
dropBadFADC
Whether to reject bad FADC channels.
|
private String |
ecalCollectionName
Output collection name (unless runBackwards=true, then it's input).
|
private EcalConditions |
ecalConditions |
private String |
ecalReadoutName
ecalCollectionName "type" (must match detector-data)
|
private boolean |
emulateFirmware
Whether to perform "firmware algorithm" on Mode-1 data.
|
private static String |
extraDataRelationsName |
private String |
rawCollectionName
Input collection name (unless runBackwards=true, then it's output).
|
private boolean |
runBackwards
If true, convert ecalCollectionName to rawCollectionName (GeV to ADC).
|
private double |
threshold
Hit threshold in GeV.
|
private boolean |
useDAQConfig
Whether to use DAQ config read from EVIO for EcalRawConverter parameters.
|
private boolean |
useTimestamps |
private boolean |
useTruthTime |
Constructor and Description |
---|
EcalRawConverterDriver() |
Modifier and Type | Method and Description |
---|---|
void |
detectorChanged(org.lcsim.geometry.Detector detector) |
private EcalChannelConstants |
findChannel(long cellID)
Convert physical ID to gain value.
|
private int |
getCrate(long cellID)
Return crate number from cellID
|
private int |
getSlot(long cellID)
Return slot number from cellID
|
private static double |
getTimestamp(int system,
org.lcsim.event.EventHeader event) |
boolean |
isBadCrystal(org.lcsim.event.CalorimeterHit hit) |
boolean |
isBadFADC(org.lcsim.event.CalorimeterHit hit) |
void |
process(org.lcsim.event.EventHeader event) |
void |
setApplyBadCrystalMap(boolean apply)
Set to
true to ignore data from channels that
are flagged as "bad" in the conditions system. |
void |
setDebug(boolean debug)
Set to
true to turn on debug output. |
void |
setDisplay(boolean display) |
void |
setDropBadFADC(boolean dropBadFADC)
Set to
true to drop hits that are mapped to a hard-coded
bad FADC configuration from the Test Run. |
void |
setEcalCollectionName(String ecalCollectionName)
Set the
CalorimeterHit collection name,
which is used as input in "normal" mode and output when running
"backwards". |
void |
setEmulateFirmware(boolean emulateFirmware)
Set to
true to emulate firmware conversion of Mode-1 to Mode-3/7 data. |
void |
setEmulateMode7(boolean mode7)
Set to
true to use Mode-7 emulation in calculations. |
void |
setFitLimitTimeHi(int sample) |
void |
setFitLimitTimeLo(int sample)
Constrain pulse fit time0 parameter.
|
void |
setFitThresholdTimeHi(int sample) |
void |
setFitThresholdTimeLo(int sample)
Limit threshold crossing range that is candidate for pulse-fitting.
|
void |
setFixedWidth(boolean fixedWidth) |
void |
setFixShapeParameter(boolean fix)
Set to
true to fix fitted pulse widths to their channel's mean value: |
void |
setGain(double gain)
Set a constant gain factor in the converter for all channels.
|
void |
setGlobalFixedPulseWidth(double width)
Fix 3-pole function width to be the same for all 442 ECal channels.
|
void |
setLeadingEdgeThreshold(double threshold)
Set the leading-edge threshold in ADC counts, relative to pedestal, for pulse-finding
and time determination.
|
void |
setNPeak(int nPeak)
Set the maximum number of peaks to search for in the signal,
which must be between 1 and 3, inclusive.
|
void |
setNsa(int nsa)
Set the integration range in nanoseconds after the threshold crossing.
|
void |
setNsb(int nsb)
Set the integration range in nanoseconds before the threshold crossing.
|
void |
setRawCollectionName(String rawCollectionName)
Set the raw collection name which is used as output in "normal" mode
and input when running "backwards".
|
void |
setRunBackwards(boolean runBackwards)
Set to
true to generate a CalorimeterHit
collection which is a conversion from energy to raw signals. |
void |
setThreshold(double threshold)
Set a minimum energy threshold in GeV for created
CalorimeterHit
objects to be written into the output collection. |
void |
setUse2014Gain(boolean use2014Gain)
Set to
true to use the "2014" gain formula: |
void |
setUseDAQConfig(boolean state)
Sets whether the driver should use the DAQ configuration from
EvIO file for its parameters.
|
void |
setUseFit(boolean useFit)
Set to
true to use pulse fitting instead of arithmetic integration: |
void |
setUseRunningPedestal(boolean useRunningPedestal)
Set to
true to use a running pedestal calibration from mode 7 data. |
void |
setUseTimestamps(boolean useTimestamps)
Set to
true to use timestamp information from the ECal or trigger. |
void |
setUseTimeWalkCorrection(boolean useTimeWalkCorrection)
Set to
true to apply time walk correction from EcalTimeWalk.correctTimeWalk(double, double) . |
void |
setUseTruthTime(boolean useTruthTime)
Set to
true to use MC truth information. |
void |
setWindowSamples(int windowSamples)
Set the number of samples in the FADC readout window.
|
void |
startOfData() |
private EcalConditions ecalConditions
private EcalRawConverter converter
private String rawCollectionName
RawTrackerHit
or RawCalorimeterHit
These have ADC and sample time information.private String ecalCollectionName
CalorimeterHit
This has energy (GeV) and ns time information.private final String ecalReadoutName
private static final String extraDataRelationsName
private boolean debug
private double threshold
private boolean applyBadCrystalMap
private boolean dropBadFADC
private boolean runBackwards
private boolean useTimestamps
private boolean useTruthTime
private boolean useDAQConfig
private boolean emulateFirmware
private boolean display
public void setUseFit(boolean useFit)
true
to use pulse fitting instead of arithmetic integration:public void setGlobalFixedPulseWidth(double width)
public void setFixShapeParameter(boolean fix)
true
to fix fitted pulse widths to their channel's mean value:public void setFitThresholdTimeLo(int sample)
public void setFitThresholdTimeHi(int sample)
public void setFitLimitTimeLo(int sample)
public void setFitLimitTimeHi(int sample)
public void setUse2014Gain(boolean use2014Gain)
true
to use the "2014" gain formula:channelGain * adcSum * gainFactor * readoutPeriod
Set to false
to use the gain formula for the Test Run:
gain * adcSum * ECalUtils.MeV
use2014Gain
- True to use 2014 gain formulation.public void setUseTimeWalkCorrection(boolean useTimeWalkCorrection)
true
to apply time walk correction from EcalTimeWalk.correctTimeWalk(double, double)
.
This is only applicable to Mode-3 data.
useTimeWalkCorrection
- True to apply time walk correction.public void setUseRunningPedestal(boolean useRunningPedestal)
true
to use a running pedestal calibration from mode 7 data.
The running pedestal values are retrieved from the event collection "EcalRunningPedestals"
which is a Map
between EcalChannel
objects
are their average pedestal.
useRunningPedestal
- True to use a running pedestal value.public void setFixedWidth(boolean fixedWidth)
public void setRunBackwards(boolean runBackwards)
true
to generate a CalorimeterHit
collection which is a conversion from energy to raw signals.runBackwards
- True to run the procedure backwards.public void setDropBadFADC(boolean dropBadFADC)
true
to drop hits that are mapped to a hard-coded
bad FADC configuration from the Test Run.dropBadFADC
- True to drop hits mapped to a bad FADC.public void setThreshold(double threshold)
CalorimeterHit
objects to be written into the output collection.threshold
- The minimum energy threshold in GeV.public void setEmulateMode7(boolean mode7)
true
to use Mode-7 emulation in calculations.
False is Mode-3.mode7
- True to use Mode-7 emulation in calculations.public void setEmulateFirmware(boolean emulateFirmware)
true
to emulate firmware conversion of Mode-1 to Mode-3/7 data.emulateFirmware
- True to use firmware emulation.public void setLeadingEdgeThreshold(double threshold)
Used to convert Mode-1 readout into Mode-3 or Mode-7 data that is usable by clustering.
threshold
- The leading edge threshold in ADC counts.public void setWindowSamples(int windowSamples)
This is needed in order to properly pedestal-correct clipped pulses for mode-3 and mode-7. It is ignored for mode-1 input, since this data already includes the number of samples.
A non-positive number disables pulse-clipped pedestals and reverts to the old behavior which assumed that the integration range was constant.
windowSamples
- The number of samples in the FADC readout window.public void setNsa(int nsa)
These numbers must be multiples of 4 nanoseconds.
This value is used for pulse integration in Mode-1, and pedestal subtraction in all modes.
nsa
- The number of nanoseconds after the threshold crossing.setNsb(int)
public void setNsb(int nsb)
These numbers must be multiples of 4 nanoseconds.
This value is used for pulse integration in Mode-1, and pedestal subtraction in all modes.
nsb
- The number of nanoseconds after the threshold crossing.setNsa(int)
public void setNPeak(int nPeak)
nPeak
- The maximum number of peaks to search for in the signal.public void setGain(double gain)
gain
- The constant gain value.public void setEcalCollectionName(String ecalCollectionName)
CalorimeterHit
collection name,
which is used as input in "normal" mode and output when running
"backwards".ecalCollectionName
- The CalorimeterHit
collection name.runBackwards
public void setRawCollectionName(String rawCollectionName)
Depending on the Driver configuration, this could be a collection
of RawTrackerHit
objects for Mode-1
or RawCalorimeterHit
objects for Mode-3
or Mode-7.
rawCollectionName
- The raw collection name.public void setApplyBadCrystalMap(boolean apply)
true
to ignore data from channels that
are flagged as "bad" in the conditions system.apply
- True to ignore bad channels.public void setDebug(boolean debug)
true
to turn on debug output.debug
- True to turn on debug output.public void setDisplay(boolean display)
public void setUseTimestamps(boolean useTimestamps)
true
to use timestamp information from the ECal or trigger.useTimestamps
- True to use timestamp information.public void setUseTruthTime(boolean useTruthTime)
true
to use MC truth information.useTruthTime
- True to use MC truth information.public void setUseDAQConfig(boolean state)
state
- - true
indicates that the configuration
should be read from the DAQ data in an EvIO file. Setting this
to false
will cause the driver to use its regular
manually-defined settings and pull gains and pedestals from the
conditions database.public void startOfData()
startOfData
in class org.lcsim.util.Driver
public void detectorChanged(org.lcsim.geometry.Detector detector)
detectorChanged
in class org.lcsim.util.Driver
public boolean isBadCrystal(org.lcsim.event.CalorimeterHit hit)
hit
- the CalorimeterHit
pointing to the channelpublic boolean isBadFADC(org.lcsim.event.CalorimeterHit hit)
hit
- the CalorimeterHit
pointing to the FADCprivate static double getTimestamp(int system, org.lcsim.event.EventHeader event)
public void process(org.lcsim.event.EventHeader event)
process
in class org.lcsim.util.Driver
private EcalChannelConstants findChannel(long cellID)
cellID
- (long)private int getCrate(long cellID)
cellID
- (long)private int getSlot(long cellID)
cellID
- (long)Copyright © 2019. All rights reserved.