laura is hosted by Hepforge, IPPP Durham
Laura++  v2r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauVetoes.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 "LauKinematics.hh"
18 #include "LauVetoes.hh"
19 
21 
22 
24  nVetoes_(0)
25 {
26 }
27 
29 {
30 }
31 
33 {
34  nVetoes_ = other.nVetoes_;
35  vetoPair_ = other.vetoPair_;
36  vetoMinMass_ = other.vetoMinMass_;
37  vetoMaxMass_ = other.vetoMaxMass_;
38 }
39 
41 {
42  if ( &other != this ) {
43  nVetoes_ = other.nVetoes_;
44  vetoPair_ = other.vetoPair_;
45  vetoMinMass_ = other.vetoMinMass_;
46  vetoMaxMass_ = other.vetoMaxMass_;
47  }
48  return *this;
49 }
50 
51 void LauVetoes::addMassVeto(Int_t resPairAmpInt, Double_t minMass, Double_t maxMass)
52 {
53 
54  Double_t minMassSq = minMass*minMass;
55  Double_t maxMassSq = maxMass*maxMass;
56 
57  this->addMassSqVeto(resPairAmpInt, minMassSq, maxMassSq);
58 }
59 
60 void LauVetoes::addMassSqVeto(Int_t resPairAmpInt, Double_t minMassSq, Double_t maxMassSq)
61 {
62  // Routine to add a veto in the Dalitz plot. The function takes as input the
63  // bachelor track number (1, 2 or 3) and the mass-squared range of the veto.
64 
65  if (resPairAmpInt == 1) {
66 
67  // The bachelor track is the first track
68  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 1, with " << minMassSq << " < m^2_23 < " << maxMassSq << std::endl;
69 
70  } else if (resPairAmpInt == 2) {
71 
72  // The bachelor track is the second track
73  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 2, with " << minMassSq << " < m^2_13 < " << maxMassSq << std::endl;
74 
75  } else if (resPairAmpInt == 3) {
76 
77  // The bachelor track is the third track
78  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 3, with " << minMassSq << " < m^2_12 < " << maxMassSq << std::endl;
79 
80  } else {
81  std::cerr << "ERROR in LauVetoes::addMassSqVeto : Invalid resPairAmpInt. Please use 1, 2 or 3 to specify bachelor daughter track. Veto is not added." << std::endl;
82  return;
83  }
84 
85  // Set the veto limits
86  vetoPair_.push_back(resPairAmpInt);
87  vetoMinMass_.push_back(minMassSq);
88  vetoMaxMass_.push_back(maxMassSq);
89 
90  // Keep track of how many vetoes we have
91  ++nVetoes_;
92 }
93 
94 Bool_t LauVetoes::passVeto(const LauKinematics* kinematics) const
95 {
96  // Routine to ask whether the given Dalitz plot point passes any specified vetoes.
97  if (kinematics == 0) {
98  std::cerr << "ERROR in LauVetoes::passVeto : LauKinematics object is null." << std::endl;
99  return kFALSE;
100  }
101 
102  Double_t m12Sq = kinematics->getm12Sq();
103  Double_t m23Sq = kinematics->getm23Sq();
104  Double_t m13Sq = kinematics->getm13Sq();
105 
106  return passVeto(m12Sq, m23Sq, m13Sq);
107 }
108 
109 Bool_t LauVetoes::passVeto(Double_t& m12Sq, Double_t& m23Sq, Double_t& m13Sq) const
110 {
111  // Routine to ask whether the given Dalitz plot point passes any specified vetoes.
112 
113  // Loop over the number of possible vetoes
114  for ( Int_t i(0); i < nVetoes_; ++i) {
115 
116  if (vetoPair_[i] == 1) {
117  // Veto m23 combination
118  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
119  return kFALSE;
120  }
121  } else if (vetoPair_[i] == 2) {
122  // Veto m13 combination
123  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
124  return kFALSE;
125  }
126  } else if (vetoPair_[i] == 3) {
127  // Veto m12 combination
128  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
129  return kFALSE;
130  }
131  }
132  }
133 
134  return kTRUE;
135 }
136 
Int_t nVetoes_
The number of vetoes.
Definition: LauVetoes.hh:113
void addMassVeto(Int_t resPairAmpInt, Double_t minMass, Double_t maxMass)
Add a veto to the Dalitz plot.
Definition: LauVetoes.cc:51
std::vector< Double_t > vetoMinMass_
The minimum mass-squared for each veto.
Definition: LauVetoes.hh:119
ClassImp(LauAbsCoeffSet)
std::vector< Double_t > vetoMaxMass_
The maximum mass-squared for each veto.
Definition: LauVetoes.hh:122
Double_t getm23Sq() const
Get the m23 invariant mass square.
std::vector< Int_t > vetoPair_
The index of the vetoed mass-squared variable for each veto.
Definition: LauVetoes.hh:116
File containing declaration of LauKinematics class.
void addMassSqVeto(Int_t resPairAmpInt, Double_t minMassSq, Double_t maxMassSq)
Add a veto to the Dalitz plot.
Definition: LauVetoes.cc:60
LauVetoes()
Constructor.
Definition: LauVetoes.cc:23
LauVetoes & operator=(const LauVetoes &other)
Copy assignment operator.
Definition: LauVetoes.cc:40
Double_t getm12Sq() const
Get the m12 invariant mass square.
Double_t getm13Sq() const
Get the m13 invariant mass square.
Bool_t passVeto(Double_t &m12Sq, Double_t &m23Sq, Double_t &m13Sq) const
Check whether the specified Dalitz plot point passes the vetoes.
Definition: LauVetoes.cc:109
virtual ~LauVetoes()
Destructor.
Definition: LauVetoes.cc:28
Class for calculating 3-body kinematic quantities.
File containing declaration of LauVetoes class.
Class for defining vetoes within the Dalitz plot.
Definition: LauVetoes.hh:33