Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

fmwk/JobControl/Module.cxx

Go to the documentation of this file.
00001 #include "JobControl/Module.h"
00002 #include "JobControl/Exception.h"
00003 #include <iostream>
00004 #include "Config/Config.h"
00005 #include "Config/Table.h"
00006 #include <unistd.h>
00007 using namespace jobc;
00008 
00009 //......................................................................
00010 
00011 Module::Module(const char*  name) :
00012   fName      ( name  ),
00013   fCfgVersion( ""    ),
00014   fIsInit    ( false )
00015 { }
00016 
00017 //......................................................................
00018 
00019 Result Module::Reco(edm::EventHandle& /*evt*/)    { 
00020   char msg[256];
00021   sprintf(msg, "Calling default %s::Reco()", fName.c_str());
00022 
00023   assert_jobc(0, msg);
00024 
00025   return kPassed;
00026 }
00027 
00028 //......................................................................
00029 
00030 Result Module::Ana(const edm::EventHandle& /*ev*/)
00031 {
00032   char msg[256];
00033   sprintf(msg, "Calling default %s::Ana()", fName.c_str());
00034   assert_jobc(0, msg);
00035   return kPassed;
00036 }
00037 
00038 void Module::NewFile(const char* /*filename*/)      { }
00039 void Module::EndFile(const char* /*filename*/)      { }
00040 void Module::NewRun(int /*run*/, int /*subrun*/)    { }
00041 void Module::EndRun(int /*run*/, int /*subrun*/)    { }
00042 void Module::NewSubrun(int /*run*/, int /*subrun*/) { }
00043 void Module::EndSubrun(int /*run*/, int /*subrun*/) { }
00044 
00045 //......................................................................
00046 
00047 void Module::Reset() { this->SetCfgVersion("default"); }
00048 
00049 //......................................................................
00050 
00051 void Module::SetCfgVersion(const char* cfgv) 
00052 {
00053   if (fCfgVersion == cfgv) return; // Nothing to do...
00054   this->RemoveWatch(fCfgVersion.c_str());
00055   fCfgVersion = cfgv;
00056   this->SetWatch(fName.c_str(), fCfgVersion.c_str());
00057   // std::cerr << "Set watch for " << this->Name() << cfgv << std::endl;
00058 }
00059 
00060 //......................................................................
00061 
00062 void Module::Report() 
00063 {
00064   std::cout << fName << ": Nothing to report." << std::endl;
00065 }
00066 
00067 //......................................................................
00068 
00069 void Module::CheckInit()
00070 {
00071   if (fIsInit) return;
00072   std::cout << "Module " << fName << "/" << fCfgVersion
00073        << " is not initialized. Stopping the job." << std::endl;
00074   exit(-1);
00075 }
00076 

Generated on Sat Oct 11 02:35:27 2008 for NOvA Offline by  doxygen 1.3.9.1