Index: trunk/ArchTOIPipe/TestPipes/simtst.cc
===================================================================
--- trunk/ArchTOIPipe/TestPipes/simtst.cc	(revision 1462)
+++ trunk/ArchTOIPipe/TestPipes/simtst.cc	(revision 1467)
@@ -22,8 +22,6 @@
   }
   else {
-    cout << "\n Usage : simtst [-sproc] [-rwtoi] [-dbg] [-start snb] [-end sne] \n" 
-	 << "         [-w1 sz] [-w2 sz] inFitsName outFitsName ppfFileName \n" 
-	 << "   -sproc : Run RzSimpleTOIProc (default RzTOIProc) \n"
-	 << "   -rwtoi : Use Regular Window TOI (default TOISeqBuffered) \n" 
+    cout << "\n Usage : simtst [-dbg] [-start snb] [-end sne] \n" 
+	 << "         [-wtoi sz] [-w2 sz] inFitsName outFitsName ppfFileName \n" 
 	 << "   -dbg : sets TOISeqBuffered debug level to 1 \n"
 	 << "   -start snb : sets the start sample num \n"
@@ -31,7 +29,7 @@
 	 << "   -range min,max : sets the acceptable range for intoi \n"
 	 << "              default= -16000,16000\n"
-	 << "   -intoi toiName : select input TOI name (def boloMuV_11)\n"
-	 << "   -w1 sz : sets main data window size (def= 8192)\n"
-	 << "   -w2 sz : sets secondary window size (def= 512) \n"
+	 << "   -intoi toiName : select input TOI name (def boloMuV_27)\n"
+	 << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
+	 << "   -wdegli sz : sets deglitcher window size (def= 512) \n"
 	 << endl;
     exit(0);
@@ -45,9 +43,7 @@
   cout << "simtst starting - Decoding arguments " << " narg=" << narg << endl;
 
-  bool fgsimple = false;
-  bool fgrwtoi = false;
   bool fgdbg = false;
   int w1 = 8192;
-  int w2 = 256;
+  int w2 = 512;
   int nmax = 10;
   int istart = 104121000+w1*5;
@@ -58,5 +54,5 @@
   string outfile;
   string ppffile;
-  string intoi = "boloMuV_11";
+  string intoi = "boloMuV_27";
 
   if (narg < 4) Usage(true);
@@ -72,9 +68,9 @@
       iend = atoi(arg[ia+1]); ia++;
     }    
