diff --git a/doc/examples/test-histo-NeXus2.msr b/doc/examples/test-histo-NeXus2.msr index 53be51c5..869aff59 100644 --- a/doc/examples/test-histo-NeXus2.msr +++ b/doc/examples/test-histo-NeXus2.msr @@ -3,21 +3,20 @@ Ag_T=100_F=20 FITPARAMETER # No Name Value Step Pos_Error Boundaries 1 zero 0 0 none - 2 phase 0.00000000029 -0.00000000029 0.00985861603 0 100 - 3 field 20.3708 -0.0088 0.0088 0 none - 4 asym 0.23135 -0.00065 0.00066 0 0.3 - 5 rate 0.0074 0.0049 none 0 100 - 6 beta 1.867 0.043 none - 7 Norm_L 1135.66 -0.58 0.58 - 8 BG_L 0 0 none 0 none - 9 Norm_R 1168.88 -0.61 0.61 0 none - 10 BG_R 0 0 none 0 none - 11 relPhase 177.40 -0.20 0.21 0 none + 2 phase 0.000000011 -0.000000011 0.005772888 0 100 + 3 field 20.3391 -0.0085 0.0085 0 none + 4 asym 0.23461 -0.00051 0.00051 0 0.3 + 5 rate 0.0239 -0.0040 0.0035 0 100 + 6 Norm_L 1151.24 -0.53 0.53 + 7 BG_L 0 0 none 0 none + 8 Norm_R 1178.60 -0.58 0.58 0 none + 9 BG_R 0 0 none 0 none + 10 relPhase 178.49 -0.20 0.20 0 none ############################################################### THEORY asymmetry 4 -generExpo 5 6 (rate exponent) +simpleGss 5 (rate) TFieldCos fun1 fun2 (phase frequency) ############################################################### @@ -28,21 +27,24 @@ fun2 = gamma_mu * par3 ############################################################### GLOBAL fittype 0 (single histogram fit) -data 10 2048 -fit 0.2 14 +data 5 2048 +t0 10.0 +deadtime-cor file +fit 0.144 30 packing 1 ############################################################### -RUN data/emu00139040 XXXX ISIS NEXUS (name beamline institute data-file-format) -norm 7 -backgr.fit 8 +RUN data/emu00139040 EMU ISIS NEXUS (name beamline institute data-file-format) +norm 6 +backgr.fit 7 map 1 0 0 0 0 0 0 0 0 0 forward 1-48 +#deadtime-cor file RUN data/emu00139040 XXXX ISIS NEXUS (name beamline institute data-file-format) -norm 9 -backgr.fit 10 -map 11 0 0 0 0 0 0 0 0 0 +norm 8 +backgr.fit 9 +map 10 0 0 0 0 0 0 0 0 0 forward 49-96 ############################################################### @@ -59,15 +61,15 @@ fourier_power 11 apodization STRONG # NONE, WEAK, MEDIUM, STRONG plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL range 0 200 -phase parR2, par11 +phase parR2, par10 ############################################################### PLOT 0 (single histo plot) lifetimecorrection runs 1 2 -range 0 14 -0.35 0.35 -view_packing 10 +range 0 20 -0.35 0.35 +#view_packing 10 ############################################################### -STATISTIC --- 2026-02-05 10:47:55 - maxLH = 2154.1, NDF = 1684, maxLH/NDF = 1.279168 +STATISTIC --- 2026-02-08 15:32:12 + maxLH = 4233.1, NDF = 3725, maxLH/NDF = 1.136412 diff --git a/src/classes/PMusr.cpp b/src/classes/PMusr.cpp index 5473ccd4..3a928880 100644 --- a/src/classes/PMusr.cpp +++ b/src/classes/PMusr.cpp @@ -721,6 +721,22 @@ PRawRunDataSet* PRawRunData::GetDataSet(const UInt_t idx, Bool_t wantHistoNo) return fData.GetSet(idx); } +//-------------------------------------------------------------------------- +// DeadTimeCorrectionReady (public) +//-------------------------------------------------------------------------- +/** + *
Checks if deadtime correction information is sufficient to apply it.
+ * This means that fNumberOfGoodFrames must be present and the deadtime
+ * parameter vector.
+ *
+ * @return true if ready to apply deadtime correctio, false otherwise
+ */
+const Bool_t PRawRunData::DeadTimeCorrectionReady()
+{
+ if ((fNumberOfGoodFrames > 0) && (fDeadTimeParam.size() > 0))
+ return true;
+ return false;
+}
//--------------------------------------------------------------------------
// SetRingAnode (public)
diff --git a/src/classes/PRunSingleHisto.cpp b/src/classes/PRunSingleHisto.cpp
index 3bf6271f..9f7ade52 100644
--- a/src/classes/PRunSingleHisto.cpp
+++ b/src/classes/PRunSingleHisto.cpp
@@ -1069,6 +1069,38 @@ Bool_t PRunSingleHisto::PrepareData()
forward[i] = *runData->GetDataBin(histoNo[i]);
}
+ // check if a dead time correction has to be done
+ // first check the global block
+ TString dtcg = fMsrInfo->GetMsrGlobal()->GetDeadTimeCorrection();
+ Int_t dtcg_tag = 0; // 0=no, 1=file, 2=estimate
+ if (dtcg.Contains("file", TString::kIgnoreCase)) {
+ dtcg_tag = 1;
+ } else if (dtcg.Contains("estimate", TString::kIgnoreCase)) {
+ dtcg_tag = 2;
+ }
+ // now check each run
+ TString dtcr{"no"};
+ Bool_t needToCheck{true};
+ for (UInt_t i=0; i