TwoBodyDecayGen
TwoBodyDecayGen is a simple MC generator that generates 4-vectors for 2-body B-decays.
 All Classes Files Functions Variables Typedefs Macros
TwoBodyDecayGen Class Reference

This class defines a sequential 2-body decay tree and generates events using the ROOT class TGenPhaseSpace. More...

#include <TwoBodyDecayGen.hxx>

Collaboration diagram for TwoBodyDecayGen:
[legend]

List of all members.

Public Types

typedef std::pair< std::vector
< TwoBodyDecayGen * >, double > 
DauNode
 Node with B.F.
typedef std::vector< DauNodeDauNodeVec
 Vector of nodes (channels)
typedef std::pair< unsigned,
double > 
chBFpair
 Channel id and B.F.

Public Member Functions

 TwoBodyDecayGen (double mommass, double dau1mass, double dau2mass, TwoBodyDecayGen *dau1=NULL, TwoBodyDecayGen *dau2=NULL)
 Constructor 1.
 TwoBodyDecayGen (double mommass, double *daumasses, TwoBodyDecayGen *dau1=NULL, TwoBodyDecayGen *dau2=NULL)
 Constructor 2.
 TwoBodyDecayGen (double *masses, unsigned nparts)
 Constructor that takes an array with particle masses for the entire decay tree.
bool add_decay_channel (double *masses, unsigned nparts, double brfr)
 Add a new decay channel.
TwoBodyDecayGenget_daughter (unsigned chid, unsigned dauid)
 Return requested daughter decay node.
double get_brfr (unsigned chid)
 Return BF for decay channel.
int find_leaf_nodes (std::vector< std::deque< chBFpair > > &brfrVec, std::deque< chBFpair > &brfrQ)
 Find leaf branches or decay nodes.
double generate (TLorentzVector &momp, std::vector< TLorentzVector > &particle_lvs, std::deque< chBFpair > chQ)
 Generate one event at a time.
TTree * get_event_tree (unsigned nevents, TH1 *hmomp)
 Generate arbitrary number of events.
void print (unsigned indent=0)
 Print decay tree.

Private Member Functions

void _printQ (std::string prefix, std::deque< chBFpair > queue)
 Print queue for debugging.
void _printQ (std::string prefix, std::vector< std::deque< chBFpair > > queue)
 Print vector of queues for debugging.

Private Attributes

TGenPhaseSpace _generator
 Generator for the current decay vertex.
double _mommass
 Mother particle mass for the current decay vertex.
double _daumasses [NDAUS]
 Array of the two daughter masses.
DauNodeVec _dauchannels
 Decay channels with BF (stored as pointers)

Static Private Attributes

static unsigned long long _count
 Debug message counter.

Detailed Description

This class defines a sequential 2-body decay tree and generates events using the ROOT class TGenPhaseSpace.

Note that this is a very simple phase space event generator and is not aware of any resonances. The decay tree is stored as an array with particle masses and pointers to TwoBodyDecayGen instances for subsequent decay vertices. These pointers are NULL for leaf nodes in the decay tree. There are several constructors to instantiate a TwoBodyDecayGen object; use of the constructor which takes an array with particle masses and length of the decay tree (also the length of the particle mass array) is recommended for simplicity of use. Look at the constructor documentation for more details on the format.

Author:
Suvayu Ali Suvay.nosp@m.u.Al.nosp@m.i@cer.nosp@m.nNOS.nosp@m.PAM.c.nosp@m.h
Date:
2012-11-05 Mon

Member Typedef Documentation

typedef std::pair<unsigned, double> TwoBodyDecayGen::chBFpair

Channel id and B.F.

pair

typedef std::pair<std::vector<TwoBodyDecayGen*>, double> TwoBodyDecayGen::DauNode

Node with B.F.


Constructor & Destructor Documentation

TwoBodyDecayGen::TwoBodyDecayGen ( double  mommass,
double  dau1mass,
double  dau2mass,
TwoBodyDecayGen dau1 = NULL,
TwoBodyDecayGen dau2 = NULL 
)

Constructor 1.

Parameters:
mommassMass of the mother in GeV/c²
dau1massMass of the first daughter in GeV/c²
dau2massMass of the second daughter in GeV/c²
dau1Pointer to TwoBodyDecayGen object for first daughter
dau2Pointer to TwoBodyDecayGen object for second daughter
TwoBodyDecayGen::TwoBodyDecayGen ( double  mommass,
double *  daumasses,
TwoBodyDecayGen dau1 = NULL,
TwoBodyDecayGen dau2 = NULL 
)

