MINT2
Public Member Functions | Static Public Attributes | List of all members
DalitzEventPattern Class Reference

#include <DalitzEventPattern.h>

Inheritance diagram for DalitzEventPattern:
MINT::PolymorphVector< DecayTreeItem >

Public Member Functions

 DalitzEventPattern ()
 
 DalitzEventPattern (int pdg_ids[], int arrayDimension)
 
 DalitzEventPattern (MINT::PolymorphVector< int > pdg_ids)
 
 DalitzEventPattern (const std::vector< int > &pdg_ids)
 
 DalitzEventPattern (const std::vector< DecayTreeItem > &yetAnother)
 
 DalitzEventPattern (const MINT::PolymorphVector< DecayTreeItem > &yetAnother)
 
 DalitzEventPattern (const DalitzEventPattern &other)
 
 DalitzEventPattern (int mum, int d1, int d2)
 
 DalitzEventPattern (int mum, int d1, int d2, int d3)
 
 DalitzEventPattern (int mum, int d1, int d2, int d3, int d4)
 
 DalitzEventPattern (const DecayTree &dt_in)
 
virtual ~DalitzEventPattern ()
 
DalitzEventPattern makeCPConjugate () const
 
bool equal (const DalitzEventPattern &other) const
 
bool lt (const DalitzEventPattern &other) const
 
bool operator== (const DalitzEventPattern &rhs) const
 
bool operator!= (const DalitzEventPattern &rhs) const
 
bool operator< (const DalitzEventPattern &rhs) const
 
bool operator<= (const DalitzEventPattern &rhs) const
 
bool operator>= (const DalitzEventPattern &rhs) const
 
bool operator> (const DalitzEventPattern &rhs) const
 
bool compatibleWithFinalState (const AmpInitialiser &ampInitContainsTree) const
 
bool compatibleWithFinalState (const DecayTree &tree) const
 
bool compatibleWithFinalState (const DalitzEventPattern &pat) const
 
bool compatibleWithFinalState (const std::vector< int > &otherFs) const
 
bool compatibleWithFinalState (const MINT::PolymorphVector< int > &otherFs) const
 
bool compatibleWith (const DecayTree &tree) const
 
bool selfConjugateFS () const
 
void print (std::ostream &os=std::cout) const
 
std::vector< int > finalStates () const
 
double sijMin (const MINT::PolymorphVector< int > &indices) const
 
double sijMax (const MINT::PolymorphVector< int > &indices) const
 
double sijMin (int i, int j) const
 
double sijMax (int i, int j) const
 
double sijMin (int i, int j, int k) const
 
double sijMax (int i, int j, int k) const
 
int numDaughters () const
 
std::vector< int > getVectorOfInts () const
 
std::string name () const
 
- Public Member Functions inherited from MINT::PolymorphVector< DecayTreeItem >
 PolymorphVector ()
 
 PolymorphVector (unsigned int N)
 
 PolymorphVector (unsigned int N, const DecayTreeItem &c)
 
 PolymorphVector (const PolymorphVector &other)
 
 PolymorphVector (const typename std::vector< DecayTreeItem > &other)
 
virtual ~PolymorphVector ()
 
std::vector< DecayTreeItem > & theVector ()
 
const std::vector< DecayTreeItem > & theVector () const
 
DecayTreeItemoperator[] (unsigned int i)
 
const DecayTreeItemoperator[] (unsigned int i) const
 
DecayTreeItemat (unsigned int i)
 
const DecayTreeItemat (unsigned int i) const
 
std::vector< DecayTreeItem >::iterator begin ()
 
std::vector< DecayTreeItem >::const_iterator begin () const
 
std::vector< DecayTreeItem >::iterator end ()
 
std::vector< DecayTreeItem >::const_iterator end () const
 
std::vector< DecayTreeItem >::iterator find (const DecayTreeItem &c)
 
std::vector< DecayTreeItem >::const_iterator find (const DecayTreeItem &c) const
 
DecayTreeItemfront ()
 
const DecayTreeItemfront () const
 
DecayTreeItemback ()
 
const DecayTreeItemback () const
 
unsigned int size () const
 
bool empty () const
 
void push_back (const DecayTreeItem &c)
 
void pop_back ()
 
void erase (typename std::vector< DecayTreeItem >::iterator pos)
 
