CMS 3D CMS Logo

Public Member Functions | Private Attributes

GeantPropagatorESProducer Class Reference

#include <GeantPropagatorESProducer.h>

Inheritance diagram for GeantPropagatorESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 GeantPropagatorESProducer (const edm::ParameterSet &p)
boost::shared_ptr< Propagatorproduce (const TrackingComponentsRecord &)
virtual ~GeantPropagatorESProducer ()

Private Attributes

boost::shared_ptr< Propagator_propagator
edm::ParameterSet pset_

Detailed Description

Definition at line 10 of file GeantPropagatorESProducer.h.


Constructor & Destructor Documentation

GeantPropagatorESProducer::GeantPropagatorESProducer ( const edm::ParameterSet p)

Definition at line 16 of file GeantPropagatorESProducer.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_ParallelJobs::p.

{
  std::string myname = p.getParameter<std::string>("ComponentName");
  pset_ = p;
  setWhatProduced(this,myname);
}
GeantPropagatorESProducer::~GeantPropagatorESProducer ( ) [virtual]

Definition at line 23 of file GeantPropagatorESProducer.cc.

{}

Member Function Documentation

boost::shared_ptr< Propagator > GeantPropagatorESProducer::produce ( const TrackingComponentsRecord iRecord)

Definition at line 26 of file GeantPropagatorESProducer.cc.

References alongMomentum, anyDirection, dir, Geant4ePropagator_cfi::Geant4ePropagator, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), autoMagneticFieldProducer_cfi::magfield, and oppositeToMomentum.

                                                                          { 

  ESHandle<MagneticField> magfield;
  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );


  std::string pdir = pset_.getParameter<std::string>("PropagationDirection");
  std::string particleName = pset_.getParameter<std::string>("ParticleName");
  const char* part = particleName.c_str();

  PropagationDirection dir = alongMomentum;
  
  if (pdir == "oppositeToMomentum") dir = oppositeToMomentum;
  if (pdir == "alongMomentum") dir = alongMomentum;
  if (pdir == "anyDirection") dir = anyDirection;
  
  _propagator  = boost::shared_ptr<Propagator>(new Geant4ePropagator(&(*magfield),part,dir));
  return _propagator;
}

Member Data Documentation

boost::shared_ptr<Propagator> GeantPropagatorESProducer::_propagator [private]

Definition at line 16 of file GeantPropagatorESProducer.h.

Definition at line 17 of file GeantPropagatorESProducer.h.