LOGO

RestFrames  v1.0.1
RestFrames HEP Event Analysis Software Library
DecayGenFrame.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 DecayGenFrame_HH
31 #define DecayGenFrame_HH
32 
33 #include "RestFrames/DecayFrame.hh"
35 
36 namespace RestFrames {
37 
38  class ResonanceGenFrame;
39 
41  // DecayGenFrame class
43  class DecayGenFrame : public DecayFrame<GeneratorFrame> {
44  public:
45  DecayGenFrame(const std::string& sname, const std::string& stitle);
46  DecayGenFrame();
47  virtual ~DecayGenFrame();
48 
49  virtual void SetMass(double val);
50  virtual void SetVariableMass(bool varymass = true);
51 
52  // For two-body decays
53  virtual void SetCosDecayAngle(double val);
54  virtual void SetDeltaPhiDecayPlane(double val);
55 
56  virtual double GetProbMCMC(double mass = -1.) const;
57  virtual void GenerateMassMCMC(double& mass, double& prob,
58  double max = -1.) const;
59 
60  protected:
61  double m_CosDecayAngle;
62  double m_DeltaPhiDecayPlane;
63 
64  std::vector<int> m_ChildIndexMCMC;
65  std::vector<double> m_ChildMassMCMC;
66  std::vector<double> m_ChildProbMCMC;
67  std::vector<double> m_InterMassFracMCMC;
68 
69  virtual bool IsSoundBody() const;
70 
71  virtual void ResetGenFrame();
72  virtual bool GenerateFrame();
73 
74  void GenerateTwoBodyRecursive(const std::vector<double>& M_parent,
75  const std::vector<double>& M_child,
76  const TVector3& axis_par,
77  const TVector3& axis_perp,
78  std::vector<TLorentzVector>& P_child);
79 
80  virtual bool InitializeGenAnalysis();
81  virtual bool IterateMCMC();
82 
83  };
84 
85  int DoubleMax(const void *a, const void *b);
86 
87 }
88 
89 #endif