Go to the documentation of this file.00001
00002
00003 #include "TRocAnalysis.h"
00004
00005 #include <cstdlib>
00006 #include <getopt.h>
00007
00008 #include "Go4EventServer.h"
00009 #include "TGo4StepFactory.h"
00010 #include "TGo4AnalysisStep.h"
00011 #include "TGo4Version.h"
00012 #include "TGo4Log.h"
00013
00014
00015
00016
00017 TRocAnalysis::TRocAnalysis()
00018 {
00019 }
00020
00021
00022
00023 TRocAnalysis::TRocAnalysis(int argc, char** argv) :
00024 TGo4Analysis(argc, argv)
00025 {
00026 if (!TGo4Version::CheckVersion(__GO4BUILDVERSION__)) {
00027 TGo4Log::Error("Go4 version mismatch");
00028 exit(-1);
00029 }
00030
00031 TGo4Log::Info("Create TRocAnalysis name: %s", argv[0]);
00032
00033
00034
00035
00036 int c;
00037 while (1)
00038 {
00039 static struct option long_options[] =
00040 {
00041
00042
00043 {"par", required_argument, 0, 'p'},
00044 {"cond", required_argument, 0, 'c'},
00045 {0, 0, 0, 0}
00046 };
00047
00048 int option_index = 0;
00049
00050 c = getopt_long (argc, argv, "c:p:",
00051 long_options, &option_index);
00052
00053
00054 if (c == -1)
00055 break;
00056
00057 switch (c)
00058 {
00059 case 'c':
00060 userConds = optarg;
00061 break;
00062
00063 case 'p':
00064 userPars = optarg;
00065 break;
00066
00067 case '?':
00068
00069 break;
00070
00071 default:
00072 TGo4Log::Error("No option %c. Check your arguments list. Aborting, sorry...", c);
00073 abort();
00074 }
00075 }
00076
00077 TGo4StepFactory* factory = new TGo4StepFactory("Factory");
00078 factory->DefEventProcessor("RocProc","TRocProc");
00079 factory->DefOutputEvent("ROC","TRocEvent");
00080 factory->DefUserEventSource("TRocSource");
00081
00082 TGo4EventSourceParameter* sourcepar = new TGo4MbsFileParameter(Form("%s/data/test.lmd",getenv("GO4SYS")));
00083 TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter(Form("%sOutput", argv[0]));
00084 storepar->SetOverwriteMode(kTRUE);
00085
00086 TGo4AnalysisStep* step = new TGo4AnalysisStep("Roc", factory, sourcepar, storepar);
00087
00088 step->SetSourceEnabled(kTRUE);
00089 step->SetStoreEnabled(kFALSE);
00090 step->SetProcessEnabled(kTRUE);
00091 step->SetErrorStopEnabled(kTRUE);
00092
00093
00094
00095 AddAnalysisStep(step);
00096
00097
00098
00099
00100 }
00101
00102
00103 TRocAnalysis::~TRocAnalysis()
00104 {
00105 TGo4Log::Info("TRocAnalysis: Delete instance");
00106 }
00107