CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
KalFitCylinder Class Reference

Cylinder is an Element whose shape is a cylinder. More...

#include <KalFitCylinder.h>

+ Inheritance diagram for KalFitCylinder:

Public Member Functions

 KalFitCylinder (const KalFitMaterial *material, double inner_radius, double thick, double length, double z0)
 Constructor.
 
virtual double intersect (const KalFitTrack &track, HepPoint3D &x) const
 Find intersection with Helix.
 
virtual double intersect (const KalFitTrack &track, HepPoint3D &x, const HepPoint3D &point) const
 
virtual double intersect (const KalFitTrack &track, HepPoint3D &x, const double ri, const double ro) const
 
bool isInside (const HepPoint3D &x) const
 Check if the position x is inside the current cylinder.
 
bool isInside (const HepPoint3D &x, const double ri, const double ro) const
 
bool isInside2 (const HepPoint3D &x) const
 
virtual double radius (void) const
 Extract radius of the cylinder.
 
double rmin () const
 
void setSensitive ()
 
bool isSensitive () const
 
- Public Member Functions inherited from KalFitElement
 KalFitElement (const KalFitMaterial *material)
 Constructor.
 
virtual ~KalFitElement ()
 Destructor.
 
const KalFitMaterialmaterial (void) const
 Return Material of which Element is made.
 
virtual void updateTrack (KalFitTrack &track, int index)
 Update track according the material properties of the current element.
 
virtual void updateTrack (KalFitTrack &track, int index, const double ri, const double ro)
 
virtual void updateTrack_rphi (KalFitTrack &track, int index)
 
virtual void updateTrack_alreadyfound (KalFitTrack &track, int index)
 
virtual void asso_rphi (KalmanFit::Lpav &circ, KalFitTrack &track)
 
virtual void asso_rphi (KalFitTrack &track)
 
bool operator< (const KalFitElement &a) const
 Operator.
 

Protected Attributes

double ro_
 
double ri_
 
double zf_
 
double zb_
 
- Protected Attributes inherited from KalFitElement
const KalFitMaterialmaterial_
 Material of this element.
 

Additional Inherited Members

- Static Public Member Functions inherited from KalFitElement
static int muls (void)
 
static int loss (void)
 
static void muls (int i)
 
static void loss (int i)
 
- Static Protected Attributes inherited from KalFitElement
static int muls_
 Flags.
 
static int loss_
 

Detailed Description

Cylinder is an Element whose shape is a cylinder.

Definition at line 21 of file KalFitCylinder.h.

Constructor & Destructor Documentation

◆ KalFitCylinder()

KalFitCylinder::KalFitCylinder ( const KalFitMaterial * material,
double inner_radius,
double thick,
double length,
double z0 )
inline

Constructor.

Definition at line 30 of file KalFitCylinder.h.

33 : KalFitElement(material), myIsSensitive(false)
34 {
35 ri_ = inner_radius;
36 ro_ = inner_radius + thick;
37 zf_ = z0 + length * .5;
38 zb_ = z0 - length * .5;
39 }
double length
const KalFitMaterial & material(void) const
Return Material of which Element is made.
KalFitElement(const KalFitMaterial *material)
Constructor.

Member Function Documentation

◆ intersect() [1/3]

double KalFitCylinder::intersect ( const KalFitTrack & track,
HepPoint3D & x ) const
virtual

Find intersection with Helix.

Implements KalFitElement.

Definition at line 23 of file KalFitCylinder.cxx.

25{
26 double dPhi[4];
27 dPhi[0] = track.intersect_cylinder(ro_);
28 if(dPhi[0] == 0) return -1;
29 dPhi[1] = track.intersect_cylinder(ri_);
30 if(dPhi[1] == 0) return -1;
31 dPhi[2] = track.intersect_xy_plane(zf_);
32 dPhi[3] = track.intersect_xy_plane(zb_);
33
34 int n[2];
35 int j = 0;
36 for(int i = 0; i < 4 && j < 2; i++){
37 HepPoint3D xx = track.x(dPhi[i]);
38 if(isInside(xx)) n[j++] = i;
39 }
40 if(j < 2) return -1;
41
42 x = track.x((dPhi[n[0]] + dPhi[n[1]]) * .5);
43
44 double tanl = track.tanl();
45 //cout<<"KalFitCylinder: track radius"<<track.radius()<<" dphi0 "
46 // <<dPhi[n[0]]<<" dphi1 "<<dPhi[n[1]]<<" tanl "<<tanl<<endl;
47 return fabs(track.radius() * (dPhi[n[0]] - dPhi[n[1]])
48 * sqrt(1 + tanl * tanl));
49}
const Int_t n
Double_t x[10]
bool isInside(const HepPoint3D &x) const
Check if the position x is inside the current cylinder.
double intersect_cylinder(double r) const
Intersection with different geometry.
double intersect_xy_plane(double z) const
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.

◆ intersect() [2/3]

double KalFitCylinder::intersect ( const KalFitTrack & track,
HepPoint3D & x,
const double ri,
const double ro ) const
virtual

Implements KalFitElement.

Definition at line 89 of file KalFitCylinder.cxx.

