Пример #1
0
        public void InitializeResultsSummarizers()
        {
            if (logger != null)
            {
                logger.TraceEvent(LogLevels.Verbose, 4042, "Initialize results summarizers (countresults)");
            }
            countresults.Clear();
            try
            {
                int idx = 0;
                foreach (BaseRate b in (ap.GetBases()))
                {
                    countresults.Add(b, new RatesResultEnhanced(1, b.gateWidthTics));
                }
                idx = 0;
                foreach (Multiplicity muon in (ap.GetMults(FAType.FAOn)))
                {
                    countresults.Add(muon, new MultiplicityCountingRes(FAType.FAOn, idx)); idx++;
                }
                idx = 0;
                foreach (Multiplicity muoff in (ap.GetMults(FAType.FAOff)))
                {
                    countresults.Add(muoff, new MultiplicityCountingRes(FAType.FAOff, idx)); idx++;
                }

                foreach (Rossi ro in (ap.GetRossis()))
                {
                    countresults.Add(ro, new RossiAlphaResultExt(10, new uint[RawAnalysisProperties.numRAGatesPerWindow]));
                }

                foreach (Feynman fy in (ap.GetFeynmans()))
                {
                    countresults.Add(fy, new FeynmanResultExt());
                }

                foreach (TimeInterval ti in (ap.GetTimeIntervals()))
                {
                    TimeIntervalResult tir = new TimeIntervalResult();
                    tir.timeIntervalHistogram = new uint[RawAnalysisProperties.maxEventSpacing + 1];  // alloc the entire possible range, but use maxIndexOfNonzeroHistogramEntry upon output
                    countresults.Add(ti, tir);
                }

                foreach (Coincidence co in ap.GetCoincidences())
                {
                    CoincidenceMatrixResult cor = new CoincidenceMatrixResult(RawAnalysisProperties.ChannelCount);
                    cor.coincidenceDeadDelay = co.SR.predelay;
                    cor.accidentalsDelay     = co.AccidentalsGateDelayInTics;
                    cor.coincidenceGateWidth = co.SR.gateLength;
                    cor.isSlowBackground     = true; // see constructor in LMRawAnalysis.CoincidenceAnalysisSlowBackGround.GetResult()
                    countresults.Add(co, cor);
                }
            }
            catch (Exception ex)
            {
                if (logger != null)
                {
                    logger.TraceEvent(LogLevels.Error, 4041, "Unable to create counting analyzers: " + ex.Message);
                }
            }
        }
Пример #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);
        }
Пример #3
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;
 }
Пример #4
0
 Row[] GenCoincidenceRows(CoincidenceMatrixResult cor, Cycle c = null)
 {
     Row[] rows = new Row[1 + cor.RACoincidenceRate.Length];
     rows[0] = GenCoincidenceParamsRow(cor, c); // ??
     Row[] rows2 = GenCoincidenceDataRows(cor, c); // RA numxnum and A numxnum and R numxnum
     Array.Copy(rows2, 0, rows, 1, rows2.Length);
     // removed the Cn header rows, rows[2] = rows2[1];
     return rows;
 }
Пример #5
0
 Row GenCoincidenceParamsRow(CoincidenceMatrixResult cor, Cycle c = null)
 {
     Row row = new Row();
     int shift = 0;
     if (c != null)
     {
         row.Add(0, c.seq.ToString());
         shift = 1;
     }
     row.Add((int)CoincidenceMatrix.GateWidth + shift, (cor.coincidenceGateWidth * 1e-1).ToString());
     row.Add((int)CoincidenceMatrix.PreDelay + shift, (cor.coincidenceDeadDelay * 1e-1).ToString());
     row.Add((int)CoincidenceMatrix.LongDelay + shift, (cor.accidentalsDelay * 1e-1).ToString());
     return row;
 }
Пример #6
0
 Row[] GenCoincidenceDataRows(CoincidenceMatrixResult cor, Cycle c = null)
 {
     int len = cor.RACoincidenceRate.Length;
     Row[] rows = new Row[len];
     for (int i = 0; i < len; i++)
         rows[i] = new Row();
     int shift = 0;
     for (int chn = 0; chn < len; chn++)
     {
         if (c != null)  // add the cycle label column
         {
             rows[chn].Add(0, c.seq.ToString());
             shift = 1;
         }
         int i = 0;
         //
         for (i = 0; i < len; i++)
         {
             rows[chn].Add(i + shift, cor.RACoincidenceRate[chn][i].ToString());
         }
         rows[chn].Add(i + shift, " "); i++;
         for (int j = 0; j < len; j++)
         {
             rows[chn].Add(i + shift + j, cor.ACoincidenceRate[chn][j].ToString());
         }
         i += 32;
         rows[chn].Add(i + shift, " "); i++;
         for (int j = 0; j < len; j++)
         {
             rows[chn].Add(i + shift + j, (cor.RACoincidenceRate[chn][j] - cor.ACoincidenceRate[chn][j]).ToString());
         }
     }
     return rows;
 }