laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauBlind.cc
Go to the documentation of this file.
1 
2 /*
3 Copyright 2015 University of Warwick
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
18 /*
19 Laura++ package authors:
20 John Back
21 Paul Harrison
22 Thomas Latham
23 */
24 
29 #include "LauBlind.hh"
30 
31 #include "TMath.h"
32 #include "TRandom3.h"
33 
35 
36 
38  blindingString_(""),
39  blindingWidth_(0.0),
40  offset_(0.0)
41 {
42 }
43 
44 LauBlind::LauBlind(const TString& blindingStr, const Double_t width) :
45  blindingString_(blindingStr),
46  blindingWidth_(width),
47  offset_(0.0)
48 {
49  this->calcOffset();
50 }
51 
53  blindingString_(rhs.blindingString_),
54  blindingWidth_(rhs.blindingWidth_),
55  offset_(rhs.offset_)
56 {
57 }
58 
60 {
61 }
62 
64 {
65  //hash the blinding string to obtain a seed
66  TRandom3 r(TMath::Hash(blindingString_));
67 
68  //offsets are Gaussian distributed with defined width
69  offset_ = blindingWidth_ * r.Gaus();
70 }
71 
LauBlind()
Default constructor.
Definition: LauBlind.cc:37
File containing declaration of LauBlind class.
ClassImp(LauAbsCoeffSet)
const Double_t blindingWidth_
The Gaussian width.
Definition: LauBlind.hh:95
void calcOffset()
Calculate the offset.
Definition: LauBlind.cc:63
const TString blindingString_
The blinding string.
Definition: LauBlind.hh:92
virtual ~LauBlind()
Destructor.
Definition: LauBlind.cc:59
Double_t offset_
The offset used to blind the value.
Definition: LauBlind.hh:98
Class for blinding and unblinding a number based on a blinding string.
Definition: LauBlind.hh:42