Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooBlindTools.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitModels *
4  * File: $Id: RooBlindTools.h,v 1.10 2007/05/11 10:15:52 verkerke Exp $
5  * Authors: *
6  * AR, Aaron Roodman, Stanford University, roodman@slac.stanford.edu *
7  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.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 #ifndef ROO_BLIND_TOOLS
17 #define ROO_BLIND_TOOLS
18 
19 // ---------------------
20 // -- Class Interface --
21 // ---------------------
22 
23 #include "Rtypes.h"
24 #include "TString.h"
25 
26 class RooBlindTools {
27 
28 //--------------------
29 // Instance Members --
30 //--------------------
31 
32 public:
33 
34  enum blindMode {
35  full=0, // blind both parameters and data
36  dataonly // blind data only
37 
38  };
39 
40 public:
41 
42  // Constructors
43  RooBlindTools() {} ;
44 
45  RooBlindTools
46  (const char *stSeed, // blinding seed string
47  blindMode Mode=full, // blinding mode
48  Double_t centralValue=0.0, // Central value for Precision measurements
49  Double_t sigmaOffset=1.0, // range for Offset
50  Bool_t s2bMode=kFALSE // Use sin2beta modifications?
51  );
52 
53  // Copy
54  RooBlindTools(const RooBlindTools& );
55 
56  // Destructor
57  virtual ~RooBlindTools( );
58 
59  // Operators
60 
61  Double_t Randomizer(const char *StringAlphabet) const;
62 
63  Double_t PseudoRandom(Int_t Seed) const;
64 
65  Double_t MakeOffset(const char *StringAlphabet) const;
66 
67  Double_t MakeGaussianOffset(const char *StringAlphabet) const;
68 
69  Double_t MakeSignFlip(const char *StringAlphabet) const;
70 
71  Int_t SignOfTag(Double_t STag) const;
72 
73  Double_t HideDeltaZ(Double_t DeltaZ, Double_t STag) const;
74 
75  Double_t HiDelZPdG(Double_t DeltaZ, Double_t STag, Double_t PdG) const;
76 
77  Double_t UnHideDeltaZ(Double_t DeltaZPrime, Double_t STag) const;
78 
79  Double_t UnHiDelZPdG(Double_t DeltaZPrime, Double_t STag, Double_t PdG) const;
80 
81  Double_t HideAsym(Double_t Asym) const;
82 
83  Double_t HiAsPdG(Double_t Asym, Double_t PdG) const;
84 
85  Double_t UnHideAsym(Double_t AsymPrime) const;
86 
87  Double_t UnHiAsPdG(Double_t AsymPrime, Double_t PdG) const;
88 
89  Double_t HideDeltaM(Double_t DeltaM) const;
90 
91  Double_t UnHideDeltaM(Double_t DeltaMPrime) const;
92 
93  Double_t MysteryPhase() const;
94 
95  Double_t RandomizeTag(Double_t STag, Int_t EventNumber) const;
96 
97  Double_t HidePrecision(Double_t Precision) const;
98 
99  Double_t UnHidePrecision(Double_t PrecisionPrime) const;
100 
101  Double_t HideOffset( Double_t Precision ) const;
102 
103  Double_t UnHideOffset( Double_t PrecisionBlind ) const;
104 
105  Double_t HideUniform( Double_t Precision ) const;
106 
107  Double_t UnHideUniform( Double_t PrecisionBlind ) const;
108 
109 
110  const char *stSeed()const {return _stSeed;}
111 
112  const blindMode& mode()const {return _mode;}
113 
114  void setMode(blindMode bmode) {_mode=bmode;}
115 
116  Double_t getPrecisionCentralValue() const {return _PrecisionCentralValue;}
117 
118  Double_t getPrecisionOffsetScale() const {return _PrecisionOffsetScale;}
119 
120 private:
121 
122  // Friends
123  // Data members
124 
125  TString _stSeed ;
126  Double_t _DeltaZOffset;
127  Double_t _DeltaZSignFlip;
128  Double_t _DeltaZScale;
129  Double_t _AsymOffset;
130  Double_t _AsymSignFlip;
131  Double_t _DeltaMScale;
132  Double_t _DeltaMOffset;
133  Double_t _MysteryPhase;
134  Double_t _STagConstant;
135  Double_t _PrecisionSignFlip;
136  Double_t _PrecisionOffsetScale;
137  Double_t _PrecisionOffset;
138  Double_t _PrecisionUniform;
139  Double_t _PrecisionCentralValue;
140  blindMode _mode;
141  Bool_t _s2bMode ;
142 
143  // setup data members from string seed
144  void setup(const char *stSeed);
145 
146 protected:
147 
148  // Helper functions
149  ClassDef(RooBlindTools,1) // Root implementation of BlindTools
150 };
151 
152 #endif