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

beamtime/tof-tdctest/go4/TGsiAug12Analysis.cxx (r4864/r4277)

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 #include "TGsiAug12Param.h"
00019 
00020 //***********************************************************
00021 TGsiAug12Analysis::TGsiAug12Analysis()
00022 {
00023 }
00024 //***********************************************************
00025 
00026 // this constructor is called by go4analysis executable
00027 TGsiAug12Analysis::TGsiAug12Analysis(int argc, char** argv) :
00028    TGo4Analysis(argc, argv)
00029 {
00030    cout << "**** Create TGsiAug12Analysis name: " << argv[0] << endl;
00031 
00032    if (!TGo4Version::CheckVersion(__GO4BUILDVERSION__)) {
00033       cout << "****  Go4 version mismatch" << endl;
00034       exit(-1);
00035    }
00036 
00037    TGo4StepFactory* factory = new TGo4StepFactory("Factory");
00038    factory->DefEventProcessor("GsiAug12UnpackProc","TGsiAug12UnpackProc");// object name, class name
00039    factory->DefOutputEvent("GsiAug12UnpackEvent","TGsiAug12UnpackEvent"); // object name, class name
00040 
00041    Text_t lmdfile[512]; // source file
00042    sprintf(lmdfile,"%s/data/test.lmd",getenv("GO4SYS"));
00043    TGo4EventSourceParameter* sourcepar = new TGo4MbsFileParameter(lmdfile);
00044 
00045    TGo4FileStoreParameter* storepar = new TGo4FileStoreParameter(Form("%sOutput", argv[0]));
00046    storepar->SetOverwriteMode(kTRUE);
00047 
00048    TGsiAug12Param* parAnalysis = (TGsiAug12Param*) MakeParameter("GsiAug12Par", "TGsiAug12Param");
00049    ExecuteScript("set_GsiAug12Par.C");
00050 
00051    TGo4AnalysisStep* step = new TGo4AnalysisStep("Unpack", factory, sourcepar, storepar);
00052 
00053    step->SetSourceEnabled(kTRUE);
00054    step->SetStoreEnabled(kFALSE);
00055    step->SetProcessEnabled(kTRUE);
00056    step->SetErrorStopEnabled(kTRUE);
00057 
00058    AddAnalysisStep(step);
00059 
00060    // Now the first analysis step is set up.
00061    // Other steps could be created here
00062 
00063    if( kTRUE == parAnalysis->bWithVftxCalib )
00064    {
00065       TGo4StepFactory* factory2 = new TGo4StepFactory("Factory2");
00066       factory2->DefEventProcessor("GsiAug12CalibrationProc","TGsiAug12CalibrationProc");// object name, class name
00067       factory2->DefInputEvent("GsiAug12UnpackEvent","TGsiAug12UnpackEvent"); // object name, class name
00068       factory2->DefOutputEvent("GsiAug12CalibrationEvent","TGsiAug12CalibrationEvent"); // object name, class name
00069 
00070       TGo4AnalysisStep* step2 = new TGo4AnalysisStep("Calibration", factory2, 0, 0);
00071 
00072       step2->SetSourceEnabled(kFALSE);
00073       step2->SetStoreEnabled(kFALSE);
00074       step2->SetProcessEnabled(kTRUE);
00075       step2->SetErrorStopEnabled(kTRUE);
00076 
00077       AddAnalysisStep(step2);
00078    } // if( kTRUE == parAnalysis->bWithVftxCalib )
00079 
00080    if( kTRUE == parAnalysis->bWithScalersRate ||
00081        0 < parAnalysis->uNbRpc ||
00082        0 < parAnalysis->uNbPadRpc ||
00083        0 < parAnalysis->uNbPlastics )
00084    {
00085       TGo4StepFactory* factory3 = new TGo4StepFactory("Factory3");
00086       factory3->DefEventProcessor("GsiAug12DetectorProc","TGsiAug12DetectorProc");// object name, class name
00087 
00088       if( kTRUE == parAnalysis->bWithVftxCalib )
00089          factory3->DefInputEvent("GsiAug12CalibrationEvent","TGsiAug12CalibrationEvent"); // object name, class name
00090       else
00091          factory3->DefInputEvent("GsiAug12UnpackEvent","TGsiAug12UnpackEvent"); // object name, class name
00092 
00093       factory3->DefOutputEvent("GsiAug12DetectorEvent","TGsiAug12DetectorEvent"); // object name, class name
00094 
00095       TGo4AnalysisStep* step3 = new TGo4AnalysisStep("Detector", factory3, 0, 0);
00096 
00097       step3->SetSourceEnabled(kFALSE);
00098       step3->SetStoreEnabled(kFALSE);
00099       step3->SetProcessEnabled(kTRUE);
00100       step3->SetErrorStopEnabled(kTRUE);
00101 
00102       AddAnalysisStep(step3);
00103    } // if at least one detector
00104 
00105    if( kTRUE == parAnalysis->bWithMatching )
00106    {
00107       TGo4StepFactory* factory4 = new TGo4StepFactory("Factory4");
00108       factory4->DefEventProcessor("GsiAug12TrackingProc","TGsiAug12TrackingProc");// object name, class name
00109       factory4->DefInputEvent("GsiAug12DetectorEvent","TGsiAug12DetectorEvent"); // object name, class name
00110       factory4->DefOutputEvent("GsiAug12TrackingEvent","TGsiAug12TrackingEvent"); // object name, class name
00111 
00112       TGo4AnalysisStep* step4 = new TGo4AnalysisStep("Tracking", factory4, 0, 0);
00113 
00114       step4->SetSourceEnabled(kFALSE);
00115       step4->SetStoreEnabled(kFALSE);
00116       step4->SetProcessEnabled(kTRUE);
00117       step4->SetErrorStopEnabled(kTRUE);
00118 
00119       AddAnalysisStep(step4);
00120    } // if( kTRUE == parAnalysis->bWithMatching )
00121 
00122    if( kTRUE == parAnalysis->bWithTreeOutput )
00123    {
00124       // Attempt to have a Ouput Tree Formatting step
00125       TGo4StepFactory* factory5 = new TGo4StepFactory("Factory5");
00126       factory5->DefEventProcessor("GsiAug12OutputProc","TGsiAug12OutputProc");// object name, class name
00127 
00128       if( kTRUE == parAnalysis->bWithMatching )
00129          factory5->DefInputEvent("GsiAug12TrackingEvent","TGsiAug12TrackingEvent"); // object name, class name
00130       else if( kTRUE == parAnalysis->bWithScalersRate ||
00131                0 < parAnalysis->uNbRpc ||
00132                0 < parAnalysis->uNbPadRpc ||
00133                0 < parAnalysis->uNbPlastics )
00134          factory5->DefInputEvent("GsiAug12DetectorEvent","TGsiAug12DetectorEvent"); // object name, class name
00135       else if( kTRUE == parAnalysis->bWithVftxCalib )
00136          factory5->DefInputEvent("GsiAug12CalibrationEvent","TGsiAug12CalibrationEvent"); // object name, class name
00137       else factory5->DefInputEvent("GsiAug12UnpackEvent","TGsiAug12UnpackEvent"); // object name, class name
00138 
00139       factory5->DefOutputEvent("GsiAug12OutputEvent","TGsiAug12OutputEvent"); // object name, class name
00140 
00141 
00142       TGo4AnalysisStep* step5 = new TGo4AnalysisStep("Output", factory5, 0, 0);
00143 
00144       step5->SetSourceEnabled(kFALSE);
00145       step5->SetStoreEnabled(kFALSE);
00146       step5->SetProcessEnabled(kTRUE);
00147       step5->SetErrorStopEnabled(kTRUE);
00148 
00149       AddAnalysisStep(step5);
00150    } // if( kTRUE == parAnalysis->bWithTreeOutput )
00151 
00152    // uncomment following line to define custom passwords for analysis server
00153    // DefineServerPasswords("GsiAug12admin", "GsiAug12ctrl", "GsiAug12view");
00154 
00155 }
00156 
00157 //***********************************************************
00158 TGsiAug12Analysis::~TGsiAug12Analysis()
00159 {
00160    cout << "**** TGsiAug12Analysis: Delete instance" << endl;
00161 }
00162 

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