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::PropagateToCal ( )
PropagateToCal::~PropagateToCal ( )

Definition at line 18 of file PropagateToCal.cc.

19 {
20 }
PropagateToCal::PropagateToCal ( double  radius,
double  minZ,
double  maxZ,
bool  theIgnoreMaterial 
)

Definition at line 3 of file PropagateToCal.cc.

References Exception, pvSelector_cfi::maxZ, maxZ_, HiClusterCompatibility_cfi::minZ, minZ_, TCMET_cfi::radius, radius_, and theIgnoreMaterial_.

4 {
5  radius_ = radius;
6  maxZ_ = maxZ;
7  minZ_ = minZ;
8  theIgnoreMaterial_ = theIgnoreMaterial;
9  if (maxZ_ < minZ_ || radius < 0.0)
10  throw cms::Exception("BadConfig") << "PropagateToCal: CalMaxZ ("
11  << maxZ_
12  << ") smaller than CalMinZ ("
13  << minZ_ << ") or invalid radius ("
14  << radius_ << ").";
15 }
double radius_
whether or not propagation should ignore material

Member Function Documentation

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(), PhotonConversionTrajectorySeedProducerFromQuadruplets_cfi::propagator, radius_, mps_fire::result, SteppingHelixPropagator::setMaterialMode(), SteppingHelixPropagator::setNoErrorPropagation(), and theIgnoreMaterial_.

Referenced by CalIsolationAlgo< T1, C2 >::operator()().

25 {
27  bool result = true;
28  typedef std::pair<TrajectoryStateOnSurface, double> TsosPath;
29 
30  SteppingHelixPropagator propagator(field); // should we somehow take it from ESetup???
31  propagator.setMaterialMode(theIgnoreMaterial_); // no material effects if set to true
32  propagator.setNoErrorPropagation(true);
33 
34  const FreeTrajectoryState fts(GlobalTrajectoryParameters(vertex, Cand, charge, field));
35  const Surface::RotationType dummyRot;
36 
38  Cylinder::ConstCylinderPointer theTargetCylinder =
39  Cylinder::build(radius_, Surface::PositionType(0.,0.,0.), dummyRot);
40 
42  Plane::ConstPlanePointer theTargetPlaneMin =
43  Plane::build(Surface::PositionType(0.,0.,minZ_), dummyRot);
44 
46  Plane::ConstPlanePointer theTargetPlaneMax =
47  Plane::build(Surface::PositionType(0.,0.,maxZ_), dummyRot);
48 
49  TsosPath aTsosPath(propagator.propagateWithPath(fts, *theTargetCylinder));
50  if (!aTsosPath.first.isValid()) {
51  result = false;
52  } else if (aTsosPath.first.globalPosition().z() < theTargetPlaneMin->position().z()) {
53  // If on cylinder, but outside minimum z, try minimum z-plane:
54  // (Would it be possible to miss rdius on plane, but reach cylinder afterwards in z-range?
55  // No, at least not in B-field parallel to z-axis which is cylinder axis.)
56  aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMin);
57  if (!aTsosPath.first.isValid()
58  || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) {
59  result = false;
60  }
61  } else if (aTsosPath.first.globalPosition().z() > theTargetPlaneMax->position().z()) {
62  // Analog for outside maximum z:
63  aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMax);
64  if (!aTsosPath.first.isValid()
65  || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) {
66  result = false;
67  }
68  }
71  if (result) {
72  Cand = GlobalVector(aTsosPath.first.globalPosition().x(),
73  aTsosPath.first.globalPosition().y(),
74  aTsosPath.first.globalPosition().z() );
75  }
76  return result;
77 }
double radius_
whether or not propagation should ignore material
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
Definition: Cylinder.h:51
static PlanePointer build(Args &&...args)
Definition: Plane.h:33
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Data Documentation

double PropagateToCal::maxZ_
private

Definition at line 37 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().

double PropagateToCal::minZ_
private

Definition at line 37 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().

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

Definition at line 36 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().