CMS 3D CMS Logo

SmartPropagator Class Reference

A propagator which use different algorithm to propagate inside or outside tracker. More...

#include <TrackingTools/GeomPropagators/interface/SmartPropagator.h>

Inheritance diagram for SmartPropagator:

Propagator

List of all members.

Public Member Functions

virtual SmartPropagatorclone () const
 Virtual constructor (using copy c'tor).
PropagatorgetGenPropagator () const
 return the propagator used outside tracker
PropagatorgetTkPropagator () const
 return the propagator used inside tracker
bool insideTkVol (const Plane &plane) const
 true if a plane is inside tracker volume
bool insideTkVol (const BoundCylinder &cylin) const
 true if a cylinder is inside tracker volume
bool insideTkVol (const Surface &surface) const
 true if a surface is inside tracker volume
bool insideTkVol (const FreeTrajectoryState &fts) const
 true if a fts is inside tracker volume
virtual const MagneticFieldmagneticField () const
 return the magneticField
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &tsos, const Cylinder &cylinder) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Cylinder &cylinder) const
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &tsos, const Plane &plane) const
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Plane &plane) const
TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface &tsos, const Surface &surface) const
 The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part.
TrajectoryStateOnSurface propagate (const FreeTrajectoryState &fts, const Surface &surface) const
 Propagate from a free state (e.g.
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &tsos, const Cylinder &cylinder) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &fts, const Cylinder &cylinder) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &tsos, const Plane &plane) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &fts, const Plane &plane) const
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const TrajectoryStateOnSurface &tsos, const Surface &surface) const
 The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part.
std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &fts, const Surface &surface) const
 The methods propagateWithPath() are identical to the corresponding methods propagate() in what concerns the resulting TrajectoryStateOnSurface, but they provide in addition the exact path length along the trajectory.
void setPropagationDirection (PropagationDirection dir)
 setting the direction fo both components
 SmartPropagator (const SmartPropagator &)
 Copy constructor.
 SmartPropagator (const Propagator &aTkProp, const Propagator &aGenProp, const MagneticField *field, PropagationDirection dir=alongMomentum, float epsilon=5)
 Defines which propagator is used inside Tk and which outside.
 SmartPropagator (Propagator *aTkProp, Propagator *aGenProp, const MagneticField *field, PropagationDirection dir=alongMomentum, float epsilon=5)
 Defines which propagator is used inside Tk and which outside.
virtual ~SmartPropagator ()
 virtual destructor

Static Private Member Functions

static void initTkVolume (float epsilon)
 build the tracker volume
static
ReferenceCountingPointer
< BoundCylinder > & 
theTkVolume ()

Private Attributes

const MagneticFieldtheField
PropagatortheGenProp
PropagatortheTkProp


Detailed Description

A propagator which use different algorithm to propagate inside or outside tracker.

Author:
Stefano Lacaprara - INFN Padova author Chang Liu - Purdue University $Date $ $Revision $
Modification: 26-Jun-2002 SL: theTkVolume is now a static ReferenceCountingPointer<BoundCylinder> 28-Aug-2002 SL: added methods to unhide Propagator methods 29-Oct-2002 SL: fixed clone and copy constructor, and BoundCylinder are build with CylinderBuilder to enforce the referencePointer

Definition at line 37 of file SmartPropagator.h.


Constructor & Destructor Documentation

SmartPropagator::SmartPropagator ( Propagator aTkProp,
Propagator aGenProp,
const MagneticField field,
PropagationDirection  dir = alongMomentum,
float  epsilon = 5 
)

Defines which propagator is used inside Tk and which outside.

Definition at line 43 of file SmartPropagator.cc.

References initTkVolume(), and theTkVolume().

Referenced by clone().

00044                                                                           :
00045   Propagator(dir), theTkProp(aTkProp->clone()), theGenProp(aGenProp->clone()), theField(field) { 
00046 
00047   if (theTkVolume()==0) initTkVolume(epsilon);
00048 
00049 }

SmartPropagator::SmartPropagator ( const Propagator aTkProp,
const Propagator aGenProp,
const MagneticField field,
PropagationDirection  dir = alongMomentum,
float  epsilon = 5 
)

