LOGO

RestFrames  v1.0.0
RestFrames HEP Event Analysis Software Library
TreePlotNode.cc
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 
31 #include "RestFrames/RestFrame.hh"
32 #include "RestFrames/Jigsaw.hh"
33 #include "RestFrames/State.hh"
34 
35 namespace RestFrames {
36 
37  TreePlotNode::TreePlotNode(){
38  m_X = 0;
39  m_Y = 0;
40  m_Label = "";
41  m_DoLabel = false;
42  m_DoSquare = false;
43  m_FramePtr = nullptr;
44  m_StatePtr = nullptr;
45  }
46 
47  TreePlotNode::~TreePlotNode() {}
48 
49  void TreePlotNode::SetX(double x){
50  m_X = x;
51  }
52 
53  void TreePlotNode::SetY(double y){
54  m_Y = y;
55  }
56 
57  void TreePlotNode::SetLabel(const std::string& label){
58  m_Label = label;
59  m_DoLabel = true;
60  }
61 
62  void TreePlotNode::SetSquare(bool square){
63  m_DoSquare = square;
64  }
65 
66  void TreePlotNode::SetFrame(const RestFrame& frame){
67  m_FramePtr = &frame;
68  }
69 
70  void TreePlotNode::SetState(const State& state){
71  m_StatePtr = &state;
72  }
73 
74  void TreePlotNode::AddJigsaw(const Jigsaw& jigsaw){
75  m_Jigsaws.Add(jigsaw);
76  }
77 
78  double TreePlotNode::GetX() const {
79  return m_X;
80  }
81 
82  double TreePlotNode::GetY() const {
83  return m_Y;
84  }
85 
86  std::string TreePlotNode::GetLabel() const {
87  return m_Label;
88  }
89 
90  const RestFrame& TreePlotNode::GetFrame() const {
91  if(m_FramePtr)
92  return *m_FramePtr;
93  else
94  return RestFrame::Empty();
95  }
96 
97  const State& TreePlotNode::GetState() const {
98  if(m_StatePtr)
99  return *m_StatePtr;
100  else
101  return State::Empty();
102  }
103 
104  bool TreePlotNode::DoLabel() const {
105  return m_DoLabel;
106  }
107 
108  bool TreePlotNode::DoSquare() const {
109  return m_DoSquare;
110  }
111 
112  int TreePlotNode::GetNJigsaws() const {
113  return m_Jigsaws.GetN();
114  }
115 
116  ConstJigsawList TreePlotNode::GetJigsawList() const {
117  return m_Jigsaws;
118  }
119 
120 }