AmpTools
Kinematics.cc
Go to the documentation of this file.
1 //******************************************************************************
2 // This file is part of AmpTools, a package for performing Amplitude Analysis
3 //
4 // Copyright Trustees of Indiana University 2010, all rights reserved
5 //
6 // This software written by Matthew Shepherd, Ryan Mitchell, and
7 // Hrayr Matevosyan at Indiana University, Bloomington
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions
11 // are met:
12 // 1. Redistributions of source code must retain the above copyright
13 // notice and author attribution, this list of conditions and the
14 // following disclaimer.
15 // 2. Redistributions in binary form must reproduce the above copyright
16 // notice and author attribution, this list of conditions and the
17 // following disclaimer in the documentation and/or other materials
18 // provided with the distribution.
19 // 3. Neither the name of the University nor the names of its contributors
20 // may be used to endorse or promote products derived from this software
21 // without specific prior written permission.
22 //
23 // Creation of derivative forms of this software for commercial
24 // utilization may be subject to restriction; written permission may be
25 // obtained from the Trustees of Indiana University.
26 //
27 // INDIANA UNIVERSITY AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES,
28 // EXPRESS OR IMPLIED. By way of example, but not limitation, INDIANA
29 // UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCANTABILITY OR
30 // FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS SOFTWARE OR
31 // DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS,
32 // OR OTHER RIGHTS. Neither Indiana University nor the authors shall be
33 // held liable for any liability with respect to any claim by the user or
34 // any other party arising from use of the program.
35 //******************************************************************************
36 
37 #include <vector>
38 #include <cassert>
39 #include <iostream>
40 
41 #include "IUAmpTools/Kinematics.h"
42 #include "TLorentzVector.h"
43 
44 using namespace std;
45 
46 const vector< TLorentzVector >&
48 
49  return m_particleList;
50 }
51 
52 const TLorentzVector&
53 Kinematics::particle( unsigned int index ) const {
54 
55  if( index >= m_particleList.size() ){
56 
57  cout << "ERROR: Request for particle index " << index <<
58  ", but only " << m_particleList.size() << " particles exist." << endl;
59 
60  assert( false );
61  }
62 
63  return m_particleList[index];
64 }
65 
66 void
67 Kinematics::setParticleList( const vector< TLorentzVector >& particleList ){
68 
69  assert( particleList.size() <= kMaxParticles );
70 
71  m_particleList = particleList;
72 }
73 
74 int Kinematics::m_globalEventID = 0;
const TLorentzVector & particle(unsigned int index) const
Definition: Kinematics.cc:53
void setParticleList(const vector< TLorentzVector > &particleList)
Definition: Kinematics.cc:67
const vector< TLorentzVector > & particleList() const
Definition: Kinematics.cc:47