Class QadbBin<T>
java.lang.Object
org.jlab.detector.scalers.DaqScalersSequence
org.jlab.detector.qadb.QadbBin<T>
- All Implemented Interfaces:
Comparator<DaqScalers>
A single bin for the Quality Assurance Database (QADB).
It may hold arbitrary data, such as a class instance, accessible by public member
data
;
its type is set by a generic type parameter.
A bin contains a (sub)sequence of scaler readouts, and therefore extends DaqScalersSequence
.
- Author:
- dilks
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
bin typestatic enum
charge correction methodstatic enum
charge typestatic interface
lambda type to print each bin's generic data as a stringstatic enum
Nested classes/interfaces inherited from class org.jlab.detector.scalers.DaqScalersSequence
DaqScalersSequence.Interval
-
Field Summary
FieldsModifier and TypeFieldDescriptionarbitrary data that may be held by this bin; it is just public so the user can do anything with itFields inherited from class org.jlab.detector.scalers.DaqScalersSequence
logger, scalers, TI_CLOCK_FREQ
-
Constructor Summary
ConstructorsConstructorDescriptionQadbBin
(int binNum, QadbBin.BinType binType, List<DaqScalers> inputScalers, T initData) construct a single bin -
Method Summary
Modifier and TypeMethodDescriptionvoid
correctCharge
(double charge, double chargeGated) correct the beam charge for this bin, using specific values from the callervoid
correct the beam charge for this bin, using a correction methodvoid
correctLowerBound
(int evnumMin, long timestampMin) correct the first bin's lower bound, if you know it from tag-0 eventsvoid
correctUpperBound
(int evnumMax, long timestampMax) correct the last bin's upper bound, if you know it from tag-0 eventsdouble
double
getBeamCharge
(QadbBin.ChargeType chargeType) double
int
double
getChargeExtremum
(QadbBin.ExtremumType extremumType, QadbBin.ChargeType chargeType) Get the min/max or initial/final charge.double
long
long
double
long
long
void
print()
print a QA bin, and some basic informationvoid
print
(QadbBin.DataPrinter<T> dataPrinter) print a QA bin's storeddata
void
print
(QadbBin.DataPrinter<T> dataPrinter, boolean verbose) print a QA bin's storeddata
, and optionally the bin's basic informationMethods inherited from class org.jlab.detector.scalers.DaqScalersSequence
add, add, clear, clear, compare, findIndex, fixClockRollover, get, get, getInterval, getInterval, getInterval, getInterval, getInterval, main, readFiles, readSequence, rebuildSequence, size, validateOrdering
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
data
arbitrary data that may be held by this bin; it is just public so the user can do anything with it
-
-
Constructor Details
-
QadbBin
construct a single bin- Parameters:
binNum
- the bin number, in theQadbBinSequence
which contains this binbinType
- the bin type (seeQadbBin.BinType
)inputScalers
- the scaler sequence for this bininitData
- the initial data for this bin (sets public memberdata
)
-
-
Method Details
-
getBinNum
public int getBinNum()- Returns:
- the bin number for this bin
-
getTimestampMin
public long getTimestampMin()- Returns:
- minimum timestamp for this bin
-
getTimestampMax
public long getTimestampMax()- Returns:
- maximum timestamp for this bin
-
getEventNumMin
public long getEventNumMin()- Returns:
- minimum event number for this bin
-
getEventNumMax
public long getEventNumMax()- Returns:
- maximum event number for this bin
-
getBeamCharge
public double getBeamCharge()- Returns:
- the beam charge, not gated by DAQ, for this bin
-
getBeamChargeGated
public double getBeamChargeGated()- Returns:
- the beam charge, gated by DAQ, for this bin
-
getBeamCharge
- Parameters:
chargeType
- the type of charge- Returns:
- the beam charge, gated or ungated
-
getMeanLivetime
public double getMeanLivetime()- Returns:
- the mean livetime for this bin
-
getDuration
public double getDuration()- Returns:
- the duration of the bin, in seconds
-
correctCharge
correct the beam charge for this bin, using a correction method- Parameters:
method
- the correction method to use- See Also:
-
correctCharge
public void correctCharge(double charge, double chargeGated) correct the beam charge for this bin, using specific values from the caller- Parameters:
charge
- the charge, not gated by the DAQchargeGated
- the DAQ-gated charge
-
correctLowerBound
public void correctLowerBound(int evnumMin, long timestampMin) correct the first bin's lower bound, if you know it from tag-0 events- Parameters:
evnumMin
- the correct minimum event numbertimestampMin
- the correct minimum timestamp
-
correctUpperBound
public void correctUpperBound(int evnumMax, long timestampMax) correct the last bin's upper bound, if you know it from tag-0 events- Parameters:
evnumMax
- the correct maximum event numbertimestampMax
- the correct maximum timestamp
-
getChargeExtremum
Get the min/max or initial/final charge.WARNING: this is likely NOT corrected by
correctCharge(org.jlab.detector.qadb.QadbBin.ChargeCorrectionMethod)
- Parameters:
extremumType
- the type of extremumchargeType
- the type of charge- Returns:
- the charge for the given extremum
-
print
public void print()print a QA bin, and some basic information -
print
-
print
-