TwoBodyDecayGen
TwoBodyDecayGen is a simple MC generator that generates 4-vectors for 2-body B-decays.
 All Classes Files Functions Variables Typedefs Macros
TwoBodyDecayGen.hxx
Go to the documentation of this file.
1 
11 #ifndef TWOBODYDECAYGEN_HXX
12 #define TWOBODYDECAYGEN_HXX
13 
14 #include <string>
15 #include <vector>
16 #include <deque>
17 
18 #include <TH1.h>
19 #include <TTree.h>
20 #include <TLorentzVector.h>
21 #include <TGenPhaseSpace.h>
22 
23 #define NDAUS 2
46 class TwoBodyDecayGen {
47 public:
48 
49  typedef std::pair<std::vector<TwoBodyDecayGen*>, double> DauNode;
50  typedef std::vector<DauNode> DauNodeVec;
51  typedef std::pair<unsigned, double> chBFpair;
62  TwoBodyDecayGen(double mommass, double dau1mass, double dau2mass,
63  TwoBodyDecayGen *dau1=NULL,
64  TwoBodyDecayGen *dau2=NULL);
65 
74  TwoBodyDecayGen(double mommass, double *daumasses,
75  TwoBodyDecayGen *dau1=NULL,
76  TwoBodyDecayGen *dau2=NULL);
77 
100  TwoBodyDecayGen(double *masses, unsigned nparts);
101 
102  ~TwoBodyDecayGen() {}
103 
113  bool add_decay_channel(double *masses, unsigned nparts,
114  double brfr);
115 
124  TwoBodyDecayGen* get_daughter(unsigned chid, unsigned dauid);
125 
133  double get_brfr(unsigned chid);
134 
170  int find_leaf_nodes(std::vector<std::deque<chBFpair> > &brfrVec,
171  std::deque<chBFpair> &brfrQ);
172 
182  double generate(TLorentzVector &momp,
183  std::vector<TLorentzVector> &particle_lvs,
184  std::deque<chBFpair> chQ);
185 
194  TTree* get_event_tree(unsigned nevents, TH1 *hmomp);
195 
201  void print(unsigned indent=0);
202 
203 private:
204 
211  void _printQ(std::string prefix, std::deque<chBFpair> queue);
212 
219  void _printQ(std::string prefix, std::vector<std::deque<chBFpair> > queue);
220 
221  static unsigned long long _count;
222  TGenPhaseSpace _generator;
223  double _mommass;
224  double _daumasses[NDAUS];
226 };
227 
228 #endif // TWOBODYDECAYGEN_HXX