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