Go to the documentation of this file.00001 #include "TCBMAnalysis.h"
00002
00003 #include <stdlib.h>
00004
00005 #include "TSystem.h"
00006
00007 #include "Go4EventServer.h"
00008 #include "TGo4StepFactory.h"
00009 #include "TGo4AnalysisStep.h"
00010 #include "TGo4Version.h"
00011 #include "TGo4Log.h"
00012
00013 #include "TCBMFirstProc.h"
00014 #include "TCBMSecondProc.h"
00015
00016
00017
00018
00019 TCBMAnalysis::TCBMAnalysis()
00020 {
00021 }
00022
00023
00024
00025 TCBMAnalysis::TCBMAnalysis(int argc, char** argv) :
00026 TGo4Analysis(argc, argv)
00027 {
00028 if (!TGo4Version::CheckVersion(__GO4BUILDVERSION__)) {
00029 TGo4Log::Error("Go4 version mismatch");
00030 exit(-1);
00031 }
00032
00033 TGo4Log::Info("Create TCBMAnalysis name: %s", argv[0]);
00034 if (argc>1) {
00035 TGo4Log::Info("Use initialization script: %s", argv[1]);
00036 TCBMFirstProc::SetDfltScript(argv[1]);
00037 }
00038
00039
00040
00041
00042 TGo4StepFactory* factory = new TGo4StepFactory("Step1");
00043 factory->DefEventProcessor("FirstProc","TCBMFirstProc");
00044 factory->DefInputEvent("MBS","TGo4MbsEvent");
00045 factory->DefOutputEvent("CBM","TCBMEvent");
00046
00047
00048 TGo4EventSourceParameter* sourcepar = new TGo4MbsFileParameter("file.lmd");
00049 TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter("NoOutput");
00050 storepar->SetOverwriteMode(kTRUE);
00051
00052 TGo4AnalysisStep* step = new TGo4AnalysisStep("First", factory, sourcepar, storepar);
00053
00054 step->SetSourceEnabled(kTRUE);
00055 step->SetStoreEnabled(kFALSE);
00056 step->SetProcessEnabled(kTRUE);
00057 step->SetErrorStopEnabled(kTRUE);
00058
00059
00060
00061 AddAnalysisStep(step);
00062
00063
00064 if (gSystem->AccessPathName(TCBMSecondProc::GetDfltScript())==0) {
00065 TGo4Log::Info("Create second step");
00066
00067 TGo4StepFactory* factory2 = new TGo4StepFactory("Step2");
00068 factory2->DefEventProcessor("SecondProc","TCBMSecondProc");
00069 factory2->DefInputEvent("CBM","TCBMEvent");
00070 factory2->DefOutputEvent("Second","TCBMEvent");
00071
00072
00073
00074
00075
00076
00077 TGo4AnalysisStep* step2 = new TGo4AnalysisStep("Second", factory2, 0, 0);
00078
00079 step2->SetSourceEnabled(kTRUE);
00080 step2->SetStoreEnabled(kFALSE);
00081 step2->SetProcessEnabled(kTRUE);
00082 step2->SetErrorStopEnabled(kTRUE);
00083
00084 AddAnalysisStep(step2);
00085 }
00086
00087
00088
00089 }
00090
00091
00092 TCBMAnalysis::~TCBMAnalysis()
00093 {
00094 TGo4Log::Info("TCBMAnalysis: Delete instance");
00095 }
00096