CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
magfieldparam::poly2d_term Struct Reference

#include <poly2d_base.h>

Public Member Functions

 poly2d_term ()
 
 poly2d_term (double C, unsigned nr, unsigned nz)
 
void Print (std::ostream &out=std::cout, bool first_term=true)
 

Public Attributes

double coeff
 
unsigned np [2]
 

Detailed Description

Definition at line 23 of file poly2d_base.h.

Constructor & Destructor Documentation

magfieldparam::poly2d_term::poly2d_term ( )
inline

Definition at line 27 of file poly2d_base.h.

27 { memset(this, 0, sizeof(*this)); }
magfieldparam::poly2d_term::poly2d_term ( double  C,
unsigned  nr,
unsigned  nz 
)
inline

Definition at line 28 of file poly2d_base.h.

References gen::C, coeff, and np.

28  {
29  coeff = C;
30  np[0] = nr;
31  np[1] = nz;
32  }

Member Function Documentation

void poly2d_term::Print ( std::ostream &  out = std::cout,
bool  first_term = true 
)

Definition at line 12 of file poly2d_base.cc.

References coeff, and np.

12  {
13  if (first_term)
14  out << coeff;
15  else if (coeff > 0.)
16  out << " + " << coeff;
17  else
18  out << " - " << -coeff;
19  if (np[0] != 0) {
20  out << "*r";
21  if (np[0] != 1)
22  out << "^" << np[0];
23  }
24  if (np[1] != 0) {
25  out << "*z";
26  if (np[1] != 1)
27  out << "^" << np[1];
28  }
29 }

Member Data Documentation

double magfieldparam::poly2d_term::coeff
unsigned magfieldparam::poly2d_term::np[2]