LOGO

RestFrames  v1.0.0
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  CombinatoricGroup(const std::string& sname, const std::string& stitle);
43  virtual ~CombinatoricGroup();
44 
45  virtual void Clear();
46 
47  virtual void AddFrame(RestFrame& frame);
48  virtual void AddJigsaw(Jigsaw& jigsaw);
49 
50  virtual void RemoveFrame(RestFrame& frame);
51 
52  virtual void SetNElementsForFrame(const RestFrame& frame,
53  int N, bool exclusive_N = false);
54  virtual void GetNElementsForFrame(const RestFrame& frame,
55  int& N, bool& exclusive_N) const;
56 
57  // Event analysis functions
58  RFKey AddLabFrameFourVector(const TLorentzVector& V,
59  const RFCharge& charge = RFCharge());
60  RFKey AddLabFrameFourVector(const TLorentzVector& V,
61  int charge);
62  RFKey AddLabFrameFourVector(const TLorentzVector& V,
63  int charge_num, int charge_den);
64 
65  RestFrame const& GetFrame(const RFKey& key) const;
66 
67  TLorentzVector GetLabFrameFourVector(const RFKey& key) const;
68 
69  int GetNElementsInFrame(const RestFrame& frame) const;
70 
71  static CombinatoricGroup& Empty();
72 
73  protected:
74  virtual bool ClearEvent();
75  virtual bool AnalyzeEvent();
76 
77  virtual CombinatoricState& InitializeParentState();
78  virtual CombinatoricState& GetParentState() const;
79 
80  virtual CombinatoricState& GetChildState(int i) const;
81 
82  private:
83  VisibleStateList m_Elements;
84  mutable std::map<const RestFrame*, int> m_NElementsForFrame;
85  mutable std::map<const RestFrame*, bool> m_NExclusiveElementsForFrame;
86 
87  VisibleStateList m_InitStates;
88  VisibleState& GetNewElement();
89 
90 
91  static CombinatoricGroup m_Empty;
92 
93  };
94 
95 }
96 
97 #endif
abstract base class for all Jigsaw objects
Definition: Jigsaw.hh:44
virtual void Clear()
Clears Group of all connections to other objects.
abstract base class for all Group objects
Definition: Group.hh:46
abstract base class for all Frame objects