NeutTraj Class Reference

#include <NeutTraj.h>

Inheritance diagram for NeutTraj:

TrkSimpTraj TrkDifTraj TrkKalDeriv Trajectory List of all members.

Public Member Functions

 NeutTraj (const NeutParams &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
 NeutTraj (const NeutTraj &)
NeutTrajclone () const
virtual ~NeutTraj ()
NeutTrajoperator= (const NeutTraj &)
virtual HepPoint3D position (double fltLen) const
virtual Hep3Vector direction (double fltLen) const
virtual Hep3Vector delDirect (double) const
void getInfo (double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
void getInfo (double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
void getDFInfo (double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
virtual double distTo1stError (double s, double tol, int pathDir) const
virtual double distTo2ndError (double s, double tol, int pathDir) const
NeutParamsparams ()
const NeutParamsparams () const
int nPar () const
double curvature (double fltLen) const
HepMatrix derivDeflect (double fltlen, deflectDirection) const
HepMatrix derivDisplace (double fltlen, deflectDirection idir) const
HepMatrix derivPFract (double fltlen) const
TranslateParams paramFunction () const
void invertParams (TrkParams *newparams, std::vector< bool > &flags) const
TrkSimpTrajinvert ()
virtual void visitAccept (TrkVisitor *vis) const
TrkParamsparameters ()
const TrkParamsparameters () const
virtual const TrkSimpTrajlocalTrajectory (double fltLen, double &localFlt) const
const HepPoint3DreferencePoint () const
virtual void print (std::ostream &os) const
virtual void printAll (std::ostream &os) const
void changePoint (const HepPoint3D &newpoint, double &fltlen)
void setPoint (const HepPoint3D &newpoint)
bool operator== (const TrkSimpTraj &) const
virtual void getDFInfo2 (double fltLen, DifPoint &pos, DifVector &direction) const
double distTo0thError (double s, double tol, int pathDir) const
bool validFlightDistance (double f, double tolerance=0.0) const
virtual void setFlightRange (double newrange[2])
double lowRange () const
double hiRange () const
double range () const

Static Public Attributes

static HepPoint3D _theOrigin

Protected Attributes

TrkParams _dtparams
HepPoint3D _refpoint
double flightrange [2]

Private Member Functions

double x (const double &) const
double y (const double &) const
double z (const double &) const
NeutParams_np () const
double d0 () const
double phi0 () const
double p () const
double z0 () const
double s0 () const
double tanDip () const
double dip () const
double cosDip () const
double sinDip () const
double translen (const double &f) const

Static Private Member Functions

static void paramFunc (const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)

Detailed Description

Definition at line 25 of file NeutTraj.h.


Constructor & Destructor Documentation

NeutTraj::NeutTraj ( const NeutParams ,
double  lowlim = -99999.,
double  hilim = 99999.,
const HepPoint3D refpoint = _theOrigin 
)

Definition at line 16 of file NeutTraj.cxx.

Referenced by clone().

00017                                                : 
00018   TrkSimpTraj(np.parameter(), np.covariance(), lowlim,hilim)
00019 {
00020 }

NeutTraj::NeutTraj ( const NeutTraj  ) 

Definition at line 22 of file NeutTraj.cxx.

00023   : TrkSimpTraj(n.parameters()->parameter(), n.parameters()->covariance(),
00024                 n.lowRange(),n.hiRange())
00025 {
00026 }

NeutTraj::~NeutTraj (  )  [virtual]

Definition at line 47 of file NeutTraj.cxx.

00047                     {
00048 }


Member Function Documentation

NeutParams* NeutTraj::_np (  )  const [inline, private]

Definition at line 90 of file NeutTraj.h.

References TrkSimpTraj::_dtparams.

Referenced by d0(), operator=(), p(), params(), phi0(), s0(), tanDip(), and z0().

00090 {return (NeutParams*) &_dtparams; }

void TrkSimpTraj::changePoint ( const HepPoint3D newpoint,
double &  fltlen 
) [inherited]

Definition at line 70 of file TrkSimpTraj.cxx.

References TrkSimpTraj::_dtparams, TrkSimpTraj::_refpoint, TrkParams::covariance(), TrkErrCode::failure(), TrkPocaBase::flt1(), Trajectory::hiRange(), icol, Trajectory::lowRange(), DifIndepPar::parameter(), TrkSimpTraj::parameters(), TrkSimpTraj::paramFunction(), Trajectory::setFlightRange(), and TrkPocaBase::status().

00070                                                                   {
00071 //----------------------------------------------------------------------------
00072   if(newpoint != _refpoint){
00073 //  find POCA to the new point
00074     TrkPocaXY endpoca(*this,fltlen,newpoint);
00075     if(endpoca.status().failure()){
00076       std::cout<<"ErrMsg(error)" << "poca failure changing reference point" << std::endl;
00077       return;
00078     } else {
00079 // update flight length
00080       fltlen = endpoca.flt1();
00081 // make a symmatrix from the covariance: temporary kludge
00082       int nrow = parameters()->covariance().num_row();
00083       HepSymMatrix cov(nrow);
00084       for(int irow=0;irow<nrow;irow++)
00085         for(int icol=0;icol<=irow;icol++)
00086           cov.fast(irow+1,icol+1) = parameters()->covariance().fast(irow+1,icol+1);
00087 //  Get the translation function
00088       TranslateParams pfunc = paramFunction();
00089 //  Use it on the SimpTraj parameters
00090       pfunc(_refpoint,newpoint,
00091             parameters()->parameter(),cov,
00092             _dtparams.parameter(),cov,
00093             fltlen);
00094 // put back the covariance
00095       _dtparams.covariance() = cov;
00096       _refpoint = newpoint;
00097 // update the flight range to correspond to the same range in space as before
00098       double newrange[2];
00099       newrange[0] = lowRange() - fltlen;
00100       newrange[1] = hiRange() - fltlen;
00101       setFlightRange(newrange);
00102     }
00103   }
00104   return;
00105 }

NeutTraj * NeutTraj::clone (  )  const [virtual]

Implements TrkSimpTraj.

Definition at line 30 of file NeutTraj.cxx.

References NeutTraj().

00031 {
00032   return new NeutTraj(*this);
00033 }

double NeutTraj::cosDip (  )  const [inline, private]

Definition at line 98 of file NeutTraj.h.

References tanDip().

Referenced by derivDeflect(), derivDisplace(), direction(), position(), sinDip(), translen(), x(), and y().

00098 {return 1./sqrt(1.+tanDip()*tanDip()); }

double NeutTraj::curvature ( double  fltLen  )  const [inline, virtual]

Implements Trajectory.

Definition at line 62 of file NeutTraj.h.

00062 {return 0.;}

double NeutTraj::d0 (  )  const [inline, private]

Definition at line 91 of file NeutTraj.h.

References _np(), and NeutParams::d0().

Referenced by getDFInfo(), position(), x(), and y().

00091 {return _np()->d0(); }

Hep3Vector NeutTraj::delDirect ( double   )  const [virtual]

Implements Trajectory.

Definition at line 93 of file NeutTraj.cxx.

Referenced by getInfo().

00093                                         {
00094 //-----------------------------------------------------------------
00095   return Hep3Vector(0.0, 0.0, 0.0);
00096 }

HepMatrix NeutTraj::derivDeflect ( double  fltlen,
deflectDirection   
) const [virtual]

Implements TrkKalDeriv.

Definition at line 172 of file NeutTraj.cxx.

References NeutParams::_d0, NeutParams::_nneutprm, NeutParams::_p, NeutParams::_phi0, NeutParams::_s0, NeutParams::_tanDip, NeutParams::_z0, cosDip(), tanDip(), theta1, theta2, and translen().

00173 {
00174 //
00175 //  This function computes the column matrix of derivatives for the change
00176 //  in parameters for a change in the direction of a track at a point along
00177 //  its flight, holding the momentum and position constant.  The effects for
00178 //  changes in 2 perpendicular directions (theta1 = dip and 
00179 //  theta2 = phi*cos(dip)) can sometimes be added, as scattering in these
00180 //  are uncorrelated.
00181 //
00182   HepMatrix ddflct(NeutParams::_nneutprm,1); 
00183 //
00184 //  Compute some common things
00185 //
00186   double tand = tanDip();
00187   double cosd = cosDip();
00188 //
00189 //  Go through the parameters
00190 //
00191   switch (idirect) {
00192   case theta1:
00193     ddflct[NeutParams::_p][0] = 0.;
00194     ddflct[NeutParams::_tanDip][0] = 1.0/(cosd*cosd);
00195     ddflct[NeutParams::_d0][0] = 0.;
00196     ddflct[NeutParams::_phi0][0] =  0.;
00197     ddflct[NeutParams::_s0][0] =  0.;
00198     ddflct[NeutParams::_z0][0] = translen(fltlen) * (-1. - (tand*tand));
00199     break;
00200   case theta2:
00201     ddflct[NeutParams::_p][0] = 0;
00202     ddflct[NeutParams::_tanDip][0] = 0;
00203     ddflct[NeutParams::_d0][0] = -translen(fltlen)/cosd;
00204     ddflct[NeutParams::_phi0][0] = 1./cosd;
00205     ddflct[NeutParams::_z0][0] = 0.;
00206     ddflct[NeutParams::_s0][0] =  0.;
00207     break;
00208   }
00209   return ddflct;
00210 }

HepMatrix NeutTraj::derivDisplace ( double  fltlen,
deflectDirection  idir 
) const [virtual]

Implements TrkKalDeriv.

Definition at line 213 of file NeutTraj.cxx.

References NeutParams::_d0, NeutParams::_nneutprm, NeutParams::_p, NeutParams::_phi0, NeutParams::_s0, NeutParams::_tanDip, NeutParams::_z0, cosDip(), theta1, and theta2.

00214 {
00215 //
00216 //  This function computes the column matrix of derivatives for the change
00217 //  in parameters for a change in the transvers position of a track at a point along
00218 //  its flight, holding the momentum and direction constant.  The effects for
00219 //  changes in 2 perpendicular directions (theta1 = dip and 
00220 //  theta2 = phi*cos(dip)) are uncorrelated.  The sign convention has been
00221 //  chosen so that correlated scattering and displacement effects may be added
00222 //
00223   HepMatrix ddflct(NeutParams::_nneutprm,1); 
00224 //
00225 //  Compute some common things
00226 //
00227   double cosd = cosDip();
00228 //
00229 //  Go through the parameters
00230 //
00231   switch (idirect) {
00232   case theta1:
00233     ddflct[NeutParams::_p][0] = 0.;
00234     ddflct[NeutParams::_tanDip][0] = 0.0;
00235     ddflct[NeutParams::_d0][0] = 0.;
00236     ddflct[NeutParams::_phi0][0] =  0.;
00237     ddflct[NeutParams::_s0][0] =  0.;
00238     ddflct[NeutParams::_z0][0] = 1.0/cosd;
00239     break;
00240   case theta2:
00241     ddflct[NeutParams::_p][0] = 0;
00242     ddflct[NeutParams::_tanDip][0] = 0;
00243     ddflct[NeutParams::_d0][0] = 1.0;
00244     ddflct[NeutParams::_phi0][0] = 0.0;
00245     ddflct[NeutParams::_z0][0] = 0.;
00246     ddflct[NeutParams::_s0][0] =  0.;
00247     break;
00248   }
00249   return ddflct;
00250 }

HepMatrix NeutTraj::derivPFract ( double  fltlen  )  const [virtual]

Implements TrkKalDeriv.

Definition at line 253 of file NeutTraj.cxx.

References NeutParams::_d0, NeutParams::_nneutprm, NeutParams::_p, NeutParams::_phi0, NeutParams::_s0, NeutParams::_tanDip, NeutParams::_z0, and p().

00254 {
00255 //  This function computes the column matrix of derivatives for the change
00256 //  in parameters from a (fractional) change in the track momentum,
00257 //  holding the direction and position constant.  The momentum change can
00258 //  come from energy loss or bfield inhomogeneities.
00259 //
00260 //  For a helix, dp/P = -domega/omega,
00261 //  dParam/d(domega/omega) = -omega*dParam/ddomega
00262 //
00263   HepMatrix dmomfrac(NeutParams::_nneutprm,1);
00264 
00265 //  Go through the parameters
00266   dmomfrac[NeutParams::_p][0] = p(); // momentum
00267   dmomfrac[NeutParams::_tanDip][0] = 0.0; // tanDip
00268   dmomfrac[NeutParams::_d0][0] = 0.0; // d0
00269   dmomfrac[NeutParams::_phi0][0] = 0.0; // phi0
00270   dmomfrac[NeutParams::_z0][0] = 0.0; // z0
00271   dmomfrac[NeutParams::_s0][0] = 0.0; // s0
00272   return dmomfrac;
00273 }

double NeutTraj::dip (  )  const [inline, private]

Definition at line 97 of file NeutTraj.h.

References tanDip().

00097 {return atan(tanDip());}

Hep3Vector NeutTraj::direction ( double  fltLen  )  const [virtual]

Implements Trajectory.

Definition at line 86 of file NeutTraj.cxx.

References cos(), cosDip(), phi0(), sin(), and sinDip().

Referenced by getInfo().

00086                                    {
00087 //-----------------------------------------------------------------
00088   return Hep3Vector ( cos(phi0())*cosDip(), sin(phi0())*cosDip(),
00089                                sinDip() );
00090 }

double Trajectory::distTo0thError ( double  s,
double  tol,
int  pathDir 
) const [inherited]

Definition at line 51 of file Trajectory.cxx.

00052 {
00053   return fabs(tolerance);
00054 }

double NeutTraj::distTo1stError ( double  s,
double  tol,
int  pathDir 
) const [virtual]

Implements Trajectory.

Definition at line 100 of file NeutTraj.cxx.

00100                                                        {
00101 //-----------------------------------------------------------------
00102   return 9999.;
00103 }

double NeutTraj::distTo2ndError ( double  s,
double  tol,
int  pathDir 
) const [virtual]

Implements Trajectory.

Definition at line 107 of file NeutTraj.cxx.

00107                                                        {
00108 //-----------------------------------------------------------------
00109   return 9999.;
00110 }

void NeutTraj::getDFInfo ( double  fltLen,
DifPoint ,
DifVector dir,
DifVector delDir 
) const [virtual]

Implements TrkDifTraj.

Definition at line 132 of file NeutTraj.cxx.

References NeutParams::_d0, NeutParams::_nneutprm, NeutParams::_p, NeutParams::_phi0, NeutParams::_s0, NeutParams::_tanDip, NeutParams::_z0, DifNumber::cosAndSin(), d0(), p(), TrkSimpTraj::parameters(), phi0(), boss::pos, DifNumber::setIndepPar(), tanDip(), x(), y(), z(), and z0().

00134 {
00135   //Provides difNum version of information for calculation of derivatives.
00136   //  Some of this duplicate code could be reduced if we had member 
00137   //  function templates.  Maybe.
00138 
00139   // Create difNumber versions of parameters
00140   //enum index (phi0(), etc) is from HelixParams.hh
00141   DifNumber phi0Df(phi0(), NeutParams::_phi0+1, NeutParams::_nneutprm);
00142   DifNumber d0Df(d0(), NeutParams::_d0+1, NeutParams::_nneutprm);
00143   DifNumber z0Df(z0(), NeutParams::_z0+1, NeutParams::_nneutprm);
00144   DifNumber tanDipDf(tanDip(), NeutParams::_tanDip+1, NeutParams::_nneutprm);
00145   DifNumber pDf(p(), NeutParams::_p+1, NeutParams::_nneutprm);
00146   // RF 03/25/99
00147   // the flight lenght has an error, which is the error along the trajectory 
00148   // in the creation point
00149   DifNumber s0Df(flt, NeutParams::_s0+1, NeutParams::_nneutprm);
00150   phi0Df.setIndepPar( parameters() );
00151   d0Df.setIndepPar( parameters() );
00152   z0Df.setIndepPar( parameters() );
00153   tanDipDf.setIndepPar( parameters() );
00154   pDf.setIndepPar( parameters() );
00155   s0Df.setIndepPar( parameters() );
00156   DifNumber dipDf = atan(tanDipDf);
00157 
00158   DifNumber sDip, cDip;
00159   dipDf.cosAndSin(cDip, sDip);
00160   DifNumber sinPhi0, cosPhi0;
00161   phi0Df.cosAndSin(cosPhi0, sinPhi0);
00162 
00163   DifNumber x =  cDip*s0Df*cosPhi0 - d0Df*sinPhi0;
00164   DifNumber y =  cDip*s0Df*sinPhi0 + d0Df*cosPhi0;
00165   DifNumber z =  z0Df + s0Df*sDip ;
00166   pos =  DifPoint(x, y, z);
00167   dir = DifVector( cosPhi0*cDip, sinPhi0*cDip, sDip );
00168   delDir = DifVector(0., 0., 0.);
00169 }

void TrkDifTraj::getDFInfo2 ( double  fltLen,
DifPoint pos,
DifVector direction 
) const [virtual, inherited]

Reimplemented in HelixTraj, TrkDifPieceTraj, and TrkCircleTraj.

Definition at line 25 of file TrkDifTraj.cxx.

References Trajectory::direction(), TrkDifTraj::getDFInfo(), and boss::pos.

Referenced by TrkDifPoca::calcDist(), TrkRep::directionErr(), TrkCompTrk::directionErr(), TrkDifPieceTraj::getDFInfo2(), TrkRep::positionErr(), and TrkCompTrk::positionErr().

00025                                                                                {
00026   // Slow default implementation.  Override in subclasses where speed matters
00027   DifVector dummy;
00028   getDFInfo(fltLen, pos, direction, dummy);
00029 }

void NeutTraj::getInfo ( double  fltLen,
HepPoint3D ,
Hep3Vector &  dir,
Hep3Vector &  delDir 
) const [virtual]

Implements Trajectory.

Definition at line 113 of file NeutTraj.cxx.

References delDirect(), direction(), and position().

00115 {
00116   // This could be made much more efficient!!!!!!
00117   pos = position(fltLen);
00118   dir = direction(fltLen);
00119   delDir = delDirect(fltLen);
00120 }

void NeutTraj::getInfo ( double  fltLen,
HepPoint3D pos,
Hep3Vector &  dir 
) const [virtual]

Implements Trajectory.

Definition at line 123 of file NeutTraj.cxx.

References direction(), and position().

00124 {
00125   //  This could be made much more efficient!!!!!
00126   pos = position(fltLen);
00127   dir = direction(fltLen);
00128   return;
00129 }

double Trajectory::hiRange (  )  const [inline, inherited]

Definition at line 92 of file Trajectory.h.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), MdcUtilitySvc::docaPatPar(), TrkRep::endValidRange(), TrkCompTrk::endValidRange(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), TrkDifPieceTraj::locallyValid(), MdcHitOnTrack::MdcHitOnTrack(), TrkSimpTraj::operator==(), TrkDifPieceTraj::prepend(), and Trajectory::range().

00092 {return flightrange[1];}

TrkSimpTraj& NeutTraj::invert (  ) 

Reimplemented from TrkSimpTraj.

void NeutTraj::invertParams ( TrkParams newparams,
std::vector< bool > &  flags 
) const [virtual]

Implements TrkSimpTraj.

Definition at line 338 of file NeutTraj.cxx.

00339 {
00340   assert(1==0);
00341 
00342 //  // Inverts parameters and returns true if the parameter inversion
00343 //  // requires a change in sign of elements in the covariance matrix
00344 //
00345 //  for (unsigned iparam = 0; iparam < NeutParams::_nneutprm; iparam++) {
00346 //    switch ( iparam ) {
00347 //    case NeutParams::_d0:  // changes sign
00348 //    case NeutParams::_tanDip:  // changes sign
00349 //      newparams->parameter()[iparam] *= -1.0;
00350 //      flags[iparam] = true;
00351 //      break;
00352 //    case NeutParams::_phi0:  // changes by pi, but covariance
00353 //                             // matrix shouldn't changed
00354 //      newparams->parameter()[iparam] =
00355 //      BesAngle(newparams->parameter()[iparam] + Constants::pi);
00356 //      flags[iparam] = false;
00357 //      break;
00358 //    case NeutParams::_p:  // no change sign
00359 //    case NeutParams::_z0:  // no change
00360 //      flags[iparam] = false;
00361 //    }
00362 //  }
00363 //  return;
00364 }

const TrkSimpTraj * TrkSimpTraj::localTrajectory ( double  fltLen,
double &  localFlt 
) const [virtual, inherited]

Implements TrkDifTraj.

Definition at line 59 of file TrkSimpTraj.cxx.

00059                                                                   {
00060 //----------------------------------------------------------------------------
00061   localFlt = fltLen;
00062   return this;
00063 }

double Trajectory::lowRange (  )  const [inline, inherited]

Definition at line 91 of file Trajectory.h.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), MdcUtilitySvc::docaPatPar(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), TrkDifPieceTraj::locallyValid(), MdcHitOnTrack::MdcHitOnTrack(), TrkSimpTraj::operator==(), TrkDifPieceTraj::prepend(), Trajectory::range(), TrkRep::startValidRange(), TrkCompTrk::startValidRange(), TrkDifPieceTraj::trajIndex(), and TrkDifPieceTraj::TrkDifPieceTraj().

00091 {return flightrange[0];}

int NeutTraj::nPar (  )  const [inline, virtual]

Reimplemented from TrkSimpTraj.

Definition at line 57 of file NeutTraj.h.

References DifIndepPar::nPar(), and params().

00057 {return params().nPar();}

NeutTraj & NeutTraj::operator= ( const NeutTraj  ) 

Definition at line 36 of file NeutTraj.cxx.

References TrkSimpTraj::_dtparams, _np(), and Trajectory::flightrange.

00037 {
00038   if( &n != this ){
00039     for(int iend=0;iend<2;iend++)
00040       flightrange[iend] = n.flightrange[iend];
00041     _dtparams = *n._np();
00042   }
00043   return *this;
00044 }

bool TrkSimpTraj::operator== ( const TrkSimpTraj  )  const [inherited]

Definition at line 156 of file TrkSimpTraj.cxx.

References TrkSimpTraj::_dtparams, TrkSimpTraj::_refpoint, Trajectory::hiRange(), genRecEmupikp::i, Trajectory::lowRange(), mp, DifIndepPar::parameter(), and x.

00157 {
00158      if (lowRange()!=x.lowRange() || hiRange()!=x.hiRange()) return false;
00159      const HepVector &m=_dtparams.parameter(); 
00160      unsigned int mp=m.num_row();
00161      const HepVector &n=x._dtparams.parameter(); 
00162      unsigned int np=n.num_row();
00163      if (np!=mp) return false;
00164      for(unsigned i=0;i<np;++i){
00165         if(m[i] != n[i]) return false;
00166      }
00167      return _refpoint==x._refpoint;
00168 }

double NeutTraj::p (  )  const [inline, private]

Definition at line 93 of file NeutTraj.h.

References _np(), and NeutParams::p().

Referenced by derivPFract(), and getDFInfo().

00093 {return _np()->p(); }

const TrkParams* TrkSimpTraj::parameters (  )  const [inline, inherited]

Definition at line 81 of file TrkSimpTraj.h.

References TrkSimpTraj::_dtparams.

00081 {return &_dtparams;}

TrkParams* TrkSimpTraj::parameters (  )  [inline, inherited]

Definition at line 80 of file TrkSimpTraj.h.

References TrkSimpTraj::_dtparams.

Referenced by TrkMomCalculator::calcCurvAllCovs(), TrkMomCalculator::calcCurvAllWeights(), TrkMomCalculator::calcNeutAllCovs(), TrkMomCalculator::calcNeutAllWeights(), TrkMomCalculator::calcNeutErrMom(), TrkMomCalculator::calcNeutPosmomCov(), TrkSimpTraj::changePoint(), TrkMomCalculator::charge(), TrkDifLineTraj::d0(), TrkCircleTraj::d0(), HelixTraj::d0(), TrkHelixFitter::fit(), TrkDifLineTraj::getDFInfo(), TrkCircleTraj::getDFInfo(), getDFInfo(), HelixTraj::getDFInfo(), TrkCircleTraj::getDFInfo2(), HelixTraj::getDFInfo2(), HelixTraj::getInfo(), TrkLineRep::helix(), TrkHelixRep::helix(), TrkCircleRep::helix(), HelixTraj::HelixTraj(), TrkSimpTraj::invert(), TrkSimpleRep::nDof(), TrkSimpTraj::nPar(), TrkCircleTraj::omega(), HelixTraj::omega(), TrkDifLineTraj::phi0(), TrkCircleTraj::phi0(), HelixTraj::phi0(), HelixTraj::position(), TrkMomCalculator::ptMom(), TrkHelixRep::resid(), TrkDifLineTraj::tanDip(), HelixTraj::tanDip(), TrkCircleTraj::TrkCircleTraj(), TrkDifLineTraj::TrkDifLineTraj(), TrkHitOnTrk::TrkHitOnTrk(), TrkMomCalculator::vecMom(), TrkDifLineTraj::z0(), and HelixTraj::z0().

00080 {return &_dtparams;}

void NeutTraj::paramFunc ( const HepPoint3D oldpoint,
const HepPoint3D newpoint,
const HepVector &  oldpar,
const HepSymMatrix &  oldcov,
HepVector &  newpar,
HepSymMatrix &  newcov,
double  fltlen 
) [static, private]

Definition at line 283 of file NeutTraj.cxx.

References NeutParams::_d0, NeutParams::_nneutprm, NeutParams::_p, NeutParams::_phi0, NeutParams::_s0, NeutParams::_tanDip, NeutParams::_z0, cos(), and sin().

Referenced by paramFunction().

00287 {
00288 
00289 // copy the input parameter vector, in case the input and output are the same
00290   HepVector parvec(oldvec);
00291 // start with the input: momentum and tandip don't change
00292   newvec = parvec;
00293 //
00294   double delx = newpoint.x()-oldpoint.x();
00295   double dely = newpoint.y()-oldpoint.y();
00296   double delz = newpoint.z()-oldpoint.z();
00297 //  
00298   double cos0 = cos(parvec[NeutParams::_phi0]);
00299   double sin0 = sin(parvec[NeutParams::_phi0]);
00300   double perp = delx*sin0-dely*cos0;
00301   double para = delx*cos0+dely*sin0;
00302   double tand = parvec[NeutParams::_tanDip];
00303 // delta
00304 // assume delta, newdelta have the same sign
00305 // d0
00306   newvec[NeutParams::_d0] = parvec[NeutParams::_d0] + perp;
00307 // phi0; check that we don't get the wrong wrapping
00308   newvec[NeutParams::_phi0] = parvec[NeutParams::_phi0];
00309 //z0   
00310   newvec[NeutParams::_z0] += 
00311     parvec[NeutParams::_tanDip]*(delx/cos0)*(1.+(sin0/cos0)) - delz;
00312 // now covariance: first, compute the rotation matrix
00313   HepMatrix covrot(NeutParams::_nneutprm,NeutParams::_nneutprm,0); // start with 0: lots of terms are zero
00314 //
00315 // momentum is diagonal
00316   covrot[NeutParams::_p][NeutParams::_p] = 1.0;
00317 // tandip is diagonal
00318   covrot[NeutParams::_tanDip][NeutParams::_tanDip] = 1.0;
00319 // d0
00320   covrot[ NeutParams::_d0][ NeutParams::_d0] = 1.;
00321   covrot[ NeutParams::_d0][ NeutParams::_phi0] = para;
00322 // phi0
00323   covrot[ NeutParams::_phi0][ NeutParams::_p] = para;
00324   covrot[ NeutParams::_phi0][ NeutParams::_phi0] = 1.;
00325 // z0
00326   covrot[ NeutParams::_z0][ NeutParams::_phi0] = tand*-2.*perp;
00327   covrot[ NeutParams::_z0][ NeutParams::_tanDip] = 
00328                                       (delx/cos0)*(1.+(sin0/cos0));
00329   covrot[ NeutParams::_z0][ NeutParams::_z0] = 1.0;  
00330   covrot[ NeutParams::_s0][ NeutParams::_s0] = 1.0;  
00331 //  
00332 //  Apply the rotation
00333   newcov = oldcov.similarity(covrot);
00334 // done
00335 }

TranslateParams NeutTraj::paramFunction (  )  const [inline, virtual]

Implements TrkSimpTraj.

Definition at line 67 of file NeutTraj.h.

References paramFunc().

00067 { return NeutTraj::paramFunc; }

const NeutParams& NeutTraj::params (  )  const [inline]

Definition at line 55 of file NeutTraj.h.

References _np().

00055 {return *_np();}

NeutParams& NeutTraj::params (  )  [inline]

Definition at line 54 of file NeutTraj.h.

References _np().

Referenced by nPar().

00054 {return *_np();}

double NeutTraj::phi0 (  )  const [private]

Definition at line 277 of file NeutTraj.cxx.

References _np().

Referenced by direction(), getDFInfo(), position(), x(), and y().

00278 {
00279   return BesAngle(_np()->phi0()).rad();
00280 }

HepPoint3D NeutTraj::position ( double  fltLen  )  const [virtual]

Implements Trajectory.

Definition at line 73 of file NeutTraj.cxx.

References cos(), cosDip(), d0(), phi0(), sin(), tanDip(), and z0().

Referenced by getInfo().

00073                                   {
00074 //-----------------------------------------------------------------
00075   double cdip = cosDip();
00076   double sphi0 = sin(phi0());
00077   double cphi0 = cos(phi0());
00078 
00079   return HepPoint3D(cdip * f * cphi0 - d0()*sphi0, 
00080                   cdip * f * sphi0 + d0()*cphi0, 
00081                   z0() + f * tanDip() * cdip);
00082 }

virtual void TrkSimpTraj::print ( std::ostream os  )  const [virtual, inherited]

Reimplemented from Trajectory.

Reimplemented in HelixTraj.

virtual void TrkSimpTraj::printAll ( std::ostream os  )  const [virtual, inherited]

Reimplemented from Trajectory.

Reimplemented in HelixTraj.

double Trajectory::range (  )  const [inline, inherited]

Definition at line 93 of file Trajectory.h.

References Trajectory::hiRange(), and Trajectory::lowRange().

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), and TrkDifPieceTraj::prepend().

00093 { return hiRange()-lowRange(); }

const HepPoint3D& TrkSimpTraj::referencePoint (  )  const [inline, inherited]

Definition at line 84 of file TrkSimpTraj.h.

References TrkSimpTraj::_refpoint.

Referenced by TrkDifLineTraj::getDFInfo(), TrkCircleTraj::getDFInfo(), HelixTraj::getDFInfo(), TrkCircleTraj::getDFInfo2(), HelixTraj::getDFInfo2(), TrkCircleTraj::getInfo(), HelixTraj::getInfo(), TrkDifLineTraj::position(), TrkCircleTraj::position(), HelixTraj::position(), TrkDifLineTraj::x(), TrkCircleTraj::x(), TrkDifLineTraj::y(), TrkCircleTraj::y(), TrkDifLineTraj::z(), and HelixTraj::z().

00084 {return _refpoint;}

double NeutTraj::s0 (  )  const [inline, private]

Definition at line 95 of file NeutTraj.h.

References _np(), and NeutParams::s0().

00095 {return _np()->s0(); }

void Trajectory::setFlightRange ( double  newrange[2]  )  [virtual, inherited]

Reimplemented in TrkDifPieceTraj.

Definition at line 57 of file Trajectory.cxx.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::append(), TrkSimpTraj::changePoint(), TrkSimpTraj::invert(), TrkDifPieceTraj::invert(), TrkDifPieceTraj::prepend(), and TrkDifPieceTraj::TrkDifPieceTraj().

00058 {
00059   if (newrange[1] >= newrange[0]) {
00060     flightrange[0] = newrange[0];
00061     flightrange[1] = newrange[1];
00062   } else {
00063     std::cout<<"ErrMsg(error) "<< "Invalid Trajectory range requested." << std::endl;
00064     flightrange[0] = newrange[1];
00065     flightrange[1] = newrange[0];
00066   }
00067 }

void TrkSimpTraj::setPoint ( const HepPoint3D newpoint  )  [inline, inherited]

Definition at line 96 of file TrkSimpTraj.h.

References TrkSimpTraj::_refpoint.

00096 {_refpoint = newpoint;}

double NeutTraj::sinDip (  )  const [inline, private]

Definition at line 99 of file NeutTraj.h.

References cosDip(), and tanDip().

Referenced by direction(), and z().

00099 {return tanDip()*cosDip(); }

double NeutTraj::tanDip (  )  const [inline, private]

Definition at line 96 of file NeutTraj.h.

References _np(), and NeutParams::tanDip().

Referenced by cosDip(), derivDeflect(), dip(), getDFInfo(), position(), and sinDip().

00096 {  return _np()->tanDip(); }

double NeutTraj::translen ( const double &  f  )  const [inline, private]

Definition at line 100 of file NeutTraj.h.

References cosDip().

Referenced by derivDeflect().

00100 {return cosDip()*f;}

bool Trajectory::validFlightDistance ( double  f,
double  tolerance = 0.0 
) const [inline, inherited]

Definition at line 88 of file Trajectory.h.

References Trajectory::flightrange.

Referenced by TrkDifPieceTraj::trajIndex().

00088                                                                      {
00089   return f >= flightrange[0]-tol && f <= flightrange[1]+tol; 
00090 }

void NeutTraj::visitAccept ( TrkVisitor vis  )  const [virtual]

Implements TrkSimpTraj.

Definition at line 367 of file NeutTraj.cxx.

References TrkVisitor::trkVisitNeutTraj().

00368 {
00369 // Visitor access--just use the Visitor class member function
00370   vis->trkVisitNeutTraj(this);
00371 }

double NeutTraj::x ( const double &   )  const [private]

Definition at line 52 of file NeutTraj.cxx.

References cos(), cosDip(), d0(), phi0(), and sin().

Referenced by getDFInfo().

00052                                    {
00053 //-----------------------------------------------------------------
00054   return cosDip()*f*cos(phi0()) - d0()*sin(phi0());
00055 }

double NeutTraj::y ( const double &   )  const [private]

Definition at line 59 of file NeutTraj.cxx.

References cos(), cosDip(), d0(), phi0(), and sin().

Referenced by getDFInfo().

00059                                    {
00060 //-----------------------------------------------------------------
00061   return cosDip()*f*sin(phi0()) + d0()*cos(phi0());
00062 }

double NeutTraj::z ( const double &   )  const [private]

Definition at line 66 of file NeutTraj.cxx.

References sinDip(), and z0().

Referenced by getDFInfo().

00066                                  {
00067 //-----------------------------------------------------------------
00068   return (z0() + f*sinDip());
00069 }

double NeutTraj::z0 (  )  const [inline, private]

Definition at line 94 of file NeutTraj.h.

References _np(), and NeutParams::z0().

Referenced by getDFInfo(), position(), and z().

00094 {return _np()->z0(); }


Member Data Documentation

TrkParams TrkSimpTraj::_dtparams [protected, inherited]

Definition at line 117 of file TrkSimpTraj.h.

Referenced by _np(), TrkSimpTraj::changePoint(), TrkDifLineTraj::operator=(), TrkCircleTraj::operator=(), operator=(), HelixTraj::operator=(), TrkSimpTraj::operator==(), and TrkSimpTraj::parameters().

HepPoint3D TrkSimpTraj::_refpoint [protected, inherited]

Definition at line 118 of file TrkSimpTraj.h.

Referenced by TrkSimpTraj::changePoint(), TrkDifLineTraj::operator=(), TrkCircleTraj::operator=(), HelixTraj::operator=(), TrkSimpTraj::operator==(), TrkSimpTraj::referencePoint(), and TrkSimpTraj::setPoint().

HepPoint3D TrkSimpTraj::_theOrigin [static, inherited]

Definition at line 59 of file TrkSimpTraj.h.

double Trajectory::flightrange[2] [protected, inherited]

Definition at line 83 of file Trajectory.h.

Referenced by TrkDifPieceTraj::append(), Trajectory::hiRange(), Trajectory::lowRange(), TrkDifPieceTraj::operator=(), operator=(), Trajectory::operator=(), MdcSagTraj::operator=(), TrkDifPieceTraj::prepend(), TrkDifPieceTraj::resize(), TrkDifPieceTraj::setFlightRange(), Trajectory::setFlightRange(), Trajectory::Trajectory(), TrkDifPieceTraj::TrkDifPieceTraj(), and Trajectory::validFlightDistance().


Generated on Tue Nov 29 23:20:38 2016 for BOSS_7.0.2 by  doxygen 1.4.7