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

/Go4CommandsAnalysis/TGo4ComAddTreeHistogram.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 "TGo4ComAddTreeHistogram.h"
00017 
00018 #include "TCut.h"
00019 
00020 #include "Go4Log/TGo4Log.h"
00021 #include "Go4AnalysisClient/TGo4AnalysisClientImp.h"
00022 #include "Go4Analysis/TGo4AnalysisImp.h"
00023 
00024 TGo4ComAddTreeHistogram::TGo4ComAddTreeHistogram()
00025 :TGo4AnalysisCommand("ANAddTreeHis","Add a tree histogram to dynamic list")
00026 {
00027    TRACE((12,"TGo4ComAddTreeHistogram::TGo4ComAddTreeHistogram() ctor",__LINE__, __FILE__));
00028    SetProtection(kGo4ComModeController);
00029 }
00030 
00031 TGo4ComAddTreeHistogram::TGo4ComAddTreeHistogram(const char* histogramname, const char* treename,const char* varexp, const char* cut)
00032 :TGo4AnalysisCommand("ANAddTreeHis","Add a tree histogram to dynamic list")
00033 {
00034    TRACE((12,"TGo4ComAddTreeHistogram::TGo4ComAddTreeHistogram() ctor",__LINE__, __FILE__));
00035    SetReceiverName("AnalysisClient");  // this command needs client as receiver
00036                                                  // to send back status message
00037    SetProtection(kGo4ComModeController);
00038    SetHistogramName(histogramname);
00039    SetTreeName(treename);
00040    SetVarexp(varexp);
00041    SetCut(cut);
00042 
00043 }
00044 
00045 TGo4ComAddTreeHistogram::~TGo4ComAddTreeHistogram()
00046 {
00047    TRACE((12,"TGo4ComAddTreeHistogram::~TGo4ComAddTreeHistogram() dtor",__LINE__, __FILE__));
00048 }
00049 Int_t TGo4ComAddTreeHistogram::ExeCom()
00050 {
00051    TRACE((12,"TGo4ComAddTreeHistogram::ExeCom()",__LINE__, __FILE__));
00052 
00053    TGo4AnalysisClient* cli = dynamic_cast<TGo4AnalysisClient*> (fxReceiverBase);
00054    if(cli)
00055       {
00056         TGo4Analysis* ana = TGo4Analysis::Instance();
00057 //         TGo4Log::Debug(" !!! %s executing: adding tree histogram entry %s ",
00058 //            GetName(),fxHistoName.GetName());
00059          if(ana)
00060             {
00061                TCut cutexpr = fxCut.Data(); 
00062                TString histo = fxHistoName;
00063                if (histo.Length()==0) histo = "hTreeDraw";
00064                Bool_t result= ana->AddTreeHistogram(histo.Data(),
00065                                  fxTreeName.Data(),
00066                                  fxVarexp.Data(),
00067                                  cutexpr);
00068                if(result)
00069                   {
00070                      cli->SendStatusMessage(1,kTRUE,"Added Dynamic histogram %s for tree %s.",
00071                                                 fxHistoName.Data(),
00072                                                 fxTreeName.Data());
00073                   }
00074                else
00075                   {
00076                       cli->SendStatusMessage(2,kTRUE,"Could not add Dynamic histogram %s for tree %s !!!",
00077                                                       fxHistoName.Data(),
00078                                                       fxTreeName.Data());
00079                   }
00080             }// if ana
00081          else
00082             {
00083                  cli->SendStatusMessage(3, kTRUE," %s ERROR no analysis ",
00084                                                  GetName());
00085 
00086             }
00087       } // if cli
00088    else
00089       {
00090       TRACE((11,"TGo4ComAddTreeHistogram::ExeCom() - no receiver specified ERROR!",__LINE__, __FILE__));
00091          TGo4Log::Debug(" !!! ComAddTreeHistogram ''%s'': NO RECEIVER ERROR!!!",GetName());
00092 
00093          return 1;
00094       }
00095 
00096    return -1;
00097 }
00098 
00099 //----------------------------END OF GO4 SOURCE FILE ---------------------

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