Defines which propagator is used inside Tk and which outside.

Definition at line 52 of file SmartPropagator.cc.

References initTkVolume(), and theTkVolume().

00053                                                                           :
00054   Propagator(dir), theTkProp(aTkProp.clone()), theGenProp(aGenProp.clone()), theField(field) {
00055 
00056   if (theTkVolume()==0) initTkVolume(epsilon);
00057 
00058 }

SmartPropagator::SmartPropagator ( const SmartPropagator aProp  ) 

Copy constructor.

Definition at line 61 of file SmartPropagator.cc.

References Propagator::clone(), getGenPropagator(), getTkPropagator(), theGenProp, and theTkProp.

00061                                                              :
00062   Propagator(aProp.propagationDirection()), theTkProp(0), theGenProp(0) { 
00063     if (aProp.theTkProp)
00064       theTkProp=aProp.getTkPropagator()->clone();
00065     if (aProp.theGenProp)
00066       theTkProp=aProp.getGenPropagator()->clone();
00067 
00068     //SL since it's a copy constructor, then the TkVolume has been already
00069     //initialized
00070     //if (theTkVolume==0) initTkVolume(epsilon);
00071 
00072   }

SmartPropagator::~SmartPropagator (  )  [virtual]

virtual destructor

Definition at line 75 of file SmartPropagator.cc.

References theGenProp, and theTkProp.

00075                                   {
00076 
00077   delete theTkProp;
00078   delete theGenProp;
00079 
00080 }


Member Function Documentation

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

