LOGO

RestFrames  v1.0.0
RestFrames HEP Event Analysis Software Library
InvisibleState.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 
33 
34 namespace RestFrames {
35 
37  // InvisibleState class
39 
40  InvisibleState::InvisibleState(const std::string& sname,
41  const std::string& stitle)
42  : State(sname, stitle)
43  {
44  m_Type = kInvisibleState;
45  }
46 
47  InvisibleState::InvisibleState() : State() {}
48 
49  InvisibleState::~InvisibleState() {}
50 
51  InvisibleState& InvisibleState::Empty(){
52  return InvisibleState::m_Empty;
53  }
54 
56  State::Clear();
57  }
58 
59  void InvisibleState::AddFrame(const RestFrame& frame){
60  if(IsEmpty()) return;
61 
62  if(!frame) return;
63  if(frame.IsInvisibleFrame() &&
64  frame.IsRecoFrame())
65  m_Frames += frame;
66 
67  }
68 
69  void InvisibleState::SetParentJigsaw(Jigsaw& jigsaw){
70  if(!jigsaw) return;
71  if(jigsaw.IsInvisibleJigsaw())
72  State::SetParentJigsaw(jigsaw);
73  }
74 
75  void InvisibleState::SetChildJigsaw(Jigsaw& jigsaw){
76  if(!jigsaw) return;
77  if(jigsaw.IsInvisibleJigsaw())
78  State::SetChildJigsaw(jigsaw);
79  }
80 
81  double InvisibleState::GetMinimumMass() const {
82  if(!GetChildJigsaw().IsEmpty())
83  return static_cast<const InvisibleJigsaw&>(GetChildJigsaw()).GetMinimumMass();
84  if(GetNFrames() == 1)
85  return static_cast<const InvisibleRecoFrame&>(m_Frames[0]).GetMinimumMass();
86  else
87  return 0.;
88  }
89 
90  InvisibleState InvisibleState::m_Empty;
91 }
bool IsEmpty() const
Checks whether this is default (empty) instance of class.
Definition: RFBase.cc:84
virtual void Clear()
Clears RFBase of all connections to other objects.
Definition: State.cc:61
abstract base class for all Frame objects
virtual void Clear()
Clears RFBase of all connections to other objects.