Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooUnblindPrecision.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitModels *
4  * @(#)root/roofit:$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 /** \class RooUnblindPrecision
18  \ingroup Roofit
19 
20 Implementation of BlindTools' precision blinding method
21 A RooUnblindPrecision object is a real valued function
22 object, constructed from a blind value holder and a
23 set of unblinding parameters. When supplied to a PDF
24 in lieu of a regular parameter, the blind value holder
25 supplied to the unblinded objects will in a fit be minimized
26 to blind value corresponding to the actual minimum of the
27 parameter. The transformation is chosen such that the
28 the error on the blind parameters is identical to that
29 of the unblind parameter
30 **/
31 
32 #include "RooFit.h"
33 
34 #include "RooArgSet.h"
35 #include "RooArgSet.h"
36 #include "RooUnblindPrecision.h"
37 
38 
39 using namespace std;
40 
41 ClassImp(RooUnblindPrecision);
42 
43 ////////////////////////////////////////////////////////////////////////////////
44 /// Default constructor
45 
46 RooUnblindPrecision::RooUnblindPrecision()
47 {
48 }
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters
52 
53 RooUnblindPrecision::RooUnblindPrecision(const char *name, const char *title,
54  const char *blindString, Double_t centralValue,
55  Double_t scale, RooAbsReal& value,
56  Bool_t sin2betaMode)
57  : RooAbsHiddenReal(name,title),
58  _value("value","Precision blinded value",this,value),
59  _blindEngine(blindString,RooBlindTools::full,centralValue,scale,sin2betaMode)
60 {
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters
65 
66 RooUnblindPrecision::RooUnblindPrecision(const char *name, const char *title,
67  const char *blindString, Double_t centralValue,
68  Double_t scale, RooAbsReal& value, RooAbsCategory& blindState,
69  Bool_t sin2betaMode)
70  : RooAbsHiddenReal(name,title,blindState),
71  _value("value","Precision blinded value",this,value),
72  _blindEngine(blindString,RooBlindTools::full,centralValue,scale,sin2betaMode)
73 {
74 }
75 
76 ////////////////////////////////////////////////////////////////////////////////
77 /// Copy constructor
78 
79 RooUnblindPrecision::RooUnblindPrecision(const RooUnblindPrecision& other, const char* name) :
80  RooAbsHiddenReal(other, name),
81  _value("asym",this,other._value),
82  _blindEngine(other._blindEngine)
83 {
84 }
85 
86 ////////////////////////////////////////////////////////////////////////////////
87 /// Destructor
88 
89 RooUnblindPrecision::~RooUnblindPrecision()
90 {
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// Evaluate RooBlindTools unhide-precision method on blind value
95 
96 Double_t RooUnblindPrecision::evaluate() const
97 {
98  if (isHidden()) {
99  // Blinding active for this event
100  return _blindEngine.UnHidePrecision(_value);
101  } else {
102  // Blinding not active for this event
103  return _value ;
104  }
105 }