// build up the requested analyses for this run from the list of analyzer params internal void PrepareAndStartCountingAnalyzers(CountingAnalysisParameters ap) { if (ap == null) { logger.TraceEvent(LogLevels.Error, 1519, "No counting analyzers specified"); return; } bool good = false; foreach (SpecificCountingAnalyzerParams sap in ap) { if (!sap.Active) // skip disabled analyzers { continue; } if (sap is BaseRate) { BaseRate b = (BaseRate)sap; good = State.Sup.AddRates(b.gateWidthTics); if (!good) { // perhaps the gate is too large // dev note : each analyzer should publish it's limits with constant attributes on the class good = State.Sup.AddRates(b.gateWidthTics = (ulong)1e7); logger.TraceEvent(LogLevels.Warning, 1512, "Rate analyzer gatewidth created with default {0} ticks", b.gateWidthTics); } } else if (sap is Multiplicity) { Multiplicity m = (Multiplicity)sap; good = State.Sup.AddMultiplicity(m, m.FA); } else if (sap is Rossi) { Rossi r = (Rossi)sap; good = State.Sup.AddRossi(r.gateWidthTics); } else if (sap is Feynman) { Feynman f = (Feynman)sap; good = State.Sup.AddFeynman(f.gateWidthTics); } else if (sap is TimeInterval) { TimeInterval ti = (TimeInterval)sap; good = State.Sup.AddTimeInterval(ti.gateWidthTics); } else if (sap is Coincidence) { Coincidence co = (Coincidence)sap; good = State.Sup.AddCoincidenceMatrix(co); } } }
void ConstructNewRow(DataGridViewRow row, Type t, FAType FA) { SpecificCountingAnalyzerParams s = null; if (t.Equals(typeof(Multiplicity))) { Multiplicity m = new Multiplicity(FA); row.Cells[3].Value = det.SRParams.predelay.ToString(); row.Cells[3].Tag = det.SRParams.predelay; if (FA == FAType.FAOn) { row.Cells[4].Value = m.BackgroundGateTimeStepInTics.ToString(); row.Cells[4].Tag = m.BackgroundGateTimeStepInTics; } else { row.Cells[4].Value = m.AccidentalsGateDelayInTics.ToString(); row.Cells[4].Tag = m.AccidentalsGateDelayInTics; } m.gateWidthTics = det.SRParams.gateLength; s = m; } else if (t.Equals(typeof(Feynman))) { s = new Feynman(); } else if (t.Equals(typeof(Rossi))) { s = new Rossi(); } else if (t.Equals(typeof(TimeInterval))) { s = new TimeInterval(); } else if (t.Equals(typeof(Coincidence))) { Coincidence c = new Coincidence(); row.Cells[3].Value = det.SRParams.predelay.ToString(); row.Cells[3].Tag = det.SRParams.predelay; row.Cells[4].Value = c.AccidentalsGateDelayInTics.ToString(); row.Cells[4].Tag = c.AccidentalsGateDelayInTics; c.gateWidthTics = det.SRParams.gateLength; s = c; } row.Cells[0].Tag = s.Active; row.Cells[2].Tag = s.gateWidthTics; row.Cells[2].Value = s.gateWidthTics.ToString(); row.Tag = s; SetRODetails(row, t); }
public bool Transfer(Feynman ryp, FeynmanResult fr) { if (fr == null) return true; bool res = true; try { FeynmanResultExt lfr = new FeynmanResultExt(); countresults.Add(ryp, lfr); lfr.TransferRawResult(fr); } catch (OutOfMemoryException e) { ryp.reason = "Feynman transfer " + e.Message; res = false; logger.TraceEvent(LogLevels.Error, 87407, ryp.reason); } return res; }
SpecificCountingAnalyzerParams Constructed(DataGridViewRow row) { SpecificCountingAnalyzerParams s = null; Type t; FAType FA; if (row.Cells[1].Value == null) return null; TTypeMap((string)row.Cells[1].Value, out t, out FA); if (t.Equals(typeof(Multiplicity))) { s = new Multiplicity(FA); ((Multiplicity)s).SR.predelay = Construct(row.Cells[3]); ((Multiplicity)s).SR.gateLength = Construct(row.Cells[2]); ((Multiplicity)s).SR.gateLengthMS = Construct(row.Cells[2])/10; if (FA == FAType.FAOn) ((Multiplicity)s).BackgroundGateTimeStepInTics = Construct(row.Cells[4]); else ((Multiplicity)s).AccidentalsGateDelayInTics = Construct(row.Cells[4]); } else if (t.Equals(typeof(Feynman))) { s = new Feynman(); } else if (t.Equals(typeof(Rossi))) { s = new Rossi(); } else if (t.Equals(typeof(TimeInterval))) { s = new TimeInterval(); } else if (t.Equals(typeof(Coincidence))) { s = new Coincidence(); ((Coincidence)s).SR.predelay = Construct(row.Cells[3]); ((Coincidence)s).AccidentalsGateDelayInTics = Construct(row.Cells[4]); } s.gateWidthTics = Construct(row.Cells[2]); s.Active = CheckedRow(row); return s; }