Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:28

0001 /******* \class BeamHaloPropagator *******
0002  *
0003  * Description: A propagator which use different algorithm to propagate
0004  * within an endcap or to cross over to the other endcap
0005  *
0006  *
0007  * \author : Jean-Roch VLIMANT UCSB
0008  *
0009  *********************************/
0010 
0011 /* This Class Header */
0012 #include "TrackingTools/GeomPropagators/interface/BeamHaloPropagator.h"
0013 
0014 /* Collaborating Class Header */
0015 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0016 #include "DataFormats/GeometrySurface/interface/Plane.h"
0017 #include "DataFormats/GeometrySurface/interface/SimpleCylinderBounds.h"
0018 
0019 #include <DataFormats/GeometrySurface/interface/Cylinder.h>
0020 
0021 #include "TrackingTools/GeomPropagators/interface/TrackerBounds.h"
0022 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0023 
0024 /* Base Class Headers */
0025 
0026 /* C++ Headers */
0027 
0028 /* ====================================================================== */
0029 
0030 /* Constructor */
0031 void BeamHaloPropagator::directionCheck(PropagationDirection dir) {
0032   //consistency check for direction
0033   if (getEndCapTkPropagator()->propagationDirection() != dir &&
0034       getEndCapTkPropagator()->propagationDirection() != anyDirection) {
0035     edm::LogError("BeamHaloPropagator") << "composite propagator set with inconsistent direction components\n"
0036                                         << "EndCap propagator is: " << getEndCapTkPropagator()->propagationDirection()
0037                                         << "\n to be set on: " << dir;
0038     theEndCapTkProp->setPropagationDirection(dir);
0039   }
0040 
0041   if (getCrossTkPropagator()->propagationDirection() != dir &&
0042       getCrossTkPropagator()->propagationDirection() != anyDirection) {
0043     edm::LogError("BeamHaloPropagator") << "composite propagator set with inconsistent direction components\n"
0044                                         << "Cross propagator is: " << getCrossTkPropagator()->propagationDirection()
0045                                         << "\n to be set on: " << dir;
0046     theCrossTkProp->setPropagationDirection(dir);
0047   }
0048 }
0049 
0050 BeamHaloPropagator::BeamHaloPropagator(const Propagator* aEndCapTkProp,
0051                                        const Propagator* aCrossTkProp,
0052                                        const MagneticField* field,
0053                                        PropagationDirection dir)
0054     : Propagator(dir), theEndCapTkProp(aEndCapTkProp->clone()), theCrossTkProp(aCrossTkProp->clone()), theField(field) {
0055   directionCheck(dir);
0056 }
0057 
0058 BeamHaloPropagator::BeamHaloPropagator(const Propagator& aEndCapTkProp,
0059                                        const Propagator& aCrossTkProp,
0060                                        const MagneticField* field,
0061                                        PropagationDirection dir)
0062     : Propagator(dir), theEndCapTkProp(aEndCapTkProp.clone()), theCrossTkProp(aCrossTkProp.clone()), theField(field) {
0063   directionCheck(dir);
0064 }
0065 
0066 BeamHaloPropagator::BeamHaloPropagator(const BeamHaloPropagator& aProp)
0067     : Propagator(aProp.propagationDirection()), theEndCapTkProp(nullptr), theCrossTkProp(nullptr) {
0068   if (aProp.theEndCapTkProp)
0069     theEndCapTkProp = aProp.getEndCapTkPropagator()->clone();
0070   if (aProp.theCrossTkProp)
0071     theCrossTkProp = aProp.getCrossTkPropagator()->clone();
0072 }
0073 
0074 /* Destructor */
0075 BeamHaloPropagator::~BeamHaloPropagator() {
0076   delete theEndCapTkProp;
0077   delete theCrossTkProp;
0078 }
0079 
0080 bool BeamHaloPropagator::crossingTk(const FreeTrajectoryState& fts, const Plane& plane) const {
0081   LogDebug("BeamHaloPropagator") << "going from: " << fts.position() << " to: " << plane.position() << "\n"
0082                                  << "and hence "
0083                                  << ((fts.position().z() * plane.position().z() < 0) ? "crossing" : "not crossing");
0084   return (fts.position().z() * plane.position().z() < 0);
0085 }
0086 
0087 std::pair<TrajectoryStateOnSurface, double> BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
0088                                                                                   const Plane& plane) const {
0089   if (crossingTk(fts, plane)) {
0090     return getCrossTkPropagator()->propagateWithPath(fts, plane);
0091   } else {
0092     return getEndCapTkPropagator()->propagateWithPath(fts, plane);
0093   }
0094 }
0095 
0096 std::pair<TrajectoryStateOnSurface, double> BeamHaloPropagator::propagateWithPath(const FreeTrajectoryState& fts,
0097                                                                                   const Cylinder& cylinder) const {
0098   return getCrossTkPropagator()->propagateWithPath(fts, cylinder);
0099 }
0100 
0101 const Propagator* BeamHaloPropagator::getEndCapTkPropagator() const {
0102   LogDebug("BeamHaloPropagator") << "using the EndCap propagator";
0103   return theEndCapTkProp;
0104 }
0105 
0106 const Propagator* BeamHaloPropagator::getCrossTkPropagator() const {
0107   LogDebug("BeamHaloPropagator") << "using the Crossing propagator";
0108   return theCrossTkProp;
0109 }