CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

magneticfield::VolumeBasedMagneticFieldESProducer Class Reference

#include <VolumeBasedMagneticFieldESProducer.h>

Inheritance diagram for magneticfield::VolumeBasedMagneticFieldESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

std::auto_ptr< MagneticFieldproduce (const IdealMagneticFieldRecord &iRecord)
 VolumeBasedMagneticFieldESProducer (const edm::ParameterSet &iConfig)

Private Member Functions

const
VolumeBasedMagneticFieldESProducer
operator= (const VolumeBasedMagneticFieldESProducer &)
 VolumeBasedMagneticFieldESProducer (const VolumeBasedMagneticFieldESProducer &)

Private Attributes

edm::ParameterSet pset

Detailed Description

Definition at line 20 of file VolumeBasedMagneticFieldESProducer.h.


Constructor & Destructor Documentation

VolumeBasedMagneticFieldESProducer::VolumeBasedMagneticFieldESProducer ( const edm::ParameterSet iConfig)
magneticfield::VolumeBasedMagneticFieldESProducer::VolumeBasedMagneticFieldESProducer ( const VolumeBasedMagneticFieldESProducer ) [private]

Member Function Documentation

const VolumeBasedMagneticFieldESProducer& magneticfield::VolumeBasedMagneticFieldESProducer::operator= ( const VolumeBasedMagneticFieldESProducer ) [private]
std::auto_ptr< MagneticField > VolumeBasedMagneticFieldESProducer::produce ( const IdealMagneticFieldRecord iRecord)

Definition at line 35 of file VolumeBasedMagneticFieldESProducer.cc.

References MagGeoBuilderFromDDD::barrelLayers(), MagGeoBuilderFromDDD::barrelVolumes(), MagGeoBuilderFromDDD::build(), gather_cfg::cout, debug, MagGeoBuilderFromDDD::endcapSectors(), MagGeoBuilderFromDDD::endcapVolumes(), edm::eventsetup::EventSetupRecord::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), relativeConstraints::keys, MagGeoBuilderFromDDD::maxR(), MagGeoBuilderFromDDD::maxZ(), edm::ESHandle< T >::product(), pset, alignCSCRings::s, MagGeoBuilderFromDDD::setScaling(), and makeHLTPrescaleTable::values.

{
  bool debug = pset.getUntrackedParameter<bool>("debugBuilder", false);
  if (debug) {
    cout << "VolumeBasedMagneticFieldESProducer::produce() " << pset.getParameter<std::string>("version") << endl;
  }
  
  edm::ESTransientHandle<DDCompactView> cpv;
  iRecord.get("magfield",cpv );
  MagGeoBuilderFromDDD builder(pset.getParameter<std::string>("version"),
                               debug, 
                               pset.getParameter<bool>("overrideMasterSector"));

  // Get scaling factors
  vector<int> keys = pset.getParameter<vector<int> >("scalingVolumes");
  vector<double> values = pset.getParameter<vector<double> >("scalingFactors");

  if (keys.size() != 0) {
    builder.setScaling(keys, values);
  }

  builder.build(*cpv);


  // Get slave field
  edm::ESHandle<MagneticField> paramField;
  if (pset.getParameter<bool>("useParametrizedTrackerField")) {;
    iRecord.get(pset.getParameter<string>("paramLabel"),paramField);
  }
  std::auto_ptr<MagneticField> s(new VolumeBasedMagneticField(pset,builder.barrelLayers(), builder.endcapSectors(), builder.barrelVolumes(), builder.endcapVolumes(), builder.maxR(), builder.maxZ(), paramField.product(), false));
  return s;
}

Member Data Documentation