00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitModels * 00004 * @(#)root/roofit:$Id: RooUnblindCPAsymVar.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' CP asymmetry blinding method 00021 // A RooUnblindCPAsymVar 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 "RooUnblindCPAsymVar.h" 00038 00039 00040 ClassImp(RooUnblindCPAsymVar) 00041 ; 00042 00043 00044 00045 //_____________________________________________________________________________ 00046 RooUnblindCPAsymVar::RooUnblindCPAsymVar() : _blindEngine("") 00047 { 00048 // Default constructor 00049 } 00050 00051 00052 00053 //_____________________________________________________________________________ 00054 RooUnblindCPAsymVar::RooUnblindCPAsymVar(const char *name, const char *title, 00055 const char *blindString, RooAbsReal& cpasym) 00056 : RooAbsHiddenReal(name,title), 00057 _asym("asym","CP Asymmetry",this,cpasym), 00058 _blindEngine(blindString) 00059 { 00060 // Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters 00061 } 00062 00063 00064 00065 //_____________________________________________________________________________ 00066 RooUnblindCPAsymVar::RooUnblindCPAsymVar(const char *name, const char *title, 00067 const char *blindString, RooAbsReal& cpasym, RooAbsCategory& blindState) 00068 : RooAbsHiddenReal(name,title,blindState), 00069 _asym("asym","CP Asymmetry",this,cpasym), 00070 _blindEngine(blindString) 00071 { 00072 // Constructor from a given RooAbsReal (to hold the blind value) and a set of blinding parameters 00073 } 00074 00075 00076 00077 //_____________________________________________________________________________ 00078 RooUnblindCPAsymVar::RooUnblindCPAsymVar(const RooUnblindCPAsymVar& other, const char* name) : 00079 RooAbsHiddenReal(other, name), 00080 _asym("asym",this,other._asym), 00081 _blindEngine(other._blindEngine) 00082 { 00083 // Copy constructor 00084 } 00085 00086 00087 00088 //_____________________________________________________________________________ 00089 RooUnblindCPAsymVar::~RooUnblindCPAsymVar() 00090 { 00091 // Copy constructor 00092 } 00093 00094 00095 00096 //_____________________________________________________________________________ 00097 Double_t RooUnblindCPAsymVar::evaluate() const 00098 { 00099 if (isHidden()) { 00100 // Blinding active for this event 00101 return _blindEngine.UnHideAsym(_asym); 00102 } else { 00103 // Blinding not active for this event 00104 return _asym ; 00105 } 00106 }