public static void Main
                    (string[] args
                    , string[] hesstypes
                    , double[] threszeroblks
                    )
                {
                    string cachebase = @"K:\cache\CoarseGraining-20150111\proteins-177\";
                    string lockbase  = cachebase + @"lock\"; if (HDirectory.Exists(lockbase) == false)
                    {
                        HDirectory.CreateDirectory(lockbase);
                    }

                    Dictionary <string, List <Tuple <double, double, double[]> > > data = new Dictionary <string, List <Tuple <double, double, double[]> > >();

                    foreach (string pdbid in pdbids)
                    {
                        if (locks.ContainsKey(pdbid) == false)
                        {
                            var filelock = HFile.LockFile(lockbase + pdbid);
                            if (filelock == null)
                            {
                                System.Console.WriteLine("{0} is locked", pdbid);
                                continue;
                            }
                            locks.Add(pdbid, filelock);
                        }

                        string pathbase = cachebase + pdbid + @"\";
                        // load univ
                        var pdb0 = Pdb.FromFile(pathbase + "xry-struc.pdb");
                        var xyz0 = Tinker.Xyz.FromFile(pathbase + "xry-struc.xyz", false);
                        var xyz1 = Tinker.Xyz.FromFile(pathbase + "min-struc-charmm22.xyz", false);
                        var prm  = Tinker.Prm.FromFile(cachebase + "charmm22.prm");
                        if (HFile.Exists(pathbase + "min-struc-charmm22-screened.xyz") == false)
                        {
                            var newton = Tinker.Run.Newton
                                             (xyz1, prm, tempbase
                                             , null       // copytemp
                                             , "A 0.0001" // param
                                             , null       // atomsToFix
                                             , false
                                             , "CUTOFF 9", "TAPER"
                                             );
                            newton.minxyz.ToFile(pathbase + "min-struc-charmm22-screened.xyz", false);
                        }
                        var      xyz2      = Tinker.Xyz.FromFile(pathbase + "min-struc-charmm22-screened.xyz", false);
                        Universe univ      = Universe.BuilderTinker.Build(xyz1, prm, pdb0, xyz0, 0.001);
                        Universe univ_scrn = Universe.BuilderTinker.Build(xyz2, prm, pdb0, xyz0, 0.001);

                        if (HDebug.IsDebuggerAttached)
                        {
                            var grad  = Tinker.Run.Testgrad(xyz1, prm, tempbase);
                            var forc  = grad.anlyts.GetForces(xyz1.atoms);
                            var mforc = forc.Dist().Max();
                            HDebug.Assert(mforc < 0.1);

                            grad = Tinker.Run.Testgrad(xyz2, prm, tempbase, new string[] { "CUTOFF 9", "TAPER" }
                                                       , optOutSource: null
                                                       );
                            forc  = grad.anlyts.GetForces(xyz1.atoms);
                            mforc = forc.Dist().Max();
                            HDebug.Assert(mforc < 0.1);
                        }

                        System.Console.Write(pdbid + " : ");
                        foreach (string hesstype in hesstypes)
                        {
                            foreach (double threszeroblk in threszeroblks)
                            {
                                double GetHessCoarseResiIter_thres_zeroblk        = threszeroblk;
                                Tuple <double, double, double[]> corr_wovlp_ovlps = GetQuality(pathbase, univ, univ_scrn, hesstype, GetHessCoarseResiIter_thres_zeroblk);
                                if (corr_wovlp_ovlps == null)
                                {
                                    System.Console.Write(hesstype + "(Unknown exception                                                            ),    ");
                                    continue;
                                }
                                System.Console.Write(hesstype + "(");
                                System.Console.Write("thod " + threszeroblk + " : ");
                                System.Console.Write("corr {0,6:0.0000}, ", corr_wovlp_ovlps.Item1);
                                System.Console.Write("wovlp {0,6:0.0000} : ", corr_wovlp_ovlps.Item2);
                                System.Console.Write("{0}),    ", corr_wovlp_ovlps.Item3.HToStringSeparated("{0,4:0.00}", ","));

                                string datakey = hesstype + "-" + threszeroblk;
                                if (data.ContainsKey(datakey) == false)
                                {
                                    data.Add(datakey, new List <Tuple <double, double, double[]> >());
                                }
                                data[datakey].Add(corr_wovlp_ovlps);
                            }
                        }
                        System.Console.WriteLine();
                    }

                    System.Console.WriteLine("=================================================================================================");
                    System.Console.Write("avg  : ");
                    foreach (string hesstype in hesstypes)
                    {
                        foreach (double threszeroblk in threszeroblks)
                        {
                            string datakey = hesstype + "-" + threszeroblk;
                            List <Tuple <double, double, double[]> > datai = data[datakey];

                            double[]   lst_corr  = datai.HListItem1().ToArray();
                            double[]   lst_wovlp = datai.HListItem2().ToArray();
                            double[][] lst_ovlps = datai.HListItem3().ToArray();

                            double   corr  = lst_corr.HRemoveAll(double.NaN).Average();
                            double   wovlp = lst_wovlp.HRemoveAll(double.NaN).Average();
                            double[] ovlps = new double[10];
                            for (int i = 0; i < 10; i++)
                            {
                                double[] lst_ovlpsi = new double[lst_ovlps.Length];
                                for (int j = 0; j < lst_ovlps.Length; j++)
                                {
                                    lst_ovlpsi[j] = lst_ovlps[j][i];
                                }
                                ovlps[i] = lst_ovlpsi.HRemoveAll(double.NaN).Average();
                            }

                            System.Console.Write(hesstype + "(");
                            System.Console.Write("thod " + threszeroblk + " : ");
                            System.Console.Write("corr {0,6:0.0000}, ", corr);
                            System.Console.Write("wovlp {0,6:0.0000} : ", wovlp);
                            System.Console.Write("{0}),    ", ovlps.HToStringSeparated("{0,4:0.00}", ","));
                        }
                    }
                    System.Console.WriteLine();
                    System.Console.Write("min  : ");
                    foreach (string hesstype in hesstypes)
                    {
                        foreach (double threszeroblk in threszeroblks)
                        {
                            string datakey = hesstype + "-" + threszeroblk;
                            List <Tuple <double, double, double[]> > datai = data[datakey];

                            double[]   lst_corr  = datai.HListItem1().ToArray();
                            double[]   lst_wovlp = datai.HListItem2().ToArray();
                            double[][] lst_ovlps = datai.HListItem3().ToArray();

                            double   corr  = lst_corr.HRemoveAll(double.NaN).Min();
                            double   wovlp = lst_wovlp.HRemoveAll(double.NaN).Min();
                            double[] ovlps = new double[10];
                            for (int i = 0; i < 10; i++)
                            {
                                double[] lst_ovlpsi = new double[lst_ovlps.Length];
                                for (int j = 0; j < lst_ovlps.Length; j++)
                                {
                                    lst_ovlpsi[j] = lst_ovlps[j][i];
                                }
                                ovlps[i] = lst_ovlpsi.HRemoveAll(double.NaN).Min();
                            }

                            System.Console.Write(hesstype + "(");
                            System.Console.Write("thod " + threszeroblk + " : ");
                            System.Console.Write("corr {0,6:0.0000}, ", corr);
                            System.Console.Write("wovlp {0,6:0.0000} : ", wovlp);
                            System.Console.Write("{0}),    ", ovlps.HToStringSeparated("{0,4:0.00}", ","));
                        }
                    }
                    System.Console.WriteLine();
                    System.Console.Write("#miss: ");
                    foreach (string hesstype in hesstypes)
                    {
                        foreach (double threszeroblk in threszeroblks)
                        {
                            string datakey = hesstype + "-" + threszeroblk;
                            List <Tuple <double, double, double[]> > datai = data[datakey];

                            double[]   lst_corr  = datai.HListItem1().ToArray();
                            double[]   lst_wovlp = datai.HListItem2().ToArray();
                            double[][] lst_ovlps = datai.HListItem3().ToArray();

                            int   cnt_corr  = lst_corr.Length - lst_corr.HRemoveAll(double.NaN).Length;
                            int   cnt_wovlp = lst_wovlp.Length - lst_wovlp.HRemoveAll(double.NaN).Length;
                            int[] cnt_ovlps = new int[10];
                            for (int i = 0; i < 10; i++)
                            {
                                double[] lst_ovlpsi = new double[lst_ovlps.Length];
                                for (int j = 0; j < lst_ovlps.Length; j++)
                                {
                                    lst_ovlpsi[j] = lst_ovlps[j][i];
                                }
                                cnt_ovlps[i] = lst_ovlpsi.Length - lst_ovlpsi.HRemoveAll(double.NaN).Length;
                            }

                            System.Console.Write(hesstype + "(");
                            System.Console.Write("thod " + threszeroblk + " : ");
                            System.Console.Write("corr {0,6}, ", cnt_corr);
                            System.Console.Write("wovlp {0,6} : ", cnt_wovlp);
                            System.Console.Write("{0}),    ", cnt_ovlps.HToStringSeparated("{0,4}", ","));
                        }
                    }
                    System.Console.WriteLine();
                }