GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitNamed.cxx
Go to the documentation of this file.
1 // $Id: TGo4FitNamed.cxx 933 2013-01-29 15:27:58Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4FitNamed.h"
15 
16 #include "Riostream.h"
17 
18 TGo4FitNamed::TGo4FitNamed() : TNamed(), fxOwner(0), fxFullName() {
19 }
20 
21 TGo4FitNamed::TGo4FitNamed(const char* Name, const char* Title, TNamed* Owner) :
22  TNamed(Name, Title), fxOwner(Owner), fxFullName() {
23 }
24 
26 }
27 
29  TGo4FitNamed* full = dynamic_cast<TGo4FitNamed*> (GetOwner());
30  if(full) return full->GetFullName();
31  if (GetOwner()) return GetOwner()->GetName();
32  else return 0;
33 
34 }
35 
37 
38  const char* ownname = GetOwnerFullName();
39 
40  if ((ownname!=0) && (strlen(ownname)>0)) {
41  fxFullName = ownname;
42  fxFullName += ".";
43  fxFullName += GetName();
44  } else fxFullName = GetName();
45  return fxFullName.Data();
46 }
47 
48 void TGo4FitNamed::Print(Option_t* option) const {
49  TNamed::Print(option);
50  const char* ownname = ((TGo4FitNamed*) this)->GetOwnerFullName();
51 
52  if ((ownname!=0) && (strlen(ownname)>0))
53  std::cout << " Full name: " << ((TGo4FitNamed*) this)->GetFullName() << std::endl;
54 }
const char * GetFullName()
TString fxFullName
Definition: TGo4FitNamed.h:77
void Print(Option_t *option) const
TNamed * GetOwner()
Definition: TGo4FitNamed.h:63
virtual ~TGo4FitNamed()
const char * GetOwnerFullName()