HighLAND
ToyVariations.cxx
1 #include "ToyVariations.hxx"
2 
3 //*************************************************************************
5 //*************************************************************************
6 
7  nWeights = npar;
8  nVariations = npar;
9  Variations = new Float_t[npar];
10  Weights = new Float_t[npar];
11 
12 }
13 
14 //*************************************************************************
16 //*************************************************************************
17  delete [] Variations;
18  delete [] Weights;
19 }
20 
21 //*************************************************************************
22 Double_t ToyVariations::GetWeight() const{
23 //*************************************************************************
24  Double_t total_weight=1;
25  for (Int_t i=0;i<nWeights;i++)
26  total_weight *= Weights[i];
27  return total_weight;
28 }
29 
30 //*************************************************************************
31 Double_t ToyVariations::GetWeight(const Int_t* bins, int nBins) const{
32 //*************************************************************************
33 
34  if (nBins==0) return GetWeight();
35 
36  Double_t total_weight=1;
37  for (Int_t i=0;i<nBins;i++){
38  total_weight *= Weights[bins[i]];
39  }
40  return total_weight;
41 }
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
Float_t * Weights
the vector of Weights, one for each of the systematic parameters
ToyVariations(Int_t npar)
Create the systematic,.
Double_t GetWeight() const
Computes the total weight for all systematic parameters.
virtual ~ToyVariations()
Everyone should have a destructor.