CMS 3D CMS Logo

Public Member Functions | Private Attributes

PropagateToCal Class Reference

#include <PropagateToCal.h>

List of all members.

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
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.

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

Definition at line 3 of file PropagateToCal.cc.

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

{ 
  radius_ = radius; 
  maxZ_ = maxZ; 
  minZ_ = minZ; 
  theIgnoreMaterial_ = theIgnoreMaterial;
  if (maxZ_ < minZ_ || radius < 0.0) 
    throw cms::Exception("BadConfig") << "PropagateToCal: CalMaxZ (" 
                                      << maxZ_
                                      << ") smaller than CalMinZ (" 
                                      << minZ_ << ") or invalid radius ("
                                      << radius_ << ").";
}

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 newFWLiteAna::build, maxZ_, minZ_, SteppingHelixPropagator::propagateWithPath(), LargeD0_PixelPairStep_cff::propagator, radius_, query::result, SteppingHelixPropagator::setMaterialMode(), SteppingHelixPropagator::setNoErrorPropagation(), and theIgnoreMaterial_.

{
  bool result = true;
  typedef std::pair<TrajectoryStateOnSurface, double> TsosPath;

  SteppingHelixPropagator propagator(field); // should we somehow take it from ESetup???
  propagator.setMaterialMode(theIgnoreMaterial_); // no material effects if set to true
  propagator.setNoErrorPropagation(true);

  const FreeTrajectoryState fts(GlobalTrajectoryParameters(vertex, Cand, charge, field));
  const Surface::RotationType dummyRot;

  Cylinder::ConstCylinderPointer theTargetCylinder = 
    Cylinder::build(Surface::PositionType(0.,0.,0.), dummyRot, radius_);

  Plane::ConstPlanePointer theTargetPlaneMin = 
    Plane::build(Surface::PositionType(0.,0.,minZ_), dummyRot);

  Plane::ConstPlanePointer theTargetPlaneMax = 
    Plane::build(Surface::PositionType(0.,0.,maxZ_), dummyRot);

  TsosPath aTsosPath(propagator.propagateWithPath(fts, *theTargetCylinder));
  if (!aTsosPath.first.isValid()) {
    result = false;
  } else if (aTsosPath.first.globalPosition().z() < theTargetPlaneMin->position().z()) {
    // If on cylinder, but outside minimum z, try minimum z-plane:
    // (Would it be possible to miss rdius on plane, but reach cylinder afterwards in z-range?
    //  No, at least not in B-field parallel to z-axis which is cylinder axis.)
    aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMin);
    if (!aTsosPath.first.isValid()
        || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) {
      result = false;
    }
  } else if (aTsosPath.first.globalPosition().z() > theTargetPlaneMax->position().z()) {
    // Analog for outside maximum z:
    aTsosPath = propagator.propagateWithPath(fts, *theTargetPlaneMax);
    if (!aTsosPath.first.isValid()
        || aTsosPath.first.globalPosition().perp() > theTargetCylinder->radius()) {
      result = false;
    }
  }
  if (result) {
    Cand = GlobalVector(aTsosPath.first.globalPosition().x(),
                        aTsosPath.first.globalPosition().y(),
                        aTsosPath.first.globalPosition().z() );
  }
  return result;
}

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().

Definition at line 36 of file PropagateToCal.h.

Referenced by propagate(), and PropagateToCal().