CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SmartPropagator Class Referencefinal

#include <SmartPropagator.h>

Inheritance diagram for SmartPropagator:
Propagator

Public Member Functions

SmartPropagatorclone () const override
 Virtual constructor (using copy c'tor) More...
 
const PropagatorgetGenPropagator () const
 return the propagator used outside tracker More...
 
const PropagatorgetTkPropagator () const
 return the propagator used inside tracker More...
 
bool insideTkVol (const FreeTrajectoryState &fts) const
 true if a fts is inside tracker volume More...
 
bool insideTkVol (const Surface &surface) const
 true if a surface is inside tracker volume More...
 
bool insideTkVol (const Cylinder &cylin) const
 true if a cylinder is inside tracker volume More...
 
bool insideTkVol (const Plane &plane) const
 true if a plane is inside tracker volume More...
 
const MagneticFieldmagneticField () const override
 return the magneticField More...
 
void setPropagationDirection (PropagationDirection dir) override
 setting the direction fo both components More...
 
 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. More...
 
 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. More...
 
 SmartPropagator (const SmartPropagator &)
 Copy constructor. More...
 
 ~SmartPropagator () override
 
- Public Member Functions inherited from Propagator
template<typename STA , typename SUR >
TrajectoryStateOnSurface propagate (STA const &state, SUR const &surface) const
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const final
 
virtual FreeTrajectoryState propagate (const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const final
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &, const Surface &) const final
 
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Surface &sur) const final
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest1, const GlobalPoint &pDest2) const
 Propagate to PCA to a line (given by 2 points) given a starting point. More...
 
virtual std::pair< FreeTrajectoryState, double > propagateWithPath (const FreeTrajectoryState &ftsStart, const reco::BeamSpot &beamSpot) const
 Propagate to PCA to a line (given by beamSpot position and slope) given a starting point. More...
 
virtual PropagationDirection propagationDirection () const final
 
 Propagator (PropagationDirection dir=alongMomentum)
 
virtual bool setMaxDirectionChange (float phiMax)
 
virtual ~Propagator ()
 

Private Member Functions

void initTkVolume (float epsilon)
 build the tracker volume More...
 
std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &fts, const Plane &plane) const override
 
std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const FreeTrajectoryState &fts, const Cylinder &cylinder) const override
 
std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Plane &sur) const override
 
std::pair< TrajectoryStateOnSurface, double > propagateWithPath (const TrajectoryStateOnSurface &tsos, const Cylinder &sur) const override
 

Private Attributes

const MagneticFieldtheField
 
PropagatortheGenProp
 
PropagatortheTkProp
 
ReferenceCountingPointer< CylindertheTkVolume
 

Detailed Description

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

Author
Stefano Lacaprara - INFN Padova author Chang Liu - Purdue University

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

Constructor & Destructor Documentation

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 38 of file SmartPropagator.cc.

References initTkVolume().

Referenced by clone().

39  :
40  Propagator(dir), theTkProp(aTkProp->clone()), theGenProp(aGenProp->clone()), theField(field) {
41 
43 
44 }
Propagator * theGenProp
virtual Propagator * clone() const =0
void initTkVolume(float epsilon)
build the tracker volume
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
Propagator * theTkProp
const MagneticField * theField
dbl *** dir
Definition: mlp_gen.cc:35
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 47 of file SmartPropagator.cc.

References initTkVolume().

48  :
49  Propagator(dir), theTkProp(aTkProp.clone()), theGenProp(aGenProp.clone()), theField(field) {
50 
52 
53 }
Propagator * theGenProp
virtual Propagator * clone() const =0
void initTkVolume(float epsilon)
build the tracker volume
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
Propagator * theTkProp
const MagneticField * theField
dbl *** dir
Definition: mlp_gen.cc:35
SmartPropagator::SmartPropagator ( const SmartPropagator aProp)

Copy constructor.

Definition at line 56 of file SmartPropagator.cc.

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

56  :
57  Propagator(aProp.propagationDirection()), theTkProp(nullptr), theGenProp(nullptr) {
58  if (aProp.theTkProp)
59  theTkProp=aProp.getTkPropagator()->clone();
60  if (aProp.theGenProp)
61  theTkProp=aProp.getGenPropagator()->clone();
62 
63  //SL since it's a copy constructor, then the TkVolume has been already
64  //initialized
65  // initTkVolume(epsilon);
66 
67  }
Propagator * theGenProp
virtual Propagator * clone() const =0
const Propagator * getTkPropagator() const
return the propagator used inside tracker
Propagator(PropagationDirection dir=alongMomentum)
Definition: Propagator.h:46
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
Propagator * theTkProp
const Propagator * getGenPropagator() const
return the propagator used outside tracker
SmartPropagator::~SmartPropagator ( )
override

