CMS 3D CMS Logo

PropagateToCal.cc
Go to the documentation of this file.
2 
3 PropagateToCal::PropagateToCal(double radius, double minZ, double maxZ, bool theIgnoreMaterial) {
4  radius_ = radius;
5  maxZ_ = maxZ;
6  minZ_ = minZ;
7  theIgnoreMaterial_ = theIgnoreMaterial;
8  if (maxZ_ < minZ_ || radius < 0.0)
9  throw cms::Exception("BadConfig") << "PropagateToCal: CalMaxZ (" << maxZ_ << ") smaller than CalMinZ (" << minZ_
10  << ") or invalid radius (" << radius_ << ").";
11 }
12 
14 
16  GlobalVector& Cand,
17  int charge,
18  const MagneticField* field) const {
20  bool result = true;
21  typedef std::pair<TrajectoryStateOnSurface, double> TsosPath;
22 
23  SteppingHelixPropagator propagator(field); // should we somehow take it from ESetup???
24  propagator.setMaterialMode(theIgnoreMaterial_); // no material effects if set to true
25  propagator.setNoErrorPropagation(true);
26 
28  const Surface::RotationType dummyRot;
29 
31  Cylinder::ConstCylinderPointer theTargetCylinder =
32  Cylinder::build(radius_, Surface::PositionType(0., 0., 0.), dummyRot);
33 
35  Plane::ConstPlanePointer theTargetPlaneMin = Plane::build(Surface::PositionType(0., 0., minZ_), dummyRot);
36 
38  Plane::ConstPlanePointer theTargetPlaneMax = Plane::build(Surface::PositionType(0., 0., maxZ_), dummyRot);
39 
40  TsosPath aTsosPath(propagator.propagateWithPath(fts, *theTargetCylinder));
41  if (!aTsosPath.first.isValid()) {
42  result = false;
43  } else if (aTsosPath.first.globalPosition().z() < theTargetPlaneMin->position().z()) {
44  // If on cylinder, but outside minimum z, try minimum z-plane:
45  // (Would it be possible to miss rdius on plane, but reach cylinder afterwards in z-range?
46  // No, at least not in B-field parallel to z-axis which is cylinder axis.)
47  aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMin);
48  if (!aTsosPath.first.isValid() || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) {
49  result = false;
50  }
51  } else if (aTsosPath.first.globalPosition().z() > theTargetPlaneMax->position().z()) {
52  // Analog for outside maximum z:
53  aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMax);
54  if (!aTsosPath.first.isValid() || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) {
55  result = false;
56  }
57  }
60  if (result) {
61  Cand = GlobalVector(aTsosPath.first.globalPosition().x(),
62  aTsosPath.first.globalPosition().y(),
63  aTsosPath.first.globalPosition().z());
64  }
65  return result;
66 }
Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
PropagateToCal::minZ_
double minZ_
Definition: PropagateToCal.h:35
PropagateToCal::PropagateToCal
PropagateToCal()
ConstReferenceCountingPointer< Cylinder >
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
CosmicsPD_Skims.maxZ
maxZ
Definition: CosmicsPD_Skims.py:136
SteppingHelixPropagator
Definition: SteppingHelixPropagator.h:36
PropagateToCal::maxZ_
double maxZ_
Definition: PropagateToCal.h:35
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
Point3DBase< float, GlobalTag >
PropagateToCal::~PropagateToCal
~PropagateToCal()
Definition: PropagateToCal.cc:13
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
Cylinder::build
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=nullptr)
Definition: Cylinder.h:45
PropagateToCal::theIgnoreMaterial_
bool theIgnoreMaterial_
Definition: PropagateToCal.h:34
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
PropagateToCal.h
Exception
Definition: hltDiff.cc:245
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
PropagateToCal::propagate
bool propagate(const GlobalPoint &vertex, GlobalVector &Cand, int charge, const MagneticField *bField) const
Definition: PropagateToCal.cc:15
PropagateToCal::radius_
double radius_
whether or not propagation should ignore material
Definition: PropagateToCal.h:35
mps_fire.result
result
Definition: mps_fire.py:311
MagneticField
Definition: MagneticField.h:19
CosmicGenFilterHelix_cff.minZ
minZ
i.e.
Definition: CosmicGenFilterHelix_cff.py:9