00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitModels * 00004 * @(#)root/roofit:$Id: RooUnblindOffset.cxx 24286 2008-06-16 15:47:04Z wouter $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 00017 ////////////////////////////////////////////////////////////////////////////// 00018 // 00019 // BEGIN_HTML 00020 // Implementation of BlindTools' offset blinding method 00021 // A RooUnblindOffset object is a real valued function 00022 // object, constructed from a blind value holder and a 00023 // set of unblinding parameters. When supplied to a PDF 00024 // in lieu of a regular parameter, the blind value holder 00025 // supplied to the unblinder objects will in a fit be minimized 00026 // to blind value corresponding to the actual minimum of the 00027 // parameter. The transformation is chosen such that the 00028 // the error on the blind parameters is indentical to that 00029 // of the unblind parameter 00030 // END_HTML 00031 // 00032 00033 #include "RooFit.h" 00034 00035 #include "RooArgSet.h" 00036 #include "RooArgSet.h" 00037 #include "RooUnblindOffset.h" 00038 00039 00040 ClassImp(RooUnblindOffset) 00041 ; 00042 00043 00044 00045 //_____________________________________________________________________________ 00046 RooUnblindOffset::RooUnblindOffset() : _blindEngine("") 00047 { 00048 // Default constructor 00049 } 00050 00051 00052 00053 //_____________________________________________________________________________ 00054 RooUnblindOffset::RooUnblindOffset(const char *name, const char *title, 00055 const char *blindString, Double_t scale, RooAbsReal& cpasym) 00056 : RooAbsHiddenReal(name,title), 00057 _value("value","Offset blinded value",this,cpasym), 00058 _blindEngine(blindString,RooBlindTools::full,0.,scale) 00059 { 00060 // Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters 00061 } 00062 00063 00064 //_____________________________________________________________________________ 00065 RooUnblindOffset::RooUnblindOffset(const char *name, const char *title, 00066 const char *blindString, Double_t scale, RooAbsReal& cpasym, 00067 RooAbsCategory& blindState) 00068 : RooAbsHiddenReal(name,title,blindState), 00069 _value("value","Offset blinded value",this,cpasym), 00070 _blindEngine(blindString,RooBlindTools::full,0.,scale) 00071 { 00072 // Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters 00073 } 00074 00075 00076 00077 //_____________________________________________________________________________ 00078 RooUnblindOffset::RooUnblindOffset(const RooUnblindOffset& other, const char* name) : 00079 RooAbsHiddenReal(other, name), 00080 _value("asym",this,other._value), 00081 _blindEngine(other._blindEngine) 00082 { 00083 // Copy constructor 00084 00085 } 00086 00087 00088 00089 //_____________________________________________________________________________ 00090 RooUnblindOffset::~RooUnblindOffset() 00091 { 00092 // Destructor 00093 } 00094 00095 00096 00097 //_____________________________________________________________________________ 00098 Double_t RooUnblindOffset::evaluate() const 00099 { 00100 // Evaluate RooBlindTools unhide-offset method on blind value 00101 00102 if (isHidden()) { 00103 // Blinding is active for this event 00104 return _blindEngine.UnHideOffset(_value); 00105 } else { 00106 // Blinding is not active for this event 00107 return _value ; 00108 } 00109 } 00110 00111 00112 00113 00114