00001 // $Id: TGo4FitNamed.cxx 933 2013-01-29 15:27:58Z 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 00016 #include "Riostream.h" 00017 00018 TGo4FitNamed::TGo4FitNamed() : TNamed(), fxOwner(0), fxFullName() { 00019 } 00020 00021 TGo4FitNamed::TGo4FitNamed(const char* Name, const char* Title, TNamed* Owner) : 00022 TNamed(Name, Title), fxOwner(Owner), fxFullName() { 00023 } 00024 00025 TGo4FitNamed::~TGo4FitNamed() { 00026 } 00027 00028 const char* TGo4FitNamed::GetOwnerFullName() { 00029 TGo4FitNamed* full = dynamic_cast<TGo4FitNamed*> (GetOwner()); 00030 if(full) return full->GetFullName(); 00031 if (GetOwner()) return GetOwner()->GetName(); 00032 else return 0; 00033 00034 } 00035 00036 const char* TGo4FitNamed::GetFullName() { 00037 00038 const char* ownname = GetOwnerFullName(); 00039 00040 if ((ownname!=0) && (strlen(ownname)>0)) { 00041 fxFullName = ownname; 00042 fxFullName += "."; 00043 fxFullName += GetName(); 00044 } else fxFullName = GetName(); 00045 return fxFullName.Data(); 00046 } 00047 00048 void TGo4FitNamed::Print(Option_t* option) const { 00049 TNamed::Print(option); 00050 const char* ownname = ((TGo4FitNamed*) this)->GetOwnerFullName(); 00051 00052 if ((ownname!=0) && (strlen(ownname)>0)) 00053 std::cout << " Full name: " << ((TGo4FitNamed*) this)->GetFullName() << std::endl; 00054 }