RkFitCylinder Class Reference

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

#include <RkFitCylinder.h>

List of all members.

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 ( const RkFitMaterial material,
double  radius,
double  thick,
double  length,
double  z0 
) [inline]

Constructor.

Definition at line 30 of file RkFitCylinder.h.

References material_, ri_, ro_, zb_, and zf_.

00033   {
00034     material_=material;  
00035     ri_ = radius;
00036     ro_ = radius + thick;
00037     zf_ = z0 + length * .5;
00038     zb_ = z0 - length * .5;
00039   }


Member Function Documentation

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

Definition at line 51 of file RkFitCylinder.cxx.

References TRunge::helix(), genRecEmupikp::i, TRunge::intersect_cylinder(), TRunge::intersect_xy_plane(), isInside(), ganga-rec::j, Helix::radius(), ri_, Helix::tanl(), Helix::x(), zb_, and zf_.

00053 {
00054 
00055  const double ro = sqrt(point.x()*point.x()+point.y()*point.y());
00056 
00057  //std::cout<<" ro: "<<ro<<std::endl;
00058  
00059  double dPhi[4];
00060  dPhi[0] = track.intersect_cylinder(ro);
00061  if(dPhi[0] == 0) return -1;
00062  dPhi[1] = track.intersect_cylinder(ri_);
00063  if(dPhi[1] == 0) return -1;
00064  dPhi[2] = track.intersect_xy_plane(zf_);
00065  dPhi[3] = track.intersect_xy_plane(zb_);
00066 
00067  //for(int ii=0; ii<4; ii++)
00068    //std::cout<<"dPhi["<<ii<<"]"<<dPhi[ii]<<std::endl;
00069  
00070  int n[2];
00071  int j = 0;
00072  for(int i = 0; i < 4 && j < 2; i++){
00073    HepPoint3D xx = track.helix().x(dPhi[i]);
00074    if(isInside(xx)) n[j++] = i;
00075  }
00076 
00077  if(j < 2) return -1;
00078 
00079  x = track.helix().x((dPhi[n[0]] + dPhi[n[1]]) * .5);
00080  
00081  double tanl = track.helix().tanl();
00082 
00083  return fabs(track.helix().radius() * (dPhi[n[0]] - dPhi[n[1]])
00084      * sqrt(1 + tanl * tanl));
00085  }

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

Find intersection with Helix.

Definition at line 21 of file RkFitCylinder.cxx.

References TRunge::helix(), genRecEmupikp::i, TRunge::intersect_cylinder(), TRunge::intersect_xy_plane(), isInside(), ganga-rec::j, Helix::radius(), ri_, ro_, Helix::tanl(), Helix::x(), zb_, and zf_.

Referenced by updateTrack().

00023 {
00024   double dPhi[4];
00025   dPhi[0] = track.intersect_cylinder(ro_);
00026   if(dPhi[0] == 0) return -1;
00027   dPhi[1] = track.intersect_cylinder(ri_);
00028   if(dPhi[1] == 0) return -1;
00029   dPhi[2] = track.intersect_xy_plane(zf_);
00030   dPhi[3] = track.intersect_xy_plane(zb_);
00031 
00032   int n[2];
00033   int j = 0;
00034   for(int i = 0; i < 4 && j < 2; i++){
00035     HepPoint3D xx = track.helix().x(dPhi[i]);
00036     if(isInside(xx)) n[j++] = i;
00037   }
00038   if(j < 2) return -1;
00039 
00040   x = track.helix().x((dPhi[n[0]] + dPhi[n[1]]) * .5);
00041 
00042   double tanl = track.helix().tanl();
00043   //cout<<"RkFitCylinder: track radius"<<track.radius()<<" dphi0 "
00044   //    <<dPhi[n[0]]<<" dphi1 "<<dPhi[n[1]]<<" tanl "<<tanl<<endl;
00045   return fabs(track.helix().radius() * (dPhi[n[0]] - dPhi[n[1]])
00046              * sqrt(1 + tanl * tanl));
00047  //   return 0;
00048 }

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.

References ri_, ro_, zb_, and zf_.

Referenced by intersect().

00103 {
00104   double r = x.perp();
00105   double z = x.z();
00106   //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
00107   
00108   return (r >= ri_ - FLT_EPSILON &&
00109           r <= ro_ + FLT_EPSILON &&
00110           z >= zb_ - FLT_EPSILON &&
00111           z <= zf_ + FLT_EPSILON);
00112 }

bool RkFitCylinder::isInside2 ( const HepPoint3D x  )  const

Definition at line 115 of file RkFitCylinder.cxx.

References ro_, zb_, and zf_.

00116 {
00117   double r = x.perp();
00118   double z = x.z();   
00119   //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
00120 
00121   return (r <= ro_ + FLT_EPSILON &&
00122           z >= zb_ - FLT_EPSILON &&
00123           z <= zf_ + FLT_EPSILON);
00124 }

virtual double RkFitCylinder::radius ( void   )  const [inline, virtual]

Extract radius of the cylinder.

Definition at line 54 of file RkFitCylinder.h.

References ro_.

00054 { return ro_; }

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

Definition at line 87 of file RkFitCylinder.cxx.

References TRunge::eloss(), intersect(), mass, material_, and x.

00087                                                               {
00088     HepPoint3D x;
00089     double path = intersect(track, x);
00090     double mass=0.000511;
00091     if(path > 0){
00092         // move pivot
00093         // multiple scattering and energy loss
00094        // if(muls_) track.ms(path, *material_, index_element);
00095         track.eloss(path, material_,mass,y,1);
00096     //    track.Propagate(path,y);
00097     }
00098       
00099 }


Member Data Documentation

const RkFitMaterial* RkFitCylinder::material_

Definition at line 28 of file RkFitCylinder.h.

Referenced by RkFitCylinder(), and updateTrack().

double RkFitCylinder::ri_ [protected]

Definition at line 24 of file RkFitCylinder.h.

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

double RkFitCylinder::ro_ [protected]

Definition at line 23 of file RkFitCylinder.h.

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

double RkFitCylinder::zb_ [protected]

Definition at line 26 of file RkFitCylinder.h.

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

double RkFitCylinder::zf_ [protected]

Definition at line 25 of file RkFitCylinder.h.

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


Generated on Tue Nov 29 23:21:00 2016 for BOSS_7.0.2 by  doxygen 1.4.7