LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
trkf::InteractGeneral Class Reference

#include "InteractGeneral.h"

Inheritance diagram for trkf::InteractGeneral:
trkf::Interactor

Public Member Functions

 InteractGeneral (detinfo::DetectorPropertiesData const &detProp, double tcut)
 
Interactorclone () const override
 Clone method. More...
 
bool noise (const KTrack &trk, double s, TrackError &noise_matrix) const override
 
double getTcut () const
 

Private Attributes

InteractPlane fInteract
 
PropAny fProp
 

Detailed Description

Definition at line 24 of file InteractGeneral.h.

Constructor & Destructor Documentation

trkf::InteractGeneral::InteractGeneral ( detinfo::DetectorPropertiesData const &  detProp,
double  tcut 
)
explicit

Constructor.

Arguments:

tcut - Maximum delta ray energy.

Definition at line 23 of file InteractGeneral.cxx.

Referenced by clone().

24  : Interactor(tcut), fInteract(detProp, tcut), fProp(detProp, -1., false)
25  {}
Interactor(double tcut)
Definition: Interactor.cxx:21
InteractPlane fInteract

Member Function Documentation

Interactor* trkf::InteractGeneral::clone ( ) const
inlineoverridevirtual

Clone method.

Implements trkf::Interactor.

Definition at line 28 of file InteractGeneral.h.

References InteractGeneral(), and noise().

28 { return new InteractGeneral(*this); }
InteractGeneral(detinfo::DetectorPropertiesData const &detProp, double tcut)
double trkf::Interactor::getTcut ( ) const
inlineinherited

Definition at line 32 of file Interactor.h.

References trkf::Interactor::clone(), trkf::Interactor::fTcut, and trkf::Interactor::noise().

Referenced by trkf::InteractPlane::noise().

32 { return fTcut; }
double fTcut
Maximum delta ray energy for dE/dx.
Definition: Interactor.h:41
bool trkf::InteractGeneral::noise ( const KTrack trk,
double  s,
TrackError noise_matrix 
) const
overridevirtual

Calculate noise matrix.

Arguments:

trk - Original track. s - Path distance. noise_matrix - Resultant noise matrix.

Returns: True if success.

Currently calculate noise from multiple scattering only.

Note about multiple scattering calculation:

We make a zero distance propagation to a plane surface (SurfXYZPlane) that is normal to the track direction. Then calculate the noise matrix on that surface and transform back to the original surface.

Implements trkf::Interactor.

Definition at line 46 of file InteractGeneral.cxx.

References fInteract, fProp, trkf::KTrack::getMomentum(), trkf::KTrack::getPosition(), trkf::invert(), trkf::InteractPlane::noise(), trkf::PropAny::short_vec_prop(), and trkf::Propagator::UNKNOWN.

Referenced by clone().

47  {
48  // Get track position and direction.
49 
50  double xyz[3];
51  double mom[3];
52  trk.getPosition(xyz);
53  trk.getMomentum(mom);
54 
55  // Generate a SurfXYZPlane with origin at current track position, and
56  // normal to current track direction.
57 
58  std::shared_ptr<Surface> psurf(
59  new SurfXYZPlane(xyz[0], xyz[1], xyz[2], mom[0], mom[1], mom[2]));
60 
61  // Propagate track to newly created surface (zero-distance propagation).
62 
63  TrackMatrix prop_matrix;
64  KTrack temp_trk = trk;
65  std::optional<double> result =
66  fProp.short_vec_prop(temp_trk, psurf, Propagator::UNKNOWN, false, &prop_matrix);
67 
68  // Return failure if propagation did not succeed.
69 
70  if (!result) return false;
71 
72  // Calculate noise on plane surface.
73 
74  TrackError plane_noise(5);
75  fInteract.noise(temp_trk, s, plane_noise);
76 
77  // Transform noise matrix to original surface using inverse of propagation matrix.
78 
79  invert(prop_matrix);
80  TrackMatrix temp = prod(plane_noise, trans(prop_matrix));
81  TrackMatrix temp2 = prod(prop_matrix, temp);
82  noise_matrix = ublas::symmetric_adaptor<TrackMatrix>(temp2);
83 
84  // Done (success).
85 
86  return true;
87  }
KSymMatrix< 5 >::type TrackError
Track error matrix, dimension 5x5.
KMatrix< 5, 5 >::type TrackMatrix
General 5x5 matrix.
bool invert(ublas::matrix< T, L, A > &m)
std::optional< double > short_vec_prop(KTrack &trk, const std::shared_ptr< const Surface > &surf, Propagator::PropDirection dir, bool doDedx, TrackMatrix *prop_matrix=0, TrackError *noise_matrix=0) const override
Propagate without error.
Definition: PropAny.cxx:54
bool noise(const KTrack &trk, double s, TrackError &noise_matrix) const override
Calculate noise matrix.
InteractPlane fInteract

Member Data Documentation

InteractPlane trkf::InteractGeneral::fInteract
private

Definition at line 32 of file InteractGeneral.h.

Referenced by noise().

PropAny trkf::InteractGeneral::fProp
private

Definition at line 33 of file InteractGeneral.h.

Referenced by noise().


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