source: Sophya/trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc@ 2389

Last change on this file since 2389 was 2371, checked in by aubourg, 22 years ago

encore une betise de cecile

File size: 2.0 KB
RevLine 
[2352]1// ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
2// Eric Aubourg
3// Christophe Magneville
4// Reza Ansari
[2371]5// $Id: ring2cout.cc,v 1.6 2003-04-24 13:33:05 aubourg Exp $
[2352]6
7#include "toimanager.h"
8#include "pexceptions.h"
9#include "ctimer.h"
10#include "ring2cout.h"
11// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
12#include "smathconst.h"
13
14////////////////////////////////////////////////////////////////////////
[2360]15Ring2cout::Ring2cout(long ns, long nr)
16 :totnscount(0)
[2352]17{
[2360]18 setNSamples(ns);
19 setNRings(nr);
[2352]20}
21
22Ring2cout::~Ring2cout()
23{
24}
25
26
27////////////////////////////////////////////////////////////////////////
28void Ring2cout::Print(::ostream & os)
29{
30}
31
32////////////////////////////////////////////////////////////////////////
33void Ring2cout::init() {
34 cout << "Ring2cout::init" << endl;
[2361]35 declareInput("Phase"); // input index 0
[2352]36}
37
38////////////////////////////////////////////////////////////////////////
39void Ring2cout::run() {
40
41//---------------------------------------------------------
[2371]42 double* val=NULL;
[2352]43try {
44 uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0;
[2360]45
46 cout << " ring " << Nrings << " ns " << Nsamples<< endl;
[2371]47 val = new double[Nsamples];
[2360]48 for (int k=0; k<Nrings; k++) {
[2352]49
[2361]50 double theta= getData(0,k*(Nsamples+2)+0);
51 double phi = getData(0,k*(Nsamples+2)+1);
52 cout << Nrings << " " << k <<" " <<theta <<" " <<phi<< endl;
53 getData(0,k*(Nsamples+2)+2,Nsamples,val);
[2352]54 mSnRead ++;
55
[2360]56 for (int i=0; i< Nsamples;i++)
[2361]57 cout << i << " " << val[i]<< endl;
58 totnscount+=Nsamples+2;
[2352]59
60 }
[2360]61
62 cout<<"RING2cout::run: Samples Read "<<mSnRead
[2352]63 <<" Filled "<<mSnFilled
64 <<" BadCoorRange="<<BadCoorRange<<endl;
65
66 //---------------------------------------------------------
67} catch (PException & exc) {
68 cout<<"Ring2cout: Catched Exception "<<(string)typeid(exc).name()
69 <<"\n .... Msg= "<<exc.Msg()<<endl;
70}
[2371]71
72 delete[] val;
[2354]73
[2352]74
[2354]75 return;
[2352]76}
[2354]77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Note: See TracBrowser for help on using the repository browser.