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

Last change on this file since 2370 was 2361, checked in by cecile, 22 years ago

nouveaux tuyaux de ring : theta, phi puis Nsamples mesures

File size: 2.0 KB
Line 
1// ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
2// Eric Aubourg
3// Christophe Magneville
4// Reza Ansari
5// $Id: ring2cout.cc,v 1.5 2003-04-17 13:47:34 cecile Exp $
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////////////////////////////////////////////////////////////////////////
15Ring2cout::Ring2cout(long ns, long nr)
16 :totnscount(0)
17{
18 setNSamples(ns);
19 setNRings(nr);
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;
35 declareInput("Phase"); // input index 0
36}
37
38////////////////////////////////////////////////////////////////////////
39void Ring2cout::run() {
40
41//---------------------------------------------------------
42try {
43 uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0;
44
45 cout << " ring " << Nrings << " ns " << Nsamples<< endl;
46 double val[Nsamples];
47 for (int k=0; k<Nrings; k++) {
48
49 double theta= getData(0,k*(Nsamples+2)+0);
50 double phi = getData(0,k*(Nsamples+2)+1);
51 cout << Nrings << " " << k <<" " <<theta <<" " <<phi<< endl;
52 getData(0,k*(Nsamples+2)+2,Nsamples,val);
53 mSnRead ++;
54
55 for (int i=0; i< Nsamples;i++)
56 cout << i << " " << val[i]<< endl;
57 totnscount+=Nsamples+2;
58
59 }
60
61 cout<<"RING2cout::run: Samples Read "<<mSnRead
62 <<" Filled "<<mSnFilled
63 <<" BadCoorRange="<<BadCoorRange<<endl;
64
65 //---------------------------------------------------------
66} catch (PException & exc) {
67 cout<<"Ring2cout: Catched Exception "<<(string)typeid(exc).name()
68 <<"\n .... Msg= "<<exc.Msg()<<endl;
69}
70
71
72 return;
73}
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Note: See TracBrowser for help on using the repository browser.