KalFitCylinder Class Reference

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

#include <KalFitCylinder.h>

Inheritance diagram for KalFitCylinder:

KalFitElement List of all members.

Public Member Functions

 KalFitCylinder (const KalFitMaterial *material, double 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
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.
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_rphi (KalFitTrack &track, int index)
virtual void updateTrack_alreadyfound (KalFitTrack &track, int index)
virtual void asso_rphi (Lpav &circ, KalFitTrack &track)
virtual void asso_rphi (KalFitTrack &track)
bool operator< (const KalFitElement &a) const
 Operator.

Static Public Member Functions

static int muls (void)
static void muls (int i)
static int loss (void)
static void loss (int i)

Protected Attributes

double ro_
double ri_
double zf_
double zb_
const KalFitMaterialmaterial_
 Material of this element.

Static Protected Attributes

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

Constructor.

Definition at line 30 of file KalFitCylinder.h.

References ri_, ro_, zb_, and zf_.

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


Member Function Documentation

void KalFitElement::asso_rphi ( KalFitTrack track  )  [virtual, inherited]

Definition at line 90 of file KalFitElement.cxx.

00091 {}

void KalFitElement::asso_rphi ( Lpav circ,
KalFitTrack track 
) [virtual, inherited]

Definition at line 87 of file KalFitElement.cxx.

00088 {}

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

Implements KalFitElement.

Definition at line 52 of file KalFitCylinder.cxx.

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

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

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

Find intersection with Helix.

Implements KalFitElement.

Definition at line 23 of file KalFitCylinder.cxx.

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

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

bool KalFitCylinder::isInside ( const HepPoint3D x  )  const

Check if the position x is inside the current cylinder.

Definition at line 91 of file KalFitCylinder.cxx.

References ri_, ro_, zb_, and zf_.

Referenced by intersect().

00092 {
00093   double r = x.perp();
00094   double z = x.z();
00095   //std::cout<<"r: "<<r<<" z: "<<z<<" ri: "<<ri_<<" ro: "<<ro_<<" zb_: "<<zb_<<"zf: "<<zf_<<std::endl;
00096   
00097   return (r >= ri_ - FLT_EPSILON &&
00098           r <= ro_ + FLT_EPSILON &&
00099           z >= zb_ - FLT_EPSILON &&
00100           z <= zf_ + FLT_EPSILON);
00101 }

bool KalFitCylinder::isInside2 ( const HepPoint3D x  )  const

Definition at line 104 of file KalFitCylinder.cxx.

References ro_, zb_, and zf_.

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

void KalFitElement::loss ( int  i  )  [static, inherited]

Definition at line 98 of file KalFitElement.cxx.

References KalFitElement::loss_.

00099 {
00100   loss_ = i;
00101 }

int KalFitElement::loss ( void   )  [static, inherited]

Definition at line 108 of file KalFitElement.cxx.

References KalFitElement::loss_.

Referenced by KalFitAlg::filter_fwd_anal(), KalFitAlg::filter_fwd_calib(), KalFitAlg::initialize(), KalFitAlg::smoother_anal(), and KalFitAlg::smoother_calib().

00109 {
00110   return loss_;
00111 }

const KalFitMaterial& KalFitElement::material ( void   )  const [inline, inherited]

Return Material of which Element is made.

Definition at line 52 of file KalFitElement.h.

References KalFitElement::material_.

00053   {
00054     return *material_;
00055   }

void KalFitElement::muls ( int  i  )  [static, inherited]

Definition at line 93 of file KalFitElement.cxx.

References KalFitElement::muls_.

00094 {
00095   muls_ = i;
00096 }

int KalFitElement::muls ( void   )  [static, inherited]

Definition at line 103 of file KalFitElement.cxx.

References KalFitElement::muls_.

Referenced by KalFitAlg::filter_fwd_anal(), KalFitAlg::filter_fwd_calib(), KalFitAlg::initialize(), KalFitAlg::smoother_anal(), and KalFitAlg::smoother_calib().

00104 {
00105   return muls_;
00106 }

bool KalFitElement::operator< ( const KalFitElement a  )  const [inline, inherited]

Operator.

Definition at line 71 of file KalFitElement.h.

References KalFitElement::radius().

00072   {
00073     return radius() < a.radius();
00074   }

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

Extract radius of the cylinder.

Implements KalFitElement.

Definition at line 53 of file KalFitCylinder.h.

References ro_.

00053 { return ro_; }

void KalFitElement::updateTrack ( KalFitTrack track,
int  index 
) [virtual, inherited]

Update track according the material properties of the current element.

Definition at line 25 of file KalFitElement.cxx.

References KalFitTrack::eloss(), KalFitElement::intersect(), KalFitElement::loss_, KalFitElement::material_, KalFitTrack::ms(), KalFitElement::muls_, KalFitTrack::pivot_numf(), and x.

00026 {
00027 
00028   HepPoint3D x;
00029   double path = intersect(track, x);
00030 
00031   //cout<<"KalFitElement: path= "<<path<<" intersect x "<<x<<endl;
00032   
00033   if(path > 0){
00034     // move pivot
00035 
00036     //std::cout<<"KalFitElement: track helix1= "<<track.a()<<std::endl;
00037     //std::cout<<" KalFitTrack::numf_: "<<KalFitTrack::numf_<<std::endl;
00038     //std::cout<<" KalFitTrack::muls_: "<<muls_<<std::endl;
00039     //std::cout<<" KalFitTrack::loss_: "<<loss_<<std::endl;
00040     
00041     track.pivot_numf(x);
00042   
00043     //std::cout<<"KalFitElement: track helix2= "<<track.a()<<std::endl;
00044   
00045     
00046     // multiple scattering and energy loss
00047     int index_element(index);
00048     if (index_element==0) index_element=1;
00049     if(muls_) track.ms(path, *material_, index_element);
00050     if(loss_) track.eloss(path, *material_, index_element);
00051 
00052     //cout<<"KalFitElement: track helix3= "<<track.a()<<endl;
00053   }
00054   //cout<<"KalfitElement: track helix2= "<<track.a()<<endl;
00055 }

void KalFitElement::updateTrack_alreadyfound ( KalFitTrack track,
int  index 
) [virtual, inherited]

Definition at line 71 of file KalFitElement.cxx.

References KalFitTrack::eloss(), KalFitElement::intersect(), KalFitElement::loss_, KalFitElement::material_, KalFitTrack::ms(), KalFitElement::muls_, KalFitTrack::pivot_numf(), and x.

00073 {
00074   HepPoint3D x;
00075   double path = intersect(track, x);
00076   if(path > 0){
00077     // move pivot
00078     track.pivot_numf(x);
00079 
00080     // multiple scattering and energy loss
00081     if(muls_) track.ms(path, *material_, index);
00082     if(loss_) track.eloss(path, *material_, index);
00083   }
00084 }

void KalFitElement::updateTrack_rphi ( KalFitTrack track,
int  index 
) [virtual, inherited]

Definition at line 57 of file KalFitElement.cxx.

References KalFitTrack::eloss(), KalFitElement::intersect(), KalFitElement::loss_, KalFitElement::material_, KalFitTrack::ms(), KalFitElement::muls_, KalFitTrack::pivot_numf(), and x.

00058 {
00059   HepPoint3D x;
00060   double path = intersect(track, x);
00061   if(path > 0){
00062     // move pivot
00063     track.pivot_numf(x);
00064 
00065     // multiple scattering and energy loss
00066     if(muls_) track.ms(path, *material_, index);
00067     if(loss_) track.eloss(path, *material_, index);
00068   }
00069 }


Member Data Documentation

int KalFitElement::loss_ [static, protected, inherited]

Definition at line 32 of file KalFitElement.h.

Referenced by KalFitElement::loss(), KalFitElement::updateTrack(), KalFitElement::updateTrack_alreadyfound(), and KalFitElement::updateTrack_rphi().

const KalFitMaterial* KalFitElement::material_ [protected, inherited]

Material of this element.

Definition at line 28 of file KalFitElement.h.

Referenced by KalFitElement::material(), KalFitElement::updateTrack(), KalFitElement::updateTrack_alreadyfound(), and KalFitElement::updateTrack_rphi().

int KalFitElement::muls_ [static, protected, inherited]

Flags.

Definition at line 31 of file KalFitElement.h.

Referenced by KalFitElement::muls(), KalFitElement::updateTrack(), KalFitElement::updateTrack_alreadyfound(), and KalFitElement::updateTrack_rphi().

double KalFitCylinder::ri_ [protected]

Definition at line 24 of file KalFitCylinder.h.

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

double KalFitCylinder::ro_ [protected]

Definition at line 23 of file KalFitCylinder.h.

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

double KalFitCylinder::zb_ [protected]

Definition at line 26 of file KalFitCylinder.h.

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

double KalFitCylinder::zf_ [protected]

Definition at line 25 of file KalFitCylinder.h.

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


Generated on Tue Nov 29 23:19:54 2016 for BOSS_7.0.2 by  doxygen 1.4.7