Last change
on this file since 2384 was 2322, checked in by cmv, 23 years ago |
- passage xxstream.h en xxstream
- compile avec gcc_3.2, gcc_2.96 et cxx
En 3.2 le seek from ::end semble marcher (voir Eval/COS/pbseekios.cc)
rz+cmv 11/2/2003
|
File size:
1.2 KB
|
Line | |
---|
1 | #include <iostream>
|
---|
2 | #include "datacirclefake.h"
|
---|
3 |
|
---|
4 | DataCircleFake::DataCircleFake() : _NMeasurements(0), _mesures(NULL)
|
---|
5 | {;}
|
---|
6 |
|
---|
7 | DataCircleFake::DataCircleFake(double theta,double phi,double aperture,int NEch,double tl) : DataCircleBase(theta,phi,aperture), _NMeasurements(NEch), _mesures(NULL)
|
---|
8 | {
|
---|
9 | _mesures= new double[NEch];
|
---|
10 | int i;
|
---|
11 | for(i = 0; i < NEch; i++) {
|
---|
12 | _mesures[i]= tl;
|
---|
13 | }
|
---|
14 | }
|
---|
15 |
|
---|
16 | DataCircleFake::~DataCircleFake()
|
---|
17 | {
|
---|
18 | if(_mesures != NULL) delete [] _mesures;
|
---|
19 | }
|
---|
20 |
|
---|
21 | double DataCircleFake::getData(double psi) const {
|
---|
22 |
|
---|
23 | int ibin= l_ft_nint(psi*_NMeasurements/(2.*M_PI));
|
---|
24 | //cout << "bin= " << ibin << ", " << _mesures[ibin] << endl;
|
---|
25 | return _mesures[ibin];
|
---|
26 | }
|
---|
27 |
|
---|
28 | int DataCircleFake::NMeasurements() const {
|
---|
29 |
|
---|
30 | return _NMeasurements;
|
---|
31 | }
|
---|
32 |
|
---|
33 | void DataCircleFake::print(ostream& out) const {
|
---|
34 |
|
---|
35 | out << " Circle:: ApertureAngle= " << ApertureAngle() << ", Theta= "
|
---|
36 | << Theta() << ", Phi= " << Phi() << ", NSamples= "
|
---|
37 | << NMeasurements() << endl;
|
---|
38 | }
|
---|
39 |
|
---|
40 | double DataCircleFake::getTMeasure(double psi) const {
|
---|
41 |
|
---|
42 | if(_mesures == NULL) {
|
---|
43 | cout << " DataCircleFake::getTMeasure data must be stored"
|
---|
44 | << " in an array... " << endl;
|
---|
45 | exit(0);
|
---|
46 | }
|
---|
47 | int ibin= l_ft_nint(psi*_NMeasurements/(2.*M_PI));
|
---|
48 | return _mesures[ibin];
|
---|
49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.