LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
shower::ShowerEnergyAlg Class Reference

#include "ShowerEnergyAlg.h"

Classes

struct  LinearFunction
 

Public Member Functions

 ShowerEnergyAlg (fhicl::ParameterSet const &pset)
 
double ShowerEnergy (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &hits, geo::PlaneID::PlaneID_t plane) const
 

Private Attributes

std::array< LinearFunction, 3 > const fLinearFunctions
 

Detailed Description

Definition at line 32 of file ShowerEnergyAlg.h.

Constructor & Destructor Documentation

shower::ShowerEnergyAlg::ShowerEnergyAlg ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 26 of file ShowerEnergyAlg.cxx.

References fhicl::ParameterSet::get().

27  : fLinearFunctions{{{pset.get<double>("UGradient"), pset.get<double>("UIntercept")},
28  {pset.get<double>("VGradient"), pset.get<double>("VIntercept")},
29  {pset.get<double>("ZGradient"), pset.get<double>("ZIntercept")}}}
30 {}
std::array< LinearFunction, 3 > const fLinearFunctions

Member Function Documentation

double shower::ShowerEnergyAlg::ShowerEnergy ( detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
std::vector< art::Ptr< recob::Hit >> const &  hits,
geo::PlaneID::PlaneID_t  plane 
) const

This overload is preferred as it does not rely on the cached DetectorProperties data member.

Definition at line 32 of file ShowerEnergyAlg.cxx.

References detinfo::DetectorPropertiesData::ElectronLifetime(), fLinearFunctions, hits(), detinfo::sampling_rate(), and lar::to_element.

Referenced by shower::EMShowerAlg::MakeShower().

36 {
37  // Should we throw instead if the plane is not in the range [0,3)?
38  if (plane >= fLinearFunctions.size()) { return 0.; }
39 
40  auto const coeff = sampling_rate(clockData) / (detprop.ElectronLifetime() * 1e3);
41 
42  auto in_plane = [plane](auto const& hit) { return hit.WireID().Plane == plane; };
43  auto charge = [coeff](auto const& hit) {
44  return hit.Integral() * std::exp(coeff * hit.PeakTime());
45  };
46 
47  double const totalCharge =
48  ranges::accumulate(hits | ranges::views::transform(to_element) |
49  ranges::views::filter(in_plane) | ranges::views::transform(charge),
50  0.);
51 
52  return fLinearFunctions[plane].energy_from(totalCharge);
53 }
std::array< LinearFunction, 3 > const fLinearFunctions
constexpr to_element_t to_element
Definition: ToElement.h:25
Detector simulation of raw signals on wires.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.

Member Data Documentation

std::array<LinearFunction, 3> const shower::ShowerEnergyAlg::fLinearFunctions
private

Definition at line 49 of file ShowerEnergyAlg.h.

Referenced by ShowerEnergy().


The documentation for this class was generated from the following files: