00001
00002
00003
00004
00005
00007
00008 #include <cassert>
00009
00010 #include "JobControl/JobCModuleRegistry.h"
00011 #include "JobControl/JobCommand.h"
00012 #include "MessageService/MsgService.h"
00013 #include "MinosObjectMap/MomNavigator.h"
00014 #include "BeamDataNtuple/NtpBDLiteRecord.h"
00015 #include "StandardNtuple/NtpStRecord.h"
00016
00017 #include "MeuCal/MeuAnalysis.h"
00018 #include "MeuCal/MeuCalModule.h"
00019
00020 JOBMODULE(MeuCalModule,
00021 "MeuCalModule",
00022 "A module to produce MeuSummary ntuples");
00023
00024 CVSID("$Id: MeuCalModule.cxx,v 1.2 2007/04/04 09:08:57 hartnell Exp $");
00025
00026 ClassImp(MeuCalModule)
00027
00028
00029
00030 MeuCalModule::MeuCalModule()
00031 {
00032 MSG("MeuCalModule", Msg::kDebug)
00033 <<"Running MeuCalModule constructor..."<<endl;
00034
00035
00036 fMeuAnalysis=0;
00037
00038 MSG("MeuCalModule", Msg::kDebug)
00039 <<"Finished constructor"<<endl;
00040 }
00041
00042
00043
00044 MeuCalModule::~MeuCalModule()
00045 {
00046 MSG("MeuCalModule", Msg::kDebug)
00047 <<"Running destructor..."<<endl;
00048
00049 MSG("MeuCalModule", Msg::kDebug)
00050 <<"Finished destructor"<<endl;
00051 }
00052
00053
00054
00055 JobCResult MeuCalModule::Ana(const MomNavigator *mom)
00056 {
00057
00058
00059
00060
00061
00062
00063 JobCResult result(JobCResult::kPassed);
00064
00065
00066 assert(mom);
00067
00068 const NtpStRecord* pntp=dynamic_cast<NtpStRecord*>
00069 (mom->GetFragment("NtpStRecord"));
00070 if (!pntp){
00071 MSG("MeuCalModule",Msg::kWarning)
00072 << "No NtpStRecord in Mom" << endl;
00073 }
00074
00075 const NtpBDLiteRecord* pntpBD=dynamic_cast<NtpBDLiteRecord*>
00076 (mom->GetFragment("NtpBDLiteRecord"));
00077 if (!pntpBD){
00078 MAXMSG("MeuCalModule",Msg::kInfo,1)
00079 <<"No NtpBDLiteRecord in Mom (note: not present for MC)"<<endl;
00080 }
00081
00082
00083 fMeuAnalysis->MakeSummaryTreeWithNtpStOneSnarl(pntp,pntpBD);
00084
00085 return result;
00086 }
00087
00088
00089
00090 void MeuCalModule::BeginJob()
00091 {
00092 MSG("MeuCalModule",Msg::kInfo)
00093 <<"Running MeuCalModule::BeginJob()..."<<endl;
00094
00095
00096 fMeuAnalysis=new MeuAnalysis();
00097
00098 MSG("MeuCalModule",Msg::kInfo)
00099 <<"Finished running MeuCalModule::BeginJob()"<<endl;
00100 }
00101
00102
00103
00104 void MeuCalModule::EndJob()
00105 {
00106 MSG("MeuCalModule",Msg::kInfo)
00107 <<"Running MeuCalModule::EndJob()..."<<endl;
00108
00109
00110 fMeuAnalysis->StoreOrFinishSummaryTree(NULL,NULL,1);
00111
00112
00113 fMeuAnalysis->WriteOutHistos();
00114
00115 MSG("MeuCalModule",Msg::kInfo)
00116 <<"Finished running MeuCalModule::EndJob()"<<endl;
00117 }
00118
00119
00120
00121 const Registry& MeuCalModule::DefaultConfig() const
00122 {
00124
00125 MSG("MeuCalModule", Msg::kDebug)
00126 << "Running MeuCalModule::DefaultConfig..." << endl;
00127
00128 static Registry r;
00129
00130 string name=this->JobCModule::GetName();
00131 name+=".config.default";
00132 r.SetName(name.c_str());
00133 r.UnLockValues();
00134
00135
00136
00137
00138 r.LockValues();
00139
00140 return r;
00141 }
00142
00143
00144
00145 void MeuCalModule::Config(const Registry& )
00146 {
00148
00149 MSG("MeuCalModule",Msg::kDebug)<<"MeuCalModule::Config"<<endl;
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 }
00160
00161
00162