LOGO

RestFrames  v1.0.0
RestFrames HEP Event Analysis Software Library
State.hh
Go to the documentation of this file.
1 // RestFrames: particle physics event analysis library
3 // --------------------------------------------------------------------
4 // Copyright (c) 2014-2016, Christopher Rogan
14 // This file is part of RestFrames.
15 //
16 // RestFrames is free software; you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation; either version 2 of the License, or
19 // (at your option) any later version.
20 //
21 // RestFrames is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with RestFrames. If not, see <http://www.gnu.org/licenses/>.
29 
30 #ifndef State_HH
31 #define State_HH
32 
33 #include "RestFrames/RFBase.hh"
34 #include "RestFrames/RFCharge.hh"
35 #include "RestFrames/Jigsaw.hh"
36 
37 namespace RestFrames {
38 
39  class RestFrame;
40 
41  enum StateType { kVanillaState, kVisibleState,
42  kInvisibleState, kCombinatoricState };
43 
44  class State : public RFBase {
45  public:
46  State(const std::string& sname, const std::string& stitle);
47  State();
48  virtual ~State();
49 
50  virtual void Clear();
51 
53  StateType GetType() const;
54 
56  bool IsVisibleState() const;
57 
59  bool IsInvisibleState() const;
60 
62  bool IsCombinatoricState() const;
63 
64  virtual void AddFrame(const RestFrame& frame) = 0;
65  virtual void AddFrames(const ConstRestFrameList& frames);
66 
67  ConstRestFrameList const& GetListFrames() const;
68  int GetNFrames() const;
69 
70  virtual bool IsFrame(const RestFrame& frame) const;
71  virtual bool IsFrames(const ConstRestFrameList& frames) const;
72 
73  virtual void SetParentJigsaw(Jigsaw& jigsaw = Jigsaw::Empty());
74  virtual void SetChildJigsaw(Jigsaw& jigsaw = Jigsaw::Empty());
75  virtual Jigsaw& GetParentJigsaw() const;
76  virtual Jigsaw& GetChildJigsaw() const;
77 
78  virtual void Boost(const TVector3& B);
79  virtual void SetFourVector(const TLorentzVector& V);
80  virtual TLorentzVector GetFourVector() const;
81  virtual RFCharge GetCharge() const;
82 
83  static State& Empty();
84  static StateList const& EmptyList();
85 
86  protected:
87  StateType m_Type;
88  RFCharge m_Charge;
89 
90  ConstRestFrameList m_Frames;
91 
92  private:
93  TLorentzVector m_P;
94 
95  Jigsaw* m_ParentJigsawPtr;
96  Jigsaw* m_ChildJigsawPtr;
97 
98  static int m_class_key;
99 
100  static const StateList m_EmptyList;
101 
102  };
103 
104 }
105 
106 #endif
abstract base class for all Jigsaw objects
Definition: Jigsaw.hh:44
Base class for all RestFrame package objects.
Definition: RFBase.hh:53
bool IsCombinatoricState() const
Is this a CombinatoricState? (true/false)
Definition: State.cc:92
virtual void Clear()
Clears RFBase of all connections to other objects.
Definition: State.cc:61
StateType GetType() const
Returns State (StateType) type.
Definition: State.cc:77
abstract base class for all Frame objects
bool IsInvisibleState() const
Is this an InvisibleState? (true/false)
Definition: State.cc:87
abstract base class for all State objects
Definition: State.hh:44
bool IsVisibleState() const
Is this a VisibleState? (true/false)
Definition: State.cc:82