LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Implementation of detinfo::DetectorClocks
interface with fixed settings from configuration.
More...
#include "DetectorClocksStandard.h"
Public Member Functions | |
DetectorClocksStandard (fhicl::ParameterSet const &pset) | |
DetectorClocksStandard (DetectorClocksStandard const &)=delete | |
void | SetConfigValue (size_t i, double val) |
std::string const & | TrigModuleName () const |
Returns the input tag of the trigger data product. More... | |
std::string | G4RefCorrTrigModuleName () const |
Returns the input tag of the trigger data product for G4Ref correctons. More... | |
std::vector< std::string > const & | ConfigNames () const override |
std::vector< double > const & | ConfigValues () const override |
DetectorClocksData | DataForJob () const override |
Returns a complete detinfo::DetectorClocksData object. More... | |
DetectorClocksData | DataFor (double const g4_ref_time, double const trigger_time, double const beam_time) const override |
Returns a complete detinfo::DetectorClocksData object. More... | |
void | ApplyParams () |
Internal function to apply loaded parameters to member attributes. More... | |
bool | IsRightConfig (const fhicl::ParameterSet &ps) const |
void | debugReport () const |
Dumps the current configuration to screen. More... | |
Private Member Functions | |
void | SetTriggerTime (double const trig_time, double const beam_time) |
Setter for trigger times. More... | |
double | TriggerOffsetTPC () const |
Private Attributes | |
std::vector< std::string > | fConfigName |
std::vector< double > | fConfigValue |
std::string | fTrigModuleName |
std::string | fG4RefCorrTrigModuleName |
double | fTriggerOffsetTPC |
Time offset from trigger to TPC readout start. More... | |
double | fTriggerTime |
Trigger time in [us]. More... | |
double | fBeamGateTime |
BeamGate time in [us]. More... | |
double | fFramePeriod |
Frame period. More... | |
ElecClock | fTPCClock |
Implementation of detinfo::DetectorClocks
interface with fixed settings from configuration.
In this implementation, all quantities are defined at configuration time and are unchanged for the duration of the entire job, with the exception of the trigger time (see below).
All configuration parameters are mandatory, unless explicitly stated.
0.0
of simulation happens in the electronics time scaleTriggerOffsetTPC: time elapsed between the start of the TPC readout clock and the hardware trigger; it can be expressed in one of two ways:
For example, TriggerOffsetTPC
of -1600.0
means that the TDC clock starts 1.6 milliseconds before the hardware trigger. TriggerOffsetTPC
of 3200.0
means that the trigger arrives at the exact start of tick 3200 of the TPC readout. In this example, if the sampling frequency of that readout is 2 MHz, these two settings are equivalent.
The consistency check feature verifies that the current configuration of detinfo::DetectorClocksStandard
is compatible with the one from previous jobs. It is expected that when this feature is enabled (InheritClockConfig
is configured to be true
), either the configuration is overridden to follow the previous ones, or an exception is thrown in case of inconsistency.
The service provider (detinfo::DetectorClocksStandard
) does not provide a facility to inherit configuration from a previous job, but it stores the expectation whether this should happen (InheritClockConfig()
). The service provider manager is in charge of implementing this feature (see detinfo::DetectorClocksStandardService
for the manager in the art environment).
For the general timing requirements, see the documentation of detinfo::DetectorClocks
.
In this implementation, the trigger time and the beam gate time both default to 0.0 µs.
The manager of this provider is expected to set those values by calling detinfo::DetectorClocksStandard::SetTriggerTime()
. See detinfo::DetectorClocksStandardService
for the manager in the art environment.
ExternalClock()
clock is never initialized!Definition at line 122 of file DetectorClocksStandard.h.
detinfo::DetectorClocksStandard::DetectorClocksStandard | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 9 of file DetectorClocksStandard.cxx.
References fBeamGateTime, fConfigName, fConfigValue, fFramePeriod, fG4RefCorrTrigModuleName, fTPCClock, fTriggerOffsetTPC, fTriggerTime, fTrigModuleName, detinfo::kClockSpeedExternal, detinfo::kClockSpeedOptical, detinfo::kClockSpeedTPC, detinfo::kClockSpeedTrigger, detinfo::kDefaultBeamTime, detinfo::kDefaultTrigTime, detinfo::kFramePeriod, detinfo::kG4RefTime, detinfo::kTriggerOffsetTPC, and SetTriggerTime().
|
delete |
void detinfo::DetectorClocksStandard::ApplyParams | ( | ) |
Internal function to apply loaded parameters to member attributes.
Definition at line 39 of file DetectorClocksStandard.cxx.
References fConfigValue, fFramePeriod, fTriggerOffsetTPC, detinfo::kDefaultBeamTime, detinfo::kDefaultTrigTime, detinfo::kFramePeriod, detinfo::kTriggerOffsetTPC, and SetTriggerTime().
Referenced by DataFor(), detinfo::DetectorClocksServiceStandard::postOpenFile(), and detinfo::DetectorClocksServiceStandard::preBeginRun().
|
inlineoverridevirtual |
Returns a list of provider configuration names.
Implements detinfo::DetectorClocks.
Definition at line 147 of file DetectorClocksStandard.h.
References fConfigName.
Referenced by detinfo::DetectorClocksServiceStandard::postOpenFile().
|
inlineoverridevirtual |
Returns a list of provider configuration values (same order as ConfigNames()
).
Implements detinfo::DetectorClocks.
Definition at line 148 of file DetectorClocksStandard.h.
References fConfigValue.
Referenced by detinfo::detectorClocksStandardDataFor(), and detinfo::DetectorClocksServiceStandard::postOpenFile().
|
inlineoverridevirtual |
Returns a complete detinfo::DetectorClocksData
object.
g4_ref_time | start of simulation time in electronics time scale [ns] |
trigger_time | the default hardware trigger time in electronics time |
beam_time | the default beam gate opening time in electronics time |
The returned timing information reflects the current context, defined by the parameters passed to this method.
If the information required by the parameters is not available, users will be forced to use DataForJob()
instead.
For more details on the definition of the parameters, see the documentation of detinfo::DetectorClocksData
constructor.
Implements detinfo::DetectorClocks.
Definition at line 163 of file DetectorClocksStandard.h.
References ApplyParams(), debugReport(), fConfigValue, fTriggerOffsetTPC, IsRightConfig(), detinfo::kClockSpeedOptical, detinfo::kClockSpeedTPC, detinfo::kClockSpeedTrigger, detinfo::kDEFAULT_FRAME_PERIOD, detinfo::kDEFAULT_FREQUENCY_EXTERNAL, and detinfo::kFramePeriod.
Referenced by detinfo::detectorClocksStandardDataFor().
|
inlineoverridevirtual |
Returns a complete detinfo::DetectorClocksData
object.
The returned timing information is based on information independent of the current input file, run or event. It is recommended that DataFor()
is used instead whenever possible.
Implements detinfo::DetectorClocks.
Definition at line 150 of file DetectorClocksStandard.h.
References fBeamGateTime, fConfigValue, fTriggerOffsetTPC, fTriggerTime, detinfo::kClockSpeedOptical, detinfo::kClockSpeedTPC, detinfo::kClockSpeedTrigger, detinfo::kDEFAULT_FRAME_PERIOD, detinfo::kDEFAULT_FREQUENCY_EXTERNAL, detinfo::kFramePeriod, and detinfo::kG4RefTime.
Referenced by debugReport().
void detinfo::DetectorClocksStandard::debugReport | ( | ) | const |
Dumps the current configuration to screen.
Definition at line 54 of file DetectorClocksStandard.cxx.
References DataForJob(), detinfo::DetectorClocksData::debugReport(), fConfigName, fConfigValue, value, and util::zip().
Referenced by DataFor().
|
inline |
Returns the input tag of the trigger data product for G4Ref correctons.
The trigger module name is set directly in the configuration as G4RefCorrTrigModuleName
.
Definition at line 145 of file DetectorClocksStandard.h.
References fG4RefCorrTrigModuleName.
Referenced by detinfo::detectorClocksStandardDataFor().
bool detinfo::DetectorClocksStandard::IsRightConfig | ( | const fhicl::ParameterSet & | ps | ) | const |
Internal function used to search for the right configuration set in the data file
Definition at line 46 of file DetectorClocksStandard.cxx.
References fConfigName, and fhicl::ParameterSet::has_key().
Referenced by DataFor(), and detinfo::DetectorClocksServiceStandard::postOpenFile().
|
inline |
Definition at line 127 of file DetectorClocksStandard.h.
References fConfigValue.
Referenced by detinfo::DetectorClocksServiceStandard::postOpenFile().
|
inlineprivate |
Setter for trigger times.
trig_time | hardware triggertime" in @ref DetectorClocksElectronicsTime "electronics time scale" @param beam_time @ref DetectorClocksBeamGateOpening "beam gate opening time" in @ref DetectorClocksElectronicsTime "electronics time scale" |
The hardware trigger and beam gate opening times are set, and the electronic clocks are updated to store the new trigger time.
Definition at line 200 of file DetectorClocksStandard.h.
References fBeamGateTime, fConfigValue, fFramePeriod, fTPCClock, fTriggerTime, and detinfo::kClockSpeedTPC.
Referenced by ApplyParams(), and DetectorClocksStandard().
|
inlineprivate |
Definition at line 207 of file DetectorClocksStandard.h.
References detinfo::ElecClock::Frequency(), fTPCClock, and fTriggerOffsetTPC.
|
inline |
Returns the input tag of the trigger data product.
The trigger module name is set directly in the configuration as TrigModuleName
.
Definition at line 136 of file DetectorClocksStandard.h.
References fTrigModuleName.
Referenced by detinfo::detectorClocksStandardDataFor().
|
private |
BeamGate time in [us].
Definition at line 229 of file DetectorClocksStandard.h.
Referenced by DataForJob(), DetectorClocksStandard(), and SetTriggerTime().
|
private |
Definition at line 216 of file DetectorClocksStandard.h.
Referenced by ConfigNames(), debugReport(), DetectorClocksStandard(), and IsRightConfig().
|
private |
Definition at line 217 of file DetectorClocksStandard.h.
Referenced by ApplyParams(), ConfigValues(), DataFor(), DataForJob(), debugReport(), DetectorClocksStandard(), SetConfigValue(), and SetTriggerTime().
|
private |
Frame period.
Definition at line 232 of file DetectorClocksStandard.h.
Referenced by ApplyParams(), DetectorClocksStandard(), and SetTriggerTime().
|
private |
Definition at line 220 of file DetectorClocksStandard.h.
Referenced by DetectorClocksStandard(), and G4RefCorrTrigModuleName().
|
private |
Definition at line 234 of file DetectorClocksStandard.h.
Referenced by DetectorClocksStandard(), SetTriggerTime(), and TriggerOffsetTPC().
|
private |
Time offset from trigger to TPC readout start.
Definition at line 223 of file DetectorClocksStandard.h.
Referenced by ApplyParams(), DataFor(), DataForJob(), DetectorClocksStandard(), and TriggerOffsetTPC().
|
private |
Trigger time in [us].
Definition at line 226 of file DetectorClocksStandard.h.
Referenced by DataForJob(), DetectorClocksStandard(), and SetTriggerTime().
|
private |
Definition at line 219 of file DetectorClocksStandard.h.
Referenced by DetectorClocksStandard(), and TrigModuleName().