void erase (typename std::vector< DecayTreeItem >::iterator first, typename std::vector< DecayTreeItem >::iterator last)
 
PolymorphVector< DecayTreeItem > & operator= (const PolymorphVector< DecayTreeItem > &other)
 
void clear ()
 
void resize (unsigned int N)
 
void resize (unsigned int N, const DecayTreeItem &c)
 
 operator const typename std::vector< DecayTreeItem > & () const
 
 operator typename std::vector< DecayTreeItem > & ()
 
bool operator== (const MINT::PolymorphVector< DecayTreeItem > &v2) const
 
bool operator!= (const MINT::PolymorphVector< DecayTreeItem > &v2) const
 
bool operator< (const MINT::PolymorphVector< DecayTreeItem > &v2) const
 
bool operator> (const MINT::PolymorphVector< DecayTreeItem > &v2) const
 

Static Public Attributes

static const DalitzEventPattern NoPattern
 

Additional Inherited Members

- Protected Attributes inherited from MINT::PolymorphVector< DecayTreeItem >
std::vector< DecayTreeItem_vec
 

Detailed Description

Definition at line 17 of file DalitzEventPattern.h.

Constructor & Destructor Documentation

◆ DalitzEventPattern() [1/11]

DalitzEventPattern::DalitzEventPattern ( )
inline

Definition at line 20 of file DalitzEventPattern.h.

20  {
21  this->clear();
22  }

◆ DalitzEventPattern() [2/11]

DalitzEventPattern::DalitzEventPattern ( int  pdg_ids[],
int  arrayDimension 
)

Definition at line 16 of file DalitzEventPattern.cpp.

17  : PolymorphVector<DecayTreeItem>(arrayDimension)
18 {
19  for(int i=0; i<arrayDimension; i++){
20  DecayTreeItem dti(pdg_ids[i]);
21  (*this)[i]=dti;
22  }
23 }

◆ DalitzEventPattern() [3/11]

DalitzEventPattern::DalitzEventPattern ( MINT::PolymorphVector< int >  pdg_ids)

◆ DalitzEventPattern() [4/11]

DalitzEventPattern::DalitzEventPattern ( const std::vector< int > &  pdg_ids)

Definition at line 25 of file DalitzEventPattern.cpp.

26  : PolymorphVector<DecayTreeItem>(pdg_ids.size())
27 {
28  for(unsigned int i=0; i<pdg_ids.size(); i++){
29  DecayTreeItem dti(pdg_ids[i]);
30  (*this)[i]=dti;
31  }
32 }

◆ DalitzEventPattern() [5/11]

DalitzEventPattern::DalitzEventPattern ( const std::vector< DecayTreeItem > &  yetAnother)

◆ DalitzEventPattern() [6/11]

DalitzEventPattern::DalitzEventPattern ( const MINT::PolymorphVector< DecayTreeItem > &  yetAnother)

◆ DalitzEventPattern() [7/11]

DalitzEventPattern::DalitzEventPattern ( const DalitzEventPattern other)

◆ DalitzEventPattern() [8/11]

DalitzEventPattern::DalitzEventPattern ( int  mum,
int  d1,
int  d2 
)

Definition at line 50 of file DalitzEventPattern.cpp.

52 {
53  (*this)[0] = DecayTreeItem(mum);
54  (*this)[1] = DecayTreeItem(d1);
55  (*this)[2] = DecayTreeItem(d2);
56 }

◆ DalitzEventPattern() [9/11]

DalitzEventPattern::DalitzEventPattern ( int  mum,
int  d1,
int  d2,
int  d3 
)

Definition at line 58 of file DalitzEventPattern.cpp.

60 {
61  (*this)[0] = DecayTreeItem(mum);
62  (*this)[1] = DecayTreeItem(d1);
63  (*this)[2] = DecayTreeItem(d2);
64  (*this)[3] = DecayTreeItem(d3);
65 }

◆ DalitzEventPattern() [10/11]

DalitzEventPattern::DalitzEventPattern ( int  mum,
int  d1,
int  d2,
int  d3,
int  d4 
)

Definition at line 67 of file DalitzEventPattern.cpp.

69 {
70  (*this)[0] = DecayTreeItem(mum);
71  (*this)[1] = DecayTreeItem(d1);
72  (*this)[2] = DecayTreeItem(d2);
73  (*this)[3] = DecayTreeItem(d3);
74  (*this)[4] = DecayTreeItem(d4);
75 }

