CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MFAnalyzer Class Reference
Inheritance diagram for MFAnalyzer:
edm::EDAnalyzer

Public Member Functions

 MFAnalyzer (const edm::ParameterSet &)
 
bool valid (void)
 
 ~MFAnalyzer (void)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
void evaluate (const double point[3], double field[3]) const
 

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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 18 of file MFAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file MFAnalyzer.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.

46  : m_valid( false )
47 {
48  m_mapDensityX = iPset.getUntrackedParameter<unsigned>( "mapDensityX", 10 );
49  m_mapDensityY = iPset.getUntrackedParameter<unsigned>( "mapDensityY", 10 );
50  m_mapDensityZ = iPset.getUntrackedParameter<unsigned>( "mapDensityY", 10 );
51  m_minX = iPset.getUntrackedParameter<double>( "minX", -18.0 );
52  m_maxX = iPset.getUntrackedParameter<double>( "maxX", 18.0 );
53  m_minY = iPset.getUntrackedParameter<double>( "minY", -18.0 );
54  m_maxY = iPset.getUntrackedParameter<double>( "maxY", 18.0 );
55  m_minZ = iPset.getUntrackedParameter<double>( "minZ", -18.0 );
56  m_maxZ = iPset.getUntrackedParameter<double>( "maxZ", 18.0 );
57 
58  m_xBaseDir = ( m_maxX - m_minX ) / m_mapDensityX;
59  m_yBaseDir = ( m_maxY - m_minY ) / m_mapDensityY;
60  m_zBaseDir = ( m_maxZ - m_minZ ) / m_mapDensityZ;
61 }
T getUntrackedParameter(std::string const &, T const &) const
double m_minX
Definition: MFAnalyzer.cc:32
double m_minZ
Definition: MFAnalyzer.cc:36
double m_xBaseDir
Definition: MFAnalyzer.cc:38
double m_maxX
Definition: MFAnalyzer.cc:33
double m_minY
Definition: MFAnalyzer.cc:34
unsigned m_mapDensityY
Definition: MFAnalyzer.cc:30
double m_maxZ
Definition: MFAnalyzer.cc:37
bool m_valid
Definition: MFAnalyzer.cc:41
double m_zBaseDir
Definition: MFAnalyzer.cc:40
unsigned m_mapDensityX
Definition: MFAnalyzer.cc:29
double m_maxY
Definition: MFAnalyzer.cc:35
double m_yBaseDir
Definition: MFAnalyzer.cc:39
unsigned m_mapDensityZ
Definition: MFAnalyzer.cc:31
MFAnalyzer::~MFAnalyzer ( void  )

Definition at line 63 of file MFAnalyzer.cc.

64 {}

Member Function Documentation

void MFAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 67 of file MFAnalyzer.cc.

References gather_cfg::cout, evaluate(), edm::EventSetup::get(), i, edm::ESHandleBase::isValid(), j, gen::k, m_mapDensityX, m_mapDensityY, m_mapDensityZ, m_mf, m_minX, m_minY, m_minZ, m_valid, m_xBaseDir, m_yBaseDir, m_zBaseDir, ExpressReco_HICollisions_FallBack::pt, ExpressReco_HICollisions_FallBack::x, ExpressReco_HICollisions_FallBack::y, and z.

