39 enum FrameType { kVanillaFrame, kVisibleFrame, kInvisibleFrame,
40 kDecayFrame, kLabFrame};
43 enum AnaType { kRecoFrame, kGenFrame };
45 class RestFrame :
public RFBase {
52 RestFrame(
const std::string& sname,
const std::string& stitle);
64 static void SetAxis(
const TVector3& axis);
67 static TVector3
const& GetAxis();
82 FrameType GetType()
const;
85 bool IsVisibleFrame()
const;
88 bool IsInvisibleFrame()
const;
91 bool IsDecayFrame()
const;
94 bool IsLabFrame()
const;
97 bool IsRecoFrame()
const;
100 bool IsGenFrame()
const;
103 virtual std::string PrintString(LogType type)
const;
122 virtual void AddChildFrame(RestFrame& frame);
127 void AddChildFrames(
const RestFrameList& frames);
135 virtual void SetParentFrame(RestFrame& frame =
144 void RemoveChildFrame(RestFrame& frame);
150 void RemoveChildFrames();
161 int GetNChildren()
const;
164 int GetNDescendants()
const;
171 virtual RestFrame
const& GetParentFrame()
const;
174 virtual RestFrame& GetChildFrame(
int i = 0)
const;
177 RestFrameList
const& GetChildFrames()
const;
184 virtual RestFrame
const& GetLabFrame()
const;
187 virtual RestFrame
const& GetProductionFrame()
const;
194 virtual RestFrame
const& GetSiblingFrame()
const;
203 int GetFrameDepth(
const RestFrame& frame)
const;
214 virtual RestFrame
const& GetFrameAtDepth(
int depth,
const RestFrame& frame)
const;
222 virtual RestFrameList GetListFrames(FrameType type = kLabFrame)
const;
225 virtual RestFrameList GetListVisibleFrames()
const;
228 virtual RestFrameList GetListInvisibleFrames()
const;
248 RestFrameList operator + (RestFrame& frame);
255 RestFrameList operator + (
const RestFrameList& frames);
258 virtual RFCharge GetCharge()
const;
261 virtual double GetMass()
const;
271 TLorentzVector GetFourVector(
const RestFrame& frame =
272 RestFrame::Empty())
const;
282 TLorentzVector GetVisibleFourVector(
const RestFrame& frame =
283 RestFrame::Empty())
const;
293 TLorentzVector GetInvisibleFourVector(
const RestFrame& frame =
294 RestFrame::Empty())
const;
303 double GetEnergy(
const RestFrame& frame)
const;
312 double GetMomentum(
const RestFrame& frame)
const;
316 TLorentzVector GetFourVector(
const TLorentzVector& P,
317 const RestFrame& def_frame =
318 RestFrame::Empty())
const;
329 double GetTransverseMomentum(
const RestFrame& frame =
331 const TVector3& axis =
332 RestFrame::GetAxis(),
333 const RestFrame& axis_frame =
334 RestFrame::Empty())
const;
338 double GetTransverseMomentum(
const TLorentzVector& P,
339 const TVector3& axis =
340 RestFrame::GetAxis(),
341 const RestFrame& axis_frame =
342 RestFrame::Empty())
const;
357 double GetVisibleShape()
const;
380 double GetSumVisibleMomentum()
const;
388 double GetSumInvisibleMomentum()
const;
396 TVector3 GetBoostInParentFrame()
const;
399 double GetGammaInParentFrame()
const;
423 TVector3 GetDecayPlaneNormalVector(
const RestFrame& frame =
424 RestFrame::Empty())
const;
433 double GetDeltaPhiDecayPlanes(
const RestFrame& frame)
const;
443 double GetCosDecayAngle(
const RestFrame& frame =
444 RestFrame::Empty())
const;
446 double GetDeltaPhiDecayAngle(
const TVector3& axis =
447 RestFrame::GetAxis(),
448 const RestFrame& frame =
449 RestFrame::Empty())
const;
450 double GetDeltaPhiBoostVisible(
const TVector3& axis =
451 RestFrame::GetAxis(),
452 const RestFrame& frame =
453 RestFrame::Empty())
const;
454 double GetDeltaPhiDecayVisible(
const TVector3& axis =
455 RestFrame::GetAxis(),
456 const RestFrame& frame =
457 RestFrame::Empty())
const;
458 double GetDeltaPhiVisible(
const TVector3& axis =
459 RestFrame::GetAxis(),
460 const RestFrame& frame =
461 RestFrame::Empty())
const;
465 static RestFrame& Empty();
468 static ConstRestFrameList
const& EmptyList();
474 virtual bool IsSoundBody()
const;
476 TVector3
const& GetChildBoostVector(RestFrame& frame)
const;
477 TVector3
const& GetParentBoostVector()
const;
480 virtual bool InitializeTreeRecursive();
483 virtual bool InitializeAnalysisRecursive() = 0;
486 virtual bool AnalyzeEventRecursive() = 0;
489 virtual bool ClearEventRecursive() = 0;
492 bool IsCircularTree(std::vector<RFKey>& keys)
const;
496 static int m_class_key;
499 static TVector3 m_Axis;
505 const RestFrame* m_ProdFramePtr;
508 RestFrameList m_ChildFrames;
509 mutable std::map<const RestFrame*, TVector3> m_ChildBoosts;
512 RestFrame* m_ParentFramePtr;
513 TVector3 m_ParentBoost;
515 void SetFourVector(
const TLorentzVector& V,
const RestFrame& frame);
516 void SetChildBoostVector(RestFrame& frame,
const TVector3& boost);
517 void SetParentBoostVector(
const TVector3& boost);
520 void FillListFramesRecursive(RestFrameList& frames,
521 FrameType type = kLabFrame)
const;
523 bool FindPathToFrame(
const RestFrame& dest_frame,
524 const RestFrame& prev_frame,
525 std::vector<const TVector3*>& boosts)
const;
527 static const ConstRestFrameList m_EmptyList;
529 friend class ReconstructionFrame;
530 friend class GeneratorFrame;