BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
KalFitElement.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File from KalFit module
3//
4// Filename : KalFitElement.cc
5//------------------------------------------------------------------------
6// Description :
7// Element is a base class which represents an element of detector
8//------------------------------------------------------------------------
9// Modif :
10//------------------------------------------------------------------------
11#include "CLHEP/Geometry/Point3D.h"
12#ifndef ENABLE_BACKWARDS_COMPATIBILITY
13typedef HepGeom::Point3D<double> HepPoint3D;
14#endif
15// #include "TrackUtil/Helix.h"
16#include "KalFitAlg/helix/Helix.h"
17
18#include "KalFitAlg/KalFitElement.h"
19#include "KalFitAlg/KalFitMaterial.h"
20#include "KalFitAlg/KalFitTrack.h"
21
24
25void KalFitElement::updateTrack( KalFitTrack& track, int index ) {
26
27 HepPoint3D x;
28 double path = intersect( track, x );
29
30 // cout<<"KalFitElement: path= "<<path<<" intersect x "<<x<<endl;
31
32 if ( path > 0 )
33 {
34 // move pivot
35
36 // std::cout<<"KalFitElement: track helix1= "<<track.a()<<std::endl;
37 // std::cout<<" KalFitTrack::numf_: "<<KalFitTrack::numf_<<std::endl;
38 // std::cout<<" KalFitTrack::muls_: "<<muls_<<std::endl;
39 // std::cout<<" KalFitTrack::loss_: "<<loss_<<std::endl;
40
41 track.pivot_numf( x );
42
43 // std::cout<<"KalFitElement: track helix2= "<<track.a()<<std::endl;
44
45 // multiple scattering and energy loss
46 int index_element( index );
47 if ( index_element == 0 ) index_element = 1;
48 if ( muls_ ) track.ms( path, *material_, index_element );
49 if ( loss_ ) track.eloss( path, *material_, index_element );
50
51 // cout<<"KalFitElement: track helix3= "<<track.a()<<endl;
52 }
53 // cout<<"KalfitElement: track helix2= "<<track.a()<<endl;
54}
55
57 HepPoint3D x;
58 double path = intersect( track, x );
59 if ( path > 0 )
60 {
61 // move pivot
62 track.pivot_numf( x );
63
64 // multiple scattering and energy loss
65 if ( muls_ ) track.ms( path, *material_, index );
66 if ( loss_ ) track.eloss( path, *material_, index );
67 }
68}
69
71 HepPoint3D x;
72 double path = intersect( track, x );
73 if ( path > 0 )
74 {
75 // move pivot
76 track.pivot_numf( x );
77
78 // multiple scattering and energy loss
79 if ( muls_ ) track.ms( path, *material_, index );
80 if ( loss_ ) track.eloss( path, *material_, index );
81 }
82}
83
84void KalFitElement::asso_rphi( Lpav& circ, KalFitTrack& track ) {}
85
87
88void KalFitElement::muls( int i ) { muls_ = i; }
89
90void KalFitElement::loss( int i ) { loss_ = i; }
91
92int KalFitElement::muls( void ) { return muls_; }
93
94int KalFitElement::loss( void ) { return loss_; }
HepGeom::Point3D< double > HepPoint3D
static int muls(void)
const KalFitMaterial * material_
Material of this element.
virtual void updateTrack(KalFitTrack &track, int index)
Update track according the material properties of the current element.
virtual double intersect(const KalFitTrack &track, HepPoint3D &x) const =0
Find intersection with Helix.
static int loss(void)
virtual void asso_rphi(KalmanFit::Lpav &circ, KalFitTrack &track)
virtual void updateTrack_rphi(KalFitTrack &track, int index)
virtual void updateTrack_alreadyfound(KalFitTrack &track, int index)
Description of a track class (<- Helix.cc).
const HepPoint3D & pivot_numf(const HepPoint3D &newPivot)
Sets pivot position in a given mag field.
void ms(double path, const KalFitMaterial &m, int index)
void eloss(double path, const KalFitMaterial &m, int index)
Calculate total energy lost in material.