BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RkFitCylinder.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File from RkFit module
3//
4// Filename : RkFitCylinder.cc
5//------------------------------------------------------------------------
6// Description :
7// Cylinder is an Element whose shape is a cylinder.
8//------------------------------------------------------------------------
9// Modif :
10//------------------------------------------------------------------------
11#include <float.h>
12#include "CLHEP/Geometry/Point3D.h"
13#ifndef ENABLE_BACKWARDS_COMPATIBILITY
15#endif
16#include "TrackUtil/Helix.h"
17#include "TrkReco/TRunge.h"
20
22 HepPoint3D& x) const
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}
49
50
52 HepPoint3D& x, const HepPoint3D& point) const
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 }
86
87void RkFitCylinder::updateTrack(TRunge& track,double y[6]) const{
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}
100
101
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}
113
114
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}
125
double mass
const Int_t n
Double_t x[10]
HepGeom::Point3D< double > HepPoint3D
HepPoint3D x(double dPhi=0.) const
returns position after rotating angle dPhi in phi direction.
double radius(void) const
returns radious of helix.
bool isInside2(const HepPoint3D &x) const
const RkFitMaterial * material_
Definition: RkFitCylinder.h:28
bool isInside(const HepPoint3D &x) const
Check if the position x is inside the current cylinder.
void updateTrack(TRunge &track, double y[6]) const
double intersect(TRunge &track, HepPoint3D &x) const
Find intersection with Helix.
A class to represent a track in tracking.
Definition: TRunge.h:65
Helix helix(void) const
returns helix class
Definition: TRunge.cxx:238
void eloss(double path, const RkFitMaterial *material, double mass, double y[6], int index) const
Definition: TRunge.cxx:1299
double intersect_xy_plane(double z) const
Definition: TRunge.cxx:1362
double intersect_cylinder(double r) const
Definition: TRunge.cxx:1316
double y[1000]