![]() |
![]() |
#include <PhysicsTools/IsolationAlgos/interface/PropagateToCal.h>
Public Member Functions | |
bool | propagate (const GlobalPoint &vertex, GlobalVector &Cand, int charge, const MagneticField *bField) const |
PropagateToCal (double radius, double minZ, double maxZ, bool theIgnoreMaterial) | |
PropagateToCal () | |
~PropagateToCal () | |
Private Attributes | |
double | maxZ_ |
double | minZ_ |
double | radius_ |
whether or not propagation should ignore material | |
bool | theIgnoreMaterial_ |
Definition at line 26 of file PropagateToCal.h.
PropagateToCal::PropagateToCal | ( | ) |
PropagateToCal::~PropagateToCal | ( | ) |
PropagateToCal::PropagateToCal | ( | double | radius, | |
double | minZ, | |||
double | maxZ, | |||
bool | theIgnoreMaterial | |||
) |
Definition at line 3 of file PropagateToCal.cc.
References Exception, maxZ_, minZ_, radius_, and theIgnoreMaterial_.
00004 { 00005 radius_ = radius; 00006 maxZ_ = maxZ; 00007 minZ_ = minZ; 00008 theIgnoreMaterial_ = theIgnoreMaterial; 00009 if (maxZ_ < minZ_ || radius < 0.0) 00010 throw cms::Exception("BadConfig") << "PropagateToCal: CalMaxZ (" 00011 << maxZ_ 00012 << ") smaller than CalMinZ (" 00013 << minZ_ << ") or invalid radius (" 00014 << radius_ << ")."; 00015 }
bool PropagateToCal::propagate | ( | const GlobalPoint & | vertex, | |
GlobalVector & | Cand, | |||
int | charge, | |||
const MagneticField * | bField | |||
) | const |
the code is inspired by Gero's CosmicGenFilterHelix class:
target cylinder, around z-axis
plane closing cylinder at 'negative' side
plane closing cylinder at 'positive' side
The result is the vector connecting the extrapolation endPoint on the Calorimeter surface and the origin of the coordinate system, point (0,0,0).
Successfully propagated to the calorimeter or not
Definition at line 23 of file PropagateToCal.cc.
References Plane::build(), Cylinder::build(), maxZ_, minZ_, SteppingHelixPropagator::propagateWithPath(), radius_, HLT_VtxMuL3::result, SteppingHelixPropagator::setMaterialMode(), SteppingHelixPropagator::setNoErrorPropagation(), and theIgnoreMaterial_.
Referenced by CalIsolationAlgo< T1, C2 >::operator()().
00025 { 00027 bool result = true; 00028 typedef std::pair<TrajectoryStateOnSurface, double> TsosPath; 00029 00030 SteppingHelixPropagator propagator(field); // should we somehow take it from ESetup??? 00031 propagator.setMaterialMode(theIgnoreMaterial_); // no material effects if set to true 00032 propagator.setNoErrorPropagation(true); 00033 00034 const FreeTrajectoryState fts(GlobalTrajectoryParameters(vertex, Cand, charge, field)); 00035 const Surface::RotationType dummyRot; 00036 00038 Cylinder::ConstCylinderPointer theTargetCylinder = 00039 Cylinder::build(Surface::PositionType(0.,0.,0.), dummyRot, radius_); 00040 00042 Plane::ConstPlanePointer theTargetPlaneMin = 00043 Plane::build(Surface::PositionType(0.,0.,minZ_), dummyRot); 00044 00046 Plane::ConstPlanePointer theTargetPlaneMax = 00047 Plane::build(Surface::PositionType(0.,0.,maxZ_), dummyRot); 00048 00049 TsosPath aTsosPath(propagator.propagateWithPath(fts, *theTargetCylinder)); 00050 if (!aTsosPath.first.isValid()) { 00051 result = false; 00052 } else if (aTsosPath.first.globalPosition().z() < theTargetPlaneMin->position().z()) { 00053 // If on cylinder, but outside minimum z, try minimum z-plane: 00054 // (Would it be possible to miss rdius on plane, but reach cylinder afterwards in z-range? 00055 // No, at least not in B-field parallel to z-axis which is cylinder axis.) 00056 aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMin); 00057 if (!aTsosPath.first.isValid() 00058 || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) { 00059 result = false; 00060 } 00061 } else if (aTsosPath.first.globalPosition().z() > theTargetPlaneMax->position().z()) { 00062 // Analog for outside maximum z: 00063 aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMax); 00064 if (!aTsosPath.first.isValid() 00065 || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) { 00066 result = false; 00067 } 00068 } 00071 if (result) { 00072 Cand = GlobalVector(aTsosPath.first.globalPosition().x(), 00073 aTsosPath.first.globalPosition().y(), 00074 aTsosPath.first.globalPosition().z() ); 00075 } 00076 return result; 00077 }
double PropagateToCal::maxZ_ [private] |
double PropagateToCal::minZ_ [private] |
double PropagateToCal::radius_ [private] |
whether or not propagation should ignore material
Definition at line 37 of file PropagateToCal.h.
Referenced by propagate(), and PropagateToCal().
bool PropagateToCal::theIgnoreMaterial_ [private] |