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

/Go4DynamicList/TGo4HistogramEntryStatus.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 "TGo4HistogramEntryStatus.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TH1.h"
00021 
00022 #include "Go4Log/TGo4Log.h"
00023 
00024 TGo4HistogramEntryStatus::TGo4HistogramEntryStatus(const Text_t* name)
00025 : TGo4DynamicEntryStatus(name)
00026 {
00027 TRACE((15,"TGo4HistogramEntryStatus::TGo4HistogramEntryStatus(Text_t*)",__LINE__, __FILE__));
00028    ResetNames();
00029 }
00030 
00031 TGo4HistogramEntryStatus::TGo4HistogramEntryStatus()
00032 {
00033 TRACE((15,"TGo4HistogramEntryStatus::TGo4HistogramEntryStatus()",__LINE__, __FILE__));
00034    //ResetNames(); // do not reset names when streaming status from file!
00035 }
00036 
00037 TGo4HistogramEntryStatus::~TGo4HistogramEntryStatus()
00038 {
00039 TRACE((15,"TGo4HistogramEntryStatus::~TGo4HistogramEntryStatus()",__LINE__, __FILE__));
00040 
00041 }
00042 
00043 void TGo4HistogramEntryStatus::SetHisEventNames(TString * names)
00044 {
00045 TRACE((11,"TGo4HistogramEntryStatus::SetHisEventNames(TString* )",__LINE__, __FILE__));
00046 for(UInt_t ix=0; ix<TGo4HistogramEntry::fguMAXHISDIMENSION; ++ix)
00047    {
00048       fxHisEventName[ix]=names[ix];
00049    }
00050 }
00051 
00052 void TGo4HistogramEntryStatus::SetHisVarNames(TString * names)
00053 {
00054 TRACE((11,"TGo4HistogramEntryStatus::SetHisVarNames(TString* )",__LINE__, __FILE__));
00055 for(UInt_t ix=0; ix<TGo4HistogramEntry::fguMAXHISDIMENSION; ++ix)
00056    {
00057       fxHisVarName[ix]=names[ix];
00058    }
00059 
00060 }
00061 
00062 const Text_t * TGo4HistogramEntryStatus::GetHistogramName()
00063 {
00064  return fxHistogramName.Data();
00065 }
00066 
00067 const Text_t * TGo4HistogramEntryStatus::GetHistogramClass()
00068 {
00069  return fxHistogramClass.Data();
00070 }
00071 
00072 const Text_t * TGo4HistogramEntryStatus::GetHisVarName(UInt_t ix)
00073 {
00074 TRACE((11,"TGo4DynamicEntryStatus::GetHisVarName(UInt_t)",__LINE__, __FILE__));
00075    if(ix>=TGo4HistogramEntry::fguMAXHISDIMENSION) return 0;
00076    return (fxHisVarName[ix].Data());
00077 }
00078 
00079 const Text_t * TGo4HistogramEntryStatus::GetHisEventName(UInt_t ix)
00080 {
00081 TRACE((11,"TGo4DynamicEntryStatus::GetHisEventName(UInt_t)",__LINE__, __FILE__));
00082    if(ix>=TGo4HistogramEntry::fguMAXHISDIMENSION) return 0;
00083    return (fxHisEventName[ix].Data());
00084 }
00085 
00086 void TGo4HistogramEntryStatus::SetHisVarName(UInt_t ix, const Text_t* txt)
00087 {
00088   if(ix>=TGo4HistogramEntry::fguMAXHISDIMENSION) return;
00089   fxHisVarName[ix]=txt;
00090 }
00091 
00092 void TGo4HistogramEntryStatus::SetHisEventName(UInt_t ix, const Text_t* txt)
00093 {
00094    if(ix>=TGo4HistogramEntry::fguMAXHISDIMENSION) return;
00095    fxHisEventName[ix]=txt;
00096 }
00097 
00098 
00099 void TGo4HistogramEntryStatus::SetHistogram(TH1 * his)
00100 {
00101 TRACE((11,"TGo4HistogramEntryStatus::SetHistogram(TH1* )",__LINE__, __FILE__));
00102    if(his)
00103       {
00104           fxHistogramName=his->GetName();
00105           fxHistogramClass=his->ClassName();
00106       }
00107 }
00108 
00109 void TGo4HistogramEntryStatus::SetHistogramName(const Text_t * name)
00110 {
00111    fxHistogramName=name;
00112 }
00113 
00114 void TGo4HistogramEntryStatus::ResetNames()
00115 {
00116 TRACE((11,"TGo4HistogramEntryStatus::ResetNames()",__LINE__, __FILE__));
00117    TGo4DynamicEntryStatus::ResetNames();
00118    SetHistogramName(TGo4DynamicEntry::fgcNOCONDITION);
00119    for (UInt_t t=0; t<TGo4HistogramEntry::fguMAXHISDIMENSION;++t)
00120       {
00121           // set names to defaults.
00122           fxHisEventName[t]=TGo4DynamicEntry::fgcNOEVENT;
00123           fxHisVarName[t]=TGo4DynamicEntry::fgcNODATA;
00124       }
00125 }
00126 
00127 TGo4DynamicEntry* TGo4HistogramEntryStatus::CreateDynamicEntry()
00128 {
00129    TGo4HistogramEntry* entry = new TGo4HistogramEntry(GetName());
00130    entry->SetStatus(this);
00131    return entry;
00132 }
00133 
00134 void TGo4HistogramEntryStatus::Print(Option_t* dummy) const
00135 {
00136    // this trick is needed since root defines Print as const function...
00137    TGo4HistogramEntryStatus* const localthis= const_cast<TGo4HistogramEntryStatus* const>(this);
00138    TROOT::IndentLevel();
00139    cout <<"-Dynamic Histogram Entry " <<localthis->GetName()<<" :"<<endl;
00140    TROOT::IncreaseDirLevel();
00141    if(localthis->AutoProcessIsEnabled())
00142       {
00143          TROOT::IndentLevel();
00144          cout <<"\t-- Enabled --" << endl;
00145       }
00146    else
00147       {
00148          TROOT::IndentLevel();
00149          cout <<"\t-- Disabled --" << endl;
00150       }
00151    TROOT::IndentLevel();
00152    cout <<"\tCondition: "<< localthis->GetConditionName();
00153    cout <<" ("<<localthis->GetConditionClass()<<")"<< endl;
00154    for(Int_t i=0;i<__MAXCONDIM__; ++i)
00155    {
00156       TROOT::IndentLevel();
00157       cout <<"\tConEvent("<<i<<"): "<< localthis->GetConEventName(i);
00158       cout <<"\t\tConVar("<<i<<"): "<< localthis->GetConVarName(i);
00159       cout << endl;
00160    }
00161    TROOT::IndentLevel();
00162    cout <<"\tHistogram: "<< localthis->GetHistogramName()<<endl;
00163    for(Int_t i=0;i<__MAXHISDIM__; ++i)
00164    {
00165       TROOT::IndentLevel();
00166       cout <<"\t HisEvent("<<i<<"): "<< localthis->GetHisEventName(i);
00167       cout <<"\t\t HisVar("<<i<<"): "<< localthis->GetHisVarName(i);
00168       cout << endl;
00169    }
00170    TROOT::DecreaseDirLevel();
00171    TROOT::IndentLevel();
00172    cout <<"-End "<<localthis->GetName()<<"-----------" << endl;
00173 }
00174 
00175 
00176 
00177 
00178 ClassImp(TGo4HistogramEntryStatus)
00179 
00180 
00181 
00182 
00183 //----------------------------END OF GO4 SOURCE FILE ---------------------

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