GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4FitNamed.cxx
Go to the documentation of this file.
1// $Id$
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
18TGo4FitNamed::TGo4FitNamed() : TNamed(), fxOwner(nullptr), fxFullName() {}
19
20TGo4FitNamed::TGo4FitNamed(const char *Name, const char *Title, TNamed *Owner)
21 : TNamed(Name, Title), fxOwner(Owner), fxFullName()
22{
23}
24
26
28{
29 TGo4FitNamed *full = dynamic_cast<TGo4FitNamed *>(GetOwner());
30 if (full)
31 return full->GetFullName();
32 if (GetOwner())
33 return GetOwner()->GetName();
34 return nullptr;
35}
36
38{
39
40 const char *ownname = GetOwnerFullName();
41
42 if (ownname && (strlen(ownname) > 0)) {
43 fxFullName = ownname;
44 fxFullName += ".";
45 fxFullName += GetName();
46 } else {
47 fxFullName = GetName();
48 }
49 return fxFullName.Data();
50}
51
52void TGo4FitNamed::Print(Option_t *option) const
53{
54 TNamed::Print(option);
55 const char *ownname = ((TGo4FitNamed *)this)->GetOwnerFullName();
56
57 if (ownname && (strlen(ownname) > 0))
58 std::cout << " Full name: " << ((TGo4FitNamed *)this)->GetFullName() << std::endl;
59}
void Print(Option_t *option="") const override
const char * GetOwnerFullName()
Return full name of owner.
virtual ~TGo4FitNamed()
Destroy TGo4FitNamed object.
TNamed * GetOwner()
Return owner of object.
TString fxFullName
String, containing full name of object.
TNamed * fxOwner
Owner of object.
TGo4FitNamed()
Default constructor.
const char * GetFullName()
Returns full name of object.