All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
icarus::opdet::AsymExpPulseFunctionTool Struct Reference

Creates a AsymExpPulseFunction pulse shape. More...

Inheritance diagram for icarus::opdet::AsymExpPulseFunctionTool:
icarus::opdet::SinglePhotonPulseFunctionTool

Classes

struct  Config
 Configuration parameters. More...
 

Public Types

using Parameters = art::ToolConfigTable< Config >
 Tool parameter configuration. More...
 
- Public Types inherited from icarus::opdet::SinglePhotonPulseFunctionTool
using nanoseconds = util::quantities::nanosecond
 Convenience definition for time stored in nanoseconds. More...
 
using PulseFunction_t = icarus::opdet::PhotoelectronPulseFunction< nanoseconds >
 Type of function returned. More...
 

Public Member Functions

 AsymExpPulseFunctionTool (Parameters const &config)
 Constructor: sets the configuration. More...
 
- Public Member Functions inherited from icarus::opdet::SinglePhotonPulseFunctionTool
virtual ~SinglePhotonPulseFunctionTool ()=default
 
std::unique_ptr< PulseFunction_tgetPulseFunction ()
 Returns an instance of the pulse function. More...
 

Private Member Functions

virtual std::unique_ptr
< PulseFunction_t
doGetPulseFunction () override
 Returns the function that was created at construction time. More...
 

Static Private Member Functions

static std::unique_ptr
< PulseFunction_t
makePulseFunction (Config const &config)
 Creates and returns a pulse function with the specified configuration. More...
 
static float peakCurrentFromGain (float gain, nanoseconds raiseTau, nanoseconds fallTau)
 Computes the peak current value out of the shape and gain parameters [mA]. More...
 

Private Attributes

std::unique_ptr< PulseFunction_tfPulseFunction
 Function stored while waiting to be delivered. More...
 

Detailed Description

Creates a AsymExpPulseFunction pulse shape.

See Also
icarus::opdet::SinglePhotonPulseFunctionTool

This tool creates a icarus::opdet::AsymExpPulseFunction<nanosecond> function to describe a R5912 PMT pulse.

See icarus::opdet::AsymExpPulseFunction for the details of the function.

Configuration

Run lar --print-description AsymExpPulseFunctionTool (or read Config data structure) for a short explanation of the meaning of the parameters.

In addition, note that the actual amplitude in ADC counts of the pulse is composed as the product of the amplitude in charge (PeakCharge) and the charge-to-ADC conversion factor (ADC). The latter can be considered as the product of the circuitry impedance (transforming the charge into a voltage) and the digitization conversion (full digitizer range divided by the largest output value).

Finally, note that it is also possible to specify the amplitude of the function in terms of PMT gain (Gain parameter) instead of current (PeakAmplitude), in which case the peak current will be calculated to have a correct total charge.

Definition at line 66 of file AsymExpPulseFunctionTool_tool.cc.

Member Typedef Documentation

Tool parameter configuration.

Definition at line 111 of file AsymExpPulseFunctionTool_tool.cc.

Constructor & Destructor Documentation

icarus::opdet::AsymExpPulseFunctionTool::AsymExpPulseFunctionTool ( Parameters const &  config)
inline

Constructor: sets the configuration.

Definition at line 114 of file AsymExpPulseFunctionTool_tool.cc.

115  : fPulseFunction(makePulseFunction(config())) {}
static std::unique_ptr< PulseFunction_t > makePulseFunction(Config const &config)
Creates and returns a pulse function with the specified configuration.
std::unique_ptr< PulseFunction_t > fPulseFunction
Function stored while waiting to be delivered.

Member Function Documentation

virtual std::unique_ptr<PulseFunction_t> icarus::opdet::AsymExpPulseFunctionTool::doGetPulseFunction ( )
inlineoverrideprivatevirtual

Returns the function that was created at construction time.

Implements icarus::opdet::SinglePhotonPulseFunctionTool.

