LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkf::InteractGeneral Class Reference

#include "InteractGeneral.h"

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

Public Member Functions

 InteractGeneral (double tcut)
 Constructor. More...
 
virtual ~InteractGeneral ()
 Destructor. More...
 
Interactorclone () const
 Clone method. More...
 
virtual bool noise (const KTrack &trk, double s, TrackError &noise_matrix) const
 Calculate noise matrix. More...
 
double getTcut () const
 

Private Attributes

InteractPlane fInteract
 Plane interactor. More...
 
PropAny fProp
 Propagator. More...
 

Detailed Description

Definition at line 24 of file InteractGeneral.h.

Constructor & Destructor Documentation

trkf::InteractGeneral::InteractGeneral ( double  tcut)

Constructor.

Constructor.

Arguments:

tcut - Maximum delta ray energy.

Definition at line 24 of file InteractGeneral.cxx.

Referenced by clone().

24  :
25  Interactor(tcut),
26  fInteract(tcut),
27  fProp(-1., false)
28  {}
PropAny fProp
Propagator.
Interactor(double tcut)
Constructor.
Definition: Interactor.cxx:21
InteractPlane fInteract
Plane interactor.
trkf::InteractGeneral::~InteractGeneral ( )
virtual

Destructor.

Definition at line 31 of file InteractGeneral.cxx.

32  {}

Member Function Documentation

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

Clone method.

Implements trkf::Interactor.

Definition at line 37 of file InteractGeneral.h.

References InteractGeneral(), noise(), and s.

37 {return new InteractGeneral(*this);}
InteractGeneral(double tcut)
Constructor.
double trkf::Interactor::getTcut ( ) const
inlineinherited

Definition at line 39 of file Interactor.h.

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

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

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

Calculate noise matrix.

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 53 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().

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

Member Data Documentation

InteractPlane trkf::InteractGeneral::fInteract
private

Plane interactor.

Definition at line 47 of file InteractGeneral.h.

Referenced by noise().

PropAny trkf::InteractGeneral::fProp
private

Propagator.

Definition at line 50 of file InteractGeneral.h.

Referenced by noise().


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