91{
92
93 //std::cout<<" ro: "<<ro<<std::endl;
94
95 double dPhi[4];
96 dPhi[0] = track.intersect_cylinder(ro);
97 if(dPhi[0] == 0) return -1;
98 dPhi[1] = track.intersect_cylinder(ri);
99 if(dPhi[1] == 0) return -1;
100 dPhi[2] = track.intersect_xy_plane(zf_);
101 dPhi[3] = track.intersect_xy_plane(zb_);
102
103 //for(int ii=0; ii<4; ii++)
104 //std::cout<<"dPhi["<<ii<<"]"<<dPhi[ii]<<std::endl;
105
106 int n[2];
107 int j = 0;
108 for(int i = 0; i < 4 && j < 2; i++){
109 HepPoint3D xx = track.x(dPhi[i]);
110 if(isInside(xx,ri,ro)) n[j++] = i;
111 }
112
113 if(j < 2) return -1;
114
115 x = track.x((dPhi[n[0]] + dPhi[n[1]]) * .5);
116
117 double tanl = track.tanl();
118
119 return fabs(track.radius() * (dPhi[n[0]] - dPhi[n[1]])
120 * sqrt(1 + tanl * tanl));
121 }

◆ intersect() [3/3]

double KalFitCylinder::intersect ( const KalFitTrack & track,
HepPoint3D & x,
const HepPoint3D & point ) const
virtual

Implements KalFitElement.

Definition at line 52 of file KalFitCylinder.cxx.

54{
55
56 const double ro = sqrt(point.x()*point.x()+point.y()*point.y());
57
58 //std::cout<<" ro: "<<ro<<std::endl;
59
60 double dPhi[4];
61 dPhi[0] = track.intersect_cylinder(ro);
62 if(dPhi[0] == 0) return -1;
63 dPhi[1] = track.intersect_cylinder(ri_);
64 if(dPhi[1] == 0) return -1;
65 dPhi[2] = track.intersect_xy_plane(zf_);
66 dPhi[3] = track.intersect_xy_plane(zb_);
67
68 //for(int ii=0; ii<4; ii++)
69 //std::cout<<"dPhi["<<ii<<"]"<<dPhi[ii]<<std::endl;
70
71 int n[2];
72 int j = 0;
73 for(int i = 0; i < 4 && j < 2; i++){
74 HepPoint3D xx = track.x(dPhi[i]);
75 if(isInside(xx)) n[j++] = i;
76 }
77
78 if(j < 2) return -1;
79
80 x = track.x((dPhi[n[0]] + dPhi[n[1]]) * .5);
81
82 double tanl = track.tanl();
83
84 return fabs(track.radius() * (dPhi[n[0]] - dPhi[n[1]])
85 * sqrt(1 + tanl * tanl));
86 }

◆ isInside() [1/2]

bool KalFitCylinder::isInside ( const HepPoint3D & x) const

Check if the position x is inside the current cylinder.

Definition at line 136 of file KalFitCylinder.cxx.

137{
138 double r = x.perp();
139 double z = x.z();
140 //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
141
142 return (r >= ri_ - FLT_EPSILON &&
143 r <= ro_ + FLT_EPSILON &&
144 z >= zb_ - FLT_EPSILON &&
145 z <= zf_ + FLT_EPSILON);
146}

Referenced by intersect(), intersect(), and intersect().

◆ isInside() [2/2]

bool KalFitCylinder::isInside ( const HepPoint3D & x,
const double ri,
const double ro ) const

Definition at line 124 of file KalFitCylinder.cxx.

125{
126 double r = x.perp();
127 double z = x.z();
128 //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
129
130 return (r >= ri - FLT_EPSILON &&
131 r <= ro + FLT_EPSILON &&
132 z >= zb_ - FLT_EPSILON &&
133 z <= zf_ + FLT_EPSILON);
134}

◆ isInside2()

bool KalFitCylinder::isInside2 ( const HepPoint3D & x) const

Definition at line 149 of file KalFitCylinder.cxx.

150{
151 double r = x.perp();
152 double z = x.z();
153 //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
154
155 return (r <= ro_ + FLT_EPSILON &&
156 z >= zb_ - FLT_EPSILON &&
157 z <= zf_ + FLT_EPSILON);
158}

◆ isSensitive()

bool KalFitCylinder::isSensitive ( ) const
inline

Definition at line 61 of file KalFitCylinder.h.

61{return myIsSensitive;}

◆ radius()

virtual double KalFitCylinder::radius ( void ) const
inlinevirtual

Extract radius of the cylinder.

Implements KalFitElement.

Definition at line 57 of file KalFitCylinder.h.

57{ return ro_; }

◆ rmin()

double KalFitCylinder::rmin ( ) const
inline

Definition at line 59 of file KalFitCylinder.h.

59{return ri_;}

◆ setSensitive()

void KalFitCylinder::setSensitive ( )
inline

Definition at line 60 of file KalFitCylinder.h.

60{myIsSensitive=true;}

Member Data Documentation

◆ ri_

double KalFitCylinder::ri_
protected

Definition at line 24 of file KalFitCylinder.h.

Referenced by intersect(), intersect(), isInside(), KalFitCylinder(), and rmin().

◆ ro_

double KalFitCylinder::ro_
protected

Definition at line 23 of file KalFitCylinder.h.

Referenced by intersect(), isInside(), isInside2(), KalFitCylinder(), and radius().

◆ zb_

double KalFitCylinder::zb_
protected

◆ zf_

double KalFitCylinder::zf_
protected

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