ROOTPWA
testPWAAmp.cc
Go to the documentation of this file.
1 
2 //
3 // Copyright 2009 Sebastian Neubert
4 //
5 // This file is part of rootpwa
6 //
7 // rootpwa is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // rootpwa is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with rootpwa. If not, see <http://www.gnu.org/licenses/>.
19 //
21 //test program for rootpwa
22 
23 #include <iostream>
24 #include <list>
25 #include <vector>
26 #include <string>
27 #include <map>
28 #include <complex>
29 
30 #include "TPWAAmp.h"
31 #include "TPWAPhaseConstraint.h"
32 
33 using namespace std;
34 
35 int main(int argc, char** argv){
36 
37  TPWAAmp a("1-1++1+blub",1);
38  if(a.reflectivity()!=1)return 1;
39  double par[2];
40  par[0]=2;par[1]=4;
41  cout << a.name() << a.setPar(par) << endl;
42  cout << "Npar=" << a.npar() << endl;
43  cout << "Par0=" << a.par(0) << " Par1=" << a.par(1) << endl;
44 
45  TPWAAmp b("1-1++1-bla",1);
46  if(b.reflectivity()!=-1)return 1;
48 
49  par[0]=5;par[1]=6;
50  cout << b.name() << b.setPar(par) << endl;
51  cout << "Npar=" << b.npar() << endl;
52  if(b.npar()!=1)return 1;
53  cout << "Par0=" << b.par(0) << " Par1=" << b.par(1) << endl;
54  if(b.amp().imag()!=0)return 2;
55 
56 
58  a.setConstraint(c1);
59  cout << a.name() << a.amp() << endl;
60 
61  if(abs(a.amp())!=a.par(0))return 3;
62  return 0;
63 }
64