|
Last change
on this file since 3795 was 3619, checked in by cmv, 16 years ago |
|
add various #include<> for g++ 4.3 (jaunty 9.04), cmv 05/05/2009
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | #include <stdlib.h>
|
|---|
| 2 | #include <iostream>
|
|---|
| 3 | #include "sopnamsp.h"
|
|---|
| 4 | #include "datacirclefake.h"
|
|---|
| 5 |
|
|---|
| 6 | DataCircleFake::DataCircleFake() : _NMeasurements(0), _mesures(NULL)
|
|---|
| 7 | {;}
|
|---|
| 8 |
|
|---|
| 9 | DataCircleFake::DataCircleFake(double theta,double phi,double aperture,int NEch,double tl) : DataCircleBase(theta,phi,aperture), _NMeasurements(NEch), _mesures(NULL)
|
|---|
| 10 | {
|
|---|
| 11 | _mesures= new double[NEch];
|
|---|
| 12 | int i;
|
|---|
| 13 | for(i = 0; i < NEch; i++) {
|
|---|
| 14 | _mesures[i]= tl;
|
|---|
| 15 | }
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | DataCircleFake::~DataCircleFake()
|
|---|
| 19 | {
|
|---|
| 20 | if(_mesures != NULL) delete [] _mesures;
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | double DataCircleFake::getData(double psi) const {
|
|---|
| 24 |
|
|---|
| 25 | int ibin= l_ft_nint(psi*_NMeasurements/(2.*M_PI));
|
|---|
| 26 | //cout << "bin= " << ibin << ", " << _mesures[ibin] << endl;
|
|---|
| 27 | return _mesures[ibin];
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | int DataCircleFake::NMeasurements() const {
|
|---|
| 31 |
|
|---|
| 32 | return _NMeasurements;
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | void DataCircleFake::print(ostream& out) const {
|
|---|
| 36 |
|
|---|
| 37 | out << " Circle:: ApertureAngle= " << ApertureAngle() << ", Theta= "
|
|---|
| 38 | << Theta() << ", Phi= " << Phi() << ", NSamples= "
|
|---|
| 39 | << NMeasurements() << endl;
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 | double DataCircleFake::getTMeasure(double psi) const {
|
|---|
| 43 |
|
|---|
| 44 | if(_mesures == NULL) {
|
|---|
| 45 | cout << " DataCircleFake::getTMeasure data must be stored"
|
|---|
| 46 | << " in an array... " << endl;
|
|---|
| 47 | exit(0);
|
|---|
| 48 | }
|
|---|
| 49 | int ibin= l_ft_nint(psi*_NMeasurements/(2.*M_PI));
|
|---|
| 50 | return _mesures[ibin];
|
|---|
| 51 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.