Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TMeshParameter.h"
00015
00016 #include "Riostream.h"
00017
00018 #include "TGo4AnalysisStep.h"
00019 #include "TGo4Analysis.h"
00020
00021
00022 TMeshParameter::TMeshParameter() :
00023 TGo4Parameter("MeshParameter"),
00024 fbUnpackOn(kTRUE), fbExec1On(kTRUE), fbExec2On(kTRUE),
00025 fbExec3On(kTRUE),fbExec12On(kTRUE),fbCollectorOn(kTRUE)
00026 {
00027 }
00028
00029 TMeshParameter::TMeshParameter(const char* name) :
00030 TGo4Parameter(name),
00031 fbUnpackOn(kTRUE), fbExec1On(kTRUE), fbExec2On(kTRUE),
00032 fbExec3On(kTRUE),fbExec12On(kTRUE),fbCollectorOn(kTRUE)
00033 {
00034 }
00035
00036 TMeshParameter::~TMeshParameter()
00037 {
00038 }
00039
00040
00041
00042 Int_t TMeshParameter::PrintParameter(Text_t * n, Int_t)
00043 {
00044 std::cout << "Parameter " << GetName()<<":" <<std::endl;
00045 std::cout << " fbUnpackOn="<<fbUnpackOn<<std::endl;
00046 std::cout << " fbExec1On="<<fbExec1On<<std::endl;
00047 std::cout << " fbExec2On="<<fbExec2On<<std::endl;
00048 std::cout << " fbExec3On="<<fbExec3On<<std::endl;
00049 std::cout << " fbExec12On="<<fbExec12On<<std::endl;
00050 std::cout << " fbCollectorOn="<<fbCollectorOn<<std::endl;
00051 return 0;
00052 }
00053
00054 Bool_t TMeshParameter::UpdateFrom(TGo4Parameter *pp)
00055 {
00056 if(pp->InheritsFrom("TMeshParameter"))
00057 {
00058 TMeshParameter* from = (TMeshParameter *) pp;
00059 fbUnpackOn=from->fbUnpackOn;
00060 fbExec1On=from->fbExec1On;
00061 fbExec2On=from->fbExec2On;
00062 fbExec3On=from->fbExec3On;
00063 fbExec12On=from->fbExec12On;
00064 fbCollectorOn=from->fbCollectorOn;
00065 std::cout <<"Updated Parameter "<<GetName() << std::endl;
00066 TGo4Analysis* ana=TGo4Analysis::Instance();
00067 TGo4AnalysisStep* unpack=ana->GetAnalysisStep("Unpack");
00068 if(unpack)
00069 unpack->SetProcessEnabled(fbUnpackOn);
00070
00071 TGo4AnalysisStep* pror1=ana->GetAnalysisStep("Input1Provider");
00072 TGo4AnalysisStep* ex1=ana->GetAnalysisStep("Exec1");
00073 if(pror1 && ex1)
00074 {
00075 pror1->SetProcessEnabled(fbExec1On);
00076 pror1->SetSourceEnabled(!fbUnpackOn);
00077 ex1->SetProcessEnabled(fbExec1On);
00078 }
00079 TGo4AnalysisStep* pror2=ana->GetAnalysisStep("Input2Provider");
00080 TGo4AnalysisStep* ex2=ana->GetAnalysisStep("Exec2");
00081 if(pror2 && ex2)
00082 {
00083 pror2->SetProcessEnabled(fbExec2On);
00084 pror2->SetSourceEnabled(!fbUnpackOn);
00085 ex2->SetProcessEnabled(fbExec2On);
00086 }
00087 TGo4AnalysisStep* pror3=ana->GetAnalysisStep("Input3Provider");
00088 TGo4AnalysisStep* ex3=ana->GetAnalysisStep("Exec3");
00089 if(pror3 && ex3)
00090 {
00091 pror3->SetProcessEnabled(fbExec3On);
00092 pror3->SetSourceEnabled(!fbUnpackOn);
00093 ex3->SetProcessEnabled(fbExec3On);
00094 }
00095
00096 TGo4AnalysisStep* pro1=ana->GetAnalysisStep("Output1Provider");
00097 TGo4AnalysisStep* pro2=ana->GetAnalysisStep("Output2Provider");
00098 TGo4AnalysisStep* pro3=ana->GetAnalysisStep("Output3Provider");
00099 TGo4AnalysisStep* ex12=ana->GetAnalysisStep("Exec12");
00100 if(pro1 && pro2 && pro3 && ex12)
00101 {
00102 pro1->SetProcessEnabled(fbExec12On | fbCollectorOn);
00103 pro1->SetSourceEnabled(!fbExec1On);
00104 pro2->SetProcessEnabled(fbExec12On | fbCollectorOn);
00105 pro2->SetSourceEnabled(!fbExec2On);
00106 pro3->SetProcessEnabled(fbCollectorOn);
00107 pro3->SetSourceEnabled(!fbExec3On);
00108 ex12->SetProcessEnabled(fbExec12On);
00109 }
00110 TGo4AnalysisStep* pro12=ana->GetAnalysisStep("Output12Provider");
00111 TGo4AnalysisStep* fin=ana->GetAnalysisStep("Final");
00112 if(pro12 && fin)
00113 {
00114 pro12->SetProcessEnabled(fbCollectorOn);
00115 pro12->SetSourceEnabled(!fbExec12On);
00116 fin->SetProcessEnabled(fbCollectorOn);
00117
00118 }
00119 std::cout <<"Parameter "<<GetName()<<" changed steps setup" << std::endl;
00120
00121
00122 }
00123 else
00124 std::cout << "Wrong parameter object: " << pp->ClassName() << std::endl;
00125 return kTRUE;
00126 }