Public Member Functions | Private Attributes | List of all members
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
 
- Public Member Functions inherited from trkf::Interactor
 Interactor (double tcut)
 
virtual ~Interactor ()
 
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.

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 29 of file InteractGeneral.h.

30  {
31  return new InteractGeneral(*this);
32  }
InteractGeneral(detinfo::DetectorPropertiesData const &detProp, double tcut)
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 47 of file InteractGeneral.cxx.

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

Member Data Documentation

InteractPlane trkf::InteractGeneral::fInteract
private

Definition at line 36 of file InteractGeneral.h.

PropAny trkf::InteractGeneral::fProp
private

Definition at line 37 of file InteractGeneral.h.


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