CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MFProducer Class Reference
Inheritance diagram for MFProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MFProducer (const edm::ParameterSet &)
 
 ~MFProducer (void) override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob (void) override
 
void endJob (void) override
 
void evaluate (const double point[3], double field[3]) const
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

unsigned m_mapDensityX
 
unsigned m_mapDensityY
 
unsigned m_mapDensityZ
 
double m_maxX
 
double m_maxY
 
double m_maxZ
 
edm::ESHandle< MagneticFieldm_mf
 
double m_minX
 
double m_minY
 
double m_minZ
 
bool m_valid
 
double m_xBaseDir
 
double m_yBaseDir
 
double m_zBaseDir
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 12 of file MFProducer.cc.

Constructor & Destructor Documentation

MFProducer::MFProducer ( const edm::ParameterSet iPset)
explicit

Definition at line 39 of file MFProducer.cc.

References edm::ParameterSet::getUntrackedParameter(), m_mapDensityX, m_mapDensityY, m_mapDensityZ, m_maxX, m_maxY, m_maxZ, m_minX, m_minY, m_minZ, m_xBaseDir, m_yBaseDir, and m_zBaseDir.

40  : m_valid( false )
41 {
42  m_mapDensityX = iPset.getUntrackedParameter<unsigned>( "mapDensityX", 10 );
43  m_mapDensityY = iPset.getUntrackedParameter<unsigned>( "mapDensityY", 10 );
44  m_mapDensityZ = iPset.getUntrackedParameter<unsigned>( "mapDensityY", 10 );
45  m_minX = iPset.getUntrackedParameter<double>( "minX", -18.0 );
46  m_maxX = iPset.getUntrackedParameter<double>( "maxX", 18.0 );
47  m_minY = iPset.getUntrackedParameter<double>( "minY", -18.0 );
48  m_maxY = iPset.getUntrackedParameter<double>( "maxY", 18.0 );
49  m_minZ = iPset.getUntrackedParameter<double>( "minZ", -18.0 );
50  m_maxZ = iPset.getUntrackedParameter<double>( "maxZ", 18.0 );
51 
52  m_xBaseDir = ( m_maxX - m_minX ) / m_mapDensityX;
53  m_yBaseDir = ( m_maxY - m_minY ) / m_mapDensityY;
54  m_zBaseDir = ( m_maxZ - m_minZ ) / m_mapDensityZ;
55 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned m_mapDensityZ
Definition: MFProducer.cc:25
double m_minX
Definition: MFProducer.cc:26
double m_minZ
Definition: MFProducer.cc:30
unsigned m_mapDensityY
Definition: MFProducer.cc:24
unsigned m_mapDensityX
Definition: MFProducer.cc:23
double m_maxX
Definition: MFProducer.cc:27
bool m_valid
Definition: MFProducer.cc:35
double m_xBaseDir
Definition: MFProducer.cc:32
double m_maxZ
Definition: MFProducer.cc:31
double m_maxY
Definition: MFProducer.cc:29
double m_zBaseDir
Definition: MFProducer.cc:34
double m_yBaseDir
Definition: MFProducer.cc:33
double m_minY
Definition: MFProducer.cc:28
MFProducer::~MFProducer ( void  )
override

Definition at line 57 of file MFProducer.cc.

58 {}

Member Function Documentation

void MFProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 94 of file MFProducer.cc.

95 {}
void MFProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 98 of file MFProducer.cc.

References DEFINE_FWK_MODULE.

99 {}
void MFProducer::evaluate ( const double  point[3],
double  field[3] 
) const
private

Definition at line 84 of file MFProducer.cc.

References b, MagneticField::inTesla(), m_mf, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by produce().

85 {
87 
88  field [0] = b.x();
89  field [1] = b.y();
90  field [2] = b.z();
91 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
edm::ESHandle< MagneticField > m_mf
Definition: MFProducer.cc:36
double b
Definition: hdecay.h:120
T x() const
Definition: PV3DBase.h:62
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void MFProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 61 of file MFProducer.cc.

References gather_cfg::cout, evaluate(), edm::EventSetup::get(), mps_fire::i, edm::ESHandleBase::isValid(), m_mapDensityX, m_mapDensityY, m_mf, m_minX, m_minY, m_valid, m_xBaseDir, m_yBaseDir, EnergyCorrector::pt, heppy_batch::val, x, y, and z.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

62 {
63  iSetup.get<IdealMagneticFieldRecord>().get( m_mf );
64  m_mf.isValid() ? m_valid = true : m_valid = false;
65 
66  for( unsigned i = 0; i <= m_mapDensityX; ++i )
67  {
68  for( unsigned j = 0; j <= m_mapDensityY; ++j )
69  {
70  // Prepare field position and get value.
71  double x = m_minX + m_xBaseDir * i;
72  double y = m_minY + m_yBaseDir * j;
73  double z = 0.;
74  double pt[3] = { x, y, z };
75  double val[3];
76  evaluate( pt, val );
77  std::cout << "(" << x << ", " << y << ", " << z << ") " << val[0] << ":" << val[1] << ":" << val[2] << "; ";
78  }
79  std::cout << std::endl;
80  }
81 }
double m_minX
Definition: MFProducer.cc:26
unsigned m_mapDensityY
Definition: MFProducer.cc:24
unsigned m_mapDensityX
Definition: MFProducer.cc:23
bool m_valid
Definition: MFProducer.cc:35
double m_xBaseDir
Definition: MFProducer.cc:32
void evaluate(const double point[3], double field[3]) const
Definition: MFProducer.cc:84
edm::ESHandle< MagneticField > m_mf
Definition: MFProducer.cc:36
const T & get() const
Definition: EventSetup.h:55
bool isValid() const
Definition: ESHandle.h:47
double m_yBaseDir
Definition: MFProducer.cc:33
double m_minY
Definition: MFProducer.cc:28

Member Data Documentation

unsigned MFProducer::m_mapDensityX
private

Definition at line 23 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

unsigned MFProducer::m_mapDensityY
private

Definition at line 24 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

unsigned MFProducer::m_mapDensityZ
private

Definition at line 25 of file MFProducer.cc.

Referenced by MFProducer().

double MFProducer::m_maxX
private

Definition at line 27 of file MFProducer.cc.

Referenced by MFProducer().

double MFProducer::m_maxY
private

Definition at line 29 of file MFProducer.cc.

Referenced by MFProducer().

double MFProducer::m_maxZ
private

Definition at line 31 of file MFProducer.cc.

Referenced by MFProducer().

edm::ESHandle<MagneticField> MFProducer::m_mf
private

Definition at line 36 of file MFProducer.cc.

Referenced by evaluate(), and produce().

double MFProducer::m_minX
private

Definition at line 26 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

double MFProducer::m_minY
private

Definition at line 28 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

double MFProducer::m_minZ
private

Definition at line 30 of file MFProducer.cc.

Referenced by MFProducer().

bool MFProducer::m_valid
private

Definition at line 35 of file MFProducer.cc.

Referenced by produce().

double MFProducer::m_xBaseDir
private

Definition at line 32 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

double MFProducer::m_yBaseDir
private

Definition at line 33 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

double MFProducer::m_zBaseDir
private

Definition at line 34 of file MFProducer.cc.

Referenced by MFProducer().