Exemplo n.º 1
0
        public Coincidence GetFirstCoincidence(bool activeOnly = true, bool addIfNotPresent = false)
        {
            List <SpecificCountingAnalyzerParams> l = GetCoincidences(activeOnly);

            if (l != null && l.Count > 0)
            {
                return((Coincidence)l[0]);
            }
            else
            {
                Coincidence t = new Coincidence();
                if (addIfNotPresent)
                {
                    Add(t);
                }
                return(t);
            }
        }
Exemplo n.º 2
0
        public bool Transfer(Coincidence cop, CoincidenceResult cor)
        {
            if (cor == null)
            {
                return(true);
            }
            bool res = true;

            try
            {
                CoincidenceMatrixResult cr = new CoincidenceMatrixResult(cor.RACoincidenceRate.Length); // check for equality to numchannels, should always be numXnum size
                countresults.Add(cop, cr);
                cr.TransferRawResult(cor);
            }
            catch (OutOfMemoryException e)
            {
                cop.reason = "Coincidence matrix transfer " + e.Message;
                res        = false;
                logger?.TraceEvent(LogLevels.Error, 87410, cop.reason);
            }
            return(res);
        }