Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4Example1Step/TXXXControl.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
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 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:54 2005 for Go4-v2.10-5 by doxygen1.2.15