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