laura is hosted by Hepforge, IPPP Durham
Laura++  v3r3
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  nVetoes_(other.nVetoes_),
34  vetoPair_(other.vetoPair_),
35  vetoMinMass_(other.vetoMinMass_),
36  vetoMaxMass_(other.vetoMaxMass_)
37 {
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(const Int_t resPairAmpInt, const Double_t minMass, const Double_t maxMass)
52 {
53 
54  const Double_t minMassSq = minMass*minMass;
55  const Double_t maxMassSq = maxMass*maxMass;
56 
57  this->addMassSqVeto(resPairAmpInt, minMassSq, maxMassSq);
58 }
59 
60 void LauVetoes::addMassSqVeto(const Int_t resPairAmpInt, const Double_t minMassSq, const 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 if (resPairAmpInt == 4) {
81 
82  // Special case for symmetric DPs - the veto will be applied on the minimum of m13Sq and m23Sq
83  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 4, with " << minMassSq << " < m^2_min < " << maxMassSq << std::endl;
84 
85  } else if (resPairAmpInt == 5) {
86 
87  // Special case for symmetric DPs - the veto will be applied on the maximum of m13Sq and m23Sq
88  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 5, with " << minMassSq << " < m^2_max < " << maxMassSq << std::endl;
89 
90  } else {
91  std::cerr << "ERROR in LauVetoes::addMassSqVeto : Invalid resPairAmpInt. Please use 1, 2 or 3 to specify bachelor daughter track (or 4 or 5 to specify a veto on mMinSq or mMaxSq in a symmetric DP). Veto is not added." << std::endl;
92  return;
93  }
94 
95  // Set the veto limits
96  vetoPair_.push_back(resPairAmpInt);
97  vetoMinMass_.push_back(minMassSq);
98  vetoMaxMass_.push_back(maxMassSq);
99 
100  // Keep track of how many vetoes we have
101  ++nVetoes_;
102 }
103 
104 Bool_t LauVetoes::passVeto(const LauKinematics* kinematics) const
105 {
106  // Routine to ask whether the given Dalitz plot point passes any specified vetoes.
107  if (kinematics == 0) {
108  std::cerr << "ERROR in LauVetoes::passVeto : LauKinematics object is null." << std::endl;
109  return kFALSE;
110  }
111 
112  const Double_t m12Sq = kinematics->getm12Sq();
113  const Double_t m23Sq = kinematics->getm23Sq();
114  const Double_t m13Sq = kinematics->getm13Sq();
115  const Bool_t symmetricDP = kinematics->gotSymmetricalDP();
116  const Bool_t fullySymmetricDP = kinematics->gotFullySymmetricDP();
117 
118  return this->passVeto(m12Sq, m23Sq, m13Sq, symmetricDP, fullySymmetricDP);
119 }
120 
121 Bool_t LauVetoes::passVeto(const Double_t m12Sq, const Double_t m23Sq, const Double_t m13Sq, const Bool_t symmetricDP, const Bool_t fullySymmetricDP) const
122 {
123  // Routine to ask whether the given Dalitz plot point passes any specified vetoes.
124 
125  // Loop over the number of possible vetoes
126  for ( UInt_t i(0); i < nVetoes_; ++i) {
127 
128  if (vetoPair_[i] == 1) {
129  // Veto m23 combination
130  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
131  return kFALSE;
132  }
133  // If the DP is symmetric we need to test m13 combination as well
134  if ( symmetricDP || fullySymmetricDP ) {
135  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
136  return kFALSE;
137  }
138  }
139  // If it's fully symmetric we need to check all 3 combinations
140  if ( fullySymmetricDP ) {
141  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
142  return kFALSE;
143  }
144  }
145  } else if (vetoPair_[i] == 2) {
146  // Veto m13 combination
147  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
148  return kFALSE;
149  }
150  // If the DP is symmetric we need to test m23 combination as well
151  if ( symmetricDP || fullySymmetricDP ) {
152  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
153  return kFALSE;
154  }
155  }
156  // If it's fully symmetric we need to check all 3 combinations
157  if ( fullySymmetricDP ) {
158  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
159  return kFALSE;
160  }
161  }
162  } else if (vetoPair_[i] == 3) {
163  // Veto m12 combination
164  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
165  return kFALSE;
166  }
167  // If it's fully symmetric we need to check all 3 combinations
168  if ( fullySymmetricDP ) {
169  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
170  return kFALSE;
171  }
172  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
173  return kFALSE;
174  }
175  }
176  } else if (vetoPair_[i] == 4) {
177  if (!symmetricDP) {
178  std::cerr << "WARNING in LauVetoes::passVeto : resPairAmpInt of 4 is only valid for symmetric DPs, will ignore this veto" << std::endl;
179  continue;
180  }
181  // Veto mMin combination
182  const Double_t mMinSq = TMath::Min( m13Sq, m23Sq );
183  if (mMinSq > vetoMinMass_[i] && mMinSq < vetoMaxMass_[i]) {
184  return kFALSE;
185  }
186  } else if (vetoPair_[i] == 5) {
187  if (!symmetricDP) {
188  std::cerr << "WARNING in LauVetoes::passVeto : resPairAmpInt of 5 is only valid for symmetric DPs, will ignore this veto" << std::endl;
189  continue;
190  }
191  // Veto mMax combination
192  const Double_t mMaxSq = TMath::Max( m13Sq, m23Sq );
193  if (mMaxSq > vetoMinMass_[i] && mMaxSq < vetoMaxMass_[i]) {
194  return kFALSE;
195  }
196  }
197  }
198 
199  return kTRUE;
200 }
201 
std::vector< Double_t > vetoMinMass_
The minimum mass-squared for each veto.
Definition: LauVetoes.hh:125
Bool_t gotSymmetricalDP() const
Is the DP symmetric?
Bool_t passVeto(const LauKinematics *kinematics) const
Check whether the specified Dalitz plot point passes the vetoes.
Definition: LauVetoes.cc:104
ClassImp(LauAbsCoeffSet)
std::vector< Double_t > vetoMaxMass_
The maximum mass-squared for each veto.
Definition: LauVetoes.hh:128
Bool_t gotFullySymmetricDP() const
Is the DP fully symmetric?
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:122
File containing declaration of LauKinematics class.
LauVetoes()
Constructor.
Definition: LauVetoes.cc:23
LauVetoes & operator=(const LauVetoes &other)
Copy assignment operator.
Definition: LauVetoes.cc:40
UInt_t nVetoes_
The number of vetoes.
Definition: LauVetoes.hh:119
Double_t getm12Sq() const
Get the m12 invariant mass square.
Double_t getm13Sq() const
Get the m13 invariant mass square.
virtual ~LauVetoes()
Destructor.
Definition: LauVetoes.cc:28
void addMassSqVeto(const Int_t resPairAmpInt, const Double_t minMassSq, const Double_t maxMassSq)
Add a veto to the Dalitz plot.
Definition: LauVetoes.cc:60
Class for calculating 3-body kinematic quantities.
File containing declaration of LauVetoes class.
void addMassVeto(const Int_t resPairAmpInt, const Double_t minMass, const Double_t maxMass)
Add a veto to the Dalitz plot.
Definition: LauVetoes.cc:51
Class for defining vetoes within the Dalitz plot.
Definition: LauVetoes.hh:36