LOGO

RestFrames  v1.0.0
RestFrames HEP Event Analysis Software Library
Group.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 Group_HH
31 #define Group_HH
32 
33 #include "RestFrames/RFBase.hh"
34 
35 namespace RestFrames {
36 
37  class Jigsaw;
38  class RestFrame;
39 
40  enum GroupType { kVanillaGroup, kInvisibleGroup,
41  kCombinatoricGroup };
42 
44  // Group class
46  class Group : public RFBase {
47 
48  public:
49  Group(const std::string& sname, const std::string& stitle);
50  Group();
51  virtual ~Group();
52 
54  virtual void Clear();
55 
56  bool IsInvisibleGroup() const;
57  bool IsCombinatoricGroup() const;
58 
59  GroupType GetType() const { return m_Type; }
60 
61  virtual void AddFrame(RestFrame& frame);
62  virtual void AddFrames(const RestFrameList& frames);
63  virtual void AddJigsaw(Jigsaw& jigsaw);
64 
65  virtual void RemoveFrame(RestFrame& frame);
66  void RemoveFrames();
67  void RemoveJigsaw(Jigsaw& jigsaw);
68  void RemoveJigsaws();
69 
70  bool ContainsFrame(const RestFrame& frame) const;
71 
72  int GetNFrames() const;
73  const RestFrameList& GetListFrames() const;
74  const JigsawList& GetListJigsaws() const;
75 
76  static Group& Empty();
77 
78  protected:
79  GroupType m_Type;
80  State* m_GroupStatePtr;
81 
82  virtual bool InitializeAnalysis();
83  virtual bool ClearEvent() = 0;
84  virtual bool AnalyzeEvent() = 0;
85 
86  virtual State& InitializeParentState() = 0;
87  virtual State& GetParentState() const;
88 
89  int GetNChildStates() const;
90  virtual State& GetChildState(int i) const;
91 
92  State& GetChildState(const RestFrame& frame) const;
93  StateList GetChildStates(const RestFrameList& frames) const;
94 
95  RestFrame const& GetLabFrame() const;
96 
97  private:
98  RestFrameList m_Frames;
99  JigsawList m_Jigsaws;
100  StateList m_States;
101 
102  StateList m_StatesToResolve;
103  JigsawList m_JigsawsToUse;
104 
105  bool ResolveUnknowns();
106  bool ResolveState(const State& state);
107  bool InitializeJigsaw(Jigsaw& jigsaw);
108 
109  static int m_class_key;
110 
111  friend class TreePlot;
112  friend class ReconstructionFrame;
113  friend class LabRecoFrame;
114  friend class Jigsaw;
115 
116  };
117 
118 }
119 
120 #endif
abstract base class for all Jigsaw objects
Definition: Jigsaw.hh:44
Base class for all RestFrame package objects.
Definition: RFBase.hh:53
abstract base class for all Group objects
Definition: Group.hh:46
virtual void Clear()
Clears Group of all connections to other objects.
Definition: Group.cc:62
abstract base class for all Frame objects
abstract base class for all State objects
Definition: State.hh:44