LOGO

RestFrames  v1.0.1
RestFrames HEP Event Analysis Software Library
CombinatoricGroup.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 CombinatoricGroup_HH
31 #define CombinatoricGroup_HH
32 
33 #include "RestFrames/Group.hh"
36 
37 namespace RestFrames {
38 
39  class CombinatoricGroup : public Group {
40  public:
41 
46  CombinatoricGroup(const std::string& sname, const std::string& stitle);
47 
50  virtual ~CombinatoricGroup();
51 
53  virtual void Clear();
54 
61  virtual void AddFrame(RestFrame& frame);
62 
69  virtual void AddJigsaw(Jigsaw& jigsaw);
70 
76  virtual void RemoveFrame(RestFrame& frame);
77 
86  virtual void SetNElementsForFrame(const RestFrame& frame,
87  int N, bool exclusive_N = false);
88 
98  virtual void GetNElementsForFrame(const RestFrame& frame,
99  int& N, bool& exclusive_N) const;
100 
107  RFKey AddLabFrameFourVector(const TLorentzVector& V,
108  const RFCharge& charge = RFCharge());
109 
118  RFKey AddLabFrameFourVector(const TLorentzVector& V,
119  int charge);
120 
128  RFKey AddLabFrameFourVector(const TLorentzVector& V,
129  int charge_num, int charge_den);
130 
139  RestFrame const& GetFrame(const RFKey& key) const;
140 
149  TLorentzVector GetLabFrameFourVector(const RFKey& key) const;
150 
156  int GetNElementsInFrame(const RestFrame& frame) const;
157 
161  static CombinatoricGroup& Empty();
162 
163  protected:
164  virtual bool ClearEvent();
165  virtual bool AnalyzeEvent();
166 
167  virtual CombinatoricState& InitializeParentState();
168  virtual CombinatoricState& GetParentState() const;
169 
170  virtual CombinatoricState& GetChildState(int i) const;
171 
172  private:
173  VisibleStateList m_Elements;
174  mutable std::map<const RestFrame*, int> m_NElementsForFrame;
175  mutable std::map<const RestFrame*, bool> m_NExclusiveElementsForFrame;
176 
177  VisibleStateList m_InitStates;
178  VisibleState& GetNewElement();
179 
180 
181  static CombinatoricGroup m_Empty;
182 
183  };
184 
185 }
186 
187 #endif
RestFrames::CombinatoricState
Definition: CombinatoricState.hh:43
RestFrames::RFCharge
Definition: RFCharge.hh:40
RestFrames::CombinatoricGroup::Clear
virtual void Clear()
Clears CombinatoricGroup of all connections to other objects.
Definition: CombinatoricGroup.cc:57
RestFrames::CombinatoricGroup::GetNElementsForFrame
virtual void GetNElementsForFrame(const RestFrame &frame, int &N, bool &exclusive_N) const
Tells number of elements required for this frame.
Definition: CombinatoricGroup.cc:101
RestFrames::RestFrame
abstract base class for all Frame objects
Definition: RestFrame.hh:45
RestFrames::Group
abstract base class for all Group objects
Definition: Group.hh:46
RestFrames::CombinatoricGroup::GetNElementsInFrame
int GetNElementsInFrame(const RestFrame &frame) const
Returns number of elements in a frame.
Definition: CombinatoricGroup.cc:197
RestFrames::RFList< VisibleState >
RestFrames::CombinatoricGroup::CombinatoricGroup
CombinatoricGroup()
Empty constructor.
Definition: CombinatoricGroup.cc:49
RestFrames::CombinatoricGroup::AddLabFrameFourVector
RFKey AddLabFrameFourVector(const TLorentzVector &V, const RFCharge &charge=RFCharge())
Adds four-vector (TLorentzVector) in the lab frame.
Definition: CombinatoricGroup.cc:154
RestFrames::CombinatoricGroup::GetFrame
RestFrame const & GetFrame(const RFKey &key) const
Returns frame (RestFrame) that contains key
Definition: CombinatoricGroup.cc:180
RestFrames::VisibleState
Definition: VisibleState.hh:39
RestFrames::CombinatoricGroup::RemoveFrame
virtual void RemoveFrame(RestFrame &frame)
Removes a frame (RestFrame) from this combinatoric group.
Definition: CombinatoricGroup.cc:79
RestFrames::CombinatoricGroup::AddJigsaw
virtual void AddJigsaw(Jigsaw &jigsaw)
Adds a jigsaw (Jigsaw) to this combinatoric group.
Definition: CombinatoricGroup.cc:109
CombinatoricState.hh
RestFrames::CombinatoricGroup::Empty
static CombinatoricGroup & Empty()
Returns empty CombinatoricGroup.
Definition: CombinatoricGroup.cc:53
RestFrames::CombinatoricGroup::GetLabFrameFourVector
TLorentzVector GetLabFrameFourVector(const RFKey &key) const
Returns lab frame's four-vector (TLorentzVector) of frame that contains key
Definition: CombinatoricGroup.cc:188
VisibleState.hh
RestFrames::CombinatoricGroup
Definition: CombinatoricGroup.hh:39
RestFrames::Jigsaw
abstract base class for all Jigsaw objects
Definition: Jigsaw.hh:44
RestFrames::RFKey
Definition: RFKey.hh:38
RestFrames::CombinatoricGroup::SetNElementsForFrame
virtual void SetNElementsForFrame(const RestFrame &frame, int N, bool exclusive_N=false)
Assigns to frame a required min/max number of elements.
Definition: CombinatoricGroup.cc:87
Group.hh
RestFrames::CombinatoricGroup::AddFrame
virtual void AddFrame(RestFrame &frame)
Adds a frame (RestFrame) to this combinatoric group.
Definition: CombinatoricGroup.cc:65