laura is hosted by Hepforge, IPPP Durham
Laura++  v1r2
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau2DAbsHistDPPdf.cc
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2004 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
15 #include <iostream>
16 
17 #include "TAxis.h"
18 #include "TH2.h"
19 #include "TRandom.h"
20 
21 #include "Lau2DAbsHistDPPdf.hh"
22 #include "LauKinematics.hh"
23 #include "LauRandom.hh"
24 #include "LauVetoes.hh"
25 
26 ClassImp(Lau2DAbsHistDPPdf)
27 
28 
30  Bool_t useUpperHalfOnly, Bool_t squareDP) :
31  kinematics_(kinematics),
32  vetoes_(vetoes),
33  upperHalf_(useUpperHalfOnly),
34  squareDP_(squareDP)
35 {
36 }
37 
39 {
40 }
41 
43 {
44  // Get the maximum height of the 2D histogram
45  maxHeight_ = 1.0;
46  if ( hist ) {
47  Int_t maxBin = hist->GetMaximumBin();
48  maxHeight_ = hist->GetBinContent(maxBin);
49  }
50 
51  std::cout << "INFO in Lau2DAbsHistDPPdf::calcMaxHeight : Max height = " << maxHeight_ << std::endl;
52 }
53 
55 {
56  if ( !hist ) {
57  return;
58  }
59 
60  TRandom* random = LauRandom::zeroSeedRandom();
61 
62  Int_t nBinsX = static_cast<Int_t>(hist->GetNbinsX());
63  Int_t nBinsY = static_cast<Int_t>(hist->GetNbinsY());
64 
65  for (Int_t i(0); i<nBinsX; i++) {
66  for (Int_t j(0); j<nBinsY; j++) {
67  Double_t currentContent = hist->GetBinContent(i+1,j+1);
68  Double_t currentError = hist->GetBinError(i+1,j+1);
69  Double_t newContent = random->Gaus(currentContent,currentError);
70  if (newContent<0.0) {
71  hist->SetBinContent(i+1,j+1,0.0);
72  } else {
73  hist->SetBinContent(i+1,j+1,newContent);
74  }
75  }
76  }
77 }
78 
79 Bool_t Lau2DAbsHistDPPdf::withinDPBoundaries(Double_t x, Double_t y) const
80 {
82 }
83 
84 void Lau2DAbsHistDPPdf::getUpperHalf(Double_t& x, Double_t& y) const
85 {
86  if ( upperHalf_ == kTRUE ) {
87  if ( squareDP_ == kFALSE && x > y ) {
88  Double_t temp = y;
89  y = x;
90  x = temp;
91  } else if ( squareDP_ == kTRUE && y > 0.5 ) {
92  y = 1.0 - y;
93  }
94  }
95 }
96 
97 void Lau2DAbsHistDPPdf::updateKinematics(Double_t x, Double_t y) const {
98  if (squareDP_ == kTRUE) {
100  } else {
102  }
103 }
virtual ~Lau2DAbsHistDPPdf()
Destructor.
TRandom * zeroSeedRandom()
Access the singleton random number generator with seed set from machine clock time (within +-1 sec)...
Definition: LauRandom.cc:30
void updateSqDPKinematics(Double_t mPrime, Double_t thetaPrime)
Update all kinematic quantities based on the square DP co-ordinates m&#39; and theta&#39;.
Double_t maxHeight_
The maximum height of 2D histogram.
Abstract base class for defining a variation across a 2D DP based on a histogram. ...
Bool_t withinDPBoundaries(Double_t x, Double_t y) const
Check whether the given co-ordinates are within the kinematic boundary.
Bool_t squareDP_
Boolean for using square DP variables.
void doBinFluctuation(TH2 *hist)
Fluctuate the histogram bin contents in accordance with their errors.
File containing declaration of LauKinematics class.
void updateKinematics(Double_t m13Sq, Double_t m23Sq)
Update all kinematic quantities based on the DP co-ordinates m13Sq and m23Sq.
File containing declaration of Lau2DAbsHistDPPdf class.
Bool_t upperHalf_
Boolean for using the upper half of DP.
void getUpperHalf(Double_t &x, Double_t &y) const
If only using the upper half of the (symmetric) DP then transform into the correct half...
Bool_t withinSqDPLimits(Double_t mPrime, Double_t thetaPrime) const
Check whether a given (m&#39;,theta&#39;) point is within the kinematic limits of the Dalitz plot...
Bool_t withinDPLimits(Double_t m13Sq, Double_t m23Sq) const
Check whether a given (m13Sq,m23Sq) point is within the kinematic limits of the Dalitz plot...
File containing LauRandom namespace.
void calcMaxHeight(TH2 *hist)
Calculate maximum height.
Class for calculating 3-body kinematic quantities.
void updateKinematics(Double_t x, Double_t y) const
Update the current co-ordinates in the kinematic space.
File containing declaration of LauVetoes class.
Class for defining vetoes within the Dalitz plot.
Definition: LauVetoes.hh:33
LauKinematics * kinematics_
DP kinematics.