TGo4FitNamed.cxx

Go to the documentation of this file.
00001 // $Id: TGo4FitNamed.cxx 478 2009-10-29 12:26:09Z linev $
00002 //-----------------------------------------------------------------------
00003 //       The GSI Online Offline Object Oriented (Go4) Project
00004 //         Experiment Data Processing at EE department, GSI
00005 //-----------------------------------------------------------------------
00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
00007 //                     Planckstr. 1, 64291 Darmstadt, Germany
00008 // Contact:            http://go4.gsi.de
00009 //-----------------------------------------------------------------------
00010 // This software can be used under the license agreements as stated
00011 // in Go4License.txt file which is part of the distribution.
00012 //-----------------------------------------------------------------------
00013 
00014 #include "TGo4FitNamed.h"
00015 #include "Riostream.h"
00016 
00017 TGo4FitNamed::TGo4FitNamed() : TNamed(), fxOwner(0), fxFullName() {
00018 }
00019 
00020 TGo4FitNamed::TGo4FitNamed(const char* Name, const char* Title, TNamed* Owner) :
00021     TNamed(Name, Title), fxOwner(Owner), fxFullName() {
00022 }
00023 
00024 TGo4FitNamed::~TGo4FitNamed() {
00025 }
00026 
00027 const char* TGo4FitNamed::GetOwnerFullName() {
00028    TGo4FitNamed* full = dynamic_cast<TGo4FitNamed*> (GetOwner());
00029    if(full) return full->GetFullName();
00030    if (GetOwner()) return GetOwner()->GetName();
00031               else return 0;
00032 
00033 }
00034 
00035 const char* TGo4FitNamed::GetFullName() {
00036 
00037   const char* ownname = GetOwnerFullName();
00038 
00039   if ((ownname!=0) && (strlen(ownname)>0)) {
00040     fxFullName = ownname;
00041     fxFullName += ".";
00042     fxFullName += GetName();
00043   } else fxFullName = GetName();
00044   return fxFullName.Data();
00045 }
00046 
00047 void TGo4FitNamed::Print(Option_t* option) const {
00048    TNamed::Print(option);
00049    const char* ownname = ((TGo4FitNamed*) this)->GetOwnerFullName();
00050 
00051    if ((ownname!=0) && (strlen(ownname)>0))
00052      cout << " Full name: " << ((TGo4FitNamed*) this)->GetFullName() << endl;
00053 }

Generated on Thu Oct 28 15:54:12 2010 for Go4-Fitpackagev4.04-2 by  doxygen 1.5.1