-    else if (strcmp(arg[ia],"-w1") == 0) {
+    else if (strcmp(arg[ia],"-wtoi") == 0) {
       if (ia == narg-1) Usage(true);  
       w1 = atoi(arg[ia+1]); ia++;
     }    
-    else if (strcmp(arg[ia],"-w2") == 0) {
+    else if (strcmp(arg[ia],"-wdegli") == 0) {
       if (ia == narg-1) Usage(true);  
       w2 = atoi(arg[ia+1]); ia++;
@@ -89,6 +85,4 @@
       intoi = arg[ia+1]; ia++;
     }    
-    else if (strcmp(arg[ia],"-sproc") == 0)  fgsimple = true;
-    else if (strcmp(arg[ia],"-rwtoi") == 0)  fgrwtoi = true;
     else if (strcmp(arg[ia],"-dbg") == 0)  fgdbg = true;
 
@@ -131,6 +125,6 @@
     TOISeqBuffered * toiin = new TOISeqBuffered("f2in", w1);
     if (fgdbg) toiin->setDebugLevel(1);
-    TOISeqBuffered * toiout = new TOISeqBuffered("out", w1);
-    if (fgdbg) toiout->setDebugLevel(1);
+    TOISeqBuffered * toidegli = new TOISeqBuffered("degli", w1);
+    if (fgdbg) toidegli->setDebugLevel(1);
     TOISeqBuffered * toimean = new TOISeqBuffered("mean", w1);
     if (fgdbg) toimean->setDebugLevel(1);
@@ -161,24 +155,67 @@
     degl.SetRange(range_min, range_max);
     degl.addInput("in", toiin);
-    degl.addOutput("out", toiout);
+    degl.addOutput("out", toidegli);
     degl.addOutput("mean", toimean);
     degl.addOutput("sigma", toisig);
     degl.addOutput("incopie", toiincopie);
- 
-    /*   
-    cout << " Creating a GaussianFilter SimplFilterObject " << endl;
-    SimpleFilter filt(..)
-    TOISeqBuffered * toiincopie = new TOISeqBuffered("incopie", w1);
-    if (fgdbg) toiincopie->setDebugLevel(1);
-    */
-
+    
+    cout << " Creating a FanOut SimpleFanOut Object " << endl;
+    SimpleFanOut fanout(2,2);
+    TOISeqBuffered * toidegli0 = new TOISeqBuffered("degli0", w1);
+    if (fgdbg) toidegli0->setDebugLevel(1);
+    TOISeqBuffered * toidegli1 = new TOISeqBuffered("degli1", w1);
+
+    TOISeqBuffered * toimean0 = new TOISeqBuffered("mean0", w1);
+    if (fgdbg) toimean0->setDebugLevel(1);
+    TOISeqBuffered * toimean1 = new TOISeqBuffered("mean1", w1);
+    if (fgdbg) toimean1->setDebugLevel(1);
+    
+    fanout.addInput("in0", toidegli);
+    fanout.addOutput("out0_0", toidegli0);
+    fanout.addOutput("out0_1", toidegli1);
+    fanout.addInput("in1", toimean);
+    fanout.addOutput("out1_0", toimean0);
+    fanout.addOutput("out1_1", toimean1);
+
+    cout << " Creating an Adder SimpleAdder Object " << endl;
+    SimpleAdder adder(2);
+    adder.addInput("in0", toidegli0);
+    adder.addInput("in1", toimean0);
+    adder.SetGain(0, 1.);
+    adder.SetGain(1, -1.);
+    TOISeqBuffered * toideglioff = new TOISeqBuffered("deglioff", w1);
+    if (fgdbg) toideglioff->setDebugLevel(1);
+    adder.addOutput("out", toideglioff);
+
+    cout << " Creating a GaussianFilter SimpleFilter Object " << endl;
+    SimpleFilter filt(8, SimpleFilter::GaussFilter, 1., 2.);
+
+    filt.addInput("in", toideglioff);
+    TOISeqBuffered * toiout = new TOISeqBuffered("out", w1);
+    if (fgdbg) toiout->setDebugLevel(1);
+    TOISeqBuffered * toideglioffcopie = new TOISeqBuffered("deglioffcopie", w1);
+    if (fgdbg) toideglioffcopie->setDebugLevel(1);
+    filt.addOutput("out", toiout);
+    filt.addOutput("incopie", toideglioffcopie);
+    
+
+    cout << " Connecting to output (FitsWriter) " << endl;
+    
     w.setOutFlags(true);
     w.addInput("in", toiincopie);
-    w.addInput("degli", toiout);
-    w.addInput("mean", toimean);
+    w.addInput("out", toiout);
+    w.addInput("degli", toidegli1);
+    w.addInput("deglioff", toideglioffcopie);
+    w.addInput("mean", toimean1);
     w.addInput("sigma", toisig);
 
     cout << " ------ FITSReaderTOI::PrintStatus() : ----- " << endl;
     r.PrintStatus(cout);  
+    cout << " ------ FanOut::PrintStatus() : ----- " << endl;
+    fanout.PrintStatus(cout);  
+    cout << " ------ Adder::PrintStatus() : ----- " << endl;
+    adder.PrintStatus(cout);  
+    cout << " ------ Filter::PrintStatus() : ----- " << endl;
+    filt.PrintStatus(cout);  
     cout << "----- FITSWriterTOI::PrintStatus() : ----- " << endl;
     w.PrintStatus(cout);  
@@ -187,12 +224,18 @@
     r.start();
     degl.start();
+    fanout.start();
+    adder.start();
+    filt.start();
     w.start();
 
-    /*    
+    /*
     for(int jj=0; jj<3; jj++) {
       cout << *toiin; 
+      cout << *toimean; 
+      cout << *toimean1; 
       cout << *toiout; 
       sleep(1);
     }
+    
     */
 
@@ -205,8 +248,13 @@
     //    w.PrintStatus(cout);  
 
+    cout << " ------ toiin, toidegli and toiout Status information ------- " << endl;
+    cout << *toiin; 
+    cout << *toidegli; 
+    cout << *toiout;
+
     cout << degl;
-    cout << " ------ toiin and toiout Status information ------- " << endl;
-    cout << *toiin; 
-    cout << *toiout;
+    cout << filt;
+    cout << adder;
+
   }
   catch (PThrowable & exc) {
