GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FitNamed.cxx
Go to the documentation of this file.
1 // $Id: TGo4FitNamed.cxx 2769 2020-04-16 14:54:23Z 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 fuer 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 <iostream>
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 
36 
37  const char* ownname = GetOwnerFullName();
38 
39  if ((ownname!=0) && (strlen(ownname)>0)) {
40  fxFullName = ownname;
41  fxFullName += ".";
42  fxFullName += GetName();
43  } else fxFullName = GetName();
44  return fxFullName.Data();
45 }
46 
47 void TGo4FitNamed::Print(Option_t* option) const {
48  TNamed::Print(option);
49  const char* ownname = ((TGo4FitNamed*) this)->GetOwnerFullName();
50 
51  if ((ownname!=0) && (strlen(ownname)>0))
52  std::cout << " Full name: " << ((TGo4FitNamed*) this)->GetFullName() << std::endl;
53 }
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()