◆ DalitzEventPattern() [11/11]

DalitzEventPattern::DalitzEventPattern ( const DecayTree dt_in)

Definition at line 78 of file DalitzEventPattern.cpp.

78  {
79  bool dbThis=false;
81  fsTree_pointers( dt_in.finalStatePtr() );
82 
83  std::vector<int> finalState( fsTree_pointers->size() );
84 
85  for(unsigned int i=0; i< fsTree_pointers->size(); i++){
86  finalState[i] = (*fsTree_pointers)[i]->pdg();
87  }
88  sort(finalState.begin(), finalState.end());
89 
90  this->resize(finalState.size() + 1);
91  (*this)[0] = dt_in.getVal();
92  for(unsigned int i=0; i< finalState.size(); i++){ // offspring
93  (*this)[i+1] = finalState[i];
94  }
95 
96  if(dbThis){
97  cout << "made this pattern: " << *this
98  << "out of this tree " << dt_in << endl;
99  }
100 }
MINT::counted_ptr< std::vector< const ValueType * > > finalStatePtr() const
Definition: DDTree.h:304
const ValueType & getVal() const
Definition: DDTree.h:102

◆ ~DalitzEventPattern()

virtual DalitzEventPattern::~DalitzEventPattern ( )
inlinevirtual

Definition at line 37 of file DalitzEventPattern.h.

37 {}

Member Function Documentation

◆ compatibleWith()

bool DalitzEventPattern::compatibleWith ( const DecayTree tree) const

Definition at line 164 of file DalitzEventPattern.cpp.

164  {
165  if(this->empty()) return false;
166 
167  if(tree.getVal().pdg() != (*this)[0]) return false; // check mother
168 
169  return compatibleWithFinalState(tree); // check daughters
170 }
bool compatibleWithFinalState(const AmpInitialiser &ampInitContainsTree) const
const ValueType & getVal() const
Definition: DDTree.h:102
int pdg() const

◆ compatibleWithFinalState() [1/5]

bool DalitzEventPattern::compatibleWithFinalState ( const AmpInitialiser ampInitContainsTree) const

Definition at line 172 of file DalitzEventPattern.cpp.

172  {
173  return compatibleWithFinalState(ampInitContainsTree.tree());
174 }
bool compatibleWithFinalState(const AmpInitialiser &ampInitContainsTree) const
const DecayTree & tree() const

◆ compatibleWithFinalState() [2/5]

bool DalitzEventPattern::compatibleWithFinalState ( const DecayTree tree) const

Definition at line 177 of file DalitzEventPattern.cpp.

177  {
178  if(this->empty()) return false;
179 
180  std::vector<const DecayTreeItem*> fsTree_pointers = tree.finalState();
181 
182  std::vector<int> fsTree;
183  for(unsigned int i=0; i< fsTree_pointers.size(); i++){
184  fsTree.push_back(fsTree_pointers[i]->pdg());
185  }
186 
187  return compatibleWithFinalState(fsTree);
188 }
bool compatibleWithFinalState(const AmpInitialiser &ampInitContainsTree) const
std::vector< const ValueType * > finalState() const
Definition: DDTree.h:293

◆ compatibleWithFinalState() [3/5]

bool DalitzEventPattern::compatibleWithFinalState ( const DalitzEventPattern pat) const

Definition at line 190 of file DalitzEventPattern.cpp.

191  {
192  if(this->empty()) return false;
193  std::vector<int> otherFs = pat.finalStates();
194  return compatibleWithFinalState(otherFs);
195 }
bool compatibleWithFinalState(const AmpInitialiser &ampInitContainsTree) const
std::vector< int > finalStates() const

◆ compatibleWithFinalState() [4/5]

bool DalitzEventPattern::compatibleWithFinalState ( const std::vector< int > &  otherFs) const

Definition at line 197 of file DalitzEventPattern.cpp.

198  {
199 
200  std::vector<int> fs = finalStates(); // my own;
201  if(otherFs_in.size() != fs.size()) return false;
202 
203  std::vector<int> otherFs(otherFs_in);
204  sort(fs.begin() , fs.end());
205  sort(otherFs.begin(), otherFs.end());
206 
207  for(unsigned int i=0; i<fs.size(); i++){
208  if(fs[i] != otherFs[i]) return false;
209  }
210 
211  return true;
212 
213 }
std::vector< int > finalStates() const

