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 #include "snprintf.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;
50  fSignal.AddLast(s);
53  char rndname[20];
54  snprintf(rndname,20, "rndname%f", generator.Rndm());
55  empty = new TVectorD(1);
56  fErrorOnSignal.AddLast(empty);
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 
77  fSignal.AddLast(s);
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);
94  fErrorOnSignal.SetOwner(swtch);
96  fIds.SetOwner(swtch);
97  fDummyTA.SetOwner(!swtch);
98  fDummyIds.SetOwner(!swtch);
99 }
100 
TLimitDataSource::fErrorOnBackground
TObjArray fErrorOnBackground
Definition: TLimitDataSource.h:45
TVectorD.h
snprintf
#define snprintf
Definition: civetweb.c:1540
TObjArray
Definition: TObjArray.h:37
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TLimitDataSource::fBackground
TObjArray fBackground
Definition: TLimitDataSource.h:42
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TLimitDataSource::fSignal
TObjArray fSignal
Definition: TLimitDataSource.h:41
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TLimitDataSource::TLimitDataSource
TLimitDataSource()
Definition: TLimitDataSource.cxx:18
b
#define b(i)
Definition: RSha256.hxx:118
TObjArray::AddLast
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
Definition: TObjArray.cxx:178
TLimitDataSource::fDummyIds
TObjArray fDummyIds
Definition: TLimitDataSource.h:49
TRandom3
Definition: TRandom3.h:27
TLimitDataSource
Definition: TLimitDataSource.h:24
TLimitDataSource::fDummyTA
TObjArray fDummyTA
Definition: TLimitDataSource.h:48
TLimitDataSource::AddChannel
virtual void AddChannel(TH1 *, TH1 *, TH1 *)
Definition: TLimitDataSource.cxx:44
TRandom3.h
TLimitDataSource::fErrorOnSignal
TObjArray fErrorOnSignal
Definition: TLimitDataSource.h:44
TVectorT
Definition: TMatrixTBase.h:78
TVectorD
TVectorT< Double_t > TVectorD
Definition: TVectorDfwd.h:22
dummy
static RooMathCoreReg dummy
Definition: RooMathCoreReg.cxx:27
TRandom3::Rndm
virtual Double_t Rndm()
Machine independent random number generator.
Definition: TRandom3.cxx:99
TH1
Definition: TH1.h:57
d
#define d(i)
Definition: RSha256.hxx:120
TLimitDataSource::SetOwner
virtual void SetOwner(bool swtch=kTRUE)
Definition: TLimitDataSource.cxx:85
TLimitDataSource.h
TH1.h
TLimitDataSource::fIds
TObjArray fIds
Definition: TLimitDataSource.h:46
TLimitDataSource::fCandidates
TObjArray fCandidates
Definition: TLimitDataSource.h:43