CMS 3D CMS Logo

BeamHaloPropagator.cc
Go to the documentation of this file.
1 /******* \class BeamHaloPropagator *******
2  *
3  * Description: A propagator which use different algorithm to propagate
4  * within an endcap or to cross over to the other endcap
5  *
6  *
7  * \author : Jean-Roch VLIMANT UCSB
8  *
9  *********************************/
10 
11 /* This Class Header */
13 
14 /* Collaborating Class Header */
18 
20 
23 
24 /* Base Class Headers */
25 
26 /* C++ Headers */
27 
28 /* ====================================================================== */
29 
30 /* Constructor */
32  //consistency check for direction
35  edm::LogError("BeamHaloPropagator") << "composite propagator set with inconsistent direction components\n"
36  << "EndCap propagator is: " << getEndCapTkPropagator()->propagationDirection()
37  << "\n to be set on: " << dir;
39  }
40 
43  edm::LogError("BeamHaloPropagator") << "composite propagator set with inconsistent direction components\n"
44  << "Cross propagator is: " << getCrossTkPropagator()->propagationDirection()
45  << "\n to be set on: " << dir;
47  }
48 }
49 
51  const Propagator* aCrossTkProp,
52  const MagneticField* field,
54  : Propagator(dir), theEndCapTkProp(aEndCapTkProp->clone()), theCrossTkProp(aCrossTkProp->clone()), theField(field) {
56 }
57 
59  const Propagator& aCrossTkProp,
60  const MagneticField* field,
62  : Propagator(dir), theEndCapTkProp(aEndCapTkProp.clone()), theCrossTkProp(aCrossTkProp.clone()), theField(field) {
64 }
65 
67  : Propagator(aProp.propagationDirection()), theEndCapTkProp(nullptr), theCrossTkProp(nullptr) {
68  if (aProp.theEndCapTkProp)
70  if (aProp.theCrossTkProp)
72 }
73 
74 /* Destructor */
76  delete theEndCapTkProp;
77  delete theCrossTkProp;
78 }
79 
80 bool BeamHaloPropagator::crossingTk(const FreeTrajectoryState& fts, const Plane& plane) const {
81  LogDebug("BeamHaloPropagator") << "going from: " << fts.position() << " to: " << plane.position() << "\n"
82  << "and hence "
83  << ((fts.position().z() * plane.position().z() < 0) ? "crossing" : "not crossing");
84  return (fts.position().z() * plane.position().z() < 0);
85 }
86 
87 std::pair<TrajectoryStateOnSurface, double> BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
88  const Plane& plane) const {
89  if (crossingTk(fts, plane)) {
90  return getCrossTkPropagator()->propagateWithPath(fts, plane);
91  } else {
92  return getEndCapTkPropagator()->propagateWithPath(fts, plane);
93  }
94 }
95 
96 std::pair<TrajectoryStateOnSurface, double> BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
97  const Cylinder& cylinder) const {
98  return getCrossTkPropagator()->propagateWithPath(fts, cylinder);
99 }
100 
102  LogDebug("BeamHaloPropagator") << "using the EndCap propagator";
103  return theEndCapTkProp;
104 }
105 
107  LogDebug("BeamHaloPropagator") << "using the Crossing propagator";
108  return theCrossTkProp;
109 }
const Propagator * getCrossTkPropagator() const
return the propagator used to cross the tracker
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
Propagator * theCrossTkProp
BeamHaloPropagator(const Propagator *aEndCapTkProp, const Propagator *aCrossTkProp, const MagneticField *field, PropagationDirection dir=alongMomentum)
Defines which propagator is used inside endcap and in barrel.
T z() const
Definition: PV3DBase.h:61
bool crossingTk(const FreeTrajectoryState &fts, const Plane &plane) const
true if the plane and the fts z position have different sign
virtual Propagator * clone() const =0
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
void directionCheck(PropagationDirection dir)
PropagationDirection
Log< level::Error, false > LogError
Definition: Plane.h:16
GlobalPoint position() const
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const final
Definition: Propagator.cc:10
~BeamHaloPropagator() override
const PositionType & position() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
const Propagator * getEndCapTkPropagator() const
return the propagator used in endcaps
Propagator * theEndCapTkProp
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &fts, const Plane &plane) const override
#define LogDebug(id)