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 "TRandom3.h"
14
16
18{
19 // Default constructor
22}
23
25{
26 // Another constructor, directly adds one channel
27 // with signal, background and data given as input.
30 AddChannel(s, b, d);
31}
32
34 TVectorD * es, TVectorD * eb, TObjArray * names)
35{
36 // Another constructor, directly adds one channel
37 // with signal, background and data given as input.
40 AddChannel(s, b, d, es, eb, names);
41}
42
44{
45 // Adds a channel with signal, background and data given as input.
46
47 TVectorD *empty;
48 TRandom3 generator;
52 char rndname[20];
53 snprintf(rndname,20, "rndname%f", generator.Rndm());
54 empty = new TVectorD(1);
56 fDummyTA.AddLast(empty);
57 snprintf(rndname,20, "rndname%f", generator.Rndm());
58 empty = new TVectorD(1);
60 fDummyTA.AddLast(empty);
61 TObjArray *dummy = new TObjArray(0);
64}
65
67 TVectorD * eb, TObjArray * names)
68{
69 // Adds a channel with signal, background and data given as input.
70 // In addition, error sources are defined.
71 // TH1 are here used for convenience: each bin has to be seen as
72 // an error source (relative).
73 // names is an array of strings containing the names of the sources.
74 // Sources with the same name are correlated.
75
81 fIds.AddLast(names);
82}
83
85{
86 // Gives to the TLimitDataSource the ownership of the various objects
87 // given as input.
88 // Objects are then deleted by the TLimitDataSource destructor.
89
90 fSignal.SetOwner(swtch);
91 fBackground.SetOwner(swtch);
92 fCandidates.SetOwner(swtch);
95 fIds.SetOwner(swtch);
96 fDummyTA.SetOwner(!swtch);
97 fDummyIds.SetOwner(!swtch);
98}
99
#define d(i)
Definition: RSha256.hxx:102
#define b(i)
Definition: RSha256.hxx:100
static RooMathCoreReg dummy
#define ClassImp(name)
Definition: Rtypes.h:361
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:178
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