◆ compatibleWithFinalState() [5/5]

bool DalitzEventPattern::compatibleWithFinalState ( const MINT::PolymorphVector< int > &  otherFs) const
inline

Definition at line 54 of file DalitzEventPattern.h.

54  {
55  return compatibleWithFinalState(otherFs.theVector());
56  }
bool compatibleWithFinalState(const AmpInitialiser &ampInitContainsTree) const
std::vector< T > & theVector()

◆ equal()

bool DalitzEventPattern::equal ( const DalitzEventPattern other) const

Definition at line 109 of file DalitzEventPattern.cpp.

109  {
110  if(size() != other.size()) return false;
111  for(unsigned int i=0; i<size(); i++){
112  if((*this)[i] != other[i]) return false;
113  }
114  return true;
115 }

◆ finalStates()

std::vector< int > DalitzEventPattern::finalStates ( ) const

Definition at line 156 of file DalitzEventPattern.cpp.

156  {
157  std::vector<int> fs;
158  for(unsigned int i=1; i<this->size(); i++){
159  fs.push_back((*this)[i]);
160  }
161  return fs;
162 }

◆ getVectorOfInts()

std::vector< int > DalitzEventPattern::getVectorOfInts ( ) const

Definition at line 275 of file DalitzEventPattern.cpp.

275  {
276  std::vector<int> v(this->size());
277  for(unsigned int i=0; i<this->size(); i++){
278  v[i] = (int) (*this)[i];
279  }
280  return v;
281 }

◆ lt()

bool DalitzEventPattern::lt ( const DalitzEventPattern other) const

Definition at line 117 of file DalitzEventPattern.cpp.

117  {
118  if(equal(other)) return false;
119  if(size() < other.size()) return true;
120  if(size() > other.size()) return false;
121  for(unsigned int i=0; i<size(); i++){
122  if((*this)[i] < other[i]) return true;
123  if((*this)[i] > other[i]) return false;
124  }
125  return false;
126 }
bool equal(const DalitzEventPattern &other) const

◆ makeCPConjugate()

DalitzEventPattern DalitzEventPattern::makeCPConjugate ( ) const

Definition at line 103 of file DalitzEventPattern.cpp.

103  {
104  DalitzEventPattern pat(*this);
105  for(unsigned int i=0; i < pat.size(); i++) pat[i].antiThis();
106  return pat;
107 }

◆ name()

std::string DalitzEventPattern::name ( ) const

Definition at line 283 of file DalitzEventPattern.cpp.

283  {
284  std::string s("");
285  if(this->size() < 1) return "";
286  s = (*this)[0].name() + "->";
287  for(unsigned int i=1; i < this->size(); i++){
288  s += (*this)[i].name();
289  }
290  return s;
291 }
static const double s

◆ numDaughters()

int DalitzEventPattern::numDaughters ( ) const
inline

Definition at line 74 of file DalitzEventPattern.h.

74  {
75  return this->size() -1 ;
76  }

◆ operator!=()

bool DalitzEventPattern::operator!= ( const DalitzEventPattern rhs) const

Definition at line 130 of file DalitzEventPattern.cpp.

130  {
131  return ! ((*this) == rhs);
132 }

◆ operator<()

bool DalitzEventPattern::operator< ( const DalitzEventPattern rhs) const

Definition at line 134 of file DalitzEventPattern.cpp.

134  {
135  return lt(rhs);
136 }
bool lt(const DalitzEventPattern &other) const

◆ operator<=()

bool DalitzEventPattern::operator<= ( const DalitzEventPattern rhs) const

Definition at line 137 of file DalitzEventPattern.cpp.

137  {
138  return (*this < rhs || *this == rhs);
139 }

◆ operator==()

bool DalitzEventPattern::operator== ( const DalitzEventPattern rhs) const

Definition at line 127 of file DalitzEventPattern.cpp.

127  {
128  return equal(rhs);
129 }
bool equal(const DalitzEventPattern &other) const

◆ operator>()

bool DalitzEventPattern::operator> ( const DalitzEventPattern rhs) const

Definition at line 143 of file DalitzEventPattern.cpp.

