GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4FitterEnvelope.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 "TGo4FitterEnvelope.h"
15 
16 #include "TGo4Status.h"
17 
19 : TGo4Parameter("Fitter envelope")
20 {
21 }
22 
24 : TGo4Parameter(name)
25 {
26  fxFitter = fitter;
27 }
28 
30 {
31  if(fxFitter) delete fxFitter;
32 }
33 
34 void TGo4FitterEnvelope::Print(Option_t *) const
35 {
37  if(fxFitter)
38  TGo4Status::PrintLine("\n This object contains the fitter: %s",fxFitter->GetName());
39  else
40  TGo4Status::PrintLine(" \t This object contains no fitter");
41 }
42 
44 {
45  auto from = dynamic_cast<TGo4FitterEnvelope *> (pp);
46  if(!from) return kFALSE;
47 
48  if(fxFitter) delete fxFitter;
49  fxFitter = from->GetFitter(kTRUE);// change ownership to us
50  return kTRUE;
51 }
52 
53 void TGo4FitterEnvelope::Clear(Option_t *opt)
54 {
55  if(fxFitter) fxFitter->Clear(opt);
56 }
57 
59 {
60  TGo4Fitter *rev=fxFitter;
61  if(chown) fxFitter = nullptr;
62  return rev;
63 }
64 
66 {
67  if(fxFitter) delete fxFitter;
68  fxFitter = fitter;
69 }
Bool_t UpdateFrom(TGo4Parameter *) override
void SetFitter(TGo4Fitter *fitter)
TGo4Fitter * GetFitter(Bool_t chown=kFALSE)
void Print(Option_t *opt="") const override
void Print(Option_t *opt="") const override
void Clear(Option_t *opt="") override
static void PrintLine(const char *text,...)
Definition: TGo4Status.cxx:101
void Clear(Option_t *option="") override
Definition: TGo4Fitter.cxx:97