virtual destructor

Definition at line 70 of file SmartPropagator.cc.

References theGenProp, and theTkProp.

70  {
71 
72  delete theTkProp;
73  delete theGenProp;
74 
75 }
Propagator * theGenProp
Propagator * theTkProp

Member Function Documentation

SmartPropagator* SmartPropagator::clone ( void  ) const
inlineoverridevirtual

Virtual constructor (using copy c'tor)

Implements Propagator.

Definition at line 55 of file SmartPropagator.h.

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

55  {
57  }
const Propagator * getTkPropagator() const
return the propagator used inside tracker
const MagneticField * magneticField() const override
return the magneticField
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.
const Propagator * getGenPropagator() const
return the propagator used outside tracker
const Propagator * SmartPropagator::getGenPropagator ( ) const

return the propagator used outside tracker

Definition at line 195 of file SmartPropagator.cc.

References theGenProp.

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

195  {
196 
197  return theGenProp;
198 
199 }
Propagator * theGenProp
const Propagator * SmartPropagator::getTkPropagator ( ) const

return the propagator used inside tracker

Definition at line 188 of file SmartPropagator.cc.

References theTkProp.

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

188  {
189 
190  return theTkProp;
191 
192 }
Propagator * theTkProp
void SmartPropagator::initTkVolume ( float  epsilon)
private

build the tracker volume

Definition at line 79 of file SmartPropagator.cc.

References Cylinder::build(), geometryDiff::epsilon, TrackerBounds::halfLength(), TCMET_cfi::radius, TrackerBounds::radius(), makeMuonMisalignmentScenario::rot, and theTkVolume.

Referenced by magneticField(), and SmartPropagator().

79  {
80 
81  //
82  // fill tracker dimensions
83  //
84  float radius = TrackerBounds::radius();
85  float r_out = radius + epsilon/2;
86  float r_in = r_out - epsilon;
87  float z_max = TrackerBounds::halfLength();
88  float z_min = - z_max;
89 
90  Surface::PositionType pos(0,0,0); // centered at the global origin
91  Surface::RotationType rot; // unit matrix - barrel cylinder orientation
92 
93  theTkVolume = Cylinder::build(radius, pos, rot, new SimpleCylinderBounds(r_in, r_out, z_min, z_max));
94 
95 }
static float halfLength()
Definition: TrackerBounds.h:34
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
static float radius()
Definition: TrackerBounds.h:33
ReferenceCountingPointer< Cylinder > theTkVolume
bool SmartPropagator::insideTkVol ( const FreeTrajectoryState fts) const

true if a fts is inside tracker volume

Definition at line 144 of file SmartPropagator.cc.

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

Referenced by insideTkVol(), propagateWithPath(), and setPropagationDirection().

144  {
145 
146  GlobalPoint gp = fts.position();
147 // LocalPoint lp = theTkVolume()->toLocal(gp);
148 // return theTkVolume()->bounds().inside(lp);
149 
150  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
151 }
T perp() const
Definition: PV3DBase.h:72
static float halfLength()
Definition: TrackerBounds.h:34
T z() const
Definition: PV3DBase.h:64
static float radius()
Definition: TrackerBounds.h:33
GlobalPoint position() const
bool SmartPropagator::insideTkVol ( const Surface surface) const

true if a surface is inside tracker volume

Definition at line 154 of file SmartPropagator.cc.

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

154  {
155 
156  const GlobalPoint& gp = surface.position();
157  // LocalPoint lp = theTkVolume()->toLocal(gp);
158 
159  // return theTkVolume()->bounds().inside(lp);
160  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
161 
162 
163 }
T perp() const
Definition: PV3DBase.h:72
static float halfLength()
Definition: TrackerBounds.h:34
T z() const
Definition: PV3DBase.h:64
static float radius()
Definition: TrackerBounds.h:33
const PositionType & position() const
bool SmartPropagator::insideTkVol ( const Cylinder cylin) const

true if a cylinder is inside tracker volume

bool SmartPropagator::insideTkVol ( const Plane plane) const

true if a plane is inside tracker volume

Definition at line 177 of file SmartPropagator.cc.

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

177  {
178 
179  const GlobalPoint& gp = plane.position();
180 // LocalPoint lp = theTkVolume()->toLocal(gp);
181 // return theTkVolume()->bounds().inside(lp);
182  return ( (gp.perp()<= TrackerBounds::radius()+10.) && (fabs(gp.z())<= TrackerBounds::halfLength()+10.) );
183 
184 
185 }
T perp() const
Definition: PV3DBase.h:72
static float halfLength()
Definition: TrackerBounds.h:34
T z() const
Definition: PV3DBase.h:64
static float radius()
Definition: TrackerBounds.h:33
const PositionType & position() const
const MagneticField* SmartPropagator::magneticField ( ) const
inlineoverridevirtual

return the magneticField

Implements Propagator.

Definition at line 105 of file SmartPropagator.h.

References geometryDiff::epsilon, initTkVolume(), and theField.

Referenced by clone().

105 {return theField;}
const MagneticField * theField
std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Plane plane 
) const
overrideprivatevirtual

