CMS 3D CMS Logo

Public Member Functions | Private Attributes

cms::HICMuonPropagator Class Reference

#include <HICMuonPropagator.h>

Inheritance diagram for cms::HICMuonPropagator:
Propagator

List of all members.

Public Member Functions

virtual HICMuonPropagatorclone () const
 HICMuonPropagator (const MagneticField *mf)
virtual const MagneticFieldmagneticField () const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Plane &plane) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Surface &surface) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Cylinder &cylin) const
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &state, const Cylinder &bc) const
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &state, const Plane &bc) const
void setHICConst (HICConst *hh)
virtual ~HICMuonPropagator ()

Private Attributes

const MagneticFieldfield
HICConsttheHICConst

Detailed Description

Definition at line 12 of file HICMuonPropagator.h.


Constructor & Destructor Documentation

cms::HICMuonPropagator::HICMuonPropagator ( const MagneticField mf) [inline]

Definition at line 14 of file HICMuonPropagator.h.

References field.

Referenced by clone().

{field = mf;}
virtual cms::HICMuonPropagator::~HICMuonPropagator ( ) [inline, virtual]

Definition at line 15 of file HICMuonPropagator.h.

{}

Member Function Documentation

virtual HICMuonPropagator* cms::HICMuonPropagator::clone ( void  ) const [inline, virtual]

Implements Propagator.

Definition at line 24 of file HICMuonPropagator.h.

References field, and HICMuonPropagator().

  {
    return new HICMuonPropagator(field);
  }
virtual const MagneticField* cms::HICMuonPropagator::magneticField ( ) const [inline, virtual]

Implements Propagator.

Definition at line 45 of file HICMuonPropagator.h.

References field.

{return field;}
TrajectoryStateOnSurface cms::HICMuonPropagator::propagate ( const FreeTrajectoryState fts,
const Plane plane 
) const [virtual]

Implements Propagator.

Definition at line 76 of file HICMuonPropagator.cc.

References a, b, FreeTrajectoryState::charge(), funct::cos(), gather_cfg::cout, FreeTrajectoryState::curvilinearError(), alignCSCRings::e, field, CurvilinearTrajectoryError::matrix(), GlobalTrajectoryParameters::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), GlobalTrajectoryParameters::position(), funct::sin(), PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

  {


//
//  Check if it is detector or layer 
//  if(surface.position().perp()>0.000001) {
//  HICTrajectoryCorrector* theNewPropagator = new HICTrajectoryCorrector();
//  TrajectoryStateOnSurface tsos = theCorrector->propagate(fts,surface);
//  delete theNewPropagator;
//  return tsos;
//  } else {
//  Check if it is forward pixel detector
// if(abs(surface.position().z())>0. && abs(surface.position().z())<50.) {
//  GtfPropagator* theNewPropagator = new GtfPropagator(oppositeToMomentum);
//  TrajectoryStateOnSurface tsos = theCorrector->propagate(fts,surface);
//  delete theNewPropagator;
//  return tsos;
// }
// }
//
  double dfcalc,phnext,rdet;
  
#ifdef MUPROPAGATOR_DEBUG
    cout<<"MuPropagator::Start propagation"<<endl;
#endif
// Information from previous layer
//
  GlobalPoint x = fts.parameters().position();
  GlobalVector p = fts.parameters().momentum();
  double px = p.x(); double py = p.y(); double pz = p.z();
  double aCharge = fts.charge();
  AlgebraicSymMatrix55 e = fts.curvilinearError().matrix();
  double phiold=x.phi();
  if(x.phi()<0.) phiold=twopi+x.phi();

#ifdef MUPROPAGATOR_DEBUG  
  cout<< "MuPropagator::xold=" << x<<" p= "<<p<<endl;
#endif  

    double a = p.perp()/pz;
    double b = x.perp()-a*x.z();
    
#ifdef MUPROPAGATOR_DEBUG  
  cout<<"MuPropagator::Propagate to disk="<<surface.position().z()<<" pz="<<pz<<
  " line parameters="<<a<<" "<<b<<endl;
#endif 
 
// Propagate on surface:phidet
//
  dfcalc = aCharge*0.006*fabs(x.z()-surface.position().z())/fabs(pz);
  phnext = phiold+dfcalc;
  
  if(phnext>twopi) phnext = phnext-twopi;
  if(phnext<0.) phnext = phnext+twopi;
  
// Propagate Zdet
//
  rdet = a*surface.position().z()-b;
  
// New state
  GlobalPoint xnew(rdet*cos(phnext),rdet*sin(phnext),surface.position().z());
  GlobalVector pnew(px*cos(dfcalc)-py*sin(dfcalc),px*sin(dfcalc)+py*cos(dfcalc),pz);
  
#ifdef MUPROPAGATOR_DEBUG
  cout<< "MuPropagator::phiold,phnext,zdet,charge,dfcalc="
  <<phiold<<" "<<phnext<<" "<<
  surface.position().z()<<" "<<aCharge<<" "<<dfcalc<<endl;
  cout<<"New coordinates="<<xnew<<endl;
  cout<<"New momentum="<<pnew<<endl;
#endif  

  TrajectoryStateOnSurface tsos(
                                 GlobalTrajectoryParameters(xnew, pnew, (int)aCharge, field),
                                 CurvilinearTrajectoryError(e),
                                 surface);
     return tsos;
  }
