Beispiel #1
0
        public CountingAnalysisParameters CountingParameters(Detector det, bool applySRFromDetector)
        {
            CountingAnalysisParameters cap = CountingParameters(det.Id.DetectorName);

            if (applySRFromDetector)
            {
                Multiplicity m = det.MultiplicityParams;
                foreach (SpecificCountingAnalyzerParams s in cap)
                {
                    Type t = s.GetType();
                    if (t.Equals(typeof(Multiplicity)))
                    {
                        Multiplicity thisone = ((Multiplicity)s);
                        ulong        gw      = thisone.gateWidthTics;
                        //ulong predelay = thisone.SR.predelay;
                        thisone.SR = new ShiftRegisterParameters(m.SR); // use the current detector's SR params, then
                        thisone.SetGateWidthTics(gw);                   // override with the user's choice from the DB
                        //thisone.SR.predelay = predelay;
                    }
                    else if (t.Equals(typeof(Coincidence)))
                    {
                        Coincidence thisone = ((Coincidence)s);
                        ulong       gw      = thisone.gateWidthTics;
                        //ulong predelay = thisone.SR.predelay;
                        thisone.SR = new ShiftRegisterParameters(m.SR); // use the current detector's SR params, then
                        thisone.SetGateWidthTics(gw);                   // override with the user's choice from the DB
                        //thisone.SR.predelay = predelay;
                    }
                }
            }
            return(cap);
        }