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