/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitModels                                                     *
 * @(#)root/roofit:$Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
//
// BEGIN_HTML
// Implementation of BlindTools' offset blinding method
// A RooUnblindOffset object is a real valued function
// object, constructed from a blind value holder and a 
// set of unblinding parameters. When supplied to a PDF
// in lieu of a regular parameter, the blind value holder
// supplied to the unblinder objects will in a fit be minimized 
// to blind value corresponding to the actual minimum of the
// parameter. The transformation is chosen such that the
// the error on the blind parameters is indentical to that
// of the unblind parameter
// END_HTML
//

#include "RooFit.h"

#include "RooArgSet.h"
#include "RooArgSet.h"
#include "RooUnblindOffset.h"


using namespace std;

ClassImp(RooUnblindOffset)
;



//_____________________________________________________________________________
RooUnblindOffset::RooUnblindOffset() 
{
  // Default constructor
}



//_____________________________________________________________________________
RooUnblindOffset::RooUnblindOffset(const char *name, const char *title,
					 const char *blindString, Double_t scale, RooAbsReal& cpasym)
  : RooAbsHiddenReal(name,title), 
  _value("value","Offset blinded value",this,cpasym),
  _blindEngine(blindString,RooBlindTools::full,0.,scale) 
{  
  // Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters
}


//_____________________________________________________________________________
RooUnblindOffset::RooUnblindOffset(const char *name, const char *title,
				   const char *blindString, Double_t scale, RooAbsReal& cpasym,
				   RooAbsCategory& blindState)
  : RooAbsHiddenReal(name,title,blindState),
    _value("value","Offset blinded value",this,cpasym), 
    _blindEngine(blindString,RooBlindTools::full,0.,scale)
{  
  // Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters
}



//_____________________________________________________________________________
RooUnblindOffset::RooUnblindOffset(const RooUnblindOffset& other, const char* name) : 
  RooAbsHiddenReal(other, name), 
  _value("asym",this,other._value),
  _blindEngine(other._blindEngine) 
{
  // Copy constructor

}



//_____________________________________________________________________________
RooUnblindOffset::~RooUnblindOffset() 
{
  // Destructor
}



//_____________________________________________________________________________
Double_t RooUnblindOffset::evaluate() const
{
  // Evaluate RooBlindTools unhide-offset method on blind value

  if (isHidden()) {
    // Blinding is active for this event
    return _blindEngine.UnHideOffset(_value);
  } else {
    // Blinding is not active for this event
    return _value ;
  }
}





 RooUnblindOffset.cxx:1
 RooUnblindOffset.cxx:2
 RooUnblindOffset.cxx:3
 RooUnblindOffset.cxx:4
 RooUnblindOffset.cxx:5
 RooUnblindOffset.cxx:6
 RooUnblindOffset.cxx:7
 RooUnblindOffset.cxx:8
 RooUnblindOffset.cxx:9
 RooUnblindOffset.cxx:10
 RooUnblindOffset.cxx:11
 RooUnblindOffset.cxx:12
 RooUnblindOffset.cxx:13
 RooUnblindOffset.cxx:14
 RooUnblindOffset.cxx:15
 RooUnblindOffset.cxx:16
 RooUnblindOffset.cxx:17
 RooUnblindOffset.cxx:18
 RooUnblindOffset.cxx:19
 RooUnblindOffset.cxx:20
 RooUnblindOffset.cxx:21
 RooUnblindOffset.cxx:22
 RooUnblindOffset.cxx:23
 RooUnblindOffset.cxx:24
 RooUnblindOffset.cxx:25
 RooUnblindOffset.cxx:26
 RooUnblindOffset.cxx:27
 RooUnblindOffset.cxx:28
 RooUnblindOffset.cxx:29
 RooUnblindOffset.cxx:30
 RooUnblindOffset.cxx:31
 RooUnblindOffset.cxx:32
 RooUnblindOffset.cxx:33
 RooUnblindOffset.cxx:34
 RooUnblindOffset.cxx:35
 RooUnblindOffset.cxx:36
 RooUnblindOffset.cxx:37
 RooUnblindOffset.cxx:38
 RooUnblindOffset.cxx:39
 RooUnblindOffset.cxx:40
 RooUnblindOffset.cxx:41
 RooUnblindOffset.cxx:42
 RooUnblindOffset.cxx:43
 RooUnblindOffset.cxx:44
 RooUnblindOffset.cxx:45
 RooUnblindOffset.cxx:46
 RooUnblindOffset.cxx:47
 RooUnblindOffset.cxx:48
 RooUnblindOffset.cxx:49
 RooUnblindOffset.cxx:50
 RooUnblindOffset.cxx:51
 RooUnblindOffset.cxx:52
 RooUnblindOffset.cxx:53
 RooUnblindOffset.cxx:54
 RooUnblindOffset.cxx:55
 RooUnblindOffset.cxx:56
 RooUnblindOffset.cxx:57
 RooUnblindOffset.cxx:58
 RooUnblindOffset.cxx:59
 RooUnblindOffset.cxx:60
 RooUnblindOffset.cxx:61
 RooUnblindOffset.cxx:62
 RooUnblindOffset.cxx:63
 RooUnblindOffset.cxx:64
 RooUnblindOffset.cxx:65
 RooUnblindOffset.cxx:66
 RooUnblindOffset.cxx:67
 RooUnblindOffset.cxx:68
 RooUnblindOffset.cxx:69
 RooUnblindOffset.cxx:70
 RooUnblindOffset.cxx:71
 RooUnblindOffset.cxx:72
 RooUnblindOffset.cxx:73
 RooUnblindOffset.cxx:74
 RooUnblindOffset.cxx:75
 RooUnblindOffset.cxx:76
 RooUnblindOffset.cxx:77
 RooUnblindOffset.cxx:78
 RooUnblindOffset.cxx:79
 RooUnblindOffset.cxx:80
 RooUnblindOffset.cxx:81
 RooUnblindOffset.cxx:82
 RooUnblindOffset.cxx:83
 RooUnblindOffset.cxx:84
 RooUnblindOffset.cxx:85
 RooUnblindOffset.cxx:86
 RooUnblindOffset.cxx:87
 RooUnblindOffset.cxx:88
 RooUnblindOffset.cxx:89
 RooUnblindOffset.cxx:90
 RooUnblindOffset.cxx:91
 RooUnblindOffset.cxx:92
 RooUnblindOffset.cxx:93
 RooUnblindOffset.cxx:94
 RooUnblindOffset.cxx:95
 RooUnblindOffset.cxx:96
 RooUnblindOffset.cxx:97
 RooUnblindOffset.cxx:98
 RooUnblindOffset.cxx:99
 RooUnblindOffset.cxx:100
 RooUnblindOffset.cxx:101
 RooUnblindOffset.cxx:102
 RooUnblindOffset.cxx:103
 RooUnblindOffset.cxx:104
 RooUnblindOffset.cxx:105
 RooUnblindOffset.cxx:106
 RooUnblindOffset.cxx:107
 RooUnblindOffset.cxx:108
 RooUnblindOffset.cxx:109
 RooUnblindOffset.cxx:110
 RooUnblindOffset.cxx:111
 RooUnblindOffset.cxx:112
 RooUnblindOffset.cxx:113
 RooUnblindOffset.cxx:114
 RooUnblindOffset.cxx:115
 RooUnblindOffset.cxx:116