All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShowerEnergyAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: ShowerEnergyAlg
3 // File: ShowerEnergyAlg.h
4 // Author: Mike Wallbank (m.wallbank@sheffield.ac.uk), November 2015
5 //
6 // Shower energy finding class
7 ////////////////////////////////////////////////////////////////////////
8 
9 #ifndef ShowerEnergyAlg_hxx
10 #define ShowerEnergyAlg_hxx
11 
12 #include <array>
13 
14 // Framework
15 #include "canvas/Persistency/Common/Ptr.h"
16 namespace fhicl {
17  class ParameterSet;
18 }
19 
20 // larsoft
23 namespace detinfo {
24  class DetectorClocksData;
25  class DetectorPropertiesData;
26 }
27 
28 namespace shower {
29  class ShowerEnergyAlg;
30 }
31 
33 public:
34  explicit ShowerEnergyAlg(fhicl::ParameterSet const& pset);
35 
36  /// This overload is preferred as it does not rely on the cached
37  /// DetectorProperties data member.
38  double ShowerEnergy(detinfo::DetectorClocksData const& clockData,
40  std::vector<art::Ptr<recob::Hit>> const& hits,
41  geo::PlaneID::PlaneID_t plane) const;
42 
43 private:
44  struct LinearFunction {
45  double gradient;
46  double intercept;
47  double
48  energy_from(double const charge) const noexcept
49  {
50  return charge * gradient + intercept;
51  }
52  };
53  std::array<LinearFunction, 3> const fLinearFunctions;
54 };
55 
56 #endif
std::array< LinearFunction, 3 > const fLinearFunctions
double ShowerEnergy(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> const &hits, geo::PlaneID::PlaneID_t plane) const
Declaration of signal hit object.
unsigned int PlaneID_t
Type for the ID number.
Definition: geo_types.h:473
ShowerEnergyAlg(fhicl::ParameterSet const &pset)
process_name shower
Definition: cheaterreco.fcl:51
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
double energy_from(double const charge) const noexcept
Definition of data types for geometry description.
Contains all timing reference information for the detector.
auto const detProp