ROOTPWA
event.h
Go to the documentation of this file.
1 #ifndef EVENT_H
2 #define EVENT_H
3 
4 
5 #include <iostream>
6 #include <string>
7 #include <list>
8 
9 #include "Vec.h"
10 #include "lorentz.h"
11 #include "particle.h"
12 
13 
14 class event {
15 
16 public:
17 
18  event();
19  event(const event&);
20  virtual ~event();
21 
22  event& operator = (const event& e);
23  friend event operator * (const lorentzTransform&,
24  const event&);
25 
26  event& addfinal (const particle&);
27  event& addinitial(const particle& p);
28  event& erase();
29 
30  bool isValid();
31 
32  particle beam () const { return *_beam; }
33  particle target() const { return *_target; }
34  event& beam (const particle&);
35  event& target(const particle&);
36 
37  int OK(const double epsilon = 1e-6) const;
38 
39  fourVec getPartPFinal(const std::string& name,
40  const int charge,
41  const int index,
42  const int debug = 0) const;
43  fourVec getPartPInitial(const std::string& name,
44  const int charge,
45  const int index) const;
46 
47  int f_charge () const;
48  double f_mass () const;
49  std::list<particle> f_mesons () const;
50  std::list<particle> f_baryons () const;
51  std::list<particle> f_particles() const { return _final; }
52  particle f_particle (const std::string& name,
53  const int charge,
54  const int index) const;
55  void set_f_mesons(const std::list<particle>& l);
56 
57  int i_charge () const;
58  std::list<particle> i_mesons () const;
59  std::list<particle> i_baryons () const;
60  std::list<particle> i_particles() const { return _initial; }
61  particle i_particle (const std::string& name,
62  const int charge,
63  const int index) const;
64 
65  threeVec mesonPlane () const;
66  threeVec baryonPlane() const;
67 
68  void print() const;
69  friend std::ostream& operator << (std::ostream& os, const event& e);
70  std::ostream& write1(std::ostream& os) const;
71  std::ostream& write2(std::ostream& os) const;
72 
73  friend std::istream& operator >> (std::istream& is, event& e);
74  std::istream& read1(std::istream& is);
75  std::istream& read2(std::istream& is);
76 
77  event& setIOVersion(const int ver);
78 
79 protected:
80 
81  std::list<particle> _initial;
82  std::list<particle> _final;
86 
87 };
88 
89 
90 #endif // EVENT_H