00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4EventProcessor.h"
00015
00016 #include <snprintf.h>
00017 #include <string.h>
00018
00019 #include "TH1.h"
00020 #include "TH2.h"
00021 #include "TCutG.h"
00022 #include "TArrayD.h"
00023 #include "TAxis.h"
00024 #include "TROOT.h"
00025
00026 #include "TGo4Log.h"
00027 #include "TGo4WinCond.h"
00028 #include "TGo4PolyCond.h"
00029 #include "TGo4EventElement.h"
00030 #include "TGo4EventCalibration.h"
00031 #include "TGo4AnalysisImp.h"
00032
00033 TGo4EventProcessor::TGo4EventProcessor(const char* name) :
00034 TGo4EventSource(name),
00035 fxInputEvent(0),
00036 fxCalibration(0),
00037 fbKeepInputEvent(kFALSE),
00038 fbKeepOutputEvent(kFALSE)
00039 {
00040 GO4TRACE((15,"TGo4EventProcessor::TGo4EventProcessor()",__LINE__, __FILE__));
00041 }
00042
00043 TGo4EventProcessor::~TGo4EventProcessor()
00044 {
00045 GO4TRACE((15,"TGo4EventProcessor::~TGo4EventProcessor()",__LINE__, __FILE__));
00046 }
00047
00048 Bool_t TGo4EventProcessor::CheckInputEvent(const char* classname)
00049 {
00050 GO4TRACE((12,"TGo4EventProcessor::CheckInputEvent()",__LINE__, __FILE__));
00051 if(fxInputEvent==0) return kFALSE;
00052
00053 return !strcmp(fxInputEvent->ClassName(),classname);
00054 }
00055
00056 Bool_t TGo4EventProcessor::CheckCalibration(const char* classname)
00057 {
00058 GO4TRACE((12,"TGo4EventProcessor::CheckCalibration()",__LINE__, __FILE__));
00059 if(fxCalibration==0) return kFALSE;
00060
00061 return !strcmp(fxCalibration->ClassName(),classname);
00062 }
00063
00064 Bool_t TGo4EventProcessor::AddObject(TNamed* any, const char* subfolder)
00065 {
00066 return TGo4Analysis::Instance()->AddObject(any,subfolder);
00067 }
00068
00069 Bool_t TGo4EventProcessor::AddHistogram(TH1* his, const char* subfolder, Bool_t replace)
00070 {
00071 return TGo4Analysis::Instance()->AddHistogram(his,subfolder,replace);
00072 }
00073
00074 Bool_t TGo4EventProcessor::AddParameter(TGo4Parameter* par,const char* subfolder)
00075 {
00076 return TGo4Analysis::Instance()->AddParameter(par,subfolder);
00077 }
00078
00079 Bool_t TGo4EventProcessor::AddPicture(TGo4Picture* pic,const char* subfolder)
00080 {
00081 return TGo4Analysis::Instance()->AddPicture(pic,subfolder);
00082 }
00083
00084 Bool_t TGo4EventProcessor::AddCanvas(TCanvas* can, const char* subfolder)
00085 {
00086 return TGo4Analysis::Instance()->AddCanvas(can,subfolder);
00087 }
00088
00089 Bool_t TGo4EventProcessor::AddAnalysisCondition(TGo4Condition* con,const char* subfolder)
00090 {
00091 return TGo4Analysis::Instance()->AddAnalysisCondition(con,subfolder);
00092 }
00093
00094 Bool_t TGo4EventProcessor::RemoveHistogram(const char* name)
00095 {
00096 return TGo4Analysis::Instance()->RemoveHistogram(name);
00097 }
00098
00099 Bool_t TGo4EventProcessor::RemoveParameter(const char* name)
00100 {
00101 return TGo4Analysis::Instance()->RemoveParameter(name);
00102 }
00103
00104 Bool_t TGo4EventProcessor::RemovePicture(const char* name)
00105 {
00106 return TGo4Analysis::Instance()->RemovePicture(name);
00107 }
00108
00109 Bool_t TGo4EventProcessor::RemoveCanvas(const char* name)
00110 {
00111 return TGo4Analysis::Instance()->RemoveCanvas(name);
00112 }
00113
00114 Bool_t TGo4EventProcessor::RemoveAnalysisCondition(const char* name)
00115 {
00116 return TGo4Analysis::Instance()->RemoveAnalysisCondition(name);
00117 }
00118
00119 TNamed* TGo4EventProcessor::GetObject(const char* name, const char* folder)
00120 {
00121 return TGo4Analysis::Instance()->GetObject(name,folder);
00122 }
00123
00124 TH1* TGo4EventProcessor::GetHistogram(const char* name)
00125 {
00126 return TGo4Analysis::Instance()->GetHistogram(name);
00127 }
00128
00129 TGo4Parameter* TGo4EventProcessor::GetParameter(const char* name, const char* par_class)
00130 {
00131 return TGo4Analysis::Instance()->GetParameter(name, par_class);
00132 }
00133
00134 TGo4Picture* TGo4EventProcessor::GetPicture(const char* name)
00135 {
00136 return TGo4Analysis::Instance()->GetPicture(name);
00137 }
00138
00139 TCanvas* TGo4EventProcessor::GetCanvas(const char* name)
00140 {
00141 return TGo4Analysis::Instance()->GetCanvas(name);
00142 }
00143
00144 TGo4Condition* TGo4EventProcessor::GetAnalysisCondition(const char* name, const char* cond_cl)
00145 {
00146 return TGo4Analysis::Instance()->GetAnalysisCondition(name, cond_cl);
00147 }
00148
00149 TGo4EventElement* TGo4EventProcessor::GetInputEvent(const char* stepname)
00150 {
00151 return TGo4Analysis::Instance()->GetInputEvent(stepname);
00152 }
00153
00154 TGo4EventElement* TGo4EventProcessor::GetOutputEvent(const char* stepname)
00155 {
00156 return TGo4Analysis::Instance()->GetOutputEvent(stepname);
00157 }
00158
00159 void TGo4EventProcessor::Message(Int_t prio, const char* text,...)
00160 {
00161 char txtbuf[__MESSAGETEXTLENGTH__];
00162 va_list args;
00163 va_start(args, text);
00164 vsnprintf(txtbuf, __MESSAGETEXTLENGTH__, text, args);
00165 va_end(args);
00166 TGo4Analysis::Instance()->Message(prio,txtbuf);
00167 }
00168
00169 void TGo4EventProcessor::SendObjectToGUI(TNamed* ob)
00170 {
00171 return (TGo4Analysis::Instance()->SendObjectToGUI(ob ) );
00172 }
00173
00174 void TGo4EventProcessor::Clear(Option_t* opt)
00175 {
00176 TGo4Log::Info("Default Clear of event processor %s", GetName());
00177
00178 }
00179
00180 void TGo4EventProcessor::SetMakeWithAutosave(Bool_t on)
00181 {
00182 TGo4Analysis::Instance()->SetMakeWithAutosave(on);
00183 }
00184
00185 Bool_t TGo4EventProcessor::IsObjMade()
00186 {
00187 return TGo4Analysis::Instance()->IsObjMade();
00188 }
00189
00190
00191 TH1* TGo4EventProcessor::MakeTH1(char type, const char* fullname, const char* title,
00192 Int_t nbinsx, Double_t xlow, Double_t xup,
00193 const char* xtitle, const char* ytitle)
00194 {
00195 return TGo4Analysis::Instance()->MakeTH1(type, fullname, title,
00196 nbinsx, xlow, xup,
00197 xtitle, ytitle);
00198 }
00199
00200 TH2* TGo4EventProcessor::MakeTH2(char type, const char* fullname, const char* title,
00201 Int_t nbinsx, Double_t xlow, Double_t xup,
00202 Int_t nbinsy, Double_t ylow, Double_t yup,
00203 const char* xtitle, const char* ytitle, const char* ztitle)
00204 {
00205 return TGo4Analysis::Instance()->MakeTH2(type, fullname, title,
00206 nbinsx, xlow, xup,
00207 nbinsy, ylow, yup,
00208 xtitle, ytitle, ztitle);
00209 }
00210
00211 TGo4WinCond* TGo4EventProcessor::MakeWinCond(const char* fullname,
00212 Double_t xmin, Double_t xmax,
00213 const char* HistoName)
00214 {
00215 return TGo4Analysis::Instance()->MakeWinCond(fullname, xmin, xmax, HistoName);
00216 }
00217
00218 TGo4WinCond* TGo4EventProcessor::MakeWinCond(const char* fullname,
00219 Double_t xmin, Double_t xmax,
00220 Double_t ymin, Double_t ymax,
00221 const char* HistoName)
00222 {
00223 return TGo4Analysis::Instance()->MakeWinCond(fullname,
00224 xmin, xmax,
00225 ymin, ymax,
00226 HistoName);
00227 }
00228
00229 TGo4PolyCond* TGo4EventProcessor::MakePolyCond(const char* fullname,
00230 Int_t npoints,
00231 Double_t (*points) [2],
00232 const char* HistoName)
00233 {
00234 return TGo4Analysis::Instance()->MakePolyCond(fullname, npoints, points, HistoName);
00235 }
00236
00237 TGo4Parameter* TGo4EventProcessor::MakeParameter(const char* fullname,
00238 const char* classname,
00239 const char* newcmd)
00240 {
00241 return TGo4Analysis::Instance()->MakeParameter(fullname, classname, newcmd);
00242 }
00243
00244 Long_t TGo4EventProcessor::ExecuteScript(const char* macro_name)
00245 {
00246 return TGo4Analysis::Instance()->ExecuteScript(macro_name);
00247 }