Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBarlowBeestonLL.cxx
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
2// Author: Kyle Cranmer, George Lewis
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11//////////////////////////////////////////////////////////////////////////////
12/** \class RooStats::HistFactory::RooBarlowBeestonLL
13 * \ingroup HistFactory
14//
15// Class RooBarlowBeestonLL implements the profile likelihood estimator for
16// a given likelihood and set of parameters of interest. The value return by
17// RooBarlowBeestonLL is the input likelihood nll minimized w.r.t all nuisance parameters
18// (which are all parameters except for those listed in the constructor) minus
19// the -log(L) of the best fit. Note that this function is slow to evaluate
20// as a MIGRAD minimization step is executed for each function evaluation
21*/
22
23#include <stdexcept>
24#include <cmath>
25#include <iostream>
26
28#include "RooAbsReal.h"
29#include "RooMsgService.h"
30#include "RooRealVar.h"
31
33#include "RooCategory.h"
34#include "RooSimultaneous.h"
35#include "RooArgList.h"
36
39
40#include <TMath.h>
41
42
43
44
45////////////////////////////////////////////////////////////////////////////////
46
48 RooAbsReal& nllIn /*, const RooArgSet& observables*/) :
49 RooAbsReal(name,title),
50 _nll("input","-log(L) function",this,nllIn)
51 // _obs("paramOfInterest","Parameters of interest",this),
52 // _par("nuisanceParam","Nuisance parameters",this,false,false),
53{
54 // Constructor of profile likelihood given input likelihood nll w.r.t
55 // the given set of variables. The input log likelihood is minimized w.r.t
56 // to all other variables of the likelihood at each evaluation and the
57 // value of the global log likelihood minimum is always subtracted.
58
59 // Determine actual parameters and observables
60 /*
61 std::unique_ptr<RooArgSet> actualObs{nllIn.getObservables(observables)};
62 std::unique_ptr<RooArgSet> actualPars{nllIn.getParameters(observables)};
63
64 _obs.add(*actualObs) ;
65 _par.add(*actualPars) ;
66 */
67}
68
69
70
71////////////////////////////////////////////////////////////////////////////////
72
74 RooAbsReal(other,name),
75 _nll("nll",this,other._nll),
76 // _obs("obs",this,other._obs),
77 // _par("par",this,other._par),
78 _paramFixed(other._paramFixed)
79{
80 // Copy constructor
81
82 // _paramAbsMin.addClone(other._paramAbsMin) ;
83 // _obsAbsMin.addClone(other._obsAbsMin) ;
84
85}
86
87
88////////////////////////////////////////////////////////////////////////////////
89
91 for (auto const *var : static_range_cast<RooRealVar *>(*bin_center)) {
92 RooRealVar* target = static_cast<RooRealVar*>(observables->find(var->GetName())) ;
93 target->setVal(var->getVal()) ;
94 }
95}
96
97
98////////////////////////////////////////////////////////////////////////////////
99
101 bool verbose=false;
102
103 if(!_data) {
104 std::cout << "Error: Must initialize data before initializing cache" << std::endl;
105 throw std::runtime_error("Uninitialized Data");
106 }
107 if(!_pdf) {
108 std::cout << "Error: Must initialize model pdf before initializing cache" << std::endl;
109 throw std::runtime_error("Uninitialized model pdf");
110 }
111
112 // Get the data bin values for all channels and bins
113 std::map< std::string, std::vector<double> > ChannelBinDataMap;
114 getDataValuesForObservables( ChannelBinDataMap, _data, _pdf );
115
116 // Get a list of constraint terms
117 RooArgList obsTerms;
118 RooArgList constraints;
119 RooArgSet* obsSet = std::unique_ptr<RooArgSet>{_pdf->getObservables(*_data)}.release();
120 FactorizeHistFactoryPdf(*obsSet, *_pdf, obsTerms, constraints);
121
122 if( obsTerms.empty() ) {
123 std::cout << "Error: Found no observable terms with pdf: " << _pdf->GetName()
124 << " using dataset: " << _data->GetName() << std::endl;
125 return;
126 }
127 if( constraints.empty() ) {
128 std::cout << "Error: Found no constraint terms with pdf: " << _pdf->GetName()
129 << " using dataset: " << _data->GetName() << std::endl;
130 return;
131 }
132
133 // Loop over the channels
134 auto simPdf = static_cast<RooSimultaneous*>(_pdf);
135 auto channelCat = static_cast<RooCategory const*>(&simPdf->indexCat());
136 for (const auto& nameIdx : *channelCat) {
137
138 // Warning: channel cat name is not necessarily the same name
139 // as the pdf's (for example, if someone does edits)
140 RooAbsPdf* channelPdf = simPdf->getPdf(nameIdx.first.c_str());
141 std::string channel_name = channelPdf->GetName();
142
143 // First, we check if this channel uses Stat Uncertainties:
144 RooArgList* gammas = nullptr;
145 ParamHistFunc* param_func=nullptr;
146 bool hasStatUncert = getStatUncertaintyFromChannel( channelPdf, param_func, gammas );
147 if( ! hasStatUncert ) {
148 if(verbose) {
149 std::cout << "Channel: " << channel_name
150 << " doesn't have statistical uncertainties"
151 << std::endl;
152 }
153 continue;
154 }
155 else {
156 if(verbose) std::cout << "Found ParamHistFunc: " << param_func->GetName() << std::endl;
157 }
158
159 // Now, loop over the bins in this channel
160 // To Do: Check that the index convention
161 // still works for 2-d (ie matches the
162 // convention in ParamHistFunc, etc)
163 int num_bins = param_func->numBins();
164
165 // Initialize the vector to the number of bins, allowing
166 // us to skip gamma's if they are constant
167
168 std::vector<BarlowCache> temp_cache( num_bins );
169 bool channel_has_stat_uncertainty=false;
170
171 for( Int_t bin_index = 0; bin_index < num_bins; ++bin_index ) {
172
173 // Create a cache object
174 BarlowCache cache;
175
176 // Get the gamma for this bin, and skip if it's constant
177 RooRealVar* gamma_stat = dynamic_cast<RooRealVar*>(&(param_func->getParameter(bin_index)));
178 if(!gamma_stat) throw std::runtime_error("ParamHistFunc contains non-RooRealVar, not supported in RooBarlowBeestonLL");
179 if( gamma_stat->isConstant() ) {
180 if(verbose) std::cout << "Ignoring constant gamma: " << gamma_stat->GetName() << std::endl;
181 continue;
182 }
183 else {
184 cache.hasStatUncert=true;
185 channel_has_stat_uncertainty=true;
186 cache.gamma = gamma_stat;
187 _statUncertParams.insert( gamma_stat->GetName() );
188 }
189
190 // Store a snapshot of the bin center
191 RooArgSet* bin_center = (RooArgSet*) param_func->get( bin_index )->snapshot();
192 cache.bin_center = bin_center;
193 cache.observables = obsSet;
194
195 cache.binVolume = param_func->binVolume(bin_index);
196
197 // Get the gamma's constraint term
198 RooAbsReal* pois_mean = nullptr;
199 RooRealVar* tau = nullptr;
200 getStatUncertaintyConstraintTerm( &constraints, gamma_stat, pois_mean, tau );
201 if( !tau || !pois_mean ) {
202 std::cout << "Failed to find pois mean or tau parameter for " << gamma_stat->GetName() << std::endl;
203 }
204 else {
205 if (verbose) {
206 std::cout << "Found pois mean and tau for parameter: " << gamma_stat->GetName() << " tau: " << tau->GetName()
207 << " " << tau->getVal() << " pois_mean: " << pois_mean->GetName() << " " << pois_mean->getVal()
208 << std::endl;
209 }
210 }
211
212 cache.tau = tau;
213 cache.nom_pois_mean = pois_mean;
214
215 // Get the RooRealSumPdf
216 RooAbsPdf* sum_pdf = getSumPdfFromChannel( channelPdf );
217 if( sum_pdf == nullptr ) {
218 std::cout << "Failed to find RooRealSumPdf in channel " << channel_name
219 << ", therefor skipping this channel for analytic uncertainty minimization"
220 << std::endl;
221 channel_has_stat_uncertainty=false;
222 break;
223 }
224 cache.sumPdf = sum_pdf;
225
226 // And set the data value for this bin
227 if( ChannelBinDataMap.find(channel_name) == ChannelBinDataMap.end() ) {
228 std::cout << "Error: channel with name: " << channel_name
229 << " not found in BinDataMap" << std::endl;
230 throw std::runtime_error("BinDataMap");
231 }
232 double nData = ChannelBinDataMap[channel_name].at(bin_index);
233 cache.nData = nData;
234
235 temp_cache.at(bin_index) = cache;
236 //_barlowCache[channel_name].at(bin_index) = cache;
237
238 } // End: Loop over bins
239
240 if( channel_has_stat_uncertainty ) {
241 std::cout << "Adding channel: " << channel_name
242 << " to the barlow cache" << std::endl;
243 _barlowCache[channel_name] = temp_cache;
244 }
245
246
247 } // End: Loop over channels
248
249
250
251 // Successfully initialized the cache
252 // Printing some info
253 /*
254 std::map< std::string, std::vector< BarlowCache > >::iterator iter_cache;
255 for( iter_cache = _barlowCache.begin(); iter_cache != _barlowCache.end(); ++iter_cache ) {
256
257 std::string channel_name = (*iter_cache).first;
258 std::vector< BarlowCache >& channel_cache = (*iter_cache).second;
259
260
261 for( unsigned int i = 0; i < channel_cache.size(); ++i ) {
262 BarlowCache& bin_cache = channel_cache.at(i);
263
264
265 RooRealVar* gamma = bin_cache.gamma;
266 RooRealVar* tau = bin_cache.tau;
267 RooAbsReal* pois_mean = bin_cache.nom_pois_mean;
268 RooAbsPdf* sum_pdf = (RooAbsPdf*) bin_cache.sumPdf;
269 double binVolume = bin_cache.binVolume;
270
271
272 if( !bin_cache.hasStatUncert ) {
273 std::cout << "Barlow Cache for Channel: " << channel_name
274 << " Bin: " << i
275 << " NO STAT UNCERT"
276 << std::endl;
277 }
278 else {
279 std::cout << "Barlow Cache for Channel: " << channel_name
280 << " Bin: " << i
281 << " gamma: " << gamma->GetName()
282 << " tau: " << tau->GetName()
283 << " pois_mean: " << pois_mean->GetName()
284 << " sum_pdf: " << sum_pdf->GetName()
285 << " binVolume: " << binVolume
286 << std::endl;
287 }
288
289 }
290 }
291 */
292
293}
294
295
296////////////////////////////////////////////////////////////////////////////////
297
299 RooArgSet& outputSet,
300 bool stripDisconnected) const {
301 bool errorInBaseCall = RooAbsArg::getParameters( depList, outputSet, stripDisconnected );
302
303 RooArgSet toRemove;
304 toRemove.reserve( _statUncertParams.size());
305
306 for (auto const& arg : outputSet) {
307
308 // If there is a gamma in the name,
309 // strip it from the list of dependencies
310
311 if( _statUncertParams.find(arg->GetName()) != _statUncertParams.end() ) {
312 toRemove.add( *arg );
313 }
314 }
315
316 for( auto& arg : toRemove) outputSet.remove( *arg, true );
317
318 return errorInBaseCall || false;
319
320}
321
322
323/*
324////////////////////////////////////////////////////////////////////////////////
325
326const RooArgSet& RooStats::HistFactory::RooBarlowBeestonLL::bestFitParams() const
327{
328 validateAbsMin() ;
329 return _paramAbsMin ;
330}
331
332
333////////////////////////////////////////////////////////////////////////////////
334
335const RooArgSet& RooStats::HistFactory::RooBarlowBeestonLL::bestFitObs() const
336{
337 validateAbsMin() ;
338 return _obsAbsMin ;
339}
340*/
341
342
343
344////////////////////////////////////////////////////////////////////////////////
345/// Optimized implementation of createProfile for profile likelihoods.
346/// Return profile of original function in terms of stated parameters
347/// of interest rather than profiling recursively.
348
349/*
350RooAbsReal* RooStats::HistFactory::RooBarlowBeestonLL::createProfile(const RooArgSet& paramsOfInterest)
351{
352 return nll().createProfile(paramsOfInterest) ;
353}
354*/
355
356
357/*
358void RooStats::HistFactory::RooBarlowBeestonLL::FactorizePdf(const RooArgSet &observables, RooAbsPdf &pdf, RooArgList &obsTerms, RooArgList &constraints) const {
359 // utility function to factorize constraint terms from a pdf
360 // (from G. Petrucciani)
361 const std::type_info & id = typeid(pdf);
362 if (id == typeid(RooProdPdf)) {
363 RooProdPdf *prod = dynamic_cast<RooProdPdf *>(&pdf);
364 RooArgList list(prod->pdfList());
365 for (int i = 0, n = list.size(); i < n; ++i) {
366 RooAbsPdf *pdfi = (RooAbsPdf *) list.at(i);
367 FactorizePdf(observables, *pdfi, obsTerms, constraints);
368 }
369 } else if (id == typeid(RooSimultaneous) ) { //|| id == typeid(RooSimultaneousOpt)) {
370 RooSimultaneous *sim = dynamic_cast<RooSimultaneous *>(&pdf);
371 std::unique_ptr<RooAbsCategoryLValue> cat{(RooAbsCategoryLValue *) sim->indexCat().Clone()};
372 for (int ic = 0, nc = cat->numBins((const char *)0); ic < nc; ++ic) {
373 cat->setBin(ic);
374 FactorizePdf(observables, *sim->getPdf(cat->getLabel()), obsTerms, constraints);
375 }
376 } else if (pdf.dependsOn(observables)) {
377 if (!obsTerms.contains(pdf)) obsTerms.add(pdf);
378 } else {
379 if (!constraints.contains(pdf)) constraints.add(pdf);
380 }
381}
382*/
383
384
385
386////////////////////////////////////////////////////////////////////////////////
387
389{
390 // Loop over the channels (keys to the map)
391 //clock_t time_before_setVal, time_after_setVal;
392 //time_before_setVal=clock();
393 std::map< std::string, std::vector< BarlowCache > >::iterator iter_cache;
394 for( iter_cache = _barlowCache.begin(); iter_cache != _barlowCache.end(); ++iter_cache ) {
395
396 std::vector< BarlowCache >& channel_cache = (*iter_cache).second;
397
398 /* Slower way to find the channel vector:
399 // Get the vector of bin uncertainty caches for this channel
400 if( _barlowCache.find( channel_name ) == _barlowCache.end() ) {
401 std::cout << "Error: channel: " << channel_name
402 << " not found in barlow Cache" << std::endl;
403 throw std::runtime_error("Channel not in barlow cache");
404 }
405
406 std::vector< BarlowCache >& channel_cache = _barlowCache[ channel_name ];
407 */
408
409 // Loop over the bins in the cache
410 // Set all gamma's to 0
411 for( unsigned int i = 0; i < channel_cache.size(); ++i ) {
412 BarlowCache& bin_cache = channel_cache.at(i);
413 if( !bin_cache.hasStatUncert ) continue;
414 RooRealVar* gamma = bin_cache.gamma;
415 gamma->setVal(0.0);
416 }
417 std::vector< double > nu_b_vec( channel_cache.size() );
418 for( unsigned int i = 0; i < channel_cache.size(); ++i ) {
419 BarlowCache& bin_cache = channel_cache.at(i);
420 if( !bin_cache.hasStatUncert ) continue;
421
422 RooAbsPdf* sum_pdf = static_cast<RooAbsPdf*>(bin_cache.sumPdf);
423 RooArgSet* obsSet = bin_cache.observables;
424 double binVolume = bin_cache.binVolume;
425
426 bin_cache.SetBinCenter();
427 double nu_b = sum_pdf->getVal(*obsSet)*sum_pdf->expectedEvents(*obsSet)*binVolume;
428 nu_b_vec.at(i) = nu_b;
429 }
430
431 // Loop over the bins in the cache
432 // Set all gamma's to 1
433 for( unsigned int i = 0; i < channel_cache.size(); ++i ) {
434 BarlowCache& bin_cache = channel_cache.at(i);
435 if( !bin_cache.hasStatUncert ) continue;
436 RooRealVar* gamma = bin_cache.gamma;
437 gamma->setVal(1.0);
438 }
439 std::vector< double > nu_b_stat_vec( channel_cache.size() );
440 for( unsigned int i = 0; i < channel_cache.size(); ++i ) {
441 BarlowCache& bin_cache = channel_cache.at(i);
442 if( !bin_cache.hasStatUncert ) continue;
443
444 RooAbsPdf* sum_pdf = static_cast<RooAbsPdf*>(bin_cache.sumPdf);
445 RooArgSet* obsSet = bin_cache.observables;
446 double binVolume = bin_cache.binVolume;
447
448 bin_cache.SetBinCenter();
449 double nu_b_stat = sum_pdf->getVal(*obsSet)*sum_pdf->expectedEvents(*obsSet)*binVolume - nu_b_vec.at(i);
450 nu_b_stat_vec.at(i) = nu_b_stat;
451 }
452 //time_after_setVal=clock();
453
454 // Done with the first loops.
455 // Now evaluating the function
456
457 //clock_t time_before_eval, time_after_eval;
458
459 // Loop over the bins in the cache
460 //time_before_eval=clock();
461 for( unsigned int i = 0; i < channel_cache.size(); ++i ) {
462
463 BarlowCache& bin_cache = channel_cache.at(i);
464
465 if( !bin_cache.hasStatUncert ) {
466 //std::cout << "Bin: " << i << " of " << channel_cache.size()
467 // << " in channel: " << channel_name
468 // << " doesn't have stat uncertainties" << std::endl;
469 continue;
470 }
471
472 // Set the observable to the bin center
473 bin_cache.SetBinCenter();
474
475 // Get the cached objects
476 RooRealVar* gamma = bin_cache.gamma;
477 RooRealVar* tau = bin_cache.tau;
478 RooAbsReal* pois_mean = bin_cache.nom_pois_mean;
479 //RooAbsPdf* sum_pdf = (RooAbsPdf*) bin_cache.sumPdf;
480 //RooArgSet* obsSet = bin_cache.observables;
481 //double binVolume = bin_cache.binVolume;
482
483 // Get the values necessary for
484 // the analytic minimization
485 double nu_b = nu_b_vec.at(i);
486 double nu_b_stat = nu_b_stat_vec.at(i);
487
488 double tau_val = tau->getVal();
489 double nData = bin_cache.nData;
490 double m_val = pois_mean->getVal();
491
492 // Initialize the minimized value of gamma
493 double gamma_hat_hat = 1.0;
494
495 // Check that the quadratic term is > 0
496 if(nu_b_stat > 0.00000001) {
497
498 double A = nu_b_stat*nu_b_stat + tau_val*nu_b_stat;
499 double B = nu_b*tau_val + nu_b*nu_b_stat - nData*nu_b_stat - m_val*nu_b_stat;
500 double C = -1*m_val*nu_b;
501
502 double discrim = B*B-4*A*C;
503
504 if( discrim < 0 ) {
505 std::cout << "Warning: Discriminant (B*B - 4AC) < 0" << std::endl;
506 std::cout << "Warning: Taking B*B - 4*A*C == 0" << std::endl;
507 discrim=0;
508 //throw std::runtime_error("BarlowBeestonLL::evaluate() : B*B - 4AC < 0");
509 }
510 if( A <= 0 ) {
511 std::cout << "Warning: A <= 0" << std::endl;
512 throw std::runtime_error("BarlowBeestonLL::evaluate() : A < 0");
513 }
514
515 gamma_hat_hat = ( -1*B + std::sqrt(discrim) ) / (2*A);
516 }
517
518 // If the quadratic term is 0, we simply
519 // use a linear equation
520 else {
521 gamma_hat_hat = m_val/tau_val;
522 }
523
524 // Check for NAN
525 if( TMath::IsNaN(gamma_hat_hat) ) {
526 std::cout << "ERROR: gamma hat hat is NAN" << std::endl;
527 throw std::runtime_error("BarlowBeestonLL::evaluate() : gamma hat hat is NAN");
528 }
529
530 if( gamma_hat_hat <= 0 ) {
531 std::cout << "WARNING: gamma hat hat <= 0. Setting to 0" << std::endl;
532 gamma_hat_hat = 0;
533 }
534
535 /*
536 std::cout << "n: " << bin_cache.nData << " "
537 << "nu_stat: " << nu_b_stat << " "
538 << "nu: " << nu_b << " "
539 << "tau: " << tau->getVal() << " "
540 << "m: " << pois_mean->getVal() << " "
541 << "A: " << A << " "
542 << "B: " << B << " "
543 << "C: " << C << " "
544 << "gamma hat hat: " << gamma_hat_hat
545 << std::endl;
546 */
547
548 gamma->setVal( gamma_hat_hat );
549
550 }
551
552 //time_after_eval=clock();
553
554 //float time_setVal = ((float) time_after_setVal - (float) time_before_setVal) / ((float) CLOCKS_PER_SEC);
555 //float time_eval = ((float) time_after_eval - (float) time_before_eval) / ((float) CLOCKS_PER_SEC);
556
557 /*
558 std::cout << "Barlow timing for channel: " << channel_name
559 << " SetVal: " << time_setVal
560 << " Eval: " << time_eval
561 << std::endl;
562 */
563 }
564
565
566 return _nll;
567
568}
569
570
571
572/*
573////////////////////////////////////////////////////////////////////////////////
574/// Check that parameters and likelihood value for 'best fit' are still valid. If not,
575/// because the best fit has never been calculated, or because constant parameters have
576/// changed value or parameters have changed const/float status, the minimum is recalculated
577
578void RooStats::HistFactory::RooBarlowBeestonLL::validateAbsMin() const
579{
580 // Check if constant status of any of the parameters have changed
581 if (_absMinValid) {
582 _piter->Reset() ;
583 RooAbsArg* par ;
584 while((par=(RooAbsArg*)_piter->Next())) {
585 if (_paramFixed[par->GetName()] != par->isConstant()) {
586 cxcoutI(Minimization) << "RooStats::HistFactory::RooBarlowBeestonLL::evaluate(" << GetName() << ") constant status of parameter " << par->GetName() << " has changed from "
587 << (_paramFixed[par->GetName()]?"fixed":"floating") << " to " << (par->isConstant()?"fixed":"floating")
588 << ", recalculating absolute minimum" << std::endl ;
589 _absMinValid = false ;
590 break ;
591 }
592 }
593 }
594
595
596 // If we don't have the absolute minimum w.r.t all observables, calculate that first
597 if (!_absMinValid) {
598
599 cxcoutI(Minimization) << "RooStats::HistFactory::RooBarlowBeestonLL::evaluate(" << GetName() << ") determining minimum likelihood for current configurations w.r.t all observable" << std::endl ;
600
601
602 // Save current values of non-marginalized parameters
603 std::unique_ptr<RooArgSet> obsStart{(RooArgSet*) _obs.snapshot(false)};
604
605 // Start from previous global minimum
606 if (_paramAbsMin.size()>0) {
607 const_cast<RooSetProxy&>(_par).assignValueOnly(_paramAbsMin) ;
608 }
609 if (_obsAbsMin.size()>0) {
610 const_cast<RooSetProxy&>(_obs).assignValueOnly(_obsAbsMin) ;
611 }
612
613 // Find minimum with all observables floating
614 const_cast<RooSetProxy&>(_obs).setAttribAll("Constant",false) ;
615 _minuit->migrad() ;
616
617 // Save value and remember
618 _absMin = _nll ;
619 _absMinValid = true ;
620
621 // Save parameter values at abs minimum as well
622 _paramAbsMin.removeAll() ;
623
624 // Only store non-constant parameters here!
625 std::unique_ptr<RooArgSet> tmp{_par.selectByAttrib("Constant",false)};
626 _paramAbsMin.addClone(*tmp) ;
627
628 _obsAbsMin.addClone(_obs) ;
629
630 // Save constant status of all parameters
631 _piter->Reset() ;
632 RooAbsArg* par ;
633 while((par=(RooAbsArg*)_piter->Next())) {
634 _paramFixed[par->GetName()] = par->isConstant() ;
635 }
636
637 if (dologI(Minimization)) {
638 cxcoutI(Minimization) << "RooStats::HistFactory::RooBarlowBeestonLL::evaluate(" << GetName() << ") minimum found at (" ;
639
640 RooAbsReal* arg ;
641 bool first=true ;
642 _oiter->Reset() ;
643 while ((arg=(RooAbsReal*)_oiter->Next())) {
644 ccxcoutI(Minimization) << (first?"":", ") << arg->GetName() << "=" << arg->getVal() ;
645 first=false ;
646 }
647 ccxcoutI(Minimization) << ")" << std::endl ;
648 }
649
650 // Restore original parameter values
651 const_cast<RooSetProxy&>(_obs) = *obsStart ;
652
653 }
654}
655*/
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
char name[80]
Definition TGX11.cxx:142
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
const RooArgSet * get(Int_t masterIdx) const
Int_t numBins() const
RooAbsReal & getParameter() const
double binVolume(std::size_t i) const
bool isConstant() const
Check if the "Constant" attribute is set.
Definition RooAbsArg.h:284
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
virtual bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void reserve(Storage_t::size_type count)
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:32
virtual double expectedEvents(const RooArgSet *nset) const
Return expected number of events to be used in calculation of extended likelihood.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:107
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
Definition RooArgSet.h:159
Object to represent discrete states.
Definition RooCategory.h:28
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
Class RooBarlowBeestonLL implements the profile likelihood estimator for a given likelihood and set o...
double evaluate() const override
Optimized implementation of createProfile for profile likelihoods.
bool getParameters(const RooArgSet *depList, RooArgSet &outputSet, bool stripDisconnected=true) const override
Fills a list with leaf nodes in the arg tree starting with ourself as top node that don't match any o...
RooBarlowBeestonLL(const char *name, const char *title, RooAbsReal &nll)
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
bool getStatUncertaintyFromChannel(RooAbsPdf *channel, ParamHistFunc *&paramfunc, RooArgList *gammaList)
void FactorizeHistFactoryPdf(const RooArgSet &, RooAbsPdf &, RooArgList &, RooArgList &)
void getDataValuesForObservables(std::map< std::string, std::vector< double > > &ChannelBinDataMap, RooAbsData *data, RooAbsPdf *simPdf)
int getStatUncertaintyConstraintTerm(RooArgList *constraints, RooRealVar *gamma_stat, RooAbsReal *&pois_nom, RooRealVar *&tau)
RooAbsPdf * getSumPdfFromChannel(RooAbsPdf *channel)
Bool_t IsNaN(Double_t x)
Definition TMath.h:905