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

beamtime/cern-oct12/go4/TCernOct12Analysis.cxx (r4864/r3724)

Go to the documentation of this file.
00001 
00002 
00003 #include "TCernOct12Analysis.h"
00004 
00005 #include <stdlib.h>
00006 
00007 #include "Go4EventServer.h"
00008 #include "TGo4StepFactory.h"
00009 #include "TGo4AnalysisStep.h"
00010 #include "TGo4Log.h"
00011 
00012 //***********************************************************
00013 TCernOct12Analysis::TCernOct12Analysis()
00014 {
00015 }
00016 //***********************************************************
00017 
00018 // this constructor is called by go4analysis executable
00019 TCernOct12Analysis::TCernOct12Analysis(int argc, char** argv) :
00020          TGo4Analysis(argc, argv)
00021 {
00022    if (!TGo4Version::CheckVersion(__GO4BUILDVERSION__)) {
00023       TGo4Log::Error("Go4 version mismatch");
00024       exit(-1);
00025    }
00026 
00027    TGo4Log::Info("TCernOct12Analysis Create instance %s", GetName());
00028 
00029    TGo4StepFactory* factory = new TGo4StepFactory("Factory");
00030    factory->DefEventProcessor("CernOct12UnpackProc","TCernOct12UnpackProc");// object name, class name
00031    factory->DefOutputEvent("CernOct12UnpackEvent","TCernOct12UnpackEvent"); // object name, class name
00032 
00033    Text_t lmdfile[512]; // source file
00034    sprintf(lmdfile,"%s/data/test.lmd",getenv("GO4SYS"));
00035    TGo4EventSourceParameter* sourcepar = new TGo4MbsFileParameter(lmdfile);
00036 
00037    TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter(Form("%sOutput", argv[0]));
00038    storepar->SetOverwriteMode(kTRUE);
00039 
00040    TGo4AnalysisStep* step = new TGo4AnalysisStep("Unpack", factory, sourcepar, storepar);
00041 
00042    step->SetSourceEnabled(kTRUE);
00043    step->SetStoreEnabled(kFALSE);
00044    step->SetProcessEnabled(kTRUE);
00045    step->SetErrorStopEnabled(kTRUE);
00046 
00047    // Now the first analysis step is set up.
00048    // Other steps could be created here
00049    AddAnalysisStep(step);
00050 
00051 
00052    TGo4StepFactory* factory2 = new TGo4StepFactory("Factory2");
00053    factory2->DefEventProcessor("CernOct12DetectorProc","TCernOct12DetectorProc");// object name, class name
00054    factory2->DefInputEvent("CernOct12UnpackEvent","TCernOct12UnpackEvent"); // object name, class name 
00055    factory2->DefOutputEvent("CernOct12DetectorEvent","TCernOct12DetectorEvent"); // object name, class name
00056 
00057 
00058    TGo4AnalysisStep* step2 = new TGo4AnalysisStep("Detector", factory2, 0, 0);
00059 
00060    step2->SetSourceEnabled(kFALSE);
00061    step2->SetStoreEnabled(kFALSE);
00062    step2->SetProcessEnabled(kTRUE);
00063    step2->SetErrorStopEnabled(kTRUE);
00064 
00065    AddAnalysisStep(step2);
00066 
00067    TGo4StepFactory* factory3 = new TGo4StepFactory("Factory3");
00068    factory3->DefEventProcessor("CernOct12FinalProc","TCernOct12FinalProc");// object name, class name
00069    factory3->DefInputEvent("CernOct12DetectorEvent","TCernOct12DetectorEvent"); // object name, class name
00070    factory3->DefOutputEvent("CernOct12FinalEvent","TCernOct12FinalEvent"); // object name, class name
00071 
00072 
00073    TGo4AnalysisStep* step3 = new TGo4AnalysisStep("Final", factory3, 0, 0);
00074 
00075    step3->SetSourceEnabled(kFALSE);
00076    step3->SetStoreEnabled(kFALSE);
00077    step3->SetProcessEnabled(kTRUE);
00078    step3->SetErrorStopEnabled(kTRUE);
00079 
00080    AddAnalysisStep(step3);
00081 
00082    // uncomment following line to define custom passwords for analysis server
00083    // DefineServerPasswords("CernOct12admin", "CernOct12ctrl", "CernOct12view");
00084 
00085 }
00086 
00087 //***********************************************************
00088 TCernOct12Analysis::~TCernOct12Analysis()
00089 {
00090    TGo4Log::Info("TCernOct12Analysis: Delete instance");
00091 }
00092 

Generated on Tue Dec 10 2013 04:52:18 for ROCsoft by  doxygen 1.7.1