TrajectoryStateOnSurface cms::HICMuonPropagator::propagate ( const FreeTrajectoryState fts,
const Cylinder cylin 
) const [virtual]

Implements Propagator.

Definition at line 19 of file HICMuonPropagator.cc.

References a, b, FreeTrajectoryState::charge(), funct::cos(), gather_cfg::cout, FreeTrajectoryState::curvilinearError(), alignCSCRings::e, field, CurvilinearTrajectoryError::matrix(), GlobalTrajectoryParameters::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GlobalTrajectoryParameters::position(), Cylinder::radius(), funct::sin(), theHICConst, PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and cms::HICConst::zvert.

Referenced by propagate().

  {
#ifdef MUPROPAGATOR_DEBUG
    cout<<"MuPropagator::Start propagation"<<endl;
#endif
// From FreeTrajectoryState to the vertex.

  GlobalPoint x = fts.parameters().position();
  GlobalVector p = fts.parameters().momentum();
  double px = p.x(); double py = p.y(); double pz = p.z();
  double aCharge = fts.charge();
  AlgebraicSymMatrix55 e = fts.curvilinearError().matrix();
  double dfcalc,phnext,zdet;
//  double pt = p.perp();
  double a = p.perp()/pz;

  double b = -a*theHICConst->zvert; 
 
  double phiold=x.phi();
  if(x.phi()<0.) phiold=twopi+x.phi();
    
#ifdef MUPROPAGATOR_DEBUG  
  cout<< "MuPropagator::xold=" << x<<" p="<<p<<endl;
  cout<<"MuPropagator::Propagate to cylinder="<<surface.radius()<<" pt="<<pt<<
  " line parameters="<<a<<" "<<b<<endl;
#endif 
 
// Propagate on surface:phidet

  dfcalc = aCharge*0.006*fabs(x.perp()-surface.radius())/p.perp();
  phnext = phiold+dfcalc;

  if(phnext>twopi) phnext = phnext-twopi;
  if(phnext<0.) phnext = phnext+twopi;
  
// Propagate Zdet

  zdet = (surface.radius()-b)/a;
  
// New state
  GlobalPoint xnew(surface.radius()*cos(phnext),surface.radius()*sin(phnext),zdet);
  GlobalVector pnew(px*cos(dfcalc)-py*sin(dfcalc),px*sin(dfcalc)+py*cos(dfcalc),pz);
#ifdef MUPROPAGATOR_DEBUG
  cout<< "almost empty propagator for the moment phnext,zdet="<<phnext<<" "<<zdet<<endl;
  cout<<"New coordinates="<<xnew<<endl;
  cout<<"New momentum="<<pnew<<endl;
#endif  

  TrajectoryStateOnSurface tsos(
                                 GlobalTrajectoryParameters(xnew, pnew, (int)aCharge, field),
                                 CurvilinearTrajectoryError(e), surface
                                 );
     return tsos;
  }
TrajectoryStateOnSurface cms::HICMuonPropagator::propagate ( const FreeTrajectoryState state,
const Surface sur 
) const [inline, virtual]

Propagate from a free state (e.g. position and momentum in in global cartesian coordinates) to a surface. Only use the generic method if the surface type (plane or cylinder) is not known at the calling point.

Reimplemented from Propagator.

Definition at line 29 of file HICMuonPropagator.h.

References propagate().

                                                                   {
    return Propagator::propagate( fts, surface);
  }
virtual std::pair< TrajectoryStateOnSurface, double> cms::HICMuonPropagator::propagateWithPath ( const FreeTrajectoryState state,
const Cylinder bc 
) const [inline, virtual]

Implements Propagator.

Definition at line 40 of file HICMuonPropagator.h.

                                                                                {
  std::pair<TrajectoryStateOnSurface,double> tp;
    return tp;
  }  
virtual std::pair< TrajectoryStateOnSurface, double> cms::HICMuonPropagator::propagateWithPath ( const FreeTrajectoryState state,
const Plane bc 
) const [inline, virtual]

Implements Propagator.

Definition at line 35 of file HICMuonPropagator.h.

                                                                              {
  std::pair<TrajectoryStateOnSurface,double> tp;
    return tp;
  }
void cms::HICMuonPropagator::setHICConst ( HICConst hh) [inline]

Definition at line 22 of file HICMuonPropagator.h.

References theHICConst.

{theHICConst = hh;}

Member Data Documentation

Definition at line 48 of file HICMuonPropagator.h.

Referenced by clone(), HICMuonPropagator(), magneticField(), and propagate().

Definition at line 47 of file HICMuonPropagator.h.

Referenced by propagate(), and setHICConst().