Index: trunk/ArchTOIPipe/TestPipes/aksj02.cc
===================================================================
--- trunk/ArchTOIPipe/TestPipes/aksj02.cc	(revision 2050)
+++ trunk/ArchTOIPipe/TestPipes/aksj02.cc	(revision 2054)
@@ -40,5 +40,5 @@
   else {
     cout << "\n Usage : aksj02 [-intoi toiname] [-start snb] [-end sne] \n" 
-	 << "         [-dbg] [-wtoi sz] [-wclean wsz,nbw] [-range min,max] \n"
+	 << "         [-dbg] [-wtoi sz] [-wclean wsz,nbw] [-range min,max] [-cleannsig nsig]\n"
 	 << "         [-soff wsz,nptfit,degpol] [-soffnt PPFName] \n"
 	 << "         [-soff2 wsz,nptfit,degpol] [-soff2nt PPFName] \n"
@@ -46,5 +46,5 @@
 	 << "         [-bgalcut bmin,bmax]  [-bgal2cut bmin,bmax] \n"
 	 << "         [-gfilt wsz,sigma] \n" 
-	 << "         [-nooutflg] [-wrtms] [-wrtifo] [-prstat] [-useseqbuff] \n"
+	 << "         [-nooutflg] [-wrtms] [-wrtifo] [-noprstat] [-useseqbuff] \n"
 	 << "         inFitsName outFitsName \n" 
 	 << "   -dbg : sets TOISeqBuffered debug level to 1 \n"
@@ -56,4 +56,5 @@
 	 << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
 	 << "   -wclean wsz,nbw : sets cleaner window parameters (256,5) \n"
+         << "   -cleannsig nsig : Sets cleanner ThrNSig (default = 999999.) \n"
 	 << "   -soff wsz,nptfit,degpol : set SimpleOffsetEstimator parameters\n"
 	 << "   -soffnt PPFName : Writes out SimpleOffsetEstimator NTuple \n"
@@ -97,6 +98,4 @@
   int wdegli = 512;
   
-  int wfft = 4096;
-  int keepfft = 0;
   int nmax = 10;
   int istart = 0;
@@ -109,4 +108,5 @@
   int clean_wsz = 256;
   int clean_nbw = 5;
+  double clean_nsig = 999999.;
 
   // SimpleOffsetEstimator parameters
@@ -154,8 +154,4 @@
 
   bool fg_f_filt = false;
-  bool fg_killfreq = false;
-  int bf_killfreq = 1;
-  int nharm_killfreq = 1;
-  double sigf_killfreq = 1.;
 
   if (narg < 4) Usage(true);
@@ -181,4 +177,12 @@
       sscanf(arg[ia+1],"%d,%d",  &clean_wsz, &clean_nbw);
     }    
+    else if (strcmp(arg[ia],"-cleannsig") == 0) {
+      if (ia == narg-1) Usage(true);  
+      clean_nsig = atof(arg[ia+1]); ia++;
+    }    
+    else if (strcmp(arg[ia],"-cleannsig") == 0) {
+      if (ia == narg-1) Usage(true);  
+      clean_nsig = atof(arg[ia+1]); ia++;
+    }    
     else if (strcmp(arg[ia],"-soff") == 0) {
       if (ia == narg-1) Usage(true);
@@ -291,4 +295,5 @@
 	 << " - " << range_max << endl;
     cleaner.SetRange(range_min, range_max);
+    cleaner.SetCleanForMeanThrNSig(clean_nsig);
 
     cout << "> Creating SimpleOffsetEstimator(" << soff_mwsz << "," << soff_nptfit 
Index: trunk/ArchTOIPipe/TestPipes/toistat.cc
===================================================================
--- trunk/ArchTOIPipe/TestPipes/toistat.cc	(revision 2050)
+++ trunk/ArchTOIPipe/TestPipes/toistat.cc	(revision 2054)
@@ -44,5 +44,5 @@
     cout << " toistat : produce a stat NTuple (mean,sigma) from a TOI" << endl;
     cout << "\n Usage : toistat [-intoi toiname] [-start snb] [-end sne] \n" 
-	 << "         [-wtoi sz] [-wclean wsz,nbw] [-range min,max] \n"
+	 << "         [-wtoi sz] [-wclean wsz,nbw] [-range min,max] [-cleannsig nsig] \n"
 	 << "         [-outppf] [-noprstat] [-useseqbuff] \n"
 	 << "         inFitsName outFileName \n" 
@@ -54,4 +54,5 @@
 	 << "   -wtoi sz : sets TOISeqBuff buffer size (def= 8192)\n"
 	 << "   -wclean wsz,nbw : sets cleaner window parameters (256,5) \n"
+         << "   -cleannsig nsig : Sets cleanner ThrNSig (default = 999999.) \n"
 	 << "   -outppf : Write the NTuple in PPF format (default: FITS) \n"
 	 << "   -noprstat : DO NOT PrintStat with ProcSampleCounter \n"
@@ -88,4 +89,5 @@
   int clean_wsz = 256;
   int clean_nbw = 5;
+  double clean_nsig = 999999.;
 
   // File names 
@@ -115,4 +117,8 @@
       sscanf(arg[ia+1],"%d,%d",  &clean_wsz, &clean_nbw);
     }    
+    else if (strcmp(arg[ia],"-cleannsig") == 0) {
+      if (ia == narg-1) Usage(true);  
+      clean_nsig = atof(arg[ia+1]); ia++;
+    }    
     else if (strcmp(arg[ia],"-range") == 0) {
       if (ia == narg-1) Usage(true);
@@ -127,4 +133,5 @@
 
     else if (strcmp(arg[ia],"-noprstat") == 0)  fgprstat = false;
+    else if (strcmp(arg[ia],"-prstat") == 0)  fgprstat = true;
     else if (strcmp(arg[ia],"-useseqbuff") == 0)  fgsegmented = false;
 
@@ -165,4 +172,5 @@
 	 << " - " << range_max << endl;
     cleaner.SetRange(range_min, range_max);
+    cleaner.SetCleanForMeanThrNSig(clean_nsig);
     cleaner.FillMeanSigNTuple(true);
 
