LOGO

RestFrames  v1.0.1
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  //typedef RestFrames::RFList<State> StateList;
45  //typedef std::vector<RestFrames::RFList<State> > StateListList;
46 
47  class State : public RFBase {
48  public:
49 
54  State(const std::string& sname, const std::string& stitle);
55 
57  State();
58  virtual ~State();
59 
61  virtual void Clear();
62 
66  StateType GetType() const;
67 
69  bool IsVisibleState() const;
70 
72  bool IsInvisibleState() const;
73 
75  bool IsCombinatoricState() const;
76 
78  virtual void AddFrame(const RestFrame& frame) = 0;
79 
87  virtual void AddFrames(const ConstRestFrameList& frames);
88 
92  ConstRestFrameList const& GetListFrames() const;
93 
97  int GetNFrames() const;
98 
105  virtual bool IsFrame(const RestFrame& frame) const;
106 
112  virtual bool IsFrames(const ConstRestFrameList& frames) const;
113 
121  virtual void SetParentJigsaw(Jigsaw& jigsaw = Jigsaw::Empty());
122 
130  virtual void SetChildJigsaw(Jigsaw& jigsaw = Jigsaw::Empty());
131 
137  virtual Jigsaw& GetParentJigsaw() const;
138 
144  virtual Jigsaw& GetChildJigsaw() const;
145 
151  virtual void Boost(const TVector3& B);
152 
156  virtual void SetFourVector(const TLorentzVector& V);
157 
161  virtual TLorentzVector GetFourVector() const;
162 
166  virtual RFCharge GetCharge() const;
167 
171  static State& Empty();
172 
176  static StateList const& EmptyList();
177 
178  protected:
179  StateType m_Type;
180  RFCharge m_Charge;
181 
182  ConstRestFrameList m_Frames;
183 
184  private:
185  TLorentzVector m_P;
186 
187  Jigsaw* m_ParentJigsawPtr;
188  Jigsaw* m_ChildJigsawPtr;
189 
190  static int m_class_key;
191 
192  static const StateList m_EmptyList;
193 
194  };
195 
196 }
197 
198 #endif
RestFrames::State::State
State()
Empty constructor.
Definition: State.cc:54
RestFrames::State::GetNFrames
int GetNFrames() const
Returns number of frames (RestFrame) contained in this state.
Definition: State.cc:106
RestFrames::State::IsCombinatoricState
bool IsCombinatoricState() const
Is this a CombinatoricState? (true/false)
Definition: State.cc:92
RestFrames::State::GetType
StateType GetType() const
Returns State (StateType) type.
Definition: State.cc:77
RestFrames::State::EmptyList
static StateList const & EmptyList()
Returns empty StateList.
Definition: State.cc:72
RFCharge.hh
RestFrames::RFCharge
Definition: RFCharge.hh:40
RestFrames::RestFrame
abstract base class for all Frame objects
Definition: RestFrame.hh:45
RestFrames::State::SetFourVector
virtual void SetFourVector(const TLorentzVector &V)
Sets four-vector of this frame.
Definition: State.cc:161
RestFrames::RFList< const RestFrame >
RestFrames::RFBase
Base class for all RestFrame package objects.
Definition: RFBase.hh:53
RestFrames::State::GetFourVector
virtual TLorentzVector GetFourVector() const
Returns four vector of this frame.
Definition: State.cc:165
Jigsaw.hh
RestFrames::State::Clear
virtual void Clear()
Clears State of all connections to other objects.
Definition: State.cc:61
RestFrames::State::GetCharge
virtual RFCharge GetCharge() const
Returns charge of this frames.
Definition: State.cc:169
RestFrames::State::SetChildJigsaw
virtual void SetChildJigsaw(Jigsaw &jigsaw=Jigsaw::Empty())
Sets the child jigsaw (Jigsaw) to jigsaw
Definition: State.cc:129
RFBase.hh
RestFrames::State::GetListFrames
ConstRestFrameList const & GetListFrames() const
Returns list of frames (RestFrame) contained in this state.
Definition: State.cc:102
RestFrames::State::IsFrames
virtual bool IsFrames(const ConstRestFrameList &frames) const
Checks if frames lists of state corresponds frames
Definition: State.cc:116
RestFrames::State::Empty
static State & Empty()
Returns empty state.
Definition: State.cc:68
RestFrames::State::AddFrames
virtual void AddFrames(const ConstRestFrameList &frames)
Adds a list of frames (RestFrame) to this state.
Definition: State.cc:96
RestFrames::Jigsaw::Empty
static Jigsaw & Empty()
Returns empty Jigsaw.
Definition: Jigsaw.cc:70
RestFrames::State::AddFrame
virtual void AddFrame(const RestFrame &frame)=0
Pure virtual function defined in derivatives of State class.
RestFrames::State::SetParentJigsaw
virtual void SetParentJigsaw(Jigsaw &jigsaw=Jigsaw::Empty())
Sets the parent jigsaw (Jigsaw) to jigsaw
Definition: State.cc:120
RestFrames::State::IsVisibleState
bool IsVisibleState() const
Is this a VisibleState? (true/false)
Definition: State.cc:82
RestFrames::State::IsFrame
virtual bool IsFrame(const RestFrame &frame) const
Checks if frame of state corresponds to frame
Definition: State.cc:110
RestFrames::State::IsInvisibleState
bool IsInvisibleState() const
Is this an InvisibleState? (true/false)
Definition: State.cc:87
RestFrames::State::Boost
virtual void Boost(const TVector3 &B)
Boosts to different frame (RestFrame)
Definition: State.cc:152
RestFrames::Jigsaw
abstract base class for all Jigsaw objects
Definition: Jigsaw.hh:44
RestFrames::State
Abstract base class for all State objects.
Definition: State.hh:47
RestFrames::State::GetChildJigsaw
virtual Jigsaw & GetChildJigsaw() const
Returns the child of this jigsaw (Jigsaw)
Definition: State.cc:145
RestFrames::State::GetParentJigsaw
virtual Jigsaw & GetParentJigsaw() const
Returns the parent of this jigsaw (Jigsaw)
Definition: State.cc:138