AmpTools
Kinematics.h
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 #if !defined(KINEMATICS)
38 #define KINEMATICS
39 
40 #include <vector>
41 #include <cassert>
42 
43 #include "TLorentzVector.h"
44 
45 using namespace std;
46 
62 {
63 
64 public:
65 
73  m_eventID( Kinematics::m_globalEventID++ ),
74  m_weight( 1.0 ) {}
75 
87  Kinematics( const vector< TLorentzVector >& particleList,
88  float weight = 1.0 ) :
89  m_eventID( Kinematics::m_globalEventID++ ),
90  m_particleList( particleList ),
91  m_weight( weight ) { assert( particleList.size() <= kMaxParticles ); }
92 
96  virtual ~Kinematics() {}
97 
104  enum { kMaxParticles = 6 };
105 
118  void setEventID( int eventID ) { m_eventID = eventID; }
119 
132  void setParticleList( const vector< TLorentzVector >& particleList );
133 
145  void setWeight( float weight ) { m_weight = weight; }
146 
156  const vector<TLorentzVector>& particleList() const;
157 
169  const TLorentzVector& particle( unsigned int index ) const;
170 
178  int eventID() const { return m_eventID; }
179 
187  float weight() const { return m_weight; }
188 
189 private:
190 
191  int m_eventID;
192  vector<TLorentzVector> m_particleList;
193  float m_weight;
194 
195  static int m_globalEventID;
196 };
197 
198 #endif
void setWeight(float weight)
Definition: Kinematics.h:145
int eventID() const
Definition: Kinematics.h:178
Kinematics(const vector< TLorentzVector > &particleList, float weight=1.0)
Definition: Kinematics.h:87
void setEventID(int eventID)
Definition: Kinematics.h:118
virtual ~Kinematics()
Definition: Kinematics.h:96
float weight() const
Definition: Kinematics.h:187