CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
31 
32 
33 /* Constructor */
35 
36  //consistency check for direction
38  edm::LogError("BeamHaloPropagator")<<"composite propagator set with inconsistent direction components\n"
39  <<"EndCap propagator is: "<<getEndCapTkPropagator()->propagationDirection()
40  <<"\n to be set on: "<<dir;
42  }
43 
45  edm::LogError("BeamHaloPropagator")<<"composite propagator set with inconsistent direction components\n"
46  <<"Cross propagator is: "<<getCrossTkPropagator()->propagationDirection()
47  <<"\n to be set on: "<<dir;
49  }
50 
51 }
52 
53 BeamHaloPropagator::BeamHaloPropagator(Propagator* aEndCapTkProp, Propagator* aCrossTkProp, const MagneticField* field,
55  Propagator(dir), theEndCapTkProp(aEndCapTkProp->clone()), theCrossTkProp(aCrossTkProp->clone()), theField(field) {
56  directionCheck(dir);
57 }
58 
59 
60 BeamHaloPropagator::BeamHaloPropagator(const Propagator& aEndCapTkProp, const Propagator& aCrossTkProp,const MagneticField* field,
62  Propagator(dir), theEndCapTkProp(aEndCapTkProp.clone()), theCrossTkProp(aCrossTkProp.clone()), theField(field) {
63  directionCheck(dir);
64 }
65 
66 
68  Propagator(aProp.propagationDirection()), theEndCapTkProp(0), theCrossTkProp(0) {
69  if (aProp.theEndCapTkProp)
71  if (aProp.theCrossTkProp)
73 }
74 
75 /* Destructor */
77 
78  delete theEndCapTkProp;
79  delete theCrossTkProp;
80 
81 }
82 
83 bool BeamHaloPropagator::crossingTk(const FreeTrajectoryState& fts, const Plane& plane) const{
84  LogDebug("BeamHaloPropagator")<<"going from: "<<fts.position()<<" to: "<<plane.position()<<"\n"
85  <<"and hence "<<((fts.position().z()*plane.position().z()<0)?"crossing":"not crossing");
86  return (fts.position().z()*plane.position().z()<0);}
87 
89  const Surface& surface) const {
90  return Propagator::propagate( fts, surface);
91 }
92 
93 
95  const Plane& plane) const {
96 
97  if (crossingTk(fts,plane)){
98  return getCrossTkPropagator()->propagate(fts, plane);}
99  else{
100  return getEndCapTkPropagator()->propagate(fts, plane);}
101 }
102 
103 
105  const Cylinder& cylinder) const {
106  return getCrossTkPropagator()->propagate(fts, cylinder);
107 }
108 
109 std::pair<TrajectoryStateOnSurface,double>
111  const Plane& plane) const
112 {
113  if (crossingTk(fts,plane)){
114  return getCrossTkPropagator()->propagateWithPath(fts, plane);}
115  else{
116  return getEndCapTkPropagator()->propagateWithPath(fts, plane);}
117 }
118 
119 std::pair<TrajectoryStateOnSurface,double>
121  const Cylinder& cylinder) const
122 { return getCrossTkPropagator()->propagateWithPath(fts, cylinder);}
123 
124 
126  LogDebug("BeamHaloPropagator")<<"using the EndCap propagator";
127  return theEndCapTkProp;}
128 
129 
131  LogDebug("BeamHaloPropagator")<<"using the Crossing propagator";
132  return theCrossTkProp;}
133 
134 
#define LogDebug(id)
std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &fts, const Surface &surface) const
Propagator * theCrossTkProp
Propagator * getEndCapTkPropagator() const
return the propagator used in endcaps
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
virtual Propagator * clone() const =0
void directionCheck(PropagationDirection dir) const
PropagationDirection
Propagator * getCrossTkPropagator() const
return the propagator used to cross the tracker
Definition: Plane.h:17
virtual std::pair< TrajectoryStateOnSurface, double > propagateWithPath(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:74
T z() const
Definition: PV3DBase.h:58
bool crossingTk(const FreeTrajectoryState &fts, const Plane &plane) const
true if the plane and the fts z position have different sign
TrajectoryStateOnSurface propagate(const FreeTrajectoryState &fts, const Surface &surface) const
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:9
GlobalPoint position() const
T * clone(const T *tp)
Definition: Ptr.h:42
virtual void setPropagationDirection(PropagationDirection dir) const
Definition: Propagator.h:132
dbl *** dir
Definition: mlp_gen.cc:35
const PositionType & position() const
Propagator * theEndCapTkProp
BeamHaloPropagator(Propagator *aEndCapTkProp, Propagator *aCrossTkProp, const MagneticField *field, PropagationDirection dir=alongMomentum)
Defines which propagator is used inside endcap and in barrel.