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) {
35 
36  //consistency check for direction
37  if (getEndCapTkPropagator()->propagationDirection() != dir &&
38  getEndCapTkPropagator()->propagationDirection() != anyDirection) {
39  edm::LogError("BeamHaloPropagator")<<"composite propagator set with inconsistent direction components\n"
40  <<"EndCap propagator is: "<<getEndCapTkPropagator()->propagationDirection()
41  <<"\n to be set on: "<<dir;
42  theEndCapTkProp->setPropagationDirection(dir);
43  }
44 
45  if (getCrossTkPropagator()->propagationDirection() != dir &&
46  getCrossTkPropagator()->propagationDirection() != anyDirection) {
47  edm::LogError("BeamHaloPropagator")<<"composite propagator set with inconsistent direction components\n"
48  <<"Cross propagator is: "<<getCrossTkPropagator()->propagationDirection()
49  <<"\n to be set on: "<<dir;
50  theCrossTkProp->setPropagationDirection(dir);
51  }
52 }
53 
54 BeamHaloPropagator::BeamHaloPropagator(const Propagator* aEndCapTkProp, const Propagator* aCrossTkProp, const MagneticField* field,
56  Propagator(dir), theEndCapTkProp(aEndCapTkProp->clone()), theCrossTkProp(aCrossTkProp->clone()), theField(field) {
57  directionCheck(dir);
58 }
59 
60 
61 BeamHaloPropagator::BeamHaloPropagator(const Propagator& aEndCapTkProp, const Propagator& aCrossTkProp,const MagneticField* field,
63  Propagator(dir), theEndCapTkProp(aEndCapTkProp.clone()), theCrossTkProp(aCrossTkProp.clone()), theField(field) {
64  directionCheck(dir);
65 }
66 
67 
68 BeamHaloPropagator::BeamHaloPropagator(const BeamHaloPropagator& aProp) :
69  Propagator(aProp.propagationDirection()), theEndCapTkProp(0), theCrossTkProp(0) {
70  if (aProp.theEndCapTkProp)
71  theEndCapTkProp=aProp.getEndCapTkPropagator()->clone();
72  if (aProp.theCrossTkProp)
73  theCrossTkProp=aProp.getCrossTkPropagator()->clone();
74 }
75 
76 /* Destructor */
77 BeamHaloPropagator::~BeamHaloPropagator() {
78 
79  delete theEndCapTkProp;
80  delete theCrossTkProp;
81 
82 }
83 
84 bool BeamHaloPropagator::crossingTk(const FreeTrajectoryState& fts, const Plane& plane) const{
85  LogDebug("BeamHaloPropagator")<<"going from: "<<fts.position()<<" to: "<<plane.position()<<"\n"
86  <<"and hence "<<((fts.position().z()*plane.position().z()<0)?"crossing":"not crossing");
87  return (fts.position().z()*plane.position().z()<0);}
88 
89 
90 
91 std::pair<TrajectoryStateOnSurface,double>
92 BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
93  const Plane& plane) const
94 {
95  if (crossingTk(fts,plane)){
96  return getCrossTkPropagator()->propagateWithPath(fts, plane);}
97  else{
98  return getEndCapTkPropagator()->propagateWithPath(fts, plane);}
99 }
100 
101 std::pair<TrajectoryStateOnSurface,double>
102 BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
103  const Cylinder& cylinder) const
104 { return getCrossTkPropagator()->propagateWithPath(fts, cylinder);}
105 
106 
107 const Propagator* BeamHaloPropagator::getEndCapTkPropagator() const {
108  LogDebug("BeamHaloPropagator")<<"using the EndCap propagator";
109  return theEndCapTkProp;}
110 
111 
112 const Propagator* BeamHaloPropagator::getCrossTkPropagator() const {
113  LogDebug("BeamHaloPropagator")<<"using the Crossing propagator";
114  return theCrossTkProp;}
115 
116 
#define LogDebug(id)
PropagationDirection
Definition: Plane.h:17
T z() const
Definition: PV3DBase.h:64
GlobalPoint position() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
dbl *** dir
Definition: mlp_gen.cc:35
const PositionType & position() const