FitStateConverged Class Reference

#include <FitStateConverged.h>

Inheritance diagram for FitStateConverged:
FitState

List of all members.

Public Member Functions

void Iterate (FitContext &context) const
const std::string & Name () const

Detailed Description

FitStateConverged is the converged state - Iterate calculates number of planes to fit during next iteration.

Author:
Sergei avva@fnal.gov

Definition at line 17 of file FitStateConverged.h.


Member Function Documentation

void FitStateConverged::Iterate ( FitContext context  )  const [virtual]

Iterate

Iterate method

Implements FitState.

Definition at line 53 of file FitStateConverged.cxx.

References FitContext::fConvergenceMaster, FitContext::fData, FitContext::fDChi2, FitContext::fLastGoodFit, FitContext::fMatCalc, FitContext::fNIterationsStep, FitContext::fNTriesDiverges, FitContext::fTimesConverged, MatrixCalculator::GetFitResult(), ConvergenceMaster::GetMaskUCur(), ConvergenceMaster::GetMaskVCur(), ConstFT::InitialDChi2, FitStateFactory::Instance(), Msg::kInfo, ConvergenceMaster::MaskIsValid(), MSG, ConvergenceMaster::NextStep(), ConvergenceMaster::SetMaskIsValid(), FitContext::SetState(), DataFT::SetUHitUse(), and DataFT::SetVHitUse().

00054 {
00055     // reset number of iterations
00056     context.fNIterationsStep = 0;    
00057     // reset number of diverging iterations
00058     context.fNTriesDiverges = 0;   
00059     
00060     // save fit parameters as last good fit
00061     FitResult result = context.fMatCalc.GetFitResult();
00062     context.fLastGoodFit = result;
00063     ++context.fTimesConverged;
00064         
00065     if ( context.fConvergenceMaster.NextStep() ) {    
00066         if ( ! context.fConvergenceMaster.MaskIsValid() ) { 
00067             // apply the next mask
00068             context.fData.SetUHitUse( context.fConvergenceMaster.GetMaskUCur() );
00069             context.fData.SetVHitUse( context.fConvergenceMaster.GetMaskVCur() );
00070             context.fConvergenceMaster.SetMaskIsValid(kTRUE);
00071             MSG("FitTrackSA",Msg::kInfo) << "Updated U, V Masks.\n";
00072         }    
00073         context.fDChi2 = ConstFT::InitialDChi2;
00074         context.SetState(FitStateFactory::Instance().GetFitState("Iterating"));
00075         //context.Print();
00076         MSG("FitTrackSA",Msg::kInfo) << "Switched from Converged to Iterating\n";
00077     } else {
00078         context.SetState(FitStateFactory::Instance().GetFitState("Final"));
00079         //context.Print();
00080         MSG("FitTrackSA",Msg::kInfo) << "Switched from Converged to Final\n";
00081         return;
00082     }
00083 }

const std::string & FitStateConverged::Name (  )  const [virtual]

Name() - return name of the state

Implements FitState.

Definition at line 44 of file FitStateConverged.cxx.

References CONVERGED_FIT_STATE.

00045 {
00046     return CONVERGED_FIT_STATE;
00047 }    


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1