Exemplo n.º 1
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);
        }
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;
 }
        public CoincidenceResult GetResult()
        {
            int i, j;
            CoincidenceResult result;

            result = new CoincidenceResult(RawAnalysisProperties.ChannelCount);

            result.coincidenceGateWidth = coincidenceGateWidth;
            result.coincidenceDeadDelay = coincidenceDeadDelay;
            result.isSlowBackground = true;
            result.accidentalsDelay = coincidenceAccidentalsDelay;

            for (i = 0; i < RawAnalysisProperties.ChannelCount; i++)
            {
                for (j = 0; j < RawAnalysisProperties.ChannelCount; j++)
                {
                    if (totalMeasurementTime > 0.0)
                    {
                        result.RACoincidenceRate[i][j] = ((double)RAcoincidence[i][j]) / totalMeasurementTime;
                        result.ACoincidenceRate[i][j] = ((double)Acoincidence[i][j]) / totalMeasurementTime;
                    }
                    else
                    {
                        result.RACoincidenceRate[i][j] = 0.0;
                        result.ACoincidenceRate[i][j] = 0.0;
                    }
                }
            }

            return (result);
        }