Definition at line 123 of file AsymExpPulseFunctionTool_tool.cc.

124  { return std::move(fPulseFunction); }
std::unique_ptr< PulseFunction_t > fPulseFunction
Function stored while waiting to be delivered.
auto icarus::opdet::AsymExpPulseFunctionTool::makePulseFunction ( Config const &  config)
staticprivate

Creates and returns a pulse function with the specified configuration.

Definition at line 147 of file AsymExpPulseFunctionTool_tool.cc.

148 {
149 
151  using ADCcount = MyFunction_t::ADCcount;
152 
153  // FIXME milliampere not available yet in `electromagnetism.h`
154  double peakCurrent;
155  if (config.Gain().has_value()) { // peak current from gain
156  if (config.PeakCurrent().has_value()) {
157  throw art::Exception(art::errors::Configuration)
158  << "AsymExpPulseFunctionTool: Only one configuration parameter out of '"
159  << config.PeakCurrent.name() << "' (set as " << (*config.PeakCurrent())
160  << ") and '" << config.Gain.name() << "' (set as " << (*config.Gain())
161  << ") can be specified at once!\n";
162  }
163  peakCurrent = peakCurrentFromGain(
164  *config.Gain(), // gain
165  config.RaiseTimeConstant(), // raiseTau
166  config.FallTimeConstant() // fallTau
167  );
168  }
169  else { // peak current directly specified
170  if (!config.PeakCurrent().has_value()) {
171  throw art::Exception(art::errors::Configuration)
172  << "AsymExpPulseFunctionTool: either configuration parameter '"
173  << config.PeakCurrent.name() << "' or '" << config.Gain.name()
174  << "' must be specified!\n";
175  }
176  peakCurrent = *config.PeakCurrent();
177  }
178 
179  return std::make_unique<MyFunction_t>(
180  // amplitude is a charge, so we have to twist the arm of the constructor to
181  // accept it as ADC count (`value()` makes `peakCurrent` lose its unit)
182 // ADCcount(config.ADC() * config.peakCurrent.value()), // amplitude
183  ADCcount(config.ADC() * peakCurrent), // amplitude
184  config.TransitTime(), // peakTime
185  config.RaiseTimeConstant(), // raiseTau
186  config.FallTimeConstant() // fallTau
187  );
188 
189 } // icarus::opdet::AsymExpPulseFunctionTool::makePulseFunction()
Describes the waveform from a single photoelectron.
static float peakCurrentFromGain(float gain, nanoseconds raiseTau, nanoseconds fallTau)
Computes the peak current value out of the shape and gain parameters [mA].
float icarus::opdet::AsymExpPulseFunctionTool::peakCurrentFromGain ( float  gain,
nanoseconds  raiseTau,
nanoseconds  fallTau 
)
staticprivate

Computes the peak current value out of the shape and gain parameters [mA].

Definition at line 194 of file AsymExpPulseFunctionTool_tool.cc.

195 {
196  static constexpr double electronCharge = -1.602176634e-7; // picocoulomb
197 
198  nanoseconds const dTau = fallTau - raiseTau; // expected positive
199  float const tauRatioLog = std::log(raiseTau / fallTau); // expected negative
200 
201  return gain * electronCharge / dTau.value() * (
202  std::exp(raiseTau / dTau * tauRatioLog)
203  - std::exp(fallTau / dTau * tauRatioLog)
204  );
205 
206 } // icarus::opdet::AsymExpPulseFunctionTool::peakCurrentFromGain()
util::quantities::nanosecond nanoseconds
Convenience definition for time stored in nanoseconds.

Member Data Documentation

std::unique_ptr<PulseFunction_t> icarus::opdet::AsymExpPulseFunctionTool::fPulseFunction
private

Function stored while waiting to be delivered.

Definition at line 129 of file AsymExpPulseFunctionTool_tool.cc.


The documentation for this struct was generated from the following file: