• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

newmonitor/go4/TCBMAnalysis.cxx (r3879/r3875)

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 // this constructor is called by go4analysis executable
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    // here should be something with macros
00041 
00042    TGo4StepFactory* factory = new TGo4StepFactory("Step1");
00043    factory->DefEventProcessor("FirstProc","TCBMFirstProc");// object name, class name
00044    factory->DefInputEvent("MBS","TGo4MbsEvent"); // object name, class name
00045    factory->DefOutputEvent("CBM","TCBMEvent"); // object name, class name
00046    // factory->DefUserEventSource("TCBMUserSource"); // object name, class name
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    // Now the first analysis step is set up.
00060    // Other steps could be created here
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");// object name, class name
00069       factory2->DefInputEvent("CBM","TCBMEvent"); // object name, class name
00070       factory2->DefOutputEvent("Second","TCBMEvent"); // object name, class name
00071       // factory->DefUserEventSource("TCBMUserSource"); // object name, class name
00072 
00073 //      TGo4EventSourceParameter* sourcepar = new TGo4MbsFileParameter("file.lmd");
00074 //      TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter("NoOutput");
00075 //      storepar->SetOverwriteMode(kTRUE);
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    // uncomment following line to define custom passwords for analysis server
00088    // DefineServerPasswords("CernOct11admin", "CernOct11ctrl", "CernOct11view");
00089 }
00090 
00091 //***********************************************************
00092 TCBMAnalysis::~TCBMAnalysis()
00093 {
00094    TGo4Log::Info("TCBMAnalysis: Delete instance");
00095 }
00096 

Generated on Thu Dec 13 2012 04:52:22 for ROCsoft by  doxygen 1.7.1