Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4AnalysisStepStatus.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "TGo4AnalysisStepStatus.h"
00017 
00018 #include "Riostream.h"
00019 
00020 #include "TROOT.h"
00021 
00022 #include "TGo4Log.h"
00023 
00024 TGo4AnalysisStepStatus::TGo4AnalysisStepStatus() :
00025    TGo4Status(),
00026    fxSourceType(0),
00027    fxStoreType(0),
00028    fxProcessorType(0),
00029    fbSourceEnabled(kFALSE),
00030    fbStoreEnabled(kFALSE),
00031    fbProcessEnabled(kFALSE),
00032    fbErrorStopEnabled(kFALSE),
00033    fbErrorStopped(kFALSE),
00034    fiProcessStatus(0)
00035 {
00036 }
00037 
00038 TGo4AnalysisStepStatus::TGo4AnalysisStepStatus(const char* name) :
00039    TGo4Status(name, "Go4 AnalysisStep Status Object"),
00040    fxSourceType(0),
00041    fxStoreType(0),
00042    fxProcessorType(0),
00043    fbSourceEnabled(kFALSE),
00044    fbStoreEnabled(kFALSE),
00045    fbProcessEnabled(kFALSE),
00046    fbErrorStopEnabled(kFALSE),
00047    fbErrorStopped(kFALSE),
00048    fiProcessStatus(0)
00049 {
00050    TRACE((15,"TGo4AnalysisStepStatus::TGo4AnalysisStepStatus(const char*)",__LINE__, __FILE__));
00051 
00052 }
00053 
00054 TGo4AnalysisStepStatus::~TGo4AnalysisStepStatus()
00055 {
00056    TRACE((15,"TGo4AnalysisStepStatus::~TGo4AnalysisStepStatus()",__LINE__, __FILE__));
00057    delete fxSourceType;
00058    delete fxStoreType;
00059    delete fxProcessorType;
00060 }
00061 
00062 Int_t TGo4AnalysisStepStatus::PrintStatus(Text_t* buffer, Int_t buflen)
00063 {
00064    TRACE((12,"TGo4AnalysisStepStatus::PrintStatus()",__LINE__, __FILE__));
00065    //
00066 
00067    Int_t locallen=64000;
00068    Text_t localbuf[64000];
00069    if(buflen<0 && buffer!=0)
00070       return 0;
00071    Int_t size=0;
00072 
00073    Text_t* current=localbuf;
00074    Int_t restlen=locallen;
00075    current=PrintIndent(current,restlen);
00076    current=PrintBuffer(current,restlen, "++++ Analysis Step %s ++++\t \n",GetName());
00077    TROOT::IncreaseDirLevel();
00078    if(IsProcessEnabled())
00079       {
00080       if(IsSourceEnabled())
00081          {
00082          TGo4EventSourceParameter* spar=GetSourcePar();
00083          if( spar!=0 )
00084             {
00085                Int_t delta=spar->PrintParameter(current,restlen);
00086                restlen-=delta;
00087                current+=delta;
00088             }
00089          else
00090             {
00091                current=PrintIndent(current,restlen);
00092                current=PrintBuffer(current,restlen, "EventSource Type: undefined \n");
00093             } // if( spar!=0 )
00094          }
00095       else
00096          {
00097             current=PrintIndent(current,restlen);
00098             current=PrintBuffer(current,restlen, "EventSource is disabled. \n");
00099          }
00100 
00101       TGo4EventProcessorParameter* ppar=GetProcessorPar();
00102       if(ppar !=0)
00103          {
00104             Int_t delta=ppar->PrintParameter(current,restlen);
00105             restlen-=delta;
00106             current+=delta;
00107          }
00108       else
00109          {
00110             // for the moment, suppress unnecessary confusing output!
00111             //  current=PrintIndent(current,restlen);
00112             //  current=PrintBuffer(current,restlen, "EventProcessor Type: undefined \n");
00113          } // if( ppar!=0 )
00114 
00115 
00116       if(IsStoreEnabled())
00117          {
00118             TGo4EventStoreParameter* tpar=GetStorePar();
00119             if(tpar!=0)
00120                {
00121                   Int_t delta=tpar->PrintParameter(current,restlen);
00122                   restlen-=delta;
00123                   current+=delta;
00124                }
00125             else
00126                {
00127                   current=PrintIndent(current,restlen);
00128                   current=PrintBuffer(current,restlen, "EventStore Type: undefined \n");
00129                } // if( tpar!=0 )
00130          }
00131       else
00132          {
00133             current=PrintIndent(current,restlen);
00134             current=PrintBuffer(current,restlen, "EventStore is disabled.\n");
00135          }
00136      //   current=PrintIndent(current,restlen);
00137      //   current=PrintBuffer(current,restlen, "Error stop enabled: %d\n",IsErrorStopEnabled());
00138      //   current=PrintIndent(current,restlen);
00139      //   current=PrintBuffer(current,restlen, "Error stopped: %d\n",IsErrorStopped());
00140       current=PrintIndent(current,restlen);
00141       current=PrintBuffer(current,restlen, "Process Status: %d\n",GetProcessStatus());
00142       }
00143    else
00144       {
00145          current=PrintIndent(current,restlen);
00146          current=PrintBuffer(current,restlen, "Step is disabled.\n");
00147       }
00148    TROOT::DecreaseDirLevel();
00149    current=PrintIndent(current,restlen);
00150    current=PrintBuffer(current,restlen, "----------------------------------------------  \n");
00151    if(buffer==0)
00152       {
00153           cout << localbuf << endl;
00154       }
00155    else
00156       {
00157          size=locallen-restlen;
00158          if(size>buflen-1)
00159                size=buflen-1;
00160          strncpy(buffer,localbuf,size);
00161       }
00162    return size;
00163 }
00164 
00165 void TGo4AnalysisStepStatus::SetSourcePar(TGo4EventSourceParameter* kind)
00166 {
00167     if(fxSourceType) delete fxSourceType;
00168     if(kind)
00169         fxSourceType=dynamic_cast<TGo4EventSourceParameter*>(kind->Clone());
00170     else
00171         fxSourceType=0;
00172 }
00173 
00174 void TGo4AnalysisStepStatus::SetStorePar(TGo4EventStoreParameter* kind)
00175 {
00176     if(fxStoreType) delete fxStoreType;
00177     if(kind)
00178         fxStoreType=dynamic_cast<TGo4EventStoreParameter*>(kind->Clone());
00179     else
00180         fxStoreType=0;
00181 }
00182 
00183 void TGo4AnalysisStepStatus::SetProcessorPar(TGo4EventProcessorParameter* kind)
00184 {
00185     if(fxProcessorType) delete fxProcessorType;
00186     if(kind)
00187         fxProcessorType=dynamic_cast<TGo4EventProcessorParameter*>(kind->Clone());
00188     else
00189         fxProcessorType=0;
00190 }
00191 
00192 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:28 2008 for Go4-v3.04-1 by  doxygen 1.4.2