Implements Propagator.

Definition at line 100 of file SmartPropagator.cc.

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

Referenced by setPropagationDirection().

102 {
103  if (insideTkVol(fts) && insideTkVol(plane)) {
104  return getTkPropagator()->propagateWithPath(fts, plane);
105  } else {
106  return getGenPropagator()->propagateWithPath(fts, plane);
107  }
108 }
const Propagator * getTkPropagator() const
return the propagator used inside tracker
bool insideTkVol(const FreeTrajectoryState &fts) const
true if a fts is inside tracker volume
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
const Propagator * getGenPropagator() const
return the propagator used outside tracker
std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const FreeTrajectoryState fts,
const Cylinder cylinder 
) const
overrideprivatevirtual

Implements Propagator.

Definition at line 111 of file SmartPropagator.cc.

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

113 {
114  if (insideTkVol(fts) && insideTkVol(cylinder)) {
115  return getTkPropagator()->propagateWithPath(fts, cylinder);
116  } else {
117  return getGenPropagator()->propagateWithPath(fts, cylinder);
118  }
119 }
const Propagator * getTkPropagator() const
return the propagator used inside tracker
bool insideTkVol(const FreeTrajectoryState &fts) const
true if a fts is inside tracker volume
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
const Propagator * getGenPropagator() const
return the propagator used outside tracker
std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface tsos,
const Plane sur 
) const
overrideprivatevirtual

Reimplemented from Propagator.

Definition at line 123 of file SmartPropagator.cc.

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

125 {
126  if (insideTkVol(*fts.freeState()) && insideTkVol(plane)) {
127  return getTkPropagator()->propagateWithPath(fts, plane);
128  } else {
129  return getGenPropagator()->propagateWithPath(fts, plane);
130  }
131 }
const Propagator * getTkPropagator() const
return the propagator used inside tracker
bool insideTkVol(const FreeTrajectoryState &fts) const
true if a fts is inside tracker volume
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
const Propagator * getGenPropagator() const
return the propagator used outside tracker
std::pair< TrajectoryStateOnSurface, double > SmartPropagator::propagateWithPath ( const TrajectoryStateOnSurface tsos,
const Cylinder sur 
) const
overrideprivatevirtual

Reimplemented from Propagator.

Definition at line 134 of file SmartPropagator.cc.

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

136 {
137  if (insideTkVol(*fts.freeState()) && insideTkVol(cylinder)) {
138  return getTkPropagator()->propagateWithPath(fts, cylinder);
139  } else {
140  return getGenPropagator()->propagateWithPath(fts, cylinder);
141  }
142 }
const Propagator * getTkPropagator() const
return the propagator used inside tracker
bool insideTkVol(const FreeTrajectoryState &fts) const
true if a fts is inside tracker volume
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:15
const Propagator * getGenPropagator() const
return the propagator used outside tracker
void SmartPropagator::setPropagationDirection ( PropagationDirection  dir)
inlineoverridevirtual

setting the direction fo both components

Reimplemented from Propagator.

Definition at line 60 of file SmartPropagator.h.

References getGenPropagator(), getTkPropagator(), insideTkVol(), Propagator::propagate(), Propagator::propagateWithPath(), propagateWithPath(), Propagator::setPropagationDirection(), theGenProp, and theTkProp.

61  {
65  }
Propagator * theGenProp
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:140
Propagator * theTkProp
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

const MagneticField* SmartPropagator::theField
private

Definition at line 113 of file SmartPropagator.h.

Referenced by magneticField().

Propagator* SmartPropagator::theGenProp
private
Propagator* SmartPropagator::theTkProp
private
ReferenceCountingPointer<Cylinder> SmartPropagator::theTkVolume
private

Definition at line 114 of file SmartPropagator.h.

Referenced by initTkVolume().