Index: /trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc	(revision 2352)
+++ /trunk/ArchTOIPipe/ProcWSophya/ring2cout.cc	(revision 2352)
@@ -0,0 +1,70 @@
+// ArchTOIPipe           (C)     CEA/DAPNIA/SPP IN2P3/LAL
+//                               Eric Aubourg
+//                               Christophe Magneville
+//                               Reza Ansari
+// $Id: ring2cout.cc,v 1.1 2003-03-24 11:07:00 cecile Exp $
+
+#include "toimanager.h"
+#include "pexceptions.h"
+#include "ctimer.h"
+#include "ring2cout.h"
+// La valeur "Pi" doit etre celle de smathconst.h a cause du test sur theta
+#include "smathconst.h"
+
+////////////////////////////////////////////////////////////////////////
+Ring2cout::Ring2cout()
+{
+}
+
+Ring2cout::~Ring2cout()
+{
+}
+
+
+////////////////////////////////////////////////////////////////////////
+void Ring2cout::Print(::ostream & os)
+{
+}
+
+////////////////////////////////////////////////////////////////////////
+void Ring2cout::init() {
+  cout << "Ring2cout::init" << endl;
+  declareInput("Theta");     // input  index 0
+  declareInput("Phi");     // input  index 1
+  declareInput("Phase");     // input  index 2
+}
+
+////////////////////////////////////////////////////////////////////////
+void Ring2cout::run() {
+
+
+//---------------------------------------------------------
+try {
+  uint_4 mSnRead=0, mSnFilled=0, BadCoorRange=0;
+  double ctheta[Nsamples],cphi[Nsamples],val[Nsamples];
+
+  for (int k=0; k<nRings; k++) {
+    
+    getData(0,k*Nsamples,Nsamples,ctheta);
+    getData(1,k*Nsamples,Nsamples,cphi);
+    getData(2,k*Nsamples,Nsamples,val);
+    mSnRead ++;
+    
+    cout << " ring " << k << endl;
+    for (int i=i; i< Nsamples;i++)
+      cout << ctheta << " " << cphi<< " " << val<< endl;
+    
+  }
+  
+  cout<<"RING2Toi::run: Samples Read "<<mSnRead
+      <<" Filled "<<mSnFilled
+      <<" BadCoorRange="<<BadCoorRange<<endl;
+  
+  //---------------------------------------------------------
+} catch (PException & exc) {
+  cout<<"Ring2cout: Catched Exception "<<(string)typeid(exc).name()
+      <<"\n .... Msg= "<<exc.Msg()<<endl;
+}
+
+return;                                                                            
+}
Index: /trunk/ArchTOIPipe/ProcWSophya/ring2cout.h
===================================================================
--- /trunk/ArchTOIPipe/ProcWSophya/ring2cout.h	(revision 2352)
+++ /trunk/ArchTOIPipe/ProcWSophya/ring2cout.h	(revision 2352)
@@ -0,0 +1,51 @@
+// This may look like C code, but it is really -*- C++ -*-
+
+// ArchTOIPipe           (C)     CEA/DAPNIA/SPP IN2P3/LAL
+//                               Eric Aubourg
+//                               Christophe Magneville
+//                               Reza Ansari
+// $Id: ring2cout.h,v 1.1 2003-03-24 11:07:00 cecile Exp $
+
+#ifndef TOI2RING_H
+#define TOI2RING_H
+
+#include "toiprocessor.h"
+#include "flagtoidef.h"
+
+//-- Un generateur de RING a partir d'une sphere et de 2 TOIs coordin1,coordin2
+// Lecture de 2 TOI coord1,coord2 et d'une Sphere Healpix
+// Sortie de 3 RING coord1,coord2,boloMuV
+//
+// Structure generale :
+//             Sphere ---- |
+//                         |
+//                     -----------
+//   toi phase    ---> |         | ---> ring value
+//                     |Ring2cout | ---> ring weight
+//   toi value    ---> |         | 
+//                     -----------
+
+class Ring2cout : public TOIProcessor {
+public:
+                 Ring2cout();
+  virtual	~Ring2cout();
+
+
+  virtual void	init(void);
+  virtual void	run(void);
+
+
+
+  // Print
+  void Print(::ostream & os);
+  inline long 	ProcessedSampleCount() const { return totnscount; }
+  inline long	ProcessedRingCount() const { return nRings; }
+
+protected:
+  long Nsamples;
+  long totnscount;
+  long nRings;
+  
+};
+
+#endif
Index: /trunk/ArchTOIPipe/TestPipes/tstring2cout.cc
===================================================================
--- /trunk/ArchTOIPipe/TestPipes/tstring2cout.cc	(revision 2352)
+++ /trunk/ArchTOIPipe/TestPipes/tstring2cout.cc	(revision 2352)
@@ -0,0 +1,93 @@
+//#define TOISEQBUFFERED
+
+#include <unistd.h>
+#include "toi.h"
+#include "cgt.h"
+#include "toiprocessor.h"
+#include "fitsringrdr.h"
+#include "toimanager.h"
+#ifdef TOISEQBUFFERED
+#include "toiseqbuff.h"
+#else
+#include "toisegment.h"
+#endif
+
+#include "sambainit.h"
+#include "ring2cout.h"
+#include "timing.h"
+
+#include <stdexcept>
+
+void usage(void);
+void usage(void) {
+  cout<<"tsttoi2ring fitsin_ring "<<endl;
+ return;
+}
+
+////////////////////////////////////////////////////////////////
+int main(int narg, char** arg) {
+
+TOIManager* mgr = TOIManager::getManager();
+
+//-- Decodage arguments
+bool fgsegmented = true;
+int wsize = 512;
+bool snimplicit = false;
+
+if(narg != 2) {usage(); exit(2);}
+char * fitsin_ring    = arg[1];
+ 
+
+cout<<">>>> tsttoi2ring:"<<endl
+cout<<"Fits Infile Value "<<fitsin_ring<<endl;
+ 
+
+SophyaInit();
+InitTim();
+
+//--------------------------------------------------------------------
+try {
+//--------------------------------------------------------------------
+  
+  CGT plombier(fgsegmented,wsize);
+  plombier.SetDebugLevel(99);
+
+ // FITS reader et writer
+ FITSRingReader rfitsr(fitsin_ring);
+
+ // TOI Processor
+ RING2cout ring2p();
+ cout<<"RING2cout created"<<endl;
+
+
+ // Definition des tuyaux
+ 
+ plombier.Connect(rfitsr,"CircTheta",ring2p,"Theta");
+ plombier.Connect(rfitsr,"CircPhi",ring2p,"Phi");
+ plombier.Connect(rfitsr,"signal",ring2p,"Phase");
+
+
+ // Run
+ cout<<"----- FITSReaderTOI::PrintStatus() : -----"<<endl;
+
+ plombier.Start();
+ plombier.ListTOIs(cout, 1);
+ cout << "Joining ..." << endl;
+
+ mgr->joinAll();
+ PrtTim("End threads");
+
+//--------------------------------------------------------------------
+} catch (PThrowable & exc) {
+ cout<<"\ntsttoi2ring: Catched Exception \n"<<(string)typeid(exc).name() 
+     <<" - Msg= "<<exc.Msg()<<endl;
+} catch (const std::exception & sex) {
+ cout<<"\ntsttoi2ring: Catched std::exception \n" 
+     <<(string)typeid(sex).name()<<endl; 
+} catch (...) {
+ cout<<"\ntsttoi2ring: some other exception was caught ! "<<endl;
+}
+//--------------------------------------------------------------------
+
+exit(0);
+}