143  {
144  return ! ((*this) <= rhs);
145 }

◆ operator>=()

bool DalitzEventPattern::operator>= ( const DalitzEventPattern rhs) const

Definition at line 140 of file DalitzEventPattern.cpp.

140  {
141  return ! ((*this) < rhs);
142 }

◆ print()

void DalitzEventPattern::print ( std::ostream &  os = std::cout) const

Definition at line 147 of file DalitzEventPattern.cpp.

147  {
148  os << "(";
149  for(unsigned int i=0; i< this->size(); i++){
150  os << (*this)[i];
151  if(i + 1< this->size()) os << ", ";
152  }
153  os << ")";
154 }

◆ selfConjugateFS()

bool DalitzEventPattern::selfConjugateFS ( ) const

Definition at line 215 of file DalitzEventPattern.cpp.

215  {
216  return this->compatibleWithFinalState(this->makeCPConjugate());
217 }
bool compatibleWithFinalState(const AmpInitialiser &ampInitContainsTree) const
DalitzEventPattern makeCPConjugate() const

◆ sijMax() [1/3]

double DalitzEventPattern::sijMax ( const MINT::PolymorphVector< int > &  indices) const

Definition at line 254 of file DalitzEventPattern.cpp.

254  {
255  if(this->empty()) return -9999;
256 
257  double sum=(*this)[0].mass();
258  for(unsigned int i=1; i<this->size(); i++){
259  sum -= (*this)[i].mass();
260  }
261  // at this stage, sum = mother mass - (all daugher masses).
262 
263  for(unsigned int i=0; i< indices.size(); i++){
264  if(indices[i] < 1 || indices[i] >= (int) this->size()){
265  // indices should be dgtr indices, i.e. from 1 to num-daughters.
266  return -9999.0;
267  }
268  sum += (*this)[indices[i]].mass();
269  }
270 
271  // now sum = mother mass - (missing daughter masses)
272  return sum*sum;
273 }

◆ sijMax() [2/3]

double DalitzEventPattern::sijMax ( int  i,
int  j 
) const

Definition at line 224 of file DalitzEventPattern.cpp.

224  {
225  std::vector<int> indices(2);
226  indices[0] = i; indices[1] = j;
227  return sijMax(indices);
228 }
double sijMax(const MINT::PolymorphVector< int > &indices) const

◆ sijMax() [3/3]

double DalitzEventPattern::sijMax ( int  i,
int  j,
int  k 
) const

Definition at line 236 of file DalitzEventPattern.cpp.

236  {
237  std::vector<int> indices(3);
238  indices[0] = i; indices[1] = j; indices[2]=k;
239  return sijMax(indices);
240 }
double sijMax(const MINT::PolymorphVector< int > &indices) const

◆ sijMin() [1/3]

double DalitzEventPattern::sijMin ( const MINT::PolymorphVector< int > &  indices) const

Definition at line 242 of file DalitzEventPattern.cpp.

242  {
243  double sum=0;
244  for(unsigned int i=0; i< indices.size(); i++){
245  if(indices[i] < 1 || indices[i] >= (int) this->size()){
246  // indices should be dgtr indices, i.e. from 1 to num-daughters.
247  return -9999.0;
248  }
249  sum += (*this)[indices[i]].mass();
250  }
251  return sum*sum;
252 }
unsigned int size() const

◆ sijMin() [2/3]

double DalitzEventPattern::sijMin ( int  i,
int  j 
) const

Definition at line 219 of file DalitzEventPattern.cpp.

219  {
220  std::vector<int> indices(2);
221  indices[0] = i; indices[1] = j;
222  return sijMin(indices);
223 }
double sijMin(const MINT::PolymorphVector< int > &indices) const

◆ sijMin() [3/3]

double DalitzEventPattern::sijMin ( int  i,
int  j,
int  k 
) const

Definition at line 230 of file DalitzEventPattern.cpp.

230  {
231  std::vector<int> indices(3);
232  indices[0] = i; indices[1] = j; indices[2] = k;
233  return sijMin(indices);
234 }
double sijMin(const MINT::PolymorphVector< int > &indices) const

Member Data Documentation

◆ NoPattern

const DalitzEventPattern DalitzEventPattern::NoPattern
static

Definition at line 19 of file DalitzEventPattern.h.


The documentation for this class was generated from the following files: