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

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

#include <RkFitCylinder.h>

Public Member Functions

 RkFitCylinder (const RkFitMaterial *material, double radius, double thick, double length, double z0)
 Constructor.
 
double intersect (TRunge &track, HepPoint3D &x) const
 Find intersection with Helix.
 
double intersect (TRunge &track, HepPoint3D &x, const HepPoint3D &point) const
 
void updateTrack (TRunge &track, double y[6]) const
 
bool isInside (const HepPoint3D &x) const
 Check if the position x is inside the current cylinder.
 
bool isInside2 (const HepPoint3D &x) const
 
virtual double radius (void) const
 Extract radius of the cylinder.
 

Public Attributes

const RkFitMaterialmaterial_
 

Protected Attributes

double ro_
 
double ri_
 
double zf_
 
double zb_
 

Detailed Description

Cylinder is an Element whose shape is a cylinder.

Definition at line 21 of file RkFitCylinder.h.

Constructor & Destructor Documentation

◆ RkFitCylinder()

RkFitCylinder::RkFitCylinder ( const RkFitMaterial * material,
double radius,
double thick,
double length,
double z0 )
inline

Constructor.

Definition at line 30 of file RkFitCylinder.h.

33 {
34 material_=material;
35 ri_ = radius;
36 ro_ = radius + thick;
37 zf_ = z0 + length * .5;
38 zb_ = z0 - length * .5;
39 }
double length
const RkFitMaterial * material_
virtual double radius(void) const
Extract radius of the cylinder.

Member Function Documentation

◆ intersect() [1/2]

double RkFitCylinder::intersect ( TRunge & track,
HepPoint3D & x ) const

Find intersection with Helix.

Definition at line 21 of file RkFitCylinder.cxx.

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

Referenced by updateTrack().

◆ intersect() [2/2]

double RkFitCylinder::intersect ( TRunge & track,
HepPoint3D & x,
const HepPoint3D & point ) const

Definition at line 51 of file RkFitCylinder.cxx.

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

◆ isInside()

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

Check if the position x is inside the current cylinder.

Definition at line 102 of file RkFitCylinder.cxx.

103{
104 double r = x.perp();
105 double z = x.z();
106 //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
107
108 return (r >= ri_ - FLT_EPSILON &&
109 r <= ro_ + FLT_EPSILON &&
110 z >= zb_ - FLT_EPSILON &&
111 z <= zf_ + FLT_EPSILON);
112}

Referenced by intersect(), and intersect().

◆ isInside2()

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

Definition at line 115 of file RkFitCylinder.cxx.

116{
117 double r = x.perp();
118 double z = x.z();
119 //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
120
121 return (r <= ro_ + FLT_EPSILON &&
122 z >= zb_ - FLT_EPSILON &&
123 z <= zf_ + FLT_EPSILON);
124}

◆ radius()

virtual double RkFitCylinder::radius ( void ) const
inlinevirtual

Extract radius of the cylinder.

Definition at line 54 of file RkFitCylinder.h.

54{ return ro_; }

Referenced by RkFitCylinder().

◆ updateTrack()

void RkFitCylinder::updateTrack ( TRunge & track,
double y[6] ) const

Definition at line 87 of file RkFitCylinder.cxx.

87 {
89 double path = intersect(track, x);
90 double mass=0.000511;
91 if(path > 0){
92 // move pivot
93 // multiple scattering and energy loss
94 // if(muls_) track.ms(path, *material_, index_element);
95 track.eloss(path, material_,mass,y,1);
96 // track.Propagate(path,y);
97 }
98
99}
double mass
double intersect(TRunge &track, HepPoint3D &x) const
Find intersection with Helix.
void eloss(double path, const RkFitMaterial *material, double mass, double y[6], int index) const
Definition TRunge.cxx:1299

Member Data Documentation

◆ material_

const RkFitMaterial* RkFitCylinder::material_

Definition at line 28 of file RkFitCylinder.h.

Referenced by RkFitCylinder(), and updateTrack().

◆ ri_

double RkFitCylinder::ri_
protected

Definition at line 24 of file RkFitCylinder.h.

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

◆ ro_

double RkFitCylinder::ro_
protected

Definition at line 23 of file RkFitCylinder.h.

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

◆ zb_

double RkFitCylinder::zb_
protected

Definition at line 26 of file RkFitCylinder.h.

Referenced by intersect(), intersect(), isInside(), isInside2(), and RkFitCylinder().

◆ zf_

double RkFitCylinder::zf_
protected

Definition at line 25 of file RkFitCylinder.h.

Referenced by intersect(), intersect(), isInside(), isInside2(), and RkFitCylinder().


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