00001
00002
00003
00004 #include <iomanip>
00005
00006
00007 #include "JobControl/JobCModuleRegistry.h"
00008 #include "JobControl/JobCommand.h"
00009 #include "MessageService/MsgService.h"
00010 #include "MinosObjectMap/MomNavigator.h"
00011
00012
00013 #include "Interface.h"
00014 #include "FillDataModule.h"
00015
00016 CVSID("$Id: FillDataModule.cxx,v 1.14 2008/01/31 22:18:17 rustem Exp $");
00017
00018 JOBMODULE(FillDataModule, "FillDataModule", "FillDataModule");
00019
00020
00021 FillDataModule::FillDataModule()
00022 :fInterface(new Anp::Interface()),
00023 fNRecord(0),
00024 fNPass(0),
00025 fNFail(0),
00026 fConfig(false)
00027 {
00028 }
00029
00030
00031 FillDataModule::~FillDataModule()
00032 {
00033 MSG("FillAlg", Msg::kDebug)
00034 << endl
00035 << "**************************************************" << std::endl
00036 << " FillDataModule" << std::endl
00037 << " Number of passed records " << fNPass << std::endl
00038 << " Number of failed records " << fNFail << std::endl
00039 << "**************************************************" << std::endl;
00040
00041 if(fInterface)
00042 {
00043 delete fInterface;
00044 fInterface = 0;
00045 }
00046 }
00047
00048
00049 JobCResult FillDataModule::Reco(MomNavigator *mom)
00050 {
00051 if(fInterface && fInterface -> FillSnarl(mom))
00052 {
00053 ++fNPass;
00054 }
00055 else
00056 {
00057 ++fNFail;
00058 }
00059
00060 if(fNRecord++ % 20000 == 0)
00061 {
00062 cout << "Record # " << std::setfill(' ') << std::right << std::setw(8) << fNRecord << " ";
00063 fTimer.Stop();
00064 fTimer.Print();
00065 fTimer.Reset();
00066 fTimer.Start();
00067 }
00068
00069 return JobCResult::kAOK;
00070 }
00071
00072
00073 void FillDataModule::Config(const Registry& reg)
00074 {
00075
00076
00077
00078
00079 MSG("FillAlg", Msg::kVerbose) << "FillDataModule::Config()" << std::endl;
00080
00081 fConfig.UnLockValues();
00082 fConfig.Merge(reg);
00083 fConfig.LockValues();
00084 }
00085
00086
00087 void FillDataModule::BeginJob()
00088 {
00089 MSG("FillAlg", Msg::kVerbose) << "FillDataModule::BeginJob()..." << std::endl;
00090
00091 if(fInterface) fInterface -> Config(fConfig);
00092
00093 fTimer.Start();
00094 }
00095
00096
00097 void FillDataModule::EndJob()
00098 {
00099 MSG("FillAlg", Msg::kVerbose) << "FillDataModule::EndJob()..." << std::endl;
00100
00101 if(fInterface)
00102 {
00103 delete fInterface;
00104 fInterface = 0;
00105 }
00106 }