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

beamtime/gsi-aug12/prod/go4/TGsiAug12Analysis.cxx (r4864/r3385)

Go to the documentation of this file.
00001 
00002 
00003 #include "TGsiAug12Analysis.h"
00004 
00005 #include <stdlib.h>
00006 #include "TGo4Version.h"
00007 #if __GO4BUILDVERSION__ > 40502
00008    #include "go4iostream.h"
00009 #else
00010    #include "Riostream.h"
00011 #endif
00012 
00013 #include "Go4EventServer.h"
00014 #include "TGo4StepFactory.h"
00015 #include "TGo4AnalysisStep.h"
00016 #include "TGo4Version.h"
00017 
00018 //***********************************************************
00019 TGsiAug12Analysis::TGsiAug12Analysis()
00020 {
00021 }
00022 //***********************************************************
00023 
00024 // this constructor is called by go4analysis executable
00025 TGsiAug12Analysis::TGsiAug12Analysis(int argc, char** argv) :
00026    TGo4Analysis(argc, argv)
00027 {
00028    cout << "**** Create TGsiAug12Analysis name: " << argv[0] << endl;
00029 
00030    if (!TGo4Version::CheckVersion(__GO4BUILDVERSION__)) {
00031       cout << "****  Go4 version mismatch" << endl;
00032       exit(-1);
00033    }
00034 
00035    TGo4StepFactory* factory = new TGo4StepFactory("Factory");
00036    factory->DefEventProcessor("GsiAug12UnpackProc","TGsiAug12UnpackProc");// object name, class name
00037    factory->DefOutputEvent("GsiAug12UnpackEvent","TGsiAug12UnpackEvent"); // object name, class name
00038 
00039    Text_t lmdfile[512]; // source file
00040    sprintf(lmdfile,"%s/data/test.lmd",getenv("GO4SYS"));
00041    TGo4EventSourceParameter* sourcepar = new TGo4MbsFileParameter(lmdfile);
00042 
00043    TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter(Form("%sOutput", argv[0]));
00044    storepar->SetOverwriteMode(kTRUE);
00045 
00046    TGo4AnalysisStep* step = new TGo4AnalysisStep("Unpack", factory, sourcepar, storepar);
00047 
00048    step->SetSourceEnabled(kTRUE);
00049    step->SetStoreEnabled(kFALSE);
00050    step->SetProcessEnabled(kTRUE);
00051    step->SetErrorStopEnabled(kTRUE);
00052 
00053    // Now the first analysis step is set up.
00054    // Other steps could be created here
00055    AddAnalysisStep(step);
00056 
00057 
00058    TGo4StepFactory* factory2 = new TGo4StepFactory("Factory2");
00059    factory2->DefEventProcessor("GsiAug12CalibrationProc","TGsiAug12CalibrationProc");// object name, class name
00060    factory2->DefInputEvent("GsiAug12UnpackEvent","TGsiAug12UnpackEvent"); // object name, class name 
00061    factory2->DefOutputEvent("GsiAug12CalibrationEvent","TGsiAug12CalibrationEvent"); // object name, class name
00062 
00063 
00064    TGo4AnalysisStep* step2 = new TGo4AnalysisStep("Calibration", factory2, 0, 0);
00065 
00066    step2->SetSourceEnabled(kFALSE);
00067    step2->SetStoreEnabled(kFALSE);
00068    step2->SetProcessEnabled(kTRUE);
00069    step2->SetErrorStopEnabled(kTRUE);
00070 
00071    AddAnalysisStep(step2);
00072 
00073 
00074    TGo4StepFactory* factory3 = new TGo4StepFactory("Factory3");
00075    factory3->DefEventProcessor("GsiAug12DetectorProc","TGsiAug12DetectorProc");// object name, class name
00076    factory3->DefInputEvent("GsiAug12CalibrationEvent","TGsiAug12CalibrationEvent"); // object name, class name
00077    factory3->DefOutputEvent("GsiAug12DetectorEvent","TGsiAug12DetectorEvent"); // object name, class name
00078 
00079 
00080    TGo4AnalysisStep* step3 = new TGo4AnalysisStep("Detector", factory3, 0, 0);
00081 
00082    step3->SetSourceEnabled(kFALSE);
00083    step3->SetStoreEnabled(kFALSE);
00084    step3->SetProcessEnabled(kTRUE);
00085    step3->SetErrorStopEnabled(kTRUE);
00086 
00087    AddAnalysisStep(step3);
00088 
00089 
00090    TGo4StepFactory* factory4 = new TGo4StepFactory("Factory4");
00091    factory4->DefEventProcessor("GsiAug12TrackingProc","TGsiAug12TrackingProc");// object name, class name
00092    factory4->DefInputEvent("GsiAug12DetectorEvent","TGsiAug12DetectorEvent"); // object name, class name
00093    factory4->DefOutputEvent("GsiAug12TrackingEvent","TGsiAug12TrackingEvent"); // object name, class name
00094 
00095 
00096    TGo4AnalysisStep* step4 = new TGo4AnalysisStep("Tracking", factory4, 0, 0);
00097 
00098    step4->SetSourceEnabled(kFALSE);
00099    step4->SetStoreEnabled(kFALSE);
00100    step4->SetProcessEnabled(kTRUE);
00101    step4->SetErrorStopEnabled(kTRUE);
00102 
00103    AddAnalysisStep(step4);
00104 
00105 
00106    // Attempt to have a Ouput Tree Formatting step
00107    TGo4StepFactory* factory5 = new TGo4StepFactory("Factory5");
00108    factory5->DefEventProcessor("GsiAug12OutputProc","TGsiAug12OutputProc");// object name, class name
00109    factory5->DefInputEvent("GsiAug12TrackingEvent","TGsiAug12TrackingEvent"); // object name, class name
00110    factory5->DefOutputEvent("GsiAug12OutputEvent","TGsiAug12OutputEvent"); // object name, class name
00111 
00112 
00113    TGo4AnalysisStep* step5 = new TGo4AnalysisStep("Output", factory5, 0, 0);
00114 
00115    step5->SetSourceEnabled(kFALSE);
00116    step5->SetStoreEnabled(kFALSE);
00117    step5->SetProcessEnabled(kTRUE);
00118    step5->SetErrorStopEnabled(kTRUE);
00119 
00120    AddAnalysisStep(step5);
00121 
00122    // uncomment following line to define custom passwords for analysis server
00123    // DefineServerPasswords("GsiAug12admin", "GsiAug12ctrl", "GsiAug12view");
00124 
00125 }
00126 
00127 //***********************************************************
00128 TGsiAug12Analysis::~TGsiAug12Analysis()
00129 {
00130    cout << "**** TGsiAug12Analysis: Delete instance" << endl;
00131 }
00132 

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