test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
MagneticField
ParametrizedEngine
src
rz_harm_poly.h
Go to the documentation of this file.
1
#ifndef rz_harm_poly_h
2
#define rz_harm_poly_h
3
4
#include <cmath>
5
#include "
poly2d_base.h
"
6
8
// //
9
// Pair (Cos(phi),Sin(Phi)). Intended for internal use by rz_harm_poly. //
10
// //
12
13
//_______________________________________________________________________________
14
namespace
magfieldparam {
15
struct
trig_pair
{
16
double
CosPhi
;
17
double
SinPhi
;
18
19
trig_pair
() :
CosPhi
(1.),
SinPhi
(0.) {}
20
trig_pair
(
const
trig_pair
&tp) :
CosPhi
(tp.
CosPhi
),
SinPhi
(tp.
SinPhi
) {}
21
trig_pair
(
const
double
C
,
const
double
S
) :
CosPhi
(C),
SinPhi
(S) {}
22
trig_pair
(
const
double
phi) :
CosPhi
(
cos
(phi)),
SinPhi
(
sin
(phi)) {}
23
24
//Return trig_pair fo angle increased by angle of tp.
25
trig_pair
Add
(
const
trig_pair
&tp) {
26
return
trig_pair
(this->
CosPhi
*tp.
CosPhi
- this->SinPhi*tp.
SinPhi
,
27
this->SinPhi*tp.
CosPhi
+ this->CosPhi*tp.
SinPhi
);
28
}
29
};
30
32
// //
33
// Harmonic homogeneous polynomial in cylindrical system. //
34
// //
36
37
//_______________________________________________________________________________
38
class
rz_harm_poly
:
public
poly2d_base
{
39
40
private
:
41
unsigned
L
;
42
int
M
;
43
44
static
unsigned
Cnt
;
//Number of the "rz_harm_poly" objects
45
static
double
phival
;
//Last phi value used
46
static
bool
phi_set
;
//TRUE if phi value is set
47
static
unsigned
MaxM
;
//Max. M among "rz_harm_poly" objects
48
49
static
unsigned
TASize
;
//TrigArr size
50
static
trig_pair
*
TrigArr
;
//Array with angular data
51
52
static
void
SetTrigArrSize
(
const
unsigned
N
);
53
static
void
FillTrigArr
(
const
double
phi);
54
55
void
PrintLM
(std::ostream &
out
=
std::cout
)
56
{
57
out
<<
"L="
<< std::setw(3) << std::left <<
L
58
<<
", M="
<< std::setw(3) << std::left <<
M
<<
"; "
;
59
}
60
61
public
:
62
63
static
int
GetMaxM
();
//return Max. M for the class
64
static
unsigned
ParentCount
() {
return
poly2d_base::Count
();}
65
static
unsigned
Count
() {
return
Cnt
;}
66
static
void
SetPhi
(
const
double
phi);
67
static
void
SetPoint
(
const
double
r
,
const
double
z,
const
double
phi)
68
{
69
poly2d_base::SetPoint
(r, z);
SetPhi
(phi);
70
}
71
72
rz_harm_poly
() :
poly2d_base
(),
L
(0),
M
(0) {++
Cnt
;}
73
rz_harm_poly
(
const
poly2d_base
&
S
) :
poly2d_base
(S),
L
(0),
M
(0) {++
Cnt
;}
74
rz_harm_poly
(
const
rz_harm_poly
&
S
) :
poly2d_base
(S),
L
(S.
L
),
M
(S.
M
) {++
Cnt
;}
75
rz_harm_poly
(
const
unsigned
N
);
76
~rz_harm_poly
();
77
78
bool
IsPhiSet
() {
return
phi_set
;}
79
80
rz_harm_poly
GetDiff
(
int
nvar) {
rz_harm_poly
R
(*
this
); R.
Diff
(nvar);
return
R
;}
81
rz_harm_poly
GetInt
(
int
nvar) {
rz_harm_poly
R
(*
this
); R.
Int
(nvar);
return
R
;}
82
rz_harm_poly
GetIncPow
(
int
nvar) {
rz_harm_poly
R
(*
this
); R.
IncPow
(nvar);
return
R
;}
83
rz_harm_poly
GetDecPow
(
int
nvar) {
rz_harm_poly
R
(*
this
); R.
DecPow
(nvar);
return
R
;}
84
85
rz_harm_poly
LadderUp
();
86
rz_harm_poly
LadderDwn
();
87
88
unsigned
GetL
() {
return
L
;}
89
int
GetM
() {
return
M
;}
90
91
//Next functions return value of angular terms.
92
//No check is made, wheither the TrigArr is initialized.
93
//User can check if IsPhiSet() == true
94
double
GetCos
() {
return
TrigArr
[
M
].
CosPhi
;}
95
double
GetSin
() {
return
TrigArr
[
M
].
SinPhi
;}
96
97
void
CheatL
(
const
unsigned
newL) {
L
= newL;}
98
void
Print
(std::ostream &
out
=
std::cout
,
const
std::streamsize prec = 5)
99
{
PrintLM
(
out
);
poly2d_base::Print
(
out
, prec);}
100
101
102
static
void
PrintTrigArr
(std::ostream &
out
=
std::cout
,
const
std::streamsize prec = 5);
103
104
};
//class rz_harm_poly
105
}
106
107
#endif
magfieldparam::rz_harm_poly::phival
static double phival
Definition:
rz_harm_poly.h:45
magfieldparam::poly2d_base
Definition:
poly2d_base.h:44
magfieldparam::rz_harm_poly::rz_harm_poly
rz_harm_poly()
Definition:
rz_harm_poly.h:72
magfieldparam::rz_harm_poly::FillTrigArr
static void FillTrigArr(const double phi)
Definition:
rz_harm_poly.cc:113
magfieldparam::poly2d_base::Print
void Print(std::ostream &out=std::cout, const std::streamsize prec=5)
Definition:
poly2d_base.cc:204
magfieldparam::rz_harm_poly::GetL
unsigned GetL()
Definition:
rz_harm_poly.h:88
magfieldparam::poly2d_base::Diff
void Diff(int nvar)
Definition:
poly2d_base.cc:222
magfieldparam::trig_pair::Add
trig_pair Add(const trig_pair &tp)
Definition:
rz_harm_poly.h:25
magfieldparam::trig_pair::CosPhi
double CosPhi
Definition:
rz_harm_poly.h:16
funct::sin
Sin< T >::type sin(const T &t)
Definition:
Sin.h:22
poly2d_base.h
magfieldparam::rz_harm_poly::L
unsigned L
Definition:
rz_harm_poly.h:41
magfieldparam::poly2d_base::IncPow
void IncPow(int nvar)
Definition:
poly2d_base.cc:260
funct::C
C
Definition:
Factorize.h:141
magfieldparam::rz_harm_poly::Count
static unsigned Count()
Definition:
rz_harm_poly.h:65
magfieldparam::rz_harm_poly::LadderDwn
rz_harm_poly LadderDwn()
Definition:
rz_harm_poly.cc:193
magfieldparam::rz_harm_poly::SetPhi
static void SetPhi(const double phi)
Definition:
rz_harm_poly.cc:88
magfieldparam::rz_harm_poly::TrigArr
static trig_pair * TrigArr
Definition:
rz_harm_poly.h:50
magfieldparam::rz_harm_poly::GetMaxM
static int GetMaxM()
Definition:
rz_harm_poly.cc:72
magfieldparam::poly2d_base::SetPoint
static void SetPoint(const double r, const double z)
Definition:
poly2d_base.cc:148
magfieldparam::rz_harm_poly::GetInt
rz_harm_poly GetInt(int nvar)
Definition:
rz_harm_poly.h:81
magfieldparam::rz_harm_poly::GetSin
double GetSin()
Definition:
rz_harm_poly.h:95
magfieldparam::rz_harm_poly::GetM
int GetM()
Definition:
rz_harm_poly.h:89
dttmaxenums::R
Definition:
DTTMax.h:28
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
magfieldparam::rz_harm_poly::M
int M
Definition:
rz_harm_poly.h:42
magfieldparam::rz_harm_poly::IsPhiSet
bool IsPhiSet()
Definition:
rz_harm_poly.h:78
magfieldparam::rz_harm_poly::SetPoint
static void SetPoint(const double r, const double z, const double phi)
Definition:
rz_harm_poly.h:67
magfieldparam::rz_harm_poly::LadderUp
rz_harm_poly LadderUp()
Definition:
rz_harm_poly.cc:155
magfieldparam::rz_harm_poly::GetIncPow
rz_harm_poly GetIncPow(int nvar)
Definition:
rz_harm_poly.h:82
magfieldparam::trig_pair::trig_pair
trig_pair(const double phi)
Definition:
rz_harm_poly.h:22
magfieldparam::rz_harm_poly::GetCos
double GetCos()
Definition:
rz_harm_poly.h:94
magfieldparam::rz_harm_poly::Cnt
static unsigned Cnt
Definition:
rz_harm_poly.h:44
GenerateHcalLaserBadRunList.out
tuple out
Definition:
GenerateHcalLaserBadRunList.py:91
magfieldparam::rz_harm_poly::GetDecPow
rz_harm_poly GetDecPow(int nvar)
Definition:
rz_harm_poly.h:83
N
#define N
Definition:
blowfish.cc:9
magfieldparam::rz_harm_poly::GetDiff
rz_harm_poly GetDiff(int nvar)
Definition:
rz_harm_poly.h:80
magfieldparam::trig_pair::trig_pair
trig_pair()
Definition:
rz_harm_poly.h:19
magfieldparam::rz_harm_poly
Definition:
rz_harm_poly.h:38
magfieldparam::poly2d_base::DecPow
void DecPow(int nvar)
Definition:
poly2d_base.cc:272
magfieldparam::rz_harm_poly::MaxM
static unsigned MaxM
Definition:
rz_harm_poly.h:47
magfieldparam::trig_pair::trig_pair
trig_pair(const double C, const double S)
Definition:
rz_harm_poly.h:21
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
magfieldparam::trig_pair
Definition:
rz_harm_poly.h:15
magfieldparam::rz_harm_poly::TASize
static unsigned TASize
Definition:
rz_harm_poly.h:49
magfieldparam::poly2d_base::Int
void Int(int nvar)
Definition:
poly2d_base.cc:246
magfieldparam::rz_harm_poly::rz_harm_poly
rz_harm_poly(const rz_harm_poly &S)
Definition:
rz_harm_poly.h:74
magfieldparam::rz_harm_poly::PrintTrigArr
static void PrintTrigArr(std::ostream &out=std::cout, const std::streamsize prec=5)
Definition:
rz_harm_poly.cc:123
magfieldparam::rz_harm_poly::~rz_harm_poly
~rz_harm_poly()
Definition:
rz_harm_poly.cc:54
alignCSCRings.r
list r
Definition:
alignCSCRings.py:92
magfieldparam::rz_harm_poly::PrintLM
void PrintLM(std::ostream &out=std::cout)
Definition:
rz_harm_poly.h:55
magfieldparam::rz_harm_poly::rz_harm_poly
rz_harm_poly(const poly2d_base &S)
Definition:
rz_harm_poly.h:73
magfieldparam::trig_pair::SinPhi
double SinPhi
Definition:
rz_harm_poly.h:17
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:145
magfieldparam::rz_harm_poly::CheatL
void CheatL(const unsigned newL)
Definition:
rz_harm_poly.h:97
magfieldparam::rz_harm_poly::ParentCount
static unsigned ParentCount()
Definition:
rz_harm_poly.h:64
magfieldparam::rz_harm_poly::phi_set
static bool phi_set
Definition:
rz_harm_poly.h:46
magfieldparam::rz_harm_poly::Print
void Print(std::ostream &out=std::cout, const std::streamsize prec=5)
Definition:
rz_harm_poly.h:98
magfieldparam::rz_harm_poly::SetTrigArrSize
static void SetTrigArrSize(const unsigned N)
Definition:
rz_harm_poly.cc:100
magfieldparam::trig_pair::trig_pair
trig_pair(const trig_pair &tp)
Definition:
rz_harm_poly.h:20
magfieldparam::poly2d_base::Count
static unsigned Count()
Definition:
poly2d_base.h:74
Generated for CMSSW Reference Manual by
1.8.5