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