CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PropagateToCal Class Reference

#include <PropagateToCal.h>

Public Member Functions

bool propagate (const GlobalPoint &vertex, GlobalVector &Cand, int charge, const MagneticField *bField) const
 
 PropagateToCal ()
 
 PropagateToCal (double radius, double minZ, double maxZ, bool theIgnoreMaterial)
 
 ~PropagateToCal ()
 

Private Attributes

double maxZ_
 
double minZ_
 
double radius_
 whether or not propagation should ignore material More...
 
bool theIgnoreMaterial_
 

Detailed Description

Definition at line 26 of file PropagateToCal.h.

Constructor & Destructor Documentation

◆ PropagateToCal() [1/2]

PropagateToCal::PropagateToCal ( )

◆ ~PropagateToCal()

PropagateToCal::~PropagateToCal ( )

Definition at line 13 of file PropagateToCal.cc.

13 {}

◆ PropagateToCal() [2/2]

PropagateToCal::PropagateToCal ( double  radius,
double  minZ,
double  maxZ,
bool  theIgnoreMaterial 
)

Definition at line 3 of file PropagateToCal.cc.

3  {
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 }

References Exception, CosmicsPD_Skims::maxZ, maxZ_, CosmicGenFilterHelix_cff::minZ, minZ_, CosmicsPD_Skims::radius, radius_, and theIgnoreMaterial_.

Member Function Documentation

◆ propagate()

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 15 of file PropagateToCal.cc.

18  {
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 }

References Plane::build(), Cylinder::build(), ALCARECOTkAlJpsiMuMu_cff::charge, maxZ_, minZ_, TrackCandidateProducer_cfi::propagator, radius_, mps_fire::result, theIgnoreMaterial_, and bphysicsOniaDQM_cfi::vertex.

Member Data Documentation

◆ maxZ_

double PropagateToCal::maxZ_
private

Definition at line 35 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().

◆ minZ_

double PropagateToCal::minZ_
private

Definition at line 35 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().

◆ radius_

double PropagateToCal::radius_
private

whether or not propagation should ignore material

Definition at line 35 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().

◆ theIgnoreMaterial_

bool PropagateToCal::theIgnoreMaterial_
private

Definition at line 34 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().

TkRotation< float >
PropagateToCal::minZ_
double minZ_
Definition: PropagateToCal.h:35
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 >
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
Exception
Definition: hltDiff.cc:246
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
PropagateToCal::radius_
double radius_
whether or not propagation should ignore material
Definition: PropagateToCal.h:35
mps_fire.result
result
Definition: mps_fire.py:303
CosmicGenFilterHelix_cff.minZ
minZ
i.e.
Definition: CosmicGenFilterHelix_cff.py:9