Logo ROOT  
Reference Guide
TLimitDataSource.cxx
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Christophe.Delaere@cern.ch 21/08/2002
3
4///////////////////////////////////////////////////////////////////////////
5/** \class TLimitDataSource
6 This class serves as interface to feed data into the TLimit routines
7*/
8///////////////////////////////////////////////////////////////////////////
9
10#include "TLimitDataSource.h"
11#include "TH1.h"
12#include "TVectorD.h"
13#include "TObjString.h"
14#include "TRandom3.h"
15
17
19{
20 // Default constructor
23}
24
26{
27 // Another constructor, directly adds one channel
28 // with signal, background and data given as input.
31 AddChannel(s, b, d);
32}
33
35 TVectorD * es, TVectorD * eb, TObjArray * names)
36{
37 // Another constructor, directly adds one channel
38 // with signal, background and data given as input.
41 AddChannel(s, b, d, es, eb, names);
42}
43
45{
46 // Adds a channel with signal, background and data given as input.
47
48 TVectorD *empty;
49 TRandom3 generator;
53 char rndname[20];
54 snprintf(rndname,20, "rndname%f", generator.Rndm());
55 empty = new TVectorD(1);
57 fDummyTA.AddLast(empty);
58 snprintf(rndname,20, "rndname%f", generator.Rndm());
59 empty = new TVectorD(1);
61 fDummyTA.AddLast(empty);
62 TObjArray *dummy = new TObjArray(0);
65}
66
68 TVectorD * eb, TObjArray * names)
69{
70 // Adds a channel with signal, background and data given as input.
71 // In addition, error sources are defined.
72 // TH1 are here used for convenience: each bin has to be seen as
73 // an error source (relative).
74 // names is an array of strings containing the names of the sources.
75 // Sources with the same name are correlated.
76
82 fIds.AddLast(names);
83}
84
86{
87 // Gives to the TLimitDataSource the ownership of the various objects
88 // given as input.
89 // Objects are then deleted by the TLimitDataSource destructor.
90
91 fSignal.SetOwner(swtch);
92 fBackground.SetOwner(swtch);
93 fCandidates.SetOwner(swtch);
96 fIds.SetOwner(swtch);
97 fDummyTA.SetOwner(!swtch);
98 fDummyIds.SetOwner(!swtch);
99}
100
#define d(i)
Definition: RSha256.hxx:102
#define b(i)
Definition: RSha256.hxx:100
static RooMathCoreReg dummy
#define ClassImp(name)
Definition: Rtypes.h:365
TVectorT< Double_t > TVectorD
Definition: TVectorDfwd.h:22
#define snprintf
Definition: civetweb.c:1540
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
The TH1 histogram class.
Definition: TH1.h:56
This class serves as interface to feed data into the TLimit routines.
virtual void SetOwner(bool swtch=kTRUE)
TObjArray fErrorOnBackground
TObjArray fErrorOnSignal
virtual void AddChannel(TH1 *, TH1 *, TH1 *)
An array of TObjects.
Definition: TObjArray.h:37
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
Definition: TObjArray.cxx:177
Random number generator class based on M.
Definition: TRandom3.h:27
virtual Double_t Rndm()
Machine independent random number generator.
Definition: TRandom3.cxx:100
static constexpr double s