public class EcalCalibrationsDriver
extends org.lcsim.util.Driver
EcalCalibration
collection
from the ADC value distributions of raw ECAL data. It may optionally insert this
information into the conditions database using the file's run number.
Currently, it uses every ADC value for the distribution, but filtering should probably
be added to exclude hits above a certain threshold.Modifier and Type | Field and Description |
---|---|
private org.lcsim.util.aida.AIDA |
aida |
private DatabaseConditionsManager |
conditionsManager |
private static DecimalFormat |
DECIMAL_FORMAT |
private static String |
ECAL_CALIBRATIONS |
private EcalConditions |
ecalConditions |
private hep.aida.IFitFactory |
fitFactory |
private hep.aida.IFunctionFactory |
functionFactory |
private String |
inputHitsCollectionName |
private boolean |
loadCalibrations |
private File |
outputFile |
private boolean |
performFit |
private Integer |
runEnd |
private Set<Integer> |
runs |
private Integer |
runStart |
Constructor and Description |
---|
EcalCalibrationsDriver() |
Modifier and Type | Method and Description |
---|---|
void |
detectorChanged(org.lcsim.geometry.Detector detector)
Initialize this Driver when conditions change is triggered.
|
private hep.aida.IFitResult |
doGaussianFit(hep.aida.IHistogram1D histogram)
Do a Gaussian fit to calculate the mean and sigma of a histogram.
|
void |
endOfData()
End of data hook, which will get the mean and sigma for the ADC distributions.
|
private void |
loadCalibrations(EcalCalibration.EcalCalibrationCollection calibrations)
Load the calibration data into the conditions database.
|
void |
process(org.lcsim.event.EventHeader event)
Process the event data, filling the channel histograms from the ADC values.
|
void |
setInputHitsCollectionName(String inputHitsCollectionName)
Set the RawTrackerHit collection of hits to be used for the calibration.
|
void |
setLoadCalibrations(boolean loadCalibrations)
Set whether to automatically load the conditions into the database.
|
void |
setOutputFileName(String outputFileName)
Set an output file path for writing the calibration data.
|
void |
setPerformFit(boolean performFit)
Set whether to perform a function fit to get the mean and sigma values.
|
void |
setRunEnd(int runEnd)
Set the end run number for the conditions record.
|
void |
setRunStart(int runStart)
Set the start run number for the conditions record.
|
void |
startOfData()
Start of job hook.
|
private void |
writeToFile(EcalCalibration.EcalCalibrationCollection calibrations,
String fieldNames)
Write the calibration data to an output file.
|
private EcalConditions ecalConditions
private DatabaseConditionsManager conditionsManager
private org.lcsim.util.aida.AIDA aida
private hep.aida.IFunctionFactory functionFactory
private hep.aida.IFitFactory fitFactory
private boolean loadCalibrations
private boolean performFit
private Integer runStart
private Integer runEnd
private File outputFile
private static DecimalFormat DECIMAL_FORMAT
private String inputHitsCollectionName
private static String ECAL_CALIBRATIONS
public void setInputHitsCollectionName(String inputHitsCollectionName)
inputHitsCollectionName
- The name of the input hits collection.public void setLoadCalibrations(boolean loadCalibrations)
loadCalibrations
- True to load conditions into the database.public void setRunStart(int runStart)
runStart
- The run start number.public void setRunEnd(int runEnd)
runEnd
- The run end number.public void setPerformFit(boolean performFit)
performFit
- True to perform a function fit of the histogram.public void setOutputFileName(String outputFileName)
outputFileName
- The path to the output file.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 void process(org.lcsim.event.EventHeader event)
process
in class org.lcsim.util.Driver
public void endOfData()
endOfData
in class org.lcsim.util.Driver
private void writeToFile(EcalCalibration.EcalCalibrationCollection calibrations, String fieldNames)
calibrations
- The calibration data which is record delimited by new lines.fieldNames
- The list of field names as a single string.private void loadCalibrations(EcalCalibration.EcalCalibrationCollection calibrations)
runList
- The list of runs processed in the job.calibrations
- The collection of calibration objects.private hep.aida.IFitResult doGaussianFit(hep.aida.IHistogram1D histogram)
histogram
- The histogram for the ECAL channel.Copyright © 2019. All rights reserved.