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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 12 of file MFProducer.cc.

Constructor & Destructor Documentation

◆ MFProducer()

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

Definition at line 38 of file MFProducer.cc.

38  : m_valid(false) {
39  m_mapDensityX = iPset.getUntrackedParameter<unsigned>("mapDensityX", 10);
40  m_mapDensityY = iPset.getUntrackedParameter<unsigned>("mapDensityY", 10);
41  m_mapDensityZ = iPset.getUntrackedParameter<unsigned>("mapDensityY", 10);
42  m_minX = iPset.getUntrackedParameter<double>("minX", -18.0);
43  m_maxX = iPset.getUntrackedParameter<double>("maxX", 18.0);
44  m_minY = iPset.getUntrackedParameter<double>("minY", -18.0);
45  m_maxY = iPset.getUntrackedParameter<double>("maxY", 18.0);
46  m_minZ = iPset.getUntrackedParameter<double>("minZ", -18.0);
47  m_maxZ = iPset.getUntrackedParameter<double>("maxZ", 18.0);
48 
52 }

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.

◆ ~MFProducer()

MFProducer::~MFProducer ( void  )
override

Definition at line 54 of file MFProducer.cc.

54 {}

Member Function Documentation

◆ beginJob()

void MFProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 83 of file MFProducer.cc.

83 {}

◆ endJob()

void MFProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 85 of file MFProducer.cc.

85 {}

◆ evaluate()

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

Definition at line 75 of file MFProducer.cc.

75  {
77 
78  field[0] = b.x();
79  field[1] = b.y();
80  field[2] = b.z();
81 }

References b, MagneticField::inTesla(), m_mf, and point.

Referenced by produce().

◆ produce()

void MFProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 56 of file MFProducer.cc.

56  {
58  m_mf.isValid() ? m_valid = true : m_valid = false;
59 
60  for (unsigned i = 0; i <= m_mapDensityX; ++i) {
61  for (unsigned j = 0; j <= m_mapDensityY; ++j) {
62  // Prepare field position and get value.
63  double x = m_minX + m_xBaseDir * i;
64  double y = m_minY + m_yBaseDir * j;
65  double z = 0.;
66  double pt[3] = {x, y, z};
67  double val[3];
68  evaluate(pt, val);
69  std::cout << "(" << x << ", " << y << ", " << z << ") " << val[0] << ":" << val[1] << ":" << val[2] << "; ";
70  }
71  std::cout << std::endl;
72  }
73 }

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

Member Data Documentation

◆ m_mapDensityX

unsigned MFProducer::m_mapDensityX
private

Definition at line 22 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

◆ m_mapDensityY

unsigned MFProducer::m_mapDensityY
private

Definition at line 23 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

◆ m_mapDensityZ

unsigned MFProducer::m_mapDensityZ
private

Definition at line 24 of file MFProducer.cc.

Referenced by MFProducer().

◆ m_maxX

double MFProducer::m_maxX
private

Definition at line 26 of file MFProducer.cc.

Referenced by MFProducer().

◆ m_maxY

double MFProducer::m_maxY
private

Definition at line 28 of file MFProducer.cc.

Referenced by MFProducer().

◆ m_maxZ

double MFProducer::m_maxZ
private

Definition at line 30 of file MFProducer.cc.

Referenced by MFProducer().

◆ m_mf

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

Definition at line 35 of file MFProducer.cc.

Referenced by evaluate(), and produce().

◆ m_minX

double MFProducer::m_minX
private

Definition at line 25 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

◆ m_minY

double MFProducer::m_minY
private

Definition at line 27 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

◆ m_minZ

double MFProducer::m_minZ
private

Definition at line 29 of file MFProducer.cc.

Referenced by MFProducer().

◆ m_valid

bool MFProducer::m_valid
private

Definition at line 34 of file MFProducer.cc.

Referenced by produce().

◆ m_xBaseDir

double MFProducer::m_xBaseDir
private

Definition at line 31 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

◆ m_yBaseDir

double MFProducer::m_yBaseDir
private

Definition at line 32 of file MFProducer.cc.

Referenced by MFProducer(), and produce().

◆ m_zBaseDir

double MFProducer::m_zBaseDir
private

Definition at line 33 of file MFProducer.cc.

Referenced by MFProducer().

Vector3DBase
Definition: Vector3DBase.h:8
DDAxes::y
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
mps_fire.i
i
Definition: mps_fire.py:428
MFProducer::m_minZ
double m_minZ
Definition: MFProducer.cc:29
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MFProducer::m_mapDensityY
unsigned m_mapDensityY
Definition: MFProducer.cc:23
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
MFProducer::m_valid
bool m_valid
Definition: MFProducer.cc:34
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
MFProducer::m_mapDensityZ
unsigned m_mapDensityZ
Definition: MFProducer.cc:24
DDAxes::z
MFProducer::m_minY
double m_minY
Definition: MFProducer.cc:27
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
MFProducer::m_zBaseDir
double m_zBaseDir
Definition: MFProducer.cc:33
MFProducer::m_maxX
double m_maxX
Definition: MFProducer.cc:26
b
double b
Definition: hdecay.h:118
MFProducer::m_mapDensityX
unsigned m_mapDensityX
Definition: MFProducer.cc:22
funct::true
true
Definition: Factorize.h:173
MFProducer::evaluate
void evaluate(const double point[3], double field[3]) const
Definition: MFProducer.cc:75
MFProducer::m_xBaseDir
double m_xBaseDir
Definition: MFProducer.cc:31
MFProducer::m_maxY
double m_maxY
Definition: MFProducer.cc:28
MFProducer::m_maxZ
double m_maxZ
Definition: MFProducer.cc:30
MFProducer::m_minX
double m_minX
Definition: MFProducer.cc:25
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
heppy_batch.val
val
Definition: heppy_batch.py:351
MFProducer::m_mf
edm::ESHandle< MagneticField > m_mf
Definition: MFProducer.cc:35
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
point
*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
MFProducer::m_yBaseDir
double m_yBaseDir
Definition: MFProducer.cc:32