protected void ConstructSRSection(INCCStyleSection sec, Multiplicity mu, Detector det) { // if this is based on a virtual SR then show it if (det.Id.source.UsingVirtualSRCounting(det.Id.SRType)) { sec.AddTwo(" Virtual shift register:", mu.ToString()); } sec.AddTwo("Predelay:", mu.SR.predelayMS); sec.AddTwo("Gate length:", mu.SR.gateLengthMS); if (det.Id.SRType == InstrType.DGSR) { sec.AddTwo("Gate length2:", mu.SR.gateLengthMS); } sec.AddIntegerRow("High voltage:", (Int32)mu.SR.highVoltage); sec.SetFPCurrentFormatPrecision(4); sec.AddTwo("Die away time:", mu.SR.dieAwayTimeMS); sec.AddTwo("Efficiency:", mu.SR.efficiency); sec.AddTwo("Multiplicity deadtime:", mu.SR.deadTimeCoefficientMultiplicityinNanoSecs); sec.AddTwo("Coefficient A deadtime:", mu.SR.deadTimeCoefficientAinMicroSecs); sec.AddTwo("Coefficient B deadtime:", mu.SR.deadTimeCoefficientBinPicoSecs); sec.AddTwo("Coefficient C deadtime:", mu.SR.deadTimeCoefficientCinNanoSecs); sec.AddTwo("Doubles gate fraction:", mu.SR.doublesGateFraction); sec.AddTwo("Triples gate fraction:", mu.SR.triplesGateFraction); }
protected void ConstructSRSection(INCCStyleSection sec, Multiplicity mu, Detector det) { // if this is based on a virtual SR then show it if (det.Id.source.UsingVirtualSRCounting(det.Id.SRType)) sec.AddTwo(" Virtual shift register:", mu.ToString()); sec.AddTwo("Predelay:", mu.SR.predelayMS); sec.AddTwo("Gate length:", mu.SR.gateLengthMS); if (det.Id.SRType == InstrType.DGSR) sec.AddTwo("Gate length2:", mu.SR.gateLengthMS); sec.AddIntegerRow("High voltage:", (Int32)mu.SR.highVoltage); sec.SetFPCurrentFormatPrecision(4); sec.AddTwo("Die away time:", mu.SR.dieAwayTimeMS); sec.AddTwo("Efficiency:", mu.SR.efficiency); sec.AddTwo("Multiplicity deadtime:", mu.SR.deadTimeCoefficientMultiplicityinNanoSecs); sec.AddTwo("Coefficient A deadtime:", mu.SR.deadTimeCoefficientAinMicroSecs); sec.AddTwo("Coefficient B deadtime:", mu.SR.deadTimeCoefficientBinPicoSecs); sec.AddTwo("Coefficient C deadtime:", mu.SR.deadTimeCoefficientCinNanoSecs); sec.AddTwo("Doubles gate fraction:", mu.SR.doublesGateFraction); sec.AddTwo("Triples gate fraction:", mu.SR.triplesGateFraction); }
protected Section ConstructReportSection(INCCReportSection section, Detector det, MeasOptionSelector moskey = null) { INCCStyleSection sec = null; try { switch (section) { case INCCReportSection.Header: sec = new INCCStyleSection(null, 1); sec.AddHeader(N.App.Name + " " + N.App.Config.VersionString); // section header break; case INCCReportSection.Context: sec = new INCCStyleSection(null, 1); ConstructContextContent(sec, det); break; case INCCReportSection.Isotopics: if (AssaySelector.ForMass(meas.MeasOption)) { sec = new INCCStyleSection(null, 1); sec.SetFPCurrentFormatPrecision(4); Isotopics curiso = Isotopics.update_isotopics(1.0, meas.MeasDate, meas.Isotopics, meas.logger, N.App.AppContext.INCCParity); if (curiso == null) { curiso = new Isotopics(); meas.Isotopics.CopyTo(curiso); ctrllog.TraceEvent(LogLevels.Warning, 82034, "Using incorrect updated defaults for " + meas.Isotopics.id); } sec.AddTwo("Isotopics id:", meas.Isotopics.id); sec.AddTwo("Isotopics source code:", meas.Isotopics.source_code.ToString()); sec.AddDualNumericRow("Pu238:", meas.Isotopics[Isotope.pu238], curiso[Isotope.pu238]); sec.AddDualNumericRow("Pu239:", meas.Isotopics[Isotope.pu239], curiso[Isotope.pu239]); sec.AddDualNumericRow("Pu240:", meas.Isotopics[Isotope.pu240], curiso[Isotope.pu240]); sec.AddDualNumericRow("Pu241:", meas.Isotopics[Isotope.pu241], curiso[Isotope.pu241]); sec.AddDualNumericRow("Pu242:", meas.Isotopics[Isotope.pu242], curiso[Isotope.pu242]); sec.AddDualDateOnlyRow("Pu date:", meas.Isotopics.pu_date, curiso.pu_date); sec.AddDualNumericRow("Am241:", meas.Isotopics[Isotope.am241], curiso[Isotope.am241]); sec.AddDualDateOnlyRow("Am date:", meas.Isotopics.am_date, curiso.am_date); // dev note: here is where the alternative K vals are added in the Euratom version } break; case INCCReportSection.ShiftRegister: sec = new INCCStyleSection(null, 1); ConstructSRSection(sec, moskey.MultiplicityParams, det); break; case INCCReportSection.Adjustments: sec = new INCCStyleSection(null, 1); if (AssaySelector.ForMass(meas.MeasOption) || meas.MeasOption == AssaySelector.MeasurementOption.rates) { ushort push = sec.FPFormatPrecision; sec.SetFPCurrentFormatPrecision(4); sec.AddNumericRow("Normalization constant:", meas.Norm.currNormalizationConstant); sec.SetFPCurrentFormatPrecision(push); } if (AssaySelector.UsesBackground(meas.MeasOption)) { sec.AddNumericRow("Passive singles bkgrnd:", meas.Background.DeadtimeCorrectedSinglesRate); sec.AddNumericRow("Passive doubles bkgrnd:", meas.Background.DeadtimeCorrectedDoublesRate); sec.AddNumericRow("Passive triples bkgrnd:", meas.Background.DeadtimeCorrectedTriplesRate); if (det.Id.SRType <= InstrType.AMSR) { sec.AddNumericRow("Passive scaler1 bkgrnd:", meas.Background.Scaler1.v); sec.AddNumericRow("Passive scaler2 bkgrnd:", meas.Background.Scaler2.v); } sec.AddNumericRow("Active singles bkgrnd:", meas.Background.INCCActive.Singles); sec.AddNumericRow("Active doubles bkgrnd:", meas.Background.INCCActive.Doubles); sec.AddNumericRow("Active triples bkgrnd:", meas.Background.INCCActive.Triples); if (det.Id.SRType <= InstrType.AMSR) { sec.AddNumericRow("Passive scaler1 bkgrnd:", meas.Background.INCCActive.Scaler1Rate); sec.AddNumericRow("Passive scaler2 bkgrnd:", meas.Background.INCCActive.Scaler2Rate); } } break; case INCCReportSection.CycleSummary: sec = new INCCStyleSection(null, 1); sec.AddIntegerRow(String.Format("Number {0} cycles:",meas.INCCAnalysisState.Methods.HasActiveSelected() || meas.INCCAnalysisState.Methods.HasActiveMultSelected()?"Active":"Passive"), (int)meas.Cycles.GetValidCycleCountForThisKey(moskey.MultiplicityParams)); //det.MultiplicityParams)); // could also use CycleList length but CycleList can be longer when a reanalysis occurs and the analysis processing stops short of the end of the list due to modified termination conditions sec.AddNumericRow("Count time (sec):", (meas.Cycles.Count > 0 ? meas.Cycles[0].TS.TotalSeconds : 0.0)); break; case INCCReportSection.Messages: List<MeasurementMsg> sl = null; bool found = meas.Messages.TryGetValue(moskey.MultiplicityParams, out sl); if (found) { sec = new INCCStyleSection(null, 1); sec.AddHeader(String.Format("{0} messages", meas.INCCAnalysisState.Methods.HasActiveSelected() || meas.INCCAnalysisState.Methods.HasActiveMultSelected() ? "Active" : "Passive")); /// todo: is there an active messages section header analog? foreach (MeasurementMsg m in sl) { Row r = new Row(); r.Add(0, m.text); // expand to log style with toString? sec.Add(r); } } break; case INCCReportSection.Reference: sec = new INCCStyleSection(null, 1); sec.AddHeader("Counting results, summaries and cycle counts file name"); // section header Row resline = new Row(); resline.Add(0, " " + meas.ResultsFileName); sec.Add(resline); break; default: break; } } catch (Exception e) { ctrllog.TraceException(e); } return sec; }
protected Section ConstructReportSection(INCCReportSection section, Detector det, MeasOptionSelector moskey = null) { INCCStyleSection sec = null; try { switch (section) { case INCCReportSection.Header: sec = new INCCStyleSection(null, 1); sec.AddHeader(N.App.Name + " " + N.App.Config.VersionString); // section header break; case INCCReportSection.Context: sec = new INCCStyleSection(null, 1); ConstructContextContent(sec, det); break; case INCCReportSection.Isotopics: if (AssaySelector.ForMass(meas.MeasOption)) { sec = new INCCStyleSection(null, 1); sec.SetFPCurrentFormatPrecision(4); Isotopics curiso = Isotopics.update_isotopics(1.0, meas.MeasDate, meas.Isotopics, meas.logger, N.App.AppContext.INCCParity); if (curiso == null) { curiso = new Isotopics(); meas.Isotopics.CopyTo(curiso); ctrllog.TraceEvent(LogLevels.Warning, 82034, "Using incorrect updated defaults for " + meas.Isotopics.id); } sec.AddTwo("Isotopics id:", meas.Isotopics.id); sec.AddTwo("Isotopics source code:", meas.Isotopics.source_code.ToString()); sec.AddDualNumericRow("Pu238:", meas.Isotopics[Isotope.pu238], curiso[Isotope.pu238]); sec.AddDualNumericRow("Pu239:", meas.Isotopics[Isotope.pu239], curiso[Isotope.pu239]); sec.AddDualNumericRow("Pu240:", meas.Isotopics[Isotope.pu240], curiso[Isotope.pu240]); sec.AddDualNumericRow("Pu241:", meas.Isotopics[Isotope.pu241], curiso[Isotope.pu241]); sec.AddDualNumericRow("Pu242:", meas.Isotopics[Isotope.pu242], curiso[Isotope.pu242]); sec.AddDualDateOnlyRow("Pu date:", meas.Isotopics.pu_date, curiso.pu_date); sec.AddDualNumericRow("Am241:", meas.Isotopics[Isotope.am241], curiso[Isotope.am241]); sec.AddDualDateOnlyRow("Am date:", meas.Isotopics.am_date, curiso.am_date); // dev note: here is where the alternative K vals are added in the Euratom version } break; case INCCReportSection.ShiftRegister: sec = new INCCStyleSection(null, 1); ConstructSRSection(sec, moskey.MultiplicityParams, det); break; case INCCReportSection.Adjustments: sec = new INCCStyleSection(null, 1); if (AssaySelector.ForMass(meas.MeasOption) || meas.MeasOption == AssaySelector.MeasurementOption.rates) { ushort push = sec.FPFormatPrecision; sec.SetFPCurrentFormatPrecision(4); sec.AddNumericRow("Normalization constant:", meas.Norm.currNormalizationConstant); sec.SetFPCurrentFormatPrecision(push); } if (AssaySelector.UsesBackground(meas.MeasOption)) { sec.AddNumericRow("Passive singles bkgrnd:", meas.Background.DeadtimeCorrectedSinglesRate); sec.AddNumericRow("Passive doubles bkgrnd:", meas.Background.DeadtimeCorrectedDoublesRate); sec.AddNumericRow("Passive triples bkgrnd:", meas.Background.DeadtimeCorrectedTriplesRate); if (det.Id.SRType <= InstrType.AMSR) { sec.AddNumericRow("Passive scaler1 bkgrnd:", meas.Background.Scaler1.v); sec.AddNumericRow("Passive scaler2 bkgrnd:", meas.Background.Scaler2.v); } sec.AddNumericRow("Active singles bkgrnd:", meas.Background.INCCActive.Singles); sec.AddNumericRow("Active doubles bkgrnd:", meas.Background.INCCActive.Doubles); sec.AddNumericRow("Active triples bkgrnd:", meas.Background.INCCActive.Triples); if (det.Id.SRType <= InstrType.AMSR) { sec.AddNumericRow("Passive scaler1 bkgrnd:", meas.Background.INCCActive.Scaler1Rate); sec.AddNumericRow("Passive scaler2 bkgrnd:", meas.Background.INCCActive.Scaler2Rate); } } break; case INCCReportSection.CycleSummary: sec = new INCCStyleSection(null, 1); sec.AddIntegerRow(String.Format("Number {0} cycles:", meas.INCCAnalysisState.Methods.HasActiveSelected() || meas.INCCAnalysisState.Methods.HasActiveMultSelected()?"Active":"Passive"), (int)meas.Cycles.GetValidCycleCountForThisKey(moskey.MultiplicityParams)); //det.MultiplicityParams)); // could also use CycleList length but CycleList can be longer when a reanalysis occurs and the analysis processing stops short of the end of the list due to modified termination conditions sec.AddNumericRow("Count time (sec):", (meas.Cycles.Count > 0 ? meas.Cycles[0].TS.TotalSeconds : 0.0)); break; case INCCReportSection.Messages: List <MeasurementMsg> sl = null; bool found = meas.Messages.TryGetValue(moskey.MultiplicityParams, out sl); if (found) { sec = new INCCStyleSection(null, 1); sec.AddHeader(String.Format("{0} messages", meas.INCCAnalysisState.Methods.HasActiveSelected() || meas.INCCAnalysisState.Methods.HasActiveMultSelected() ? "Active" : "Passive")); /// todo: is there an active messages section header analog? foreach (MeasurementMsg m in sl) { Row r = new Row(); r.Add(0, m.text); // expand to log style with toString? sec.Add(r); } } break; case INCCReportSection.Reference: sec = new INCCStyleSection(null, 1); sec.AddHeader("Counting results, summaries and cycle counts file name"); // section header Row resline = new Row(); resline.Add(0, " " + meas.ResultsFileName); sec.Add(resline); break; default: break; } } catch (Exception e) { ctrllog.TraceException(e); } return(sec); }