laura is hosted by Hepforge, IPPP Durham
Laura++  v3r4
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauVetoes.cc
Go to the documentation of this file.
1 
2 /*
3 Copyright 2004 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 <iostream>
30 
31 #include "LauKinematics.hh"
32 #include "LauVetoes.hh"
33 
35 
36 
38  nVetoes_(0)
39 {
40 }
41 
43 {
44 }
45 
47  nVetoes_(other.nVetoes_),
48  vetoPair_(other.vetoPair_),
49  vetoMinMass_(other.vetoMinMass_),
50  vetoMaxMass_(other.vetoMaxMass_)
51 {
52 }
53 
55 {
56  if ( &other != this ) {
57  nVetoes_ = other.nVetoes_;
58  vetoPair_ = other.vetoPair_;
59  vetoMinMass_ = other.vetoMinMass_;
60  vetoMaxMass_ = other.vetoMaxMass_;
61  }
62  return *this;
63 }
64 
65 void LauVetoes::addMassVeto(const Int_t resPairAmpInt, const Double_t minMass, const Double_t maxMass)
66 {
67 
68  const Double_t minMassSq = minMass*minMass;
69  const Double_t maxMassSq = maxMass*maxMass;
70 
71  this->addMassSqVeto(resPairAmpInt, minMassSq, maxMassSq);
72 }
73 
74 void LauVetoes::addMassSqVeto(const Int_t resPairAmpInt, const Double_t minMassSq, const Double_t maxMassSq)
75 {
76  // Routine to add a veto in the Dalitz plot. The function takes as input the
77  // bachelor track number (1, 2 or 3) and the mass-squared range of the veto.
78 
79  if (resPairAmpInt == 1) {
80 
81  // The bachelor track is the first track
82  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 1, with " << minMassSq << " < m^2_23 < " << maxMassSq << std::endl;
83 
84  } else if (resPairAmpInt == 2) {
85 
86  // The bachelor track is the second track
87  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 2, with " << minMassSq << " < m^2_13 < " << maxMassSq << std::endl;
88 
89  } else if (resPairAmpInt == 3) {
90 
91  // The bachelor track is the third track
92  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 3, with " << minMassSq << " < m^2_12 < " << maxMassSq << std::endl;
93 
94  } else if (resPairAmpInt == 4) {
95 
96  // Special case for symmetric DPs - the veto will be applied on the minimum of m13Sq and m23Sq
97  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 4, with " << minMassSq << " < m^2_min < " << maxMassSq << std::endl;
98 
99  } else if (resPairAmpInt == 5) {
100 
101  // Special case for symmetric DPs - the veto will be applied on the maximum of m13Sq and m23Sq
102  std::cout << "INFO in LauVetoes::addMassSqVeto : Adding the veto for resPairAmpInt = 5, with " << minMassSq << " < m^2_max < " << maxMassSq << std::endl;
103 
104  } else {
105  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;
106  return;
107  }
108 
109  // Set the veto limits
110  vetoPair_.push_back(resPairAmpInt);
111  vetoMinMass_.push_back(minMassSq);
112  vetoMaxMass_.push_back(maxMassSq);
113 
114  // Keep track of how many vetoes we have
115  ++nVetoes_;
116 }
117 
118 Bool_t LauVetoes::passVeto(const LauKinematics* kinematics) const
119 {
120  // Routine to ask whether the given Dalitz plot point passes any specified vetoes.
121  if (kinematics == 0) {
122  std::cerr << "ERROR in LauVetoes::passVeto : LauKinematics object is null." << std::endl;
123  return kFALSE;
124  }
125 
126  const Double_t m12Sq = kinematics->getm12Sq();
127  const Double_t m23Sq = kinematics->getm23Sq();
128  const Double_t m13Sq = kinematics->getm13Sq();
129  const Bool_t symmetricDP = kinematics->gotSymmetricalDP();
130  const Bool_t fullySymmetricDP = kinematics->gotFullySymmetricDP();
131 
132  return this->passVeto(m12Sq, m23Sq, m13Sq, symmetricDP, fullySymmetricDP);
133 }
134 
135 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
136 {
137  // Routine to ask whether the given Dalitz plot point passes any specified vetoes.
138 
139  // Loop over the number of possible vetoes
140  for ( UInt_t i(0); i < nVetoes_; ++i) {
141 
142  if (vetoPair_[i] == 1) {
143  // Veto m23 combination
144  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
145  return kFALSE;
146  }
147  // If the DP is symmetric we need to test m13 combination as well
148  if ( symmetricDP || fullySymmetricDP ) {
149  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
150  return kFALSE;
151  }
152  }
153  // If it's fully symmetric we need to check all 3 combinations
154  if ( fullySymmetricDP ) {
155  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
156  return kFALSE;
157  }
158  }
159  } else if (vetoPair_[i] == 2) {
160  // Veto m13 combination
161  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
162  return kFALSE;
163  }
164  // If the DP is symmetric we need to test m23 combination as well
165  if ( symmetricDP || fullySymmetricDP ) {
166  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
167  return kFALSE;
168  }
169  }
170  // If it's fully symmetric we need to check all 3 combinations
171  if ( fullySymmetricDP ) {
172  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
173  return kFALSE;
174  }
175  }
176  } else if (vetoPair_[i] == 3) {
177  // Veto m12 combination
178  if (m12Sq > vetoMinMass_[i] && m12Sq < vetoMaxMass_[i]) {
179  return kFALSE;
180  }
181  // If it's fully symmetric we need to check all 3 combinations
182  if ( fullySymmetricDP ) {
183  if (m13Sq > vetoMinMass_[i] && m13Sq < vetoMaxMass_[i]) {
184  return kFALSE;
185  }
186  if (m23Sq > vetoMinMass_[i] && m23Sq < vetoMaxMass_[i]) {
187  return kFALSE;
188  }
189  }
190  } else if (vetoPair_[i] == 4) {
191  if (!symmetricDP) {
192  std::cerr << "WARNING in LauVetoes::passVeto : resPairAmpInt of 4 is only valid for symmetric DPs, will ignore this veto" << std::endl;
193  continue;
194  }
195  // Veto mMin combination
196  const Double_t mMinSq = TMath::Min( m13Sq, m23Sq );
197  if (mMinSq > vetoMinMass_[i] && mMinSq < vetoMaxMass_[i]) {
198  return kFALSE;
199  }
200  } else if (vetoPair_[i] == 5) {
201  if (!symmetricDP) {
202  std::cerr << "WARNING in LauVetoes::passVeto : resPairAmpInt of 5 is only valid for symmetric DPs, will ignore this veto" << std::endl;
203  continue;
204  }
205  // Veto mMax combination
206  const Double_t mMaxSq = TMath::Max( m13Sq, m23Sq );
207  if (mMaxSq > vetoMinMass_[i] && mMaxSq < vetoMaxMass_[i]) {
208  return kFALSE;
209  }
210  }
211  }
212 
213  return kTRUE;
214 }
215 
std::vector< Double_t > vetoMinMass_
The minimum mass-squared for each veto.
Definition: LauVetoes.hh:139
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:118
ClassImp(LauAbsCoeffSet)
std::vector< Double_t > vetoMaxMass_
The maximum mass-squared for each veto.
Definition: LauVetoes.hh:142
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:136
File containing declaration of LauKinematics class.
LauVetoes()
Constructor.
Definition: LauVetoes.cc:37
LauVetoes & operator=(const LauVetoes &other)
Copy assignment operator.
Definition: LauVetoes.cc:54
UInt_t nVetoes_
The number of vetoes.
Definition: LauVetoes.hh:133
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:42
void addMassSqVeto(const Int_t resPairAmpInt, const Double_t minMassSq, const Double_t maxMassSq)
Add a veto to the Dalitz plot.
Definition: LauVetoes.cc:74
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:65
Class for defining vetoes within the Dalitz plot.
Definition: LauVetoes.hh:50