68 {
69  iSetup.get<IdealMagneticFieldRecord>().get( m_mf );
70  m_mf.isValid() ? m_valid = true : m_valid = false;
71 
72  for( unsigned i = 0; i <= m_mapDensityX; ++i )
73  {
74  for( unsigned j = 0; j <= m_mapDensityY; ++j )
75  {
76  for( unsigned k = 0; k <= m_mapDensityZ; ++k )
77  {
78  // Prepare field position and get value.
79  double x = m_minX + m_xBaseDir * i;
80  double y = m_minY + m_yBaseDir * j;
81  double z = m_minZ + m_zBaseDir * k;
82  double pt[3] = { x, y, z };
83  double val[3];
84  evaluate( pt, val );
85  std::cout << "(" << x << ", " << y << ", " << z << ") " << val[0] << ":" << val[1] << ":" << val[2] << "; ";
86  }
87  std::cout << std::endl;
88  }
89  std::cout << std::endl;
90  }
91 }
int i
Definition: DBlmapReader.cc:9
double m_minX
Definition: MFAnalyzer.cc:32
void evaluate(const double point[3], double field[3]) const
Definition: MFAnalyzer.cc:94
double m_minZ
Definition: MFAnalyzer.cc:36
edm::ESHandle< MagneticField > m_mf
Definition: MFAnalyzer.cc:42
double m_xBaseDir
Definition: MFAnalyzer.cc:38
double m_minY
Definition: MFAnalyzer.cc:34
Definition: DDAxes.h:10
unsigned m_mapDensityY
Definition: MFAnalyzer.cc:30
int j
Definition: DBlmapReader.cc:9
bool m_valid
Definition: MFAnalyzer.cc:41
int k[5][pyjets_maxn]
double m_zBaseDir
Definition: MFAnalyzer.cc:40
unsigned m_mapDensityX
Definition: MFAnalyzer.cc:29
const T & get() const
Definition: EventSetup.h:55
double m_yBaseDir
Definition: MFAnalyzer.cc:39
tuple cout
Definition: gather_cfg.py:41
unsigned m_mapDensityZ
Definition: MFAnalyzer.cc:31
bool isValid() const
Definition: ESHandle.h:37
void MFAnalyzer::evaluate ( const double  point[3],
double  field[3] 
) const
private

Definition at line 94 of file MFAnalyzer.cc.

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

Referenced by analyze().

95 {
96  GlobalVector b = m_mf->inTesla( GlobalPoint( point[0], point[1], point[2] ));
97 
98  field [0] = b.x();
99  field [1] = b.y();
100  field [2] = b.z();
101 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:57
edm::ESHandle< MagneticField > m_mf
Definition: MFAnalyzer.cc:42
T z() const
Definition: PV3DBase.h:58
double b
Definition: hdecay.h:120
T x() const
Definition: PV3DBase.h:56
*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
bool MFAnalyzer::valid ( void  )
inline

Definition at line 24 of file MFAnalyzer.cc.

References m_valid.

24 { return m_valid; }
bool m_valid
Definition: MFAnalyzer.cc:41

Member Data Documentation

unsigned MFAnalyzer::m_mapDensityX
private

Definition at line 29 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

unsigned MFAnalyzer::m_mapDensityY
private

Definition at line 30 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

unsigned MFAnalyzer::m_mapDensityZ
private

Definition at line 31 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

double MFAnalyzer::m_maxX
private

Definition at line 33 of file MFAnalyzer.cc.

Referenced by MFAnalyzer().

double MFAnalyzer::m_maxY
private

Definition at line 35 of file MFAnalyzer.cc.

Referenced by MFAnalyzer().

double MFAnalyzer::m_maxZ
private

Definition at line 37 of file MFAnalyzer.cc.

Referenced by MFAnalyzer().

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

Definition at line 42 of file MFAnalyzer.cc.

Referenced by analyze(), and evaluate().

double MFAnalyzer::m_minX
private

Definition at line 32 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

double MFAnalyzer::m_minY
private

Definition at line 34 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

double MFAnalyzer::m_minZ
private

Definition at line 36 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

bool MFAnalyzer::m_valid
private

Definition at line 41 of file MFAnalyzer.cc.

Referenced by analyze(), and valid().

double MFAnalyzer::m_xBaseDir
private

Definition at line 38 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

double MFAnalyzer::m_yBaseDir
private

Definition at line 39 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().

double MFAnalyzer::m_zBaseDir
private

Definition at line 40 of file MFAnalyzer.cc.

Referenced by analyze(), and MFAnalyzer().