LOGO

RestFrames  v1.0.1
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 
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 
70  if(!jigsaw) return;
71  if(jigsaw.IsInvisibleJigsaw())
72  State::SetParentJigsaw(jigsaw);
73  }
74 
76  if(!jigsaw) return;
77  if(jigsaw.IsInvisibleJigsaw())
78  State::SetChildJigsaw(jigsaw);
79  }
80 
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 }
RestFrames::State::GetNFrames
int GetNFrames() const
Returns number of frames (RestFrame) contained in this state.
Definition: State.cc:106
InvisibleJigsaw.hh
RestFrames::InvisibleState::GetMinimumMass
virtual double GetMinimumMass() const
Returns minimum Lorentz invariant mass.
Definition: InvisibleState.cc:81
InvisibleState.hh
RestFrames::RestFrame::IsRecoFrame
bool IsRecoFrame() const
Is this an ReconstructionFrame ? (yes/no)
Definition: RestFrame.cc:113
RestFrames::RestFrame
abstract base class for all Frame objects
Definition: RestFrame.hh:45
RestFrames::RFBase::IsEmpty
bool IsEmpty() const
Checks whether this is default (empty) instance of class.
Definition: RFBase.cc:84
RestFrames::InvisibleState::InvisibleState
InvisibleState()
Empty constructor.
Definition: InvisibleState.cc:47
RestFrames::InvisibleState::SetParentJigsaw
virtual void SetParentJigsaw(Jigsaw &jigsaw)
Sets the parent jigsaw (Jigsaw) to jigsaw
Definition: InvisibleState.cc:69
RestFrames::State::Clear
virtual void Clear()
Clears State of all connections to other objects.
Definition: State.cc:61
RestFrames::InvisibleState::SetChildJigsaw
virtual void SetChildJigsaw(Jigsaw &jigsaw)
Sets the child jigsaw (Jigsaw) to jigsaw
Definition: InvisibleState.cc:75
RestFrames::Jigsaw::IsInvisibleJigsaw
bool IsInvisibleJigsaw() const
Is invisible jigsaw? (true/false)
Definition: Jigsaw.cc:92
RestFrames::State::SetChildJigsaw
virtual void SetChildJigsaw(Jigsaw &jigsaw=Jigsaw::Empty())
Sets the child jigsaw (Jigsaw) to jigsaw
Definition: State.cc:129
RestFrames::InvisibleState::AddFrame
virtual void AddFrame(const RestFrame &frame)
Adds a frame (RestFrame) to this state.
Definition: InvisibleState.cc:59
RestFrames::RestFrame::IsInvisibleFrame
bool IsInvisibleFrame() const
Is this an InvisibleFrame ? (yes/no)
Definition: RestFrame.cc:101
RestFrames::InvisibleState::Clear
virtual void Clear()
Clears InvisibleState to all connections from other objects.
Definition: InvisibleState.cc:55
RestFrames::InvisibleRecoFrame
Definition: InvisibleRecoFrame.hh:41
RestFrames::State::SetParentJigsaw
virtual void SetParentJigsaw(Jigsaw &jigsaw=Jigsaw::Empty())
Sets the parent jigsaw (Jigsaw) to jigsaw
Definition: State.cc:120
InvisibleRecoFrame.hh
RestFrames::InvisibleRecoFrame::GetMinimumMass
double GetMinimumMass() const
Returns minimum Lorentz invariant mass.
Definition: InvisibleRecoFrame.cc:48
RestFrames::Jigsaw
abstract base class for all Jigsaw objects
Definition: Jigsaw.hh:44
RestFrames::InvisibleJigsaw
Definition: InvisibleJigsaw.hh:39
RestFrames::State
Abstract base class for all State objects.
Definition: State.hh:47
RestFrames::InvisibleState
Definition: InvisibleState.hh:40
RestFrames::State::GetChildJigsaw
virtual Jigsaw & GetChildJigsaw() const
Returns the child of this jigsaw (Jigsaw)
Definition: State.cc:145