[2352] | 1 | // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
|
---|
| 2 | // Eric Aubourg
|
---|
| 3 | // Christophe Magneville
|
---|
| 4 | // Reza Ansari
|
---|
[2361] | 5 | // $Id: ring2cout.cc,v 1.5 2003-04-17 13:47:34 cecile 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] | 15 | Ring2cout::Ring2cout(long ns, long nr)
|
---|
| 16 | :totnscount(0)
|
---|
[2352] | 17 | {
|
---|
[2360] | 18 | setNSamples(ns);
|
---|
| 19 | setNRings(nr);
|
---|
[2352] | 20 | }
|
---|
| 21 |
|
---|
| 22 | Ring2cout::~Ring2cout()
|
---|
| 23 | {
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | ////////////////////////////////////////////////////////////////////////
|
---|
| 28 | void Ring2cout::Print(::ostream & os)
|
---|
| 29 | {
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | ////////////////////////////////////////////////////////////////////////
|
---|
| 33 | void Ring2cout::init() {
|
---|
| 34 | cout << "Ring2cout::init" << endl;
|
---|
[2361] | 35 | declareInput("Phase"); // input index 0
|
---|
[2352] | 36 | }
|
---|
| 37 |
|
---|
| 38 | ////////////////////////////////////////////////////////////////////////
|
---|
| 39 | void Ring2cout::run() {
|
---|
| 40 |
|
---|
| 41 | //---------------------------------------------------------
|
---|
| 42 | try {
|
---|
| 43 | uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0;
|
---|
[2360] | 44 |
|
---|
| 45 | cout << " ring " << Nrings << " ns " << Nsamples<< endl;
|
---|
[2361] | 46 | double val[Nsamples];
|
---|
[2360] | 47 | for (int k=0; k<Nrings; k++) {
|
---|
[2352] | 48 |
|
---|
[2361] | 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);
|
---|
[2352] | 53 | mSnRead ++;
|
---|
| 54 |
|
---|
[2360] | 55 | for (int i=0; i< Nsamples;i++)
|
---|
[2361] | 56 | cout << i << " " << val[i]<< endl;
|
---|
| 57 | totnscount+=Nsamples+2;
|
---|
[2352] | 58 |
|
---|
| 59 | }
|
---|
[2360] | 60 |
|
---|
| 61 | cout<<"RING2cout::run: Samples Read "<<mSnRead
|
---|
[2352] | 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 | }
|
---|
[2354] | 70 |
|
---|
[2352] | 71 |
|
---|
[2354] | 72 | return;
|
---|
[2352] | 73 | }
|
---|
[2354] | 74 |
|
---|
| 75 |
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 |
|
---|
| 89 |
|
---|
| 90 |
|
---|
| 91 |
|
---|