Virtual constructor (using copy c'tor).

Implements Propagator.

Definition at line 57 of file SmartPropagator.h.

References getGenPropagator(), getTkPropagator(), magneticField(), and SmartPropagator().

00057                                            {
00058       return new SmartPropagator(getTkPropagator(),getGenPropagator(),magneticField());
00059     }

Propagator * SmartPropagator::getGenPropagator (  )  const

return the propagator used outside tracker

Definition at line 204 of file SmartPropagator.cc.

References theGenProp.

Referenced by clone(), propagate(), propagateWithPath(), setPropagationDirection(), and SmartPropagator().

00204                                                     {
00205 
00206   return theGenProp;
00207 
00208 }

Propagator * SmartPropagator::getTkPropagator (  )  const

return the propagator used inside tracker

Definition at line 197 of file SmartPropagator.cc.

References theTkProp.

Referenced by clone(), propagate(), propagateWithPath(), setPropagationDirection(), and SmartPropagator().

00197                                                    {
00198 
00199   return theTkProp;
00200 
00201 }

void SmartPropagator::initTkVolume ( float  epsilon  )  [static, private]

build the tracker volume

Definition at line 84 of file SmartPropagator.cc.

References BoundCylinder::build(), TrackerBounds::halfLength(), TrackerBounds::radius(), radius(), rot, and theTkVolume().

Referenced by SmartPropagator().

00084                                                 {
00085 
00086   //
00087   // fill tracker dimensions
00088   //
00089   float radius = TrackerBounds::radius();
00090   float r_out  = radius + epsilon/2;
00091   float r_in   = r_out - epsilon;
00092   float z_max  = TrackerBounds::halfLength();
00093   float z_min  = - z_max;
00094 
00095   Surface::PositionType pos(0,0,0); // centered at the global origin
00096   Surface::RotationType rot; // unit matrix - barrel cylinder orientation
00097 
00098   theTkVolume() = BoundCylinder::build(pos, rot, radius, SimpleCylinderBounds(r_in, r_out, z_min, z_max));
00099 
00100 }

bool SmartPropagator::insideTkVol ( const Plane plane  )  const

true if a plane is inside tracker volume

Definition at line 186 of file SmartPropagator.cc.

References TrackerBounds::halfLength(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), TrackerBounds::radius(), and PV3DBase< T, PVType, FrameType >::z().

00186                                                             {
00187 
00188   GlobalPoint gp = plane.position();
00189 //  LocalPoint lp = theTkVolume()->toLocal(gp);
00190 //  return theTkVolume()->bounds().inside(lp);
00191   return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
00192 
00193 
00194 }

bool SmartPropagator::insideTkVol ( const BoundCylinder cylin  )  const

true if a cylinder is inside tracker volume

Definition at line 175 of file SmartPropagator.cc.

References BoundSurface::bounds(), TrackerBounds::halfLength(), Bounds::length(), PV3DBase< T, PVType, FrameType >::perp(), TrackerBounds::radius(), Cylinder::radius(), and PV3DBase< T, PVType, FrameType >::z().

00175                                                                     {
00176 
00177   GlobalPoint gp(cylin.radius(),0.,(cylin.bounds().length())/2.);
00178 //  LocalPoint lp = theTkVolume()->toLocal(gp);
00179 //  return theTkVolume()->bounds().inside(lp);
00180   return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
00181 
00182 
00183 }

bool SmartPropagator::insideTkVol ( const Surface surface  )  const

true if a surface is inside tracker volume

Definition at line 163 of file SmartPropagator.cc.

References TrackerBounds::halfLength(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), TrackerBounds::radius(), and PV3DBase< T, PVType, FrameType >::z().

00163                                                               {
00164 
00165   GlobalPoint gp = surface.position();
00166  // LocalPoint lp = theTkVolume()->toLocal(gp);
00167 
00168  // return theTkVolume()->bounds().inside(lp);
00169   return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
00170 
00171 
00172 }

bool SmartPropagator::insideTkVol ( const FreeTrajectoryState fts  )  const

true if a fts is inside tracker volume

Definition at line 153 of file SmartPropagator.cc.

References TrackerBounds::halfLength(), PV3DBase< T, PVType, FrameType >::perp(), FreeTrajectoryState::position(), TrackerBounds::radius(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by propagate(), and propagateWithPath().

00153                                                                       {
00154 
00155   GlobalPoint gp = fts.position();
00156 //  LocalPoint lp = theTkVolume()->toLocal(gp);
00157 //  return theTkVolume()->bounds().inside(lp);
00158 
00159   return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
00160 }

virtual const MagneticField* SmartPropagator::magneticField (  )  const [inline, virtual]

return the magneticField

Implements Propagator.

Definition at line 141 of file SmartPropagator.h.

References theField.

Referenced by clone().

00141 {return theField;}

TrajectoryStateOnSurface SmartPropagator::propagate ( const TrajectoryStateOnSurface tsos,
const Cylinder cylinder 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 90 of file SmartPropagator.h.

References Propagator::propagate().

00091                                                                        {
00092       return Propagator::propagate(tsos, cylinder);
00093     }

TrajectoryStateOnSurface SmartPropagator::propagate ( const FreeTrajectoryState fts,
const Cylinder cylinder 
) const [virtual]

Implements Propagator.

Definition at line 121 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagate().

00122                                                                                     {
00123   if (insideTkVol(fts) && insideTkVol(cylinder)) {
00124     return getTkPropagator()->propagate(fts, cylinder);
00125   } else {
00126     return getGenPropagator()->propagate(fts, cylinder);
00127   }
00128 
00129 }

TrajectoryStateOnSurface SmartPropagator::propagate ( const TrajectoryStateOnSurface tsos,
const Plane plane 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 82 of file SmartPropagator.h.

References Propagator::propagate().

00083                                                                  {
00084       return Propagator::propagate(tsos, plane);
00085     }

TrajectoryStateOnSurface SmartPropagator::propagate ( const FreeTrajectoryState fts,
const Plane plane 
) const [virtual]

Implements Propagator.

Definition at line 109 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagate().

00110                                                                               {
00111 
00112   if (insideTkVol(fts) && insideTkVol(plane)) {
00113     return getTkPropagator()->propagate(fts, plane);
00114   } else {
00115     return getGenPropagator()->propagate(fts, plane);
00116   }
00117 
00118 }

TrajectoryStateOnSurface SmartPropagator::propagate ( const TrajectoryStateOnSurface state,
const Surface sur 
) const [inline, virtual]

The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part.

It may help some concrete propagators. 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 74 of file SmartPropagator.h.

References Propagator::propagate().

00075                                                                      {
00076       return Propagator::propagate(tsos,surface);
00077     }

TrajectoryStateOnSurface SmartPropagator::propagate ( const FreeTrajectoryState state,
const Surface sur 
) const [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 103 of file SmartPropagator.cc.

References Propagator::propagate().

00104                                                                                   {
00105   return Propagator::propagate( fts, surface);
00106 }

std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface tsos,
const Cylinder cylinder 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 122 of file SmartPropagator.h.

References Propagator::propagateWithPath().

00123                                                         {
00124         return Propagator::propagateWithPath(tsos, cylinder);
00125       }

std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder cylinder 
) const [virtual]

Implements Propagator.

Definition at line 143 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagateWithPath().

00145 {
00146   if (insideTkVol(fts) && insideTkVol(cylinder)) {
00147     return getTkPropagator()->propagateWithPath(fts, cylinder);
00148   } else {
00149     return getGenPropagator()->propagateWithPath(fts, cylinder);
00150   }
00151 }

std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface tsos,
const Plane plane 
) const [inline, virtual]

Reimplemented from Propagator.

Definition at line 112 of file SmartPropagator.h.

References Propagator::propagateWithPath().

00113                                                   {
00114         return Propagator::propagateWithPath(tsos, plane);
00115       }

std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Plane plane 
) const [virtual]

Implements Propagator.

Definition at line 132 of file SmartPropagator.cc.

References getGenPropagator(), getTkPropagator(), insideTkVol(), and Propagator::propagateWithPath().

00134 {
00135   if (insideTkVol(fts) && insideTkVol(plane)) {
00136     return getTkPropagator()->propagateWithPath(fts, plane);
00137   } else {
00138     return getGenPropagator()->propagateWithPath(fts, plane);
00139   }
00140 }

std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface state,
const Surface sur 
) const [inline, virtual]

The following three methods are equivalent to the corresponding methods above, but if the starting state is a TrajectoryStateOnSurface, it's better to use it as such rather than use just the FreeTrajectoryState part.

It may help some concrete propagators. 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 102 of file SmartPropagator.h.

References Propagator::propagateWithPath().

00103                                                       {
00104         return Propagator::propagateWithPath(tsos,surface);
00105       }

std::pair<TrajectoryStateOnSurface,double> SmartPropagator::propagateWithPath ( const FreeTrajectoryState state,
const Surface sur 
) const [inline, virtual]

The methods propagateWithPath() are identical to the corresponding methods propagate() in what concerns the resulting TrajectoryStateOnSurface, but they provide in addition the exact path length along the trajectory.

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 96 of file SmartPropagator.h.

References Propagator::propagateWithPath().

00097                                                       {
00098         return Propagator::propagateWithPath(fts,surface);
00099       }

void SmartPropagator::setPropagationDirection ( PropagationDirection  dir  )  [inline, virtual]

setting the direction fo both components

Reimplemented from Propagator.

Definition at line 62 of file SmartPropagator.h.

References getGenPropagator(), getTkPropagator(), and Propagator::setPropagationDirection().

ReferenceCountingPointer< BoundCylinder > & SmartPropagator::theTkVolume (  )  [static, private]

Definition at line 35 of file SmartPropagator.cc.

Referenced by initTkVolume(), and SmartPropagator().

00035                                                                        {
00036   static ReferenceCountingPointer<BoundCylinder> local=0;
00037   return local;
00038 }


Member Data Documentation

const MagneticField* SmartPropagator::theField [private]

Definition at line 149 of file SmartPropagator.h.

Referenced by magneticField().

Propagator* SmartPropagator::theGenProp [mutable, private]

Definition at line 148 of file SmartPropagator.h.

Referenced by getGenPropagator(), SmartPropagator(), and ~SmartPropagator().

Propagator* SmartPropagator::theTkProp [mutable, private]

Definition at line 147 of file SmartPropagator.h.

Referenced by getTkPropagator(), SmartPropagator(), and ~SmartPropagator().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:38 2009 for CMSSW by  doxygen 1.5.4