104                                       Int_t nmc, 
bool stat,
 
  117   for (i = 0; i <= 
data->GetSignal()->GetLast(); i++) {
 
  118      maxbins = (((
TH1 *) (
data->GetSignal()->At(i)))->GetNbinsX() + 2) > maxbins ?
 
  119                 (((
TH1 *) (
data->GetSignal()->At(i)))->GetNbinsX() + 2) : maxbins;
 
  120      nsig   +=  ((
TH1 *) (
data->GetSignal()->At(i)))->Integral();
 
  121      nbg    +=  ((
TH1 *) (
data->GetBackground()->At(i)))->Integral();
 
  122      ncand  +=  (
Int_t) ((
TH1 *) (
data->GetCandidates()->At(i)))->Integral();
 
  129   for (
Int_t channel = 0; channel <= 
data->GetSignal()->GetLast(); channel++)
 
  131           bin <= ((
TH1 *) (
data->GetSignal()->At(channel)))->GetNbinsX()+1;
 
  137         if ((
b == 0) && (
s > 0)) {
 
  138            std::cout << 
"WARNING: Ignoring bin " << bin << 
" of channel " 
  139                 << channel << 
" which has s=" << 
s << 
" but b=" << 
b << std::endl;
 
  140            std::cout << 
"         Maybe the MC statistic has to be improved..." << std::endl;
 
  142         if ((
s > 0) && (
b > 0))
 
  147         if ((
s > 0) && (
b > 0))
 
  149         else if ((
s > 0) && (
b == 0))
 
  165   for (i = 0; i < nmc; i++) {
 
  177      for (
Int_t channel = 0;
 
  178           channel <= fluctuated->
GetSignal()->GetLast(); channel++) {
 
  180              bin <=((
TH1 *) (fluctuated->
GetSignal()->
At(channel)))->GetNbinsX()+1;
 
  187               tss[i] += rand * 
fgTable->
At((channel * maxbins) + bin);
 
  192               if ((
s > 0) && (b2 > 0))
 
  194               else if ((
s > 0) && (b2 == 0))
 
  195                  lrs[i] += 20 * rand - 
s;
 
  198               rand = myrandom->
Poisson(rate);
 
  199               tsb[i] += rand * 
fgTable->
At((channel * maxbins) + bin);
 
  200               if ((s2 > 0) && (
b > 0))
 
  202               else if ((
s > 0) && (
b == 0))
 
  203                  lrb[i] += 20 * rand - 
s;
 
  207      lrs[i] = 
TMath::Exp(lrs[i] < 710 ? lrs[i] : 710);
 
  208      lrb[i] = 
TMath::Exp(lrb[i] < 710 ? lrb[i] : 710);
 
  258         TH1 *newsignal = (
TH1*)(
output->GetSignal()->At(channel));
 
  261            for(
int i=1; i<=newsignal->
GetNbinsX(); i++) {
 
  265         TH1 *newbackground = (
TH1*)(
output->GetBackground()->At(channel));
 
  268            for(
int i=1; i<=newbackground->
GetNbinsX(); i++)
 
  284         toss[i] = generator->
Gaus(0, 1);
 
  286      for (
Int_t channel = 0;
 
  299         if ((serrf[channel] < -1.0) || (berrf[channel] < -0.9)) {
 
  311      TH1 *newsignal = (
TH1*)(
output->GetSignal()->At(channel));
 
  314         for(
int i=1; i<=newsignal->
GetNbinsX(); i++)
 
  317         for(
int i=1; i<=newsignal->
GetNbinsX(); i++)
 
  319      newsignal->
Scale(1 + serrf[channel]);
 
  321      TH1 *newbackground = (
TH1*)(
output->GetBackground()->At(channel));
 
  324         for(
int i=1; i<=newbackground->
GetNbinsX(); i++)
 
  327         for(
int i=1; i<=newbackground->
GetNbinsX(); i++)
 
  329      newbackground->
Scale(1 + berrf[channel]);
 
  338                                       Int_t nmc, 
bool stat,
 
  351                                       Int_t nmc, 
bool stat,
 
  369   TH1D* sh = 
new TH1D(
"__sh",
"__sh",1,0,2);
 
  371   TH1D* bh = 
new TH1D(
"__bh",
"__bh",1,0,2);
 
  373   TH1D* dh = 
new TH1D(
"__dh",
"__dh",1,0,2);
 
  392   TH1D* sh = 
new TH1D(
"__sh",
"__sh",1,0,2);
 
  394   TH1D* bh = 
new TH1D(
"__bh",
"__bh",1,0,2);
 
  396   TH1D* dh = 
new TH1D(
"__dh",
"__dh",1,0,2);
 
Array of doubles (64 bits per element).
Double_t At(Int_t i) const
void Set(Int_t n)
Set size of this array to n doubles.
void AddAt(Double_t c, Int_t i)
Set the double c value at position i in the array.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Class to compute 95% CL limits.
void SetTSS(Double_t *in)
Set the TSS.
void SetStot(Double_t in)
void SetBtot(Double_t in)
void SetLRB(Double_t *in)
void SetTSB(Double_t *in)
Set the TSB.
void SetLRS(Double_t *in)
1-D histogram with a double per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t GetNbinsX() const
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
Iterator abstract base class.
virtual TObject * Next()=0
This class serves as interface to feed data into the TLimit routines.
virtual TObjArray * GetErrorOnSignal()
virtual TObjArray * GetSignal()
virtual TObjArray * GetBackground()
virtual TObjArray * GetErrorNames()
virtual TObjArray * GetErrorOnBackground()
Algorithm to compute 95% C.L.
static Double_t LogLikelihood(Double_t s, Double_t b, Double_t b2, Double_t d)
static TOrdCollection * fgSystNames
static TConfidenceLevel * ComputeLimit(TLimitDataSource *data, Int_t nmc=50000, bool stat=false, TRandom *generator=0)
static bool Fluctuate(TLimitDataSource *input, TLimitDataSource *output, bool init, TRandom *, bool stat=false)
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Int_t GetLast() const
Return index of last object in array.
TObject * At(Int_t idx) const
Collectable string class.
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
void AddLast(TObject *obj)
Add object at the end of the collection.
void Sort()
If objects in collection are sortable (i.e.
Int_t BinarySearch(TObject *obj)
Find object using a binary search.
Random number generator class based on M.
This is the base class for the ROOT Random number generators.
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
virtual Int_t Poisson(Double_t mean)
Generates a random integer N according to a Poisson law.
static constexpr double s