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

/Go4Event/TGo4EventElement.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 "TGo4EventElement.h"
00017 
00018 #include "TTree.h"
00019 
00020 #include "TGo4EventSource.h"
00021 
00022 TGo4EventElement::TGo4EventElement()
00023 : TNamed("Go4Element","This is a Go4 EventElement"),
00024    fbIsValid(kTRUE), fxParent(0), fxEventSource(0)
00025 {
00026 
00027 TRACE((15,"TGo4EventElement::TGo4EventElement()",__LINE__, __FILE__));
00028  fIdentifier=-1;
00029  isComposite=kFALSE;
00030  isActivated=kFALSE;
00031  fDebug=kFALSE;
00032 
00033 }
00034 
00035 TGo4EventElement::TGo4EventElement(const char* name)
00036 : TNamed(name,"This is a Go4 EventElement"),
00037    fbIsValid(kTRUE), fxParent(0), fxEventSource(0)
00038 {
00039 TRACE((15,"TGo4EventElement::TGo4EventElement(const char*)",__LINE__, __FILE__));
00040  fIdentifier=-1;
00041  isComposite=kFALSE;
00042  isActivated=kFALSE;
00043  fDebug=kFALSE;
00044 }
00045 
00046 TGo4EventElement::TGo4EventElement(const char* aName,
00047                                    const char* aTitle,
00048                                    Short_t aBaseCat)
00049 {
00050 
00051 //Allocates a new event Element with name aName and title aTitle
00052 // aBaseCat could be the identifier of the Element for fast
00053 // retrieval of objects in the composite structure
00054   SetName(aName);
00055   SetTitle(aTitle);
00056   fIdentifier=aBaseCat;
00057   isComposite=kFALSE;
00058   isActivated=kFALSE;
00059   fDebug=kFALSE;
00060 
00061 }
00062 
00063 TGo4EventElement::~TGo4EventElement()
00064 {
00065 
00066 TRACE((15,"TGo4EventElement::~TGo4EventElement()",__LINE__, __FILE__));
00067 }
00068 
00069 Bool_t TGo4EventElement::CheckEventSource(const char* classname)
00070 {
00071    TRACE((12,"TGo4EventElement::CheckEventSource(Text_t*)",__LINE__, __FILE__));
00072    if(fxEventSource==0)
00073       {
00074          return kFALSE;
00075       }
00076    else
00077       {
00078         return ( fxEventSource->InheritsFrom(classname) );
00079       }
00080 }
00081 
00082 Char_t TGo4EventElement::GetDataChar(TGo4EventDataIndex * index)
00083 {
00084    TRACE((12,"TGo4EventElement::GetDataChar()",__LINE__, __FILE__));
00085 
00086    TGo4Log::Debug(" !!! EventElement BaseClass --  default GetDataChar without implementation!!! ");
00087    return 0;
00088 }
00089 
00090 Short_t TGo4EventElement::GetDataShort(TGo4EventDataIndex * index)
00091    {
00092    TRACE((12,"TGo4EventElement::GetDataShort()",__LINE__, __FILE__));
00093 
00094    TGo4Log::Debug(" !!! EventElement BaseClass --  default GetDataShort without implementation!!! ");
00095    return 0;
00096 
00097    }
00098 
00099 Int_t TGo4EventElement::GetDataInt(TGo4EventDataIndex* index)
00100    {
00101    TRACE((12,"TGo4EventElement::GetDataInt()",__LINE__, __FILE__));
00102 
00103    TGo4Log::Debug(" !!! EventElement BaseClass --  default GetDataInt without implementation!!! ");
00104    return 0;
00105 
00106    }
00107 
00108 Long_t TGo4EventElement::GetDataLong(TGo4EventDataIndex * index)
00109    {
00110    TRACE((12,"TGo4EventElement::GetDataLong()",__LINE__, __FILE__));
00111 
00112    TGo4Log::Debug(" !!! EventElement BaseClass --  default GetDataLong without implementation!!! ");
00113    return 0;
00114    }
00115 
00116 Float_t TGo4EventElement::GetDataFloat(TGo4EventDataIndex * index)
00117    {
00118    TRACE((12,"TGo4EventElement::GetDataFloat()",__LINE__, __FILE__));
00119 
00120    TGo4Log::Debug(" !!! EventElement BaseClass --  default GetDataFloat without implementation!!! ");
00121    return 0;
00122 
00123    }
00124 
00125 Double_t TGo4EventElement::GetDataDouble(TGo4EventDataIndex * index)
00126    {
00127    TRACE((12,"TGo4EventElement::GetDataDouble()",__LINE__, __FILE__));
00128 
00129    TGo4Log::Debug(" !!! EventElement BaseClass --  default GetDataDouble without implementation!!! ");
00130    return 0;
00131    }
00132 void TGo4EventElement::PrintEvent()
00133 {
00134    TRACE((12,"TGo4EventElement::PrintEvent()",__LINE__, __FILE__));
00135 
00136    TGo4Log::Debug( " EventElement printout: ");
00137    TGo4Log::Debug( "\tIsValid=%d ",fbIsValid);
00138    if(fxEventSource)
00139       {
00140          TGo4Log::Debug( "\tEventSource: %s of class %s",
00141                         fxEventSource->GetName(),
00142                         fxEventSource->ClassName() );
00143       }
00144    else
00145       {
00146          TGo4Log::Debug( "\tNO EventSource");
00147       }
00148 
00149 
00150 
00151 
00152 }
00153 
00154 void TGo4EventElement::makeBranch(TBranch *parent){
00155   // method for recursive branching algorithm
00156 
00157 }
00158 
00159 Int_t  TGo4EventElement::activateBranch(TBranch *branch,Int_t splitLevel,Int_t init){
00160 
00161   TString cad=branch->GetName();
00162   if(!isActivated){
00163       TTree* tree = branch->GetTree();
00164       TGo4EventElement *dump = this;
00165       tree->SetBranchAddress(cad.Data(), &dump );
00166 
00167       tree->SetBranchStatus(cad.Data(), 1);
00168       cad+="*";
00169       tree->SetBranchStatus(cad.Data(), 1);
00170       isActivated=kTRUE;
00171   }
00172 
00173   branch->GetEntry(0);
00174   return 0;
00175 }
00176 
00177 void TGo4EventElement::deactivate(){
00178 
00179 TString name=GetName();
00180   name+=".";
00181   gTree->SetBranchStatus(name.Data(), 0);
00182   name+="*";
00183   gTree->SetBranchStatus(name.Data(), 0);
00184   printf("-I- Deactivating elements at location :%s \n",name.Data());
00185 }
00186 
00187 void TGo4EventElement::activate(){
00188 
00189 TString name=GetName();
00190   name+=".";
00191   gTree->SetBranchStatus(name.Data(), 1);
00192   name+="*";
00193   gTree->SetBranchStatus(name.Data(), 1);
00194   printf("-I- Activating elements at location :%s \n",name.Data());
00195 }
00196 
00197 
00198 
00199 
00200 void TGo4EventElement::Clear(Option_t *) {
00201 }
00202 
00203 
00204 //void TGo4EventElement::Streamer(TBuffer &R__b)
00205 //{
00206 //  //FIXME! to be done for split level 0
00207 //  if (R__b.IsReading()) {
00208 //    printf("TGo4EventElement::Streamer reading \n");
00209 //    Version_t R__v = R__b.ReadVersion(); if (R__v) { }
00210 //    TNamed::Streamer(R__b);
00211 //    R__b >> fbIsValid;
00212 //    R__b >> isComposite;
00213 //
00214 //  } else {
00215 //    printf("TGo4EventElement::Streamer writing \n");
00216 //   TNamed::Streamer(R__b);
00217 //    R__b << fbIsValid;
00218 //    R__b << isComposite;
00219 //  }
00220 //}
00221 
00222 
00223 
00224 
00225 ClassImp(TGo4EventElement)
00226 
00227 
00228 
00229 
00230 //----------------------------END OF GO4 SOURCE FILE ---------------------

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