CMS 3D CMS Logo

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

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, magfieldparam::poly2d_base::MIN_COEFF, np, magfieldparam::poly2d_base::NPwr, magfieldparam::poly2d_base::NTab, magfieldparam::poly2d_base::poly2d_base_set, magfieldparam::poly2d_base::rval, magfieldparam::poly2d_base::rz_pow, magfieldparam::poly2d_base::rz_set, and magfieldparam::poly2d_base::zval.

Referenced by magfieldparam::poly2d_base::GetVal(), and poly2d_term().

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

Member Data Documentation

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