Constructor 2.

Parameters:
mommassMass of the mother in GeV/c²
daumassesArray of doubles with mass of the two daughters in GeV/c²
dau1Pointer to TwoBodyDecayGen object for first daughter
dau2Pointer to TwoBodyDecayGen object for second daughter
TwoBodyDecayGen::TwoBodyDecayGen ( double *  masses,
unsigned  nparts 
)

Constructor that takes an array with particle masses for the entire decay tree.

No need to create the different decay vertices in the right order any more. Instead, pass an array with all the particle masses and the number of particles (length of the array). The array should look something like these:

  1. Bs → Ds*(Dsγ)ρ(ππ) double masses[7] = {Bs, Ds*, ρ, Ds, γ, π, π};
  2. Bs → Ds*(Dsγ)π double masses[5] = {Bs, Ds*, π, Ds, γ};
  3. Bs → Ds*(Dsπ)π double masses[5] = {Bs, Ds*, π, Ds, π};

NB: Only one level of decay vertices have been tested at the moment.

Parameters:
massesArray of doubles with mass of all the particles in GeV/c²
npartsNumber of particles in the decay tree (length of the array)

Member Function Documentation

void TwoBodyDecayGen::_printQ ( std::string  prefix,
std::deque< chBFpair queue 
)
private

Print queue for debugging.

Parameters:
prefixString prefix in output
queueQueue to print
void TwoBodyDecayGen::_printQ ( std::string  prefix,
std::vector< std::deque< chBFpair > >  queue 
)
private

Print vector of queues for debugging.

Parameters:
prefixString prefix in output
queueVector of queues to print
bool TwoBodyDecayGen::add_decay_channel ( double *  masses,
unsigned  nparts,
double  brfr 
)

Add a new decay channel.

Parameters:
massesArray of doubles with mass of all the particles in GeV/c²
npartsNumber of particles in the decay tree (length of the array)
brfrBranching fraction for the channel
Returns:
Status
int TwoBodyDecayGen::find_leaf_nodes ( std::vector< std::deque< chBFpair > > &  brfrVec,
std::deque< chBFpair > &  brfrQ 
)

Find leaf branches or decay nodes.

This method traverses the decay tree and extracts the branching fraction and the channel id from each node into a double-ended queue. It stops the queue everytime a leaf node is encountered. The queue is then saved into a vector.

Implementation: Follow each daughter node, until a leaf node is found. Return the depth of the recursive call, so in the current function scope 0, increment it by 1 as we go up the tree. Once a leaf node is found, branch off the search to the other daughters one level above (recursion level = 1).

  (recursion depth)

  L3  - - -                     mother
                               /      \
                              /        \
  L2  - - -                  d1        d2 (leaf node)
                            /  \      /  \
                           /    \    /    \
  L1  - - -   (leaf node) d1    d2  d3    d4
                         /  \
                        /    \
  L0  - - -            d1    d2

NB: end points (d{2..4} @ L1 or d{1,2} @ L0) are stored as NULL pointers

Parameters:
brfrVecVector with deque for each leaf branch / decay node
brfrQPointer to deque for each leaf branch / decay node
Returns:
Depth where leaf node was found (-ve numbers are invalid)
double TwoBodyDecayGen::generate ( TLorentzVector &  momp,
std::vector< TLorentzVector > &  particle_lvs,
std::deque< chBFpair chQ 
)

Generate one event at a time.

Parameters:
mompMother 4-momentum
particle_lvsstd::vector used to return generated 4-momenta
chQQueue with channels to generate
Returns:
Event weight
double TwoBodyDecayGen::get_brfr ( unsigned  chid)

Return BF for decay channel.

Parameters:
chidDecay channel id
Returns:
Branching fraction for decay channel
TwoBodyDecayGen * TwoBodyDecayGen::get_daughter ( unsigned  chid,
unsigned  dauid 
)

Return requested daughter decay node.

Parameters:
chidDecay channel id
dauidDaughter number (0 or 1)
Returns:
Pointer to the daughter decay node
TTree * TwoBodyDecayGen::get_event_tree ( unsigned  nevents,
TH1 *  hmomp 
)

Generate arbitrary number of events.

Parameters:
neventsNumber of events to generate
hmompHistogram template for 3-momentum of the mother mother particle
Returns:
Generated event tree
void TwoBodyDecayGen::print ( unsigned  indent = 0)

Print decay tree.

Parameters:
indentSpaces to indent (to denote decay level)

The documentation for this class was generated from the following files: