00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TXXXControl.h"
00017
00018 #include <stdio.h>
00019 #include "Riostream.h"
00020
00021
00022 TXXXControl::TXXXControl() :
00023 TGo4Parameter("Control"),
00024 fill(kTRUE)
00025 {
00026 }
00027
00028 TXXXControl::TXXXControl(const char* name) :
00029 TGo4Parameter(name),
00030 fill(kTRUE)
00031 {
00032 }
00033
00034 TXXXControl::~TXXXControl() {}
00035
00036
00037
00038 Int_t TXXXControl::PrintParameter(Text_t * n, Int_t){
00039 cout << "**** TXXXControl: ";
00040 cout << "Histogram filling ";
00041 if(fill == kFALSE) cout << "disabled " << endl;
00042 else cout << "enabled " << endl;
00043 return 0;
00044
00045 }
00046
00047 Bool_t TXXXControl::UpdateFrom(TGo4Parameter *pp)
00048 {
00049 cout << "**** TXXXControl " << GetName() << " updated from auto save file" << endl;
00050 if(pp->InheritsFrom(TXXXControl::Class()))
00051 {
00052 TXXXControl * from = (TXXXControl *) pp;
00053 fill=from->fill;
00054 }
00055 else
00056 cout << "Wrong parameter object: " << pp->ClassName() << endl;
00057
00058 SaveMacro();
00059 PrintParameter(0,0);
00060 return kTRUE;
00061 }
00062
00063 void TXXXControl::SaveMacro()
00064 {
00065 FILE *pf;
00066 pf=fopen("histofill.C","w+");
00067 if(pf)
00068 {
00069 fputs("// written by setfill.C macro\n",pf);
00070 fputs("// executed in TXXXProc\n",pf);
00071 fputs("{\n",pf);
00072 fputs("TXXXControl * fCtl;\n",pf);
00073 fputs("fCtl = (TXXXControl *)(TGo4Analysis::Instance()->GetParameter(\"Control\"));\n",pf);
00074 if(fill)fputs("fCtl->fill=kTRUE;\n",pf);
00075 else fputs("fCtl->fill=kFALSE;\n",pf);
00076 fputs("}\n",pf);
00077 fclose(pf);
00078 cout << "**** TXXXControl: new histofill.C written" << endl;
00079 }
00080 else cout << "**** TXXXControl: Error writing histofill.C!" << endl;
00081
00082 PrintParameter(0,0);
00083 }
00084
00085