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 */
34 void BeamHaloPropagator::directionCheck(PropagationDirection dir)const {
35 
36  //consistency check for direction
37  if (getEndCapTkPropagator()->propagationDirection()!=dir && getEndCapTkPropagator()->propagationDirection()!=anyDirection){
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;
41  getEndCapTkPropagator()->setPropagationDirection(dir);
42  }
43 
44  if (getCrossTkPropagator()->propagationDirection()!=dir && getCrossTkPropagator()->propagationDirection()!=anyDirection){
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;
48  getCrossTkPropagator()->setPropagationDirection(dir);
49  }
50 
51 }
52 
53 BeamHaloPropagator::BeamHaloPropagator(const Propagator* aEndCapTkProp, const 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 
67 BeamHaloPropagator::BeamHaloPropagator(const BeamHaloPropagator& aProp) :
68  Propagator(aProp.propagationDirection()), theEndCapTkProp(0), theCrossTkProp(0) {
69  if (aProp.theEndCapTkProp)
70  theEndCapTkProp=aProp.getEndCapTkPropagator()->clone();
71  if (aProp.theCrossTkProp)
72  theCrossTkProp=aProp.getCrossTkPropagator()->clone();
73 }
74 
75 /* Destructor */
76 BeamHaloPropagator::~BeamHaloPropagator() {
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 
88 TrajectoryStateOnSurface BeamHaloPropagator::propagate(const FreeTrajectoryState& fts,
89  const Surface& surface) const {
90  return Propagator::propagate( fts, surface);
91 }
92 
93 
94 TrajectoryStateOnSurface BeamHaloPropagator::propagate(const FreeTrajectoryState& fts,
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 
104 TrajectoryStateOnSurface BeamHaloPropagator::propagate(const FreeTrajectoryState& fts,
105  const Cylinder& cylinder) const {
106  return getCrossTkPropagator()->propagate(fts, cylinder);
107 }
108 
109 std::pair<TrajectoryStateOnSurface,double>
110 BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
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>
120 BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
121  const Cylinder& cylinder) const
122 { return getCrossTkPropagator()->propagateWithPath(fts, cylinder);}
123 
124 
125 const Propagator* BeamHaloPropagator::getEndCapTkPropagator() const {
126  LogDebug("BeamHaloPropagator")<<"using the EndCap propagator";
127  return theEndCapTkProp;}
128 
129 
130 const Propagator* BeamHaloPropagator::getCrossTkPropagator() const {
131  LogDebug("BeamHaloPropagator")<<"using the Crossing propagator";
132  return theCrossTkProp;}
133 
134 
#define LogDebug(id)
PropagationDirection
Definition: Plane.h:17
tuple field
Definition: statics.py:62
T z() const
Definition: PV3DBase.h:64
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
Definition: Propagator.cc:12
GlobalPoint position() const
tuple clone
Definition: statics.py:58
dbl *** dir
Definition: mlp_gen.cc:35
const PositionType & position() const