Logo ROOT   6.14/05
Reference Guide
RooAbsRealLValue.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * @(#)root/roofitcore:$Id$
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 
17 /**
18 \file RooAbsRealLValue.cxx
19 \class RooAbsRealLValue
20 \ingroup Roofitcore
21 
22 RooAbsRealLValue is the common abstract base class for objects that represent a
23 real value that may appear on the left hand side of an equation ('lvalue')
24 Each implementation must provide a setVal() member to allow direct modification
25 of the value. RooAbsRealLValue may be derived, but its functional relation
26 to other RooAbsArg must be invertible
27 
28 This class has methods that export the defined range of the lvalue,
29 but doesn't hold its values because these limits may be derived
30 from limits of client object. The range serve as integration
31 range when interpreted as a observable and a boundaries when
32 interpreted as a parameter.
33 **/
34 
35 #include "RooFit.h"
36 
37 #include <math.h>
38 #include "Riostream.h"
39 #include "TObjString.h"
40 #include "TTree.h"
41 #include "TH1.h"
42 #include "TH2.h"
43 #include "TH3.h"
44 #include "RooAbsRealLValue.h"
45 #include "RooStreamParser.h"
46 #include "RooRandom.h"
47 #include "RooPlot.h"
48 #include "RooArgList.h"
49 #include "RooAbsBinning.h"
50 #include "RooBinning.h"
51 #include "RooUniformBinning.h"
52 #include "RooCmdConfig.h"
53 #include "RooTreeData.h"
54 #include "RooRealVar.h"
55 #include "RooMsgService.h"
56 
57 
58 
59 using namespace std;
60 
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Constructor
65 
66 RooAbsRealLValue::RooAbsRealLValue(const char *name, const char *title, const char *unit) :
67  RooAbsReal(name, title, 0, 0, unit)
68 {
69 }
70 
71 
72 
73 ////////////////////////////////////////////////////////////////////////////////
74 /// Copy constructor
75 
77  RooAbsReal(other,name), RooAbsLValue(other)
78 {
79 }
80 
81 
82 ////////////////////////////////////////////////////////////////////////////////
83 /// Destructor
84 
86 {
87 }
88 
89 
90 
91 ////////////////////////////////////////////////////////////////////////////////
92 /// Return kTRUE if the input value is within our fit range. Otherwise, return
93 /// kFALSE and write a clipped value into clippedValPtr if it is non-zero.
94 
95 Bool_t RooAbsRealLValue::inRange(Double_t value, const char* rangeName, Double_t* clippedValPtr) const
96 {
97  // Double_t range = getMax() - getMin() ; // ok for +/-INIFINITY
98  Double_t clippedValue(value);
99  Bool_t isInRange(kTRUE) ;
100 
101  const RooAbsBinning& binning = getBinning(rangeName) ;
102  Double_t min = binning.lowBound() ;
103  Double_t max = binning.highBound() ;
104 
105  // test this value against our upper fit limit
106  if(!RooNumber::isInfinite(max) && value > (max+1e-6)) {
107  if (clippedValPtr) {
108 // coutW(InputArguments) << "RooAbsRealLValue::inFitRange(" << GetName() << "): value " << value
109 // << " rounded down to max limit " << getMax(rangeName) << endl ;
110  }
111  clippedValue = max;
112  isInRange = kFALSE ;
113  }
114  // test this value against our lower fit limit
115  if(!RooNumber::isInfinite(min) && value < min-1e-6) {
116  if (clippedValPtr) {
117 // coutW(InputArguments) << "RooAbsRealLValue::inFitRange(" << GetName() << "): value " << value
118 // << " rounded up to min limit " << getMin(rangeName) << endl;
119  }
120  clippedValue = min ;
121  isInRange = kFALSE ;
122  }
123 
124  if (clippedValPtr) *clippedValPtr=clippedValue ;
125 
126  return isInRange ;
127 }
128 
129 
130 
131 ////////////////////////////////////////////////////////////////////////////////
132 /// Check if given value is valid
133 
135 {
136  if (!inRange(value,0)) {
137  if (verbose)
138  coutI(InputArguments) << "RooRealVar::isValid(" << GetName() << "): value " << value
139  << " out of range (" << getMin() << " - " << getMax() << ")" << endl ;
140  return kFALSE ;
141  }
142  return kTRUE ;
143 }
144 
145 
146 
147 ////////////////////////////////////////////////////////////////////////////////
148 /// Read object contents from given stream
149 
150 Bool_t RooAbsRealLValue::readFromStream(istream& /*is*/, Bool_t /*compact*/, Bool_t /*verbose*/)
151 {
152  return kTRUE ;
153 }
154 
155 
156 
157 ////////////////////////////////////////////////////////////////////////////////
158 /// Write object contents to given stream
159 
160 void RooAbsRealLValue::writeToStream(ostream& /*os*/, Bool_t /*compact*/) const
161 {
162 }
163 
164 
165 
166 ////////////////////////////////////////////////////////////////////////////////
167 /// Assignment operator from a Double_t
168 
170 {
171  Double_t clipValue ;
172  // Clip
173  inRange(newValue,0,&clipValue) ;
174  setVal(clipValue) ;
175 
176  return *this ;
177 }
178 
179 
180 ////////////////////////////////////////////////////////////////////////////////
181 /// Assignment operator from other RooAbsReal
182 
184 {
185  return operator=(arg.getVal()) ;
186 }
187 
188 
189 
190 ////////////////////////////////////////////////////////////////////////////////
191 
192 RooPlot* RooAbsRealLValue::frame(const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3, const RooCmdArg& arg4,
193  const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) const
194 
195  // Create a new RooPlot on the heap with a drawing frame initialized for this
196  // object, but no plot contents. Use x.frame() as the first argument to a
197  // y.plotOn(...) method, for example. The caller is responsible for deleting
198  // the returned object.
199  //
200  // This function takes the following named arguments
201  //
202  // Range(double lo, double hi) -- Make plot frame for the specified range
203  // Range(const char* name) -- Make plot frame for range with the specified name
204  // Bins(Int_t nbins) -- Set default binning for datasets to specified number of bins
205  // AutoRange(const RooAbsData& data, -- Specifies range so that all points in given data set fit
206  // double margin) inside the range with given margin.
207  // AutoSymRange(const RooAbsData& data, -- Specifies range so that all points in given data set fit
208  // double margin) inside the range and center of range coincides with mean
209  // of distribution in given dataset.
210  // Name(const char* name) -- Give specified name to RooPlot object
211  // Title(const char* title) -- Give specified title to RooPlot object
212  //
213 {
214  RooLinkedList cmdList ;
215  cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
216  cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
217  cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
218  cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ; cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;
219 
220  return frame(cmdList) ;
221 }
222 
223 
224 
225 ////////////////////////////////////////////////////////////////////////////////
226 /// Back-end function for named argument frame() method
227 
229 {
230  // Define configuration for this method
231  RooCmdConfig pc(Form("RooAbsRealLValue::frame(%s)",GetName())) ;
232  pc.defineDouble("min","Range",0,getMin()) ;
233  pc.defineDouble("max","Range",1,getMax()) ;
234  pc.defineInt("nbins","Bins",0,getBins()) ;
235  pc.defineString("rangeName","RangeWithName",0,"") ;
236  pc.defineString("name","Name",0,"") ;
237  pc.defineString("title","Title",0,"") ;
238  pc.defineMutex("Range","RangeWithName","AutoRange") ;
239  pc.defineObject("rangeData","AutoRange",0,0) ;
240  pc.defineDouble("rangeMargin","AutoRange",0,0.1) ;
241  pc.defineInt("rangeSym","AutoRange",0,0) ;
242 
243  // Process & check varargs
244  pc.process(cmdList) ;
245  if (!pc.ok(kTRUE)) {
246  return 0 ;
247  }
248 
249  // Extract values from named arguments
250  Double_t xmin(getMin()),xmax(getMax()) ;
251  if (pc.hasProcessed("Range")) {
252  xmin = pc.getDouble("min") ;
253  xmax = pc.getDouble("max") ;
254  if (xmin==xmax) {
255  xmin = getMin() ;
256  xmax = getMax() ;
257  }
258  } else if (pc.hasProcessed("RangeWithName")) {
259  const char* rangeName=pc.getString("rangeName",0,kTRUE) ;
260  xmin = getMin(rangeName) ;
261  xmax = getMax(rangeName) ;
262  } else if (pc.hasProcessed("AutoRange")) {
263  RooTreeData* rangeData = static_cast<RooTreeData*>(pc.getObject("rangeData")) ;
264  rangeData->getRange((RooRealVar&)*this,xmin,xmax) ;
265  if (pc.getInt("rangeSym")==0) {
266  // Regular mode: range is from xmin to xmax with given extra margin
267  Double_t margin = pc.getDouble("rangeMargin")*(xmax-xmin) ;
268  xmin -= margin ;
269  xmax += margin ;
270  if (xmin<getMin()) xmin = getMin() ;
271  if (xmin>getMax()) xmax = getMax() ;
272  } else {
273  // Symmetric mode: range is centered at mean of distribution with enough width to include
274  // both lowest and highest point with margin
275  Double_t dmean = rangeData->moment((RooRealVar&)*this,1) ;
276  Double_t ddelta = ((xmax-dmean)>(dmean-xmin)?(xmax-dmean):(dmean-xmin))*(1+pc.getDouble("rangeMargin")) ;
277  xmin = dmean-ddelta ;
278  xmax = dmean+ddelta ;
279  if (xmin<getMin()) xmin = getMin() ;
280  if (xmin>getMax()) xmax = getMax() ;
281  }
282  } else {
283  xmin = getMin() ;
284  xmax = getMax() ;
285  }
286 
287  Int_t nbins = pc.getInt("nbins") ;
288  const char* name = pc.getString("name",0,kTRUE) ;
289  const char* title = pc.getString("title",0,kTRUE) ;
290 
291  RooPlot* theFrame = new RooPlot(*this,xmin,xmax,nbins) ;
292 
293  if (name) {
294  theFrame->SetName(name) ;
295  }
296  if (title) {
297  theFrame->SetTitle(title) ;
298  }
299 
300  return theFrame ;
301 }
302 
303 
304 
305 ////////////////////////////////////////////////////////////////////////////////
306 /// Create a new RooPlot on the heap with a drawing frame initialized for this
307 /// object, but no plot contents. Use x.frame() as the first argument to a
308 /// y.plotOn(...) method, for example. The caller is responsible for deleting
309 /// the returned object.
310 
312 {
313  return new RooPlot(*this,xlo,xhi,nbins);
314 }
315 
316 
317 
318 ////////////////////////////////////////////////////////////////////////////////
319 /// Create a new RooPlot on the heap with a drawing frame initialized for this
320 /// object, but no plot contents. Use x.frame() as the first argument to a
321 /// y.plotOn(...) method, for example. The caller is responsible for deleting
322 /// the returned object.
323 
325 {
326  return new RooPlot(*this,xlo,xhi,getBins());
327 }
328 
329 
330 
331 ////////////////////////////////////////////////////////////////////////////////
332 /// Create a new RooPlot on the heap with a drawing frame initialized for this
333 /// object, but no plot contents. Use x.frame() as the first argument to a
334 /// y.plotOn(...) method, for example. The caller is responsible for deleting
335 /// the returned object.
336 ///
337 /// The current fit range may not be open ended or empty.
338 
340 {
341  // Plot range of variable may not be infinite or empty
342  if (getMin()==getMax()) {
343  coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: empty fit range, must specify plot range" << endl ;
344  return 0 ;
345  }
347  coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: open ended fit range, must specify plot range" << endl ;
348  return 0 ;
349  }
350 
351  return new RooPlot(*this,getMin(),getMax(),nbins);
352 }
353 
354 
355 
356 ////////////////////////////////////////////////////////////////////////////////
357 /// Create a new RooPlot on the heap with a drawing frame initialized for this
358 /// object, but no plot contents. Use x.frame() as the first argument to a
359 /// y.plotOn(...) method, for example. The caller is responsible for deleting
360 /// the returned object.
361 ///
362 /// The current fit range may not be open ended or empty.
363 
365 {
366  // Plot range of variable may not be infinite or empty
367  if (getMin()==getMax()) {
368  coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: empty fit range, must specify plot range" << endl ;
369  return 0 ;
370  }
372  coutE(InputArguments) << "RooAbsRealLValue::frame(" << GetName() << ") ERROR: open ended fit range, must specify plot range" << endl ;
373  return 0 ;
374  }
375 
376  return new RooPlot(*this,getMin(),getMax(),getBins());
377 }
378 
379 
380 
381 ////////////////////////////////////////////////////////////////////////////////
382 /// Copy cache of another RooAbsArg to our cache
383 
384 void RooAbsRealLValue::copyCache(const RooAbsArg* source, Bool_t valueOnly, Bool_t setValDirty)
385 {
386  RooAbsReal::copyCache(source,valueOnly,setValDirty) ;
387  setVal(_value) ; // force back-propagation
388 }
389 
390 
391 ////////////////////////////////////////////////////////////////////////////////
392 /// Structure printing
393 
394 void RooAbsRealLValue::printMultiline(ostream& os, Int_t contents, Bool_t verbose, TString indent) const
395 {
396  RooAbsReal::printMultiline(os,contents,verbose,indent);
397  os << indent << "--- RooAbsRealLValue ---" << endl;
398  TString unit(_unit);
399  if(!unit.IsNull()) unit.Prepend(' ');
400  os << indent << " Fit range is [ ";
401  if(hasMin()) {
402  os << getMin() << unit << " , ";
403  }
404  else {
405  os << "-INF , ";
406  }
407  if(hasMax()) {
408  os << getMax() << unit << " ]" << endl;
409  }
410  else {
411  os << "+INF ]" << endl;
412  }
413 }
414 
415 
416 
417 ////////////////////////////////////////////////////////////////////////////////
418 /// Set a new value sampled from a uniform distribution over the fit range.
419 /// Prints a warning and does nothing if the fit range is not finite.
420 
421 void RooAbsRealLValue::randomize(const char* rangeName)
422 {
423  RooAbsBinning& binning = getBinning(rangeName) ;
424  Double_t min = binning.lowBound() ;
425  Double_t max = binning.highBound() ;
426 
427  if(!RooNumber::isInfinite(min) && !RooNumber::isInfinite(max)) {
428  setValFast(min + RooRandom::uniform()*(max-min));
429  }
430  else {
431  coutE(Generation) << fName << "::" << ClassName() << ":randomize: fails with unbounded fit range" << endl;
432  }
433 }
434 
435 
436 
437 ////////////////////////////////////////////////////////////////////////////////
438 /// Set value to center of bin 'ibin' of binning 'rangeName' (or of
439 /// default binning if no range is specified)
440 
441 void RooAbsRealLValue::setBin(Int_t ibin, const char* rangeName)
442 {
443  // Check range of plot bin index
444  if (ibin<0 || ibin>=numBins(rangeName)) {
445  coutE(InputArguments) << "RooAbsRealLValue::setBin(" << GetName() << ") ERROR: bin index " << ibin
446  << " is out of range (0," << getBins(rangeName)-1 << ")" << endl ;
447  return ;
448  }
449 
450  // Set value to center of requested bin
451  setVal(getBinning(rangeName).binCenter(ibin)) ;
452 }
453 
454 
455 
456 
457 
458 ////////////////////////////////////////////////////////////////////////////////
459 /// Set value to center of bin 'ibin' of binning 'binning'
460 
461 void RooAbsRealLValue::setBin(Int_t ibin, const RooAbsBinning& binning)
462 {
463  // Set value to center of requested bin
464  setVal(binning.binCenter(ibin)) ;
465 }
466 
467 
468 
469 
470 
471 ////////////////////////////////////////////////////////////////////////////////
472 /// Set a new value sampled from a uniform distribution over the fit range.
473 /// Prints a warning and does nothing if the fit range is not finite.
474 
476 {
477  Double_t range= binning.highBound() - binning.lowBound() ;
478  setVal(binning.lowBound() + RooRandom::uniform()*range);
479 }
480 
481 
482 
483 
484 
485 ////////////////////////////////////////////////////////////////////////////////
486 /// Set value to center of bin 'ibin' of binning 'rangeName' (or of
487 /// default binning if no range is specified)
488 
490 {
491  // Set value to center of requested bin
492  setValFast(binning.binCenter(ibin)) ;
493 }
494 
495 
496 
497 ////////////////////////////////////////////////////////////////////////////////
498 /// Check if fit range is usable as plot range, i.e. it is neither
499 /// open ended, nor empty
500 
502 {
503  return (hasMin() && hasMax() && (getMin()!=getMax())) ;
504 }
505 
506 
507 
508 ////////////////////////////////////////////////////////////////////////////////
509 /// Check if current value is inside range with given name
510 
512 {
513  Double_t val = getVal() ;
514  Double_t epsilon = 1e-8 * fabs(val) ;
515  return (val >= getMin(name)-epsilon && val <= getMax(name)+epsilon) ;
516 }
517 
518 
519 
520 ////////////////////////////////////////////////////////////////////////////////
521 
522 TH1* RooAbsRealLValue::createHistogram(const char *name, const RooCmdArg& arg1, const RooCmdArg& arg2,
523  const RooCmdArg& arg3, const RooCmdArg& arg4, const RooCmdArg& arg5,
524  const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) const
525 
526  // Create an empty ROOT histogram TH1,TH2 or TH3 suitabe to store information represent by the RooAbsRealLValue
527  //
528  // This function accepts the following arguments
529  //
530  // name -- Name of the ROOT histogram
531  //
532  // Binning(const char* name) -- Apply binning with given name to x axis of histogram
533  // Binning(RooAbsBinning& binning) -- Apply specified binning to x axis of histogram
534  // Binning(int_t nbins) -- Apply specified binning to x axis of histogram
535  // Binning(int_t nbins, double lo, double hi) -- Apply specified binning to x axis of histogram
536  // ConditionalObservables(const RooArgSet& set) -- Do not normalized PDF over following observables when projecting PDF into histogram
537  //
538  // YVar(const RooAbsRealLValue& var,...) -- Observable to be mapped on y axis of ROOT histogram
539  // ZVar(const RooAbsRealLValue& var,...) -- Observable to be mapped on z axis of ROOT histogram
540  //
541  // The YVar() and ZVar() arguments can be supplied with optional Binning() arguments to control the binning of the Y and Z axes, e.g.
542  // createHistogram("histo",x,Binning(-1,1,20), YVar(y,Binning(-1,1,30)), ZVar(z,Binning("zbinning")))
543  //
544  // The caller takes ownership of the returned histogram
545 {
546  RooLinkedList l ;
547  l.Add((TObject*)&arg1) ; l.Add((TObject*)&arg2) ;
548  l.Add((TObject*)&arg3) ; l.Add((TObject*)&arg4) ;
549  l.Add((TObject*)&arg5) ; l.Add((TObject*)&arg6) ;
550  l.Add((TObject*)&arg7) ; l.Add((TObject*)&arg8) ;
551 
552  return createHistogram(name,l) ;
553 }
554 
555 
556 
557 ////////////////////////////////////////////////////////////////////////////////
558 /// Create empty 1,2 or 3D histogram
559 /// Arguments recognized
560 ///
561 /// YVar() -- RooRealVar defining Y dimension with optional range/binning
562 /// ZVar() -- RooRealVar defining Z dimension with optional range/binning
563 /// AxisLabel() -- Vertical axis label
564 /// Binning() -- Range/Binning specification of X axis
565 
566 TH1* RooAbsRealLValue::createHistogram(const char *name, const RooLinkedList& cmdList) const
567 {
568  // Define configuration for this method
569  RooCmdConfig pc(Form("RooAbsRealLValue::createHistogram(%s)",GetName())) ;
570 
571  pc.defineObject("xbinning","Binning",0,0) ;
572  pc.defineString("xbinningName","BinningName",0,"") ;
573  pc.defineInt("nxbins","BinningSpec",0) ;
574  pc.defineDouble("xlo","BinningSpec",0,0) ;
575  pc.defineDouble("xhi","BinningSpec",1,0) ;
576 
577  pc.defineObject("yvar","YVar",0,0) ;
578  pc.defineObject("ybinning","YVar::Binning",0,0) ;
579  pc.defineString("ybinningName","YVar::BinningName",0,"") ;
580  pc.defineInt("nybins","YVar::BinningSpec",0) ;
581  pc.defineDouble("ylo","YVar::BinningSpec",0,0) ;
582  pc.defineDouble("yhi","YVar::BinningSpec",1,0) ;
583 
584  pc.defineObject("zvar","ZVar",0,0) ;
585  pc.defineObject("zbinning","ZVar::Binning",0,0) ;
586  pc.defineString("zbinningName","ZVar::BinningName",0,"") ;
587  pc.defineInt("nzbins","ZVar::BinningSpec",0) ;
588  pc.defineDouble("zlo","ZVar::BinningSpec",0,0) ;
589  pc.defineDouble("zhi","ZVar::BinningSpec",1,0) ;
590 
591  pc.defineString("axisLabel","AxisLabel",0,"Events") ;
592 
593  pc.defineDependency("ZVar","YVar") ;
594 
595  // Process & check varargs
596  pc.process(cmdList) ;
597  if (!pc.ok(kTRUE)) {
598  return 0 ;
599  }
600 
601  // Initialize arrays for call to implementation version of createHistogram
602  const char* axisLabel = pc.getString("axisLabel") ;
603  const RooAbsBinning* binning[3] ;
604  Bool_t ownBinning[3] = { kFALSE, kFALSE, kFALSE } ;
605  RooArgList vars ;
606 
607  // Prepare X dimension
608  vars.add(*this) ;
609  if (pc.hasProcessed("Binning")) {
610  binning[0] = static_cast<RooAbsBinning*>(pc.getObject("xbinning")) ;
611  } else if (pc.hasProcessed("BinningName")) {
612  binning[0] = &getBinning(pc.getString("xbinningName",0,kTRUE)) ;
613  } else if (pc.hasProcessed("BinningSpec")) {
614  Double_t xlo = pc.getDouble("xlo") ;
615  Double_t xhi = pc.getDouble("xhi") ;
616  binning[0] = new RooUniformBinning((xlo==xhi)?getMin():xlo,(xlo==xhi)?getMax():xhi,pc.getInt("nxbins")) ;
617  ownBinning[0] = kTRUE ;
618  } else {
619  binning[0] = &getBinning() ;
620  }
621 
622  if (pc.hasProcessed("YVar")) {
623  RooAbsRealLValue& yvar = *static_cast<RooAbsRealLValue*>(pc.getObject("yvar")) ;
624  vars.add(yvar) ;
625  if (pc.hasProcessed("YVar::Binning")) {
626  binning[1] = static_cast<RooAbsBinning*>(pc.getObject("ybinning")) ;
627  } else if (pc.hasProcessed("YVar::BinningName")) {
628  binning[1] = &yvar.getBinning(pc.getString("ybinningName",0,kTRUE)) ;
629  } else if (pc.hasProcessed("YVar::BinningSpec")) {
630  Double_t ylo = pc.getDouble("ylo") ;
631  Double_t yhi = pc.getDouble("yhi") ;
632  binning[1] = new RooUniformBinning((ylo==yhi)?yvar.getMin():ylo,(ylo==yhi)?yvar.getMax():yhi,pc.getInt("nybins")) ;
633  ownBinning[1] = kTRUE ;
634  } else {
635  binning[1] = &yvar.getBinning() ;
636  }
637  }
638 
639  if (pc.hasProcessed("ZVar")) {
640  RooAbsRealLValue& zvar = *static_cast<RooAbsRealLValue*>(pc.getObject("zvar")) ;
641  vars.add(zvar) ;
642  if (pc.hasProcessed("ZVar::Binning")) {
643  binning[2] = static_cast<RooAbsBinning*>(pc.getObject("zbinning")) ;
644  } else if (pc.hasProcessed("ZVar::BinningName")) {
645  binning[2] = &zvar.getBinning(pc.getString("zbinningName",0,kTRUE)) ;
646  } else if (pc.hasProcessed("ZVar::BinningSpec")) {
647  Double_t zlo = pc.getDouble("zlo") ;
648  Double_t zhi = pc.getDouble("zhi") ;
649  binning[2] = new RooUniformBinning((zlo==zhi)?zvar.getMin():zlo,(zlo==zhi)?zvar.getMax():zhi,pc.getInt("nzbins")) ;
650  ownBinning[2] = kTRUE ;
651  } else {
652  binning[2] = &zvar.getBinning() ;
653  }
654  }
655 
656 
657  TH1* ret = createHistogram(name, vars, axisLabel, binning) ;
658 
659  if (ownBinning[0]) delete binning[0] ;
660  if (ownBinning[1]) delete binning[1] ;
661  if (ownBinning[2]) delete binning[2] ;
662 
663  return ret ;
664 }
665 
666 
667 
668 ////////////////////////////////////////////////////////////////////////////////
669 /// Create an empty 1D-histogram with appropriate scale and labels for this variable.
670 /// This method uses the default plot range which can be changed using the
671 /// setPlotMin(),setPlotMax() methods, and the default binning which can be
672 /// changed with setPlotBins(). The caller takes ownership of the returned
673 /// object and is responsible for deleting it.
674 
675 TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel) const
676 {
677  // Check if the fit range is usable as plot range
678  if (!fitRangeOKForPlotting()) {
679  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
680  << ") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
681  return 0 ;
682  }
683 
684  RooArgList list(*this) ;
685  Double_t xlo = getMin() ;
686  Double_t xhi = getMax() ;
687  Int_t nbins = getBins() ;
688 
689  // coverity[ARRAY_VS_SINGLETON]
690  return (TH1F*)createHistogram(name, list, yAxisLabel, &xlo, &xhi, &nbins);
691 }
692 
693 
694 
695 ////////////////////////////////////////////////////////////////////////////////
696 /// Create an empty 1D-histogram with appropriate scale and labels for this variable.
697 /// This method uses the default plot range which can be changed using the
698 /// setPlotMin(),setPlotMax() methods, and the default binning which can be
699 /// changed with setPlotBins(). The caller takes ownership of the returned
700 /// object and is responsible for deleting it.
701 
702 TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel, Double_t xlo, Double_t xhi, Int_t nBins) const
703 {
704  RooArgList list(*this) ;
705 
706  // coverity[ARRAY_VS_SINGLETON]
707  return (TH1F*)createHistogram(name, list, yAxisLabel, &xlo, &xhi, &nBins);
708 }
709 
710 
711 
712 ////////////////////////////////////////////////////////////////////////////////
713 /// Create an empty 1D-histogram with appropriate scale and labels for this variable.
714 
715 TH1F *RooAbsRealLValue::createHistogram(const char *name, const char *yAxisLabel, const RooAbsBinning& bins) const
716 {
717  RooArgList list(*this) ;
718  const RooAbsBinning* pbins = &bins ;
719 
720  // coverity[ARRAY_VS_SINGLETON]
721  return (TH1F*)createHistogram(name, list, yAxisLabel, &pbins);
722 }
723 
724 
725 
726 ////////////////////////////////////////////////////////////////////////////////
727 /// Create an empty 2D-histogram with appropriate scale and labels for this variable (x)
728 /// and the specified y variable. This method uses the default plot ranges for x and y which
729 /// can be changed using the setPlotMin(),setPlotMax() methods, and the default binning which
730 /// can be changed with setPlotBins(). The caller takes ownership of the returned object
731 /// and is responsible for deleting it.
732 
733 TH2F *RooAbsRealLValue::createHistogram(const char *name, const RooAbsRealLValue &yvar, const char *zAxisLabel,
734  Double_t* xlo, Double_t* xhi, Int_t* nBins) const
735 {
736  if ((!xlo && xhi) || (xlo && !xhi)) {
737  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
738  << ") ERROR must specify either no range, or both limits" << endl ;
739  return 0 ;
740  }
741 
742  Double_t xlo_fit[2] ;
743  Double_t xhi_fit[2] ;
744  Int_t nbins_fit[2] ;
745 
746  Double_t *xlo2 = xlo;
747  Double_t *xhi2 = xhi;
748  Int_t *nBins2 = nBins;
749 
750  if (!xlo2) {
751 
752  if (!fitRangeOKForPlotting()) {
753  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
754  << ") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
755  return 0 ;
756  }
757  if (!yvar.fitRangeOKForPlotting()) {
758  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
759  << ") ERROR: fit range of " << yvar.GetName() << " empty or open ended, must explicitly specify range" << endl ;
760  return 0 ;
761  }
762 
763  xlo_fit[0] = getMin() ;
764  xhi_fit[0] = getMax() ;
765 
766  xlo_fit[1] = yvar.getMin() ;
767  xhi_fit[1] = yvar.getMax() ;
768 
769  xlo2 = xlo_fit ;
770  xhi2 = xhi_fit ;
771  }
772 
773  if (!nBins2) {
774  nbins_fit[0] = getBins() ;
775  nbins_fit[1] = yvar.getBins() ;
776  nBins2 = nbins_fit ;
777  }
778 
779 
780  RooArgList list(*this,yvar) ;
781  // coverity[OVERRUN_STATIC]
782  return (TH2F*)createHistogram(name, list, zAxisLabel, xlo2, xhi2, nBins2);
783 }
784 
785 
786 
787 ////////////////////////////////////////////////////////////////////////////////
788 /// Create an empty 2D-histogram with appropriate scale and labels for this variable (x)
789 /// and the specified y variable.
790 
792  const char *zAxisLabel, const RooAbsBinning** bins) const
793 {
794  RooArgList list(*this,yvar) ;
795  return (TH2F*)createHistogram(name, list, zAxisLabel, bins);
796 }
797 
798 
799 
800 ////////////////////////////////////////////////////////////////////////////////
801 /// Create an empty 3D-histogram with appropriate scale and labels for this variable (x)
802 /// and the specified y,z variables. This method uses the default plot ranges for x,y,z which
803 /// can be changed using the setPlotMin(),setPlotMax() methods, and the default binning which
804 /// can be changed with setPlotBins(). The caller takes ownership of the returned object
805 /// and is responsible for deleting it.
806 
808  const char *tAxisLabel, Double_t* xlo, Double_t* xhi, Int_t* nBins) const
809 {
810  if ((!xlo && xhi) || (xlo && !xhi)) {
811  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
812  << ") ERROR must specify either no range, or both limits" << endl ;
813  return 0 ;
814  }
815 
816  Double_t xlo_fit[3] ;
817  Double_t xhi_fit[3] ;
818  Int_t nbins_fit[3] ;
819 
820  Double_t *xlo2 = xlo;
821  Double_t *xhi2 = xhi;
822  Int_t* nBins2 = nBins;
823  if (!xlo2) {
824 
825  if (!fitRangeOKForPlotting()) {
826  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
827  << ") ERROR: fit range empty or open ended, must explicitly specify range" << endl ;
828  return 0 ;
829  }
830  if (!yvar.fitRangeOKForPlotting()) {
831  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
832  << ") ERROR: fit range of " << yvar.GetName() << " empty or open ended, must explicitly specify range" << endl ;
833  return 0 ;
834  }
835  if (!zvar.fitRangeOKForPlotting()) {
836  coutE(InputArguments) << "RooAbsRealLValue::createHistogram(" << GetName()
837  << ") ERROR: fit range of " << zvar.GetName() << " empty or open ended, must explicitly specify range" << endl ;
838  return 0 ;
839  }
840 
841  xlo_fit[0] = getMin() ;
842  xhi_fit[0] = getMax() ;
843 
844  xlo_fit[1] = yvar.getMin() ;
845  xhi_fit[1] = yvar.getMax() ;
846 
847  xlo_fit[2] = zvar.getMin() ;
848  xhi_fit[2] = zvar.getMax() ;
849 
850  xlo2 = xlo_fit ;
851  xhi2 = xhi_fit ;
852  }
853 
854  if (!nBins2) {
855  nbins_fit[0] = getBins() ;
856  nbins_fit[1] = yvar.getBins() ;
857  nbins_fit[2] = zvar.getBins() ;
858  nBins2 = nbins_fit ;
859  }
860 
861  RooArgList list(*this,yvar,zvar) ;
862  return (TH3F*)createHistogram(name, list, tAxisLabel, xlo2, xhi2, nBins2);
863 }
864 
865 
867  const char* tAxisLabel, const RooAbsBinning** bins) const
868 {
869  // Create an empty 3D-histogram with appropriate scale and labels for this variable (x)
870  // and the specified y,z variables.
871 
872  RooArgList list(*this,yvar,zvar) ;
873  return (TH3F*)createHistogram(name, list, tAxisLabel, bins);
874 }
875 
876 
877 
878 
879 ////////////////////////////////////////////////////////////////////////////////
880 /// Create 1-, 2- or 3-d ROOT histogram with labels taken
881 /// from the variables in 'vars' and the with range and binning
882 /// specified in xlo,xhi and nBins. The dimensions of the arrays xlo,xhi,
883 /// nBins should match the number of objects in vars.
884 
885 TH1 *RooAbsRealLValue::createHistogram(const char *name, RooArgList &vars, const char *tAxisLabel,
886  Double_t* xlo, Double_t* xhi, Int_t* nBins)
887 {
888  const RooAbsBinning* bin[3] ;
889  Int_t ndim = vars.getSize() ;
890  bin[0] = new RooUniformBinning(xlo[0],xhi[0],nBins[0]) ;
891  bin[1] = (ndim>1) ? new RooUniformBinning(xlo[1],xhi[1],nBins[1]) : 0 ;
892  bin[2] = (ndim>2) ? new RooUniformBinning(xlo[2],xhi[2],nBins[2]) : 0 ;
893 
894  TH1* ret = createHistogram(name,vars,tAxisLabel,bin) ;
895 
896  if (bin[0]) delete bin[0] ;
897  if (bin[1]) delete bin[1] ;
898  if (bin[2]) delete bin[2] ;
899  return ret ;
900 }
901 
902 
903 
904 ////////////////////////////////////////////////////////////////////////////////
905 /// Create a 1,2, or 3D-histogram with appropriate scale and labels.
906 /// Binning and ranges are taken from the variables themselves and can be changed by
907 /// calling their setPlotMin/Max() and setPlotBins() methods. A histogram can be filled
908 /// using RooAbsReal::fillHistogram() or RooTreeData::fillHistogram().
909 /// The caller takes ownership of the returned object and is responsible for deleting it.
910 
911 TH1 *RooAbsRealLValue::createHistogram(const char *name, RooArgList &vars, const char *tAxisLabel, const RooAbsBinning** bins)
912 {
913  // Check that we have 1-3 vars
914  Int_t dim= vars.getSize();
915  if(dim < 1 || dim > 3) {
916  oocoutE((TObject*)0,InputArguments) << "RooAbsReal::createHistogram: dimension not supported: " << dim << endl;
917  return 0;
918  }
919 
920  // Check that all variables are AbsReals and prepare a name of the form <name>_<var1>_...
921  TString histName(name);
922  histName.Append("_");
923  const RooAbsRealLValue *xyz[3];
924 
925  Int_t index;
926  for(index= 0; index < dim; index++) {
927  const RooAbsArg *arg= vars.at(index);
928  xyz[index]= dynamic_cast<const RooAbsRealLValue*>(arg);
929  if(!xyz[index]) {
930  oocoutE((TObject*)0,InputArguments) << "RooAbsRealLValue::createHistogram: variable is not real lvalue: " << arg->GetName() << endl;
931  return 0;
932  }
933  histName.Append("_");
934  histName.Append(arg->GetName());
935  }
936  TString histTitle(histName);
937  histTitle.Prepend("Histogram of ");
938 
939  // Create the histogram
940  TH1 *histogram = 0;
941  switch(dim) {
942  case 1:
943  if (bins[0]->isUniform()) {
944  histogram= new TH1F(histName.Data(), histTitle.Data(),
945  bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound());
946  } else {
947  histogram= new TH1F(histName.Data(), histTitle.Data(),
948  bins[0]->numBins(),bins[0]->array());
949  }
950  break;
951  case 2:
952  if (bins[0]->isUniform() && bins[1]->isUniform()) {
953  histogram= new TH2F(histName.Data(), histTitle.Data(),
954  bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound(),
955  bins[1]->numBins(),bins[1]->lowBound(),bins[1]->highBound());
956  } else {
957  histogram= new TH2F(histName.Data(), histTitle.Data(),
958  bins[0]->numBins(),bins[0]->array(),
959  bins[1]->numBins(),bins[1]->array());
960  }
961  break;
962  case 3:
963  if (bins[0]->isUniform() && bins[1]->isUniform() && bins[2]->isUniform()) {
964  histogram= new TH3F(histName.Data(), histTitle.Data(),
965  bins[0]->numBins(),bins[0]->lowBound(),bins[0]->highBound(),
966  bins[1]->numBins(),bins[1]->lowBound(),bins[1]->highBound(),
967  bins[2]->numBins(),bins[2]->lowBound(),bins[2]->highBound()) ;
968  } else {
969  histogram= new TH3F(histName.Data(), histTitle.Data(),
970  bins[0]->numBins(),bins[0]->array(),
971  bins[1]->numBins(),bins[1]->array(),
972  bins[2]->numBins(),bins[2]->array()) ;
973  }
974  break;
975  }
976  if(!histogram) {
977  oocoutE((TObject*)0,InputArguments) << "RooAbsReal::createHistogram: unable to create a new histogram" << endl;
978  return 0;
979  }
980 
981  // Set the histogram coordinate axis labels from the titles of each variable, adding units if necessary.
982  for(index= 0; index < dim; index++) {
983  TString axisTitle(xyz[index]->getTitle(kTRUE));
984  switch(index) {
985  case 0:
986  histogram->SetXTitle(axisTitle.Data());
987  break;
988  case 1:
989  histogram->SetYTitle(axisTitle.Data());
990  break;
991  case 2:
992  histogram->SetZTitle(axisTitle.Data());
993  break;
994  default:
995  assert(0);
996  break;
997  }
998  }
999 
1000  // Set the t-axis title if given one
1001  if((0 != tAxisLabel) && (0 != strlen(tAxisLabel))) {
1002  TString axisTitle(tAxisLabel);
1003  axisTitle.Append(" / ( ");
1004  for(Int_t index2= 0; index2 < dim; index2++) {
1005  Double_t delta= bins[index2]->averageBinWidth() ; // xyz[index2]->getBins();
1006  if(index2 > 0) axisTitle.Append(" x ");
1007  axisTitle.Append(Form("%g",delta));
1008  if(strlen(xyz[index2]->getUnit())) {
1009  axisTitle.Append(" ");
1010  axisTitle.Append(xyz[index2]->getUnit());
1011  }
1012  }
1013  axisTitle.Append(" )");
1014  switch(dim) {
1015  case 1:
1016  histogram->SetYTitle(axisTitle.Data());
1017  break;
1018  case 2:
1019  histogram->SetZTitle(axisTitle.Data());
1020  break;
1021  case 3:
1022  // not supported in TH1
1023  break;
1024  default:
1025  assert(0);
1026  break;
1027  }
1028  }
1029 
1030  return histogram;
1031 }
1032 
1033 
1035 {
1036  // Interface function to indicate that this lvalue
1037  // has a unit or constant jacobian terms with respect to
1038  // the observable passed as argument. This default implementation
1039  // always returns true (i.e. jacobian is constant)
1040  return kTRUE ;
1041 }
virtual Bool_t isUniform() const
Definition: RooAbsBinning.h:48
virtual Double_t getMin(const char *name=0) const
virtual void SetZTitle(const char *title)
Definition: TH1.h:407
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void setBin(Int_t ibin, const char *rangeName=0)
Set value to center of bin &#39;ibin&#39; of binning &#39;rangeName&#39; (or of default binning if no range is specif...
virtual ~RooAbsRealLValue()
Destructor.
#define coutE(a)
Definition: RooMsgService.h:34
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
float xmin
Definition: THbookFile.cxx:93
Bool_t hasMin(const char *name=0) const
virtual void setValFast(Double_t value)
virtual Double_t getMax(const char *name=0) const
const Text_t * getUnit() const
Definition: RooAbsReal.h:83
virtual void randomize(const char *rangeName=0)
Set a new value sampled from a uniform distribution over the fit range.
void SetName(const char *name)
Set the name of the RooPlot to &#39;name&#39;.
Definition: RooPlot.cxx:1076
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name &#39;name&#39; mapped to Double_t in slot &#39;doubleNum&#39; in RooCmdArg with name ar...
3-D histogram with a float per channel (see TH1 documentation)}
Definition: TH3.h:267
#define coutI(a)
Definition: RooMsgService.h:31
virtual Int_t numBins(const char *rangeName=0) const
const char * getString(const char *name, const char *defaultValue="", Bool_t convEmptyToNull=kFALSE)
Return string property registered with name &#39;name&#39;.
Double_t getVal(const RooArgSet *set=0) const
Definition: RooAbsReal.h:64
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
Definition: THist.hxx:285
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
Bool_t hasMax(const char *name=0) const
TString getTitle(Bool_t appendUnit=kFALSE) const
Return this variable&#39;s title string.
Definition: RooAbsReal.cxx:229
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
Definition: RooAbsReal.cxx:422
RooTreeData is the abstract base class for data collection that use a TTree as internal storage mecha...
Definition: RooTreeData.h:25
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:567
int Int_t
Definition: RtypesCore.h:41
virtual void SetYTitle(const char *title)
Definition: TH1.h:406
bool Bool_t
Definition: RtypesCore.h:59
static Int_t isInfinite(Double_t x)
Return true if x is infinite by RooNumBer internal specification.
Definition: RooNumber.cxx:58
void SetTitle(const char *name)
Set the title of the RooPlot to &#39;title&#39;.
Definition: RooPlot.cxx:1098
STL namespace.
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name &#39;name&#39;.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy the cached value of another RooAbsArg to our cache.
Bool_t getRange(RooRealVar &var, Double_t &lowest, Double_t &highest, Double_t marginFrac=0, Bool_t symMode=kFALSE) const
Fill Doubles &#39;lowest&#39; and &#39;highest&#39; with the lowest and highest value of observable &#39;var&#39; in this dat...
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
Bool_t fitRangeOKForPlotting() const
Check if fit range is usable as plot range, i.e.
TH1 * createHistogram(const char *name, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
#define oocoutE(o, a)
Definition: RooMsgService.h:47
virtual void setBinFast(Int_t ibin, const RooAbsBinning &binning)
Set value to center of bin &#39;ibin&#39; of binning &#39;rangeName&#39; (or of default binning if no range is specif...
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name &#39;name&#39; mapped to Double_t in slot &#39;stringNum&#39; in RooCmdArg with name ar...
RooPlot * frame() const
Create a new RooPlot on the heap with a drawing frame initialized for this object, but no plot contents.
virtual Double_t highBound() const =0
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
virtual RooAbsArg & operator=(const RooAbsReal &other)
Assignment operator from other RooAbsReal.
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name &#39;name&#39; mapped to integer in slot &#39;intNum&#39; in RooCmdArg with name argName...
RooRealVar represents a fundamental (non-derived) real valued object.
Definition: RooRealVar.h:36
virtual void Add(TObject *arg)
Definition: RooLinkedList.h:62
Int_t getSize() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name &#39;name&#39;.
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
Check if given value is valid.
RooAbsArg * at(Int_t idx) const
Definition: RooArgList.h:84
2-D histogram with a float per channel (see TH1 documentation)}
Definition: TH2.h:250
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
char * Form(const char *fmt,...)
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
virtual Double_t lowBound() const =0
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
Definition: RooCmdConfig.h:27
float xmax
Definition: THbookFile.cxx:93
TString fName
Definition: TNamed.h:32
REAL epsilon
Definition: triangle.c:617
virtual void setVal(Double_t value)=0
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
Definition: RooPlot.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:35
virtual Bool_t isJacobianOK(const RooArgSet &depList) const
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
RooUniformBinning is an implementation of RooAbsBinning that provides a uniform binning in &#39;n&#39; bins b...
#define ClassImp(name)
Definition: Rtypes.h:359
static Double_t uniform(TRandom *generator=randomGenerator())
Return a number uniformly distributed from (0,1)
Definition: RooRandom.cxx:84
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual Double_t binCenter(Int_t bin) const =0
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name &#39;name&#39;.
The TH1 histogram class.
Definition: TH1.h:56
Double_t moment(RooRealVar &var, Double_t order, const char *cutSpec=0, const char *cutRange=0) const
Calculate moment < (X - <X>)^n > where n = order.
Definition: RooAbsData.cxx:857
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Definition: TRolke.cxx:630
Int_t numBins() const
Definition: RooAbsBinning.h:37
virtual Bool_t inRange(const char *name) const
Check if current value is inside range with given name.
Double_t _value
Definition: RooAbsReal.h:389
THist< 3, float, THistStatContent, THistStatUncertainty > TH3F
Definition: THist.hxx:297
Mother of all ROOT objects.
Definition: TObject.h:37
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name &#39;cmdName&#39; has been processed.
virtual void SetXTitle(const char *title)
Definition: TH1.h:405
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
auto * l
Definition: textangle.C:4
void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)
Copy cache of another RooAbsArg to our cache.
static constexpr double pc
virtual Double_t * array() const =0
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
Define TObject property name &#39;name&#39; mapped to object in slot &#39;setNum&#39; in RooCmdArg with name argName ...
virtual Int_t getBins(const char *name=0) const
Abstract base class for objects that are lvalues, i.e.
Definition: RooAbsLValue.h:26
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
virtual Double_t averageBinWidth() const =0
THist< 2, float, THistStatContent, THistStatUncertainty > TH2F
Definition: THist.hxx:291
const Bool_t kTRUE
Definition: RtypesCore.h:87
char name[80]
Definition: TGX11.cxx:109
TString _unit
Definition: RooAbsReal.h:390
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:27