00001 //_____________________________________________________________________________ 00010 00011 #include <string> 00012 00013 #include "Algorithm/AlgConfig.h" 00014 #include "MessageService/MsgService.h" 00015 00016 #include "CandFitTrackSA/ConstFT.h" 00017 #include "CandFitTrackSA/DataFT.h" 00018 #include "CandFitTrackSA/MatrixCalculator.h" 00019 00020 #include "CandFitTrackSA/FitStateFactory.h" 00021 #include "CandFitTrackSA/FitStateDiverged.h" 00022 #include "CandFitTrackSA/FitContext.h" 00023 00024 CVSID("$Id: FitStateDiverged.cxx,v 1.2 2006/02/04 21:47:35 avva Exp $"); 00025 00026 // The ID of class Line 00027 static const std::string DIVERGED_FIT_STATE = "Diverged"; 00028 00029 // Create an anonymous namespace 00030 // to make the function invisible from other modules 00031 namespace { 00032 00033 FitState* CreateDivergedFS() { return new FitStateDiverged; } 00034 00035 // register block 00036 bool registered = FitStateFactory::Instance().RegisterFitState( 00037 DIVERGED_FIT_STATE, 00038 CreateDivergedFS); 00039 } // namespace 00040 00041 00045 const std::string& FitStateDiverged::Name() const 00046 { 00047 return DIVERGED_FIT_STATE; 00048 } 00049 00050 00054 void FitStateDiverged::Iterate(FitContext& context) const 00055 { 00056 // reset number of iterations 00057 context.fNIterationsStep = 0; 00058 00059 // reset number of diverging iterations 00060 context.fNTriesDiverges = 0; 00061 00062 // next step in dearch of convergence 00063 if ( context.fConvergenceMaster.NextStep() ) { 00064 if ( ! context.fConvergenceMaster.MaskIsValid() ) { 00065 // apply the next mask 00066 context.fData.SetUHitUse( context.fConvergenceMaster.GetMaskUCur() ); 00067 context.fData.SetVHitUse( context.fConvergenceMaster.GetMaskVCur() ); 00068 context.fConvergenceMaster.SetMaskIsValid(kTRUE); 00069 MSG("FitTrackSA",Msg::kInfo) << "Updated U, V Masks.\n"; 00070 } 00071 context.fDChi2 = ConstFT::InitialDChi2; 00072 context.SetFromLastGoodFit(); 00073 context.SetState(FitStateFactory::Instance().GetFitState("Iterating")); 00074 //context.Print(); 00075 MSG("FitTrackSA",Msg::kInfo) << "Switched from Diverged to Iterating\n"; 00076 } else { 00077 context.SetState(FitStateFactory::Instance().GetFitState("Final")); 00078 //context.Print(); 00079 MSG("FitTrackSA",Msg::kInfo) << "Switched from Diverged to Final\n"; 00080 return; 00081 } 00082 00083 } 00084
1.3.9.1