EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nBodyPhaseSpaceGen Class Reference

#include <estarlight/blob/master/include/nBodyPhaseSpaceGen.h>

+ Collaboration diagram for nBodyPhaseSpaceGen:

Public Member Functions

 nBodyPhaseSpaceGen (const randomGenerator &randy)
 
virtual ~nBodyPhaseSpaceGen ()
 
bool setDecay (const std::vector< double > &daughterMasses)
 sets decay constants and prepares internal variables
 
bool setDecay (const unsigned int nmbOfDaughters, const double *daughterMasses)
 
double random ()
 returns number from internal random generator
 
double generateDecay (const lorentzVector &nBody)
 generates full event with certain n-body mass and momentum and returns event weight
 
bool generateDecayAccepted (const lorentzVector &nBody, const double maxWeight=0)
 generates full event with certain n-body mass and momentum only when event is accepted (return value = true) this function is more efficient, if only weighted events are needed
 
void setMaxWeight (const double maxWeight)
 sets maximum weight used for hit-miss MC
 
double maxWeight () const
 returns maximum weight used for hit-miss MC
 
double normalization () const
 returns normalization used in weight calculation
 
double eventWeight () const
 returns weight of generated event
 
double maxWeightObserved () const
 returns maximum observed weight since instantiation
 
void resetMaxWeightObserved ()
 sets maximum observed weight back to zero
 
double estimateMaxWeight (const double nBodyMass, const unsigned int nmbOfIterations=10000)
 estimates maximum weight for given n-body mass
 
bool eventAccepted (const double maxWeight=0)
 applies event weight in form of hit-miss MC assumes that event weight has been already calculated by calcWeight() if maxWeight > 0 value is used as maximum weight, otherwise _maxWeight value is used
 
const lorentzVectordaughter (const int index) const
 returns Lorentz vector of daughter at index
 
const std::vector
< lorentzVector > & 
daughters () const
 returns Lorentz vectors of all daughters
 
unsigned int nmbOfDaughters () const
 returns number of daughters
 
double daughterMass (const int index) const
 returns invariant mass of daughter at index
 
double intermediateMass (const int index) const
 returns intermediate mass of (index + 1)-body system
 
double breakupMom (const int index) const
 returns breakup momentum in (index + 1)-body RF
 
double cosTheta (const int index) const
 returns polar angle in (index + 1)-body RF
 
double phi (const int index) const
 returns azimuth in (index + 1)-body RF
 
std::ostream & print (std::ostream &out=std::cout) const
 prints generator status
 

Private Member Functions

void pickMasses (const double nBodyMass)
 randomly choses the (n - 2) effective masses of the respective (i + 1)-body systems
 
double calcWeight ()
 computes event weight and breakup momenta operates on vector of intermediate two-body masses prepared by pickMasses()
 
void pickAngles ()
 randomly choses the (n - 1) polar and (n - 1) azimuthal angles in the respective (i + 1)-body RFs
 
void calcEventKinematics (const lorentzVector &nBody)
 calculates full event kinematics from the effective masses of the (i + 1)-body systems and the Lorentz vector of the decaying system uses the break-up momenta calculated by calcWeight() and angles from pickAngles()
 

Private Attributes

std::vector< double > _m
 masses of daughter particles
 
unsigned int _n
 number of daughter particles
 
std::vector< double > _M
 effective masses of (i + 1)-body systems
 
std::vector< double > _cosTheta
 cosine of polar angle of the 2-body decay of the (i + 1)-body system
 
std::vector< double > _phi
 azimuthal angle of the 2-body decay of the (i + 1)-body system
 
std::vector< double > _mSum
 sums of daughter particle masses
 
std::vector< double > _breakupMom
 breakup momenta for the two-body decays: (i + 1)-body –> daughter_(i + 1) + i-body
 
std::vector< lorentzVector_daughters
 Lorentz vectors of the daughter particles.
 
double _norm
 normalization value
 
double _weight
 phase space weight of generated event
 
double _maxWeightObserved
 maximum event weight calculated processing the input data
 
double _maxWeight
 maximum weight used to weight events in hit-miss MC
 
randomGenerator _randy
 

Friends

std::ostream & operator<< (std::ostream &out, const nBodyPhaseSpaceGen &gen)
 

Detailed Description

Definition at line 108 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 108 of file nBodyPhaseSpaceGen.h

Constructor & Destructor Documentation

nBodyPhaseSpaceGen::nBodyPhaseSpaceGen ( const randomGenerator randy)

Definition at line 43 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 43 of file nBodyPhaseSpaceGen.cpp

nBodyPhaseSpaceGen::~nBodyPhaseSpaceGen ( )
virtual

Definition at line 53 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 53 of file nBodyPhaseSpaceGen.cpp

Member Function Documentation

double nBodyPhaseSpaceGen::breakupMom ( const int  index) const
inline

returns breakup momentum in (index + 1)-body RF

Definition at line 155 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 155 of file nBodyPhaseSpaceGen.h

References _breakupMom.

void nBodyPhaseSpaceGen::calcEventKinematics ( const lorentzVector nBody)
private

calculates full event kinematics from the effective masses of the (i + 1)-body systems and the Lorentz vector of the decaying system uses the break-up momenta calculated by calcWeight() and angles from pickAngles()

Definition at line 201 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 201 of file nBodyPhaseSpaceGen.cpp

References _breakupMom, _cosTheta, _daughters, _m, _n, _phi, lorentzVector::Boost(), lorentzVector::BoostVector(), cos(), daughter(), and lorentzVector::SetPxPyPzE().

Referenced by generateDecay(), and generateDecayAccepted().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double nBodyPhaseSpaceGen::calcWeight ( )
private

computes event weight and breakup momenta operates on vector of intermediate two-body masses prepared by pickMasses()

Definition at line 180 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 180 of file nBodyPhaseSpaceGen.cpp

References _breakupMom, _m, _M, _maxWeightObserved, _mSum, _n, _norm, _weight, breakupMomentum(), and printWarn.

Referenced by estimateMaxWeight(), generateDecay(), and generateDecayAccepted().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double nBodyPhaseSpaceGen::cosTheta ( const int  index) const
inline

returns polar angle in (index + 1)-body RF

Definition at line 156 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 156 of file nBodyPhaseSpaceGen.h

References _cosTheta.

const lorentzVector& nBodyPhaseSpaceGen::daughter ( const int  index) const
inline

returns Lorentz vector of daughter at index

Definition at line 150 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 150 of file nBodyPhaseSpaceGen.h

References _daughters.

Referenced by calcEventKinematics().

+ Here is the caller graph for this function:

double nBodyPhaseSpaceGen::daughterMass ( const int  index) const
inline

returns invariant mass of daughter at index

Definition at line 153 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 153 of file nBodyPhaseSpaceGen.h

References _m.

const std::vector<lorentzVector>& nBodyPhaseSpaceGen::daughters ( ) const
inline

returns Lorentz vectors of all daughters

Definition at line 151 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 151 of file nBodyPhaseSpaceGen.h

References _daughters.

double nBodyPhaseSpaceGen::estimateMaxWeight ( const double  nBodyMass,
const unsigned int  nmbOfIterations = 10000 
)

estimates maximum weight for given n-body mass

Definition at line 227 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 227 of file nBodyPhaseSpaceGen.cpp

References _weight, calcWeight(), max, maxWeight(), and pickMasses().

+ Here is the call graph for this function:

bool nBodyPhaseSpaceGen::eventAccepted ( const double  maxWeight = 0)
inline

applies event weight in form of hit-miss MC assumes that event weight has been already calculated by calcWeight() if maxWeight > 0 value is used as maximum weight, otherwise _maxWeight value is used

Definition at line 216 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 216 of file nBodyPhaseSpaceGen.h

References _maxWeight, _weight, max, printWarn, and random().

Referenced by generateDecayAccepted().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double nBodyPhaseSpaceGen::eventWeight ( ) const
inline

returns weight of generated event

Definition at line 135 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 135 of file nBodyPhaseSpaceGen.h

References _weight.

double nBodyPhaseSpaceGen::generateDecay ( const lorentzVector nBody)

generates full event with certain n-body mass and momentum and returns event weight

Definition at line 113 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 113 of file nBodyPhaseSpaceGen.cpp

References _mSum, _n, _weight, calcEventKinematics(), calcWeight(), lorentzVector::M(), pickAngles(), pickMasses(), and printWarn.

+ Here is the call graph for this function:

bool nBodyPhaseSpaceGen::generateDecayAccepted ( const lorentzVector nBody,
const double  maxWeight = 0 
)

generates full event with certain n-body mass and momentum only when event is accepted (return value = true) this function is more efficient, if only weighted events are needed

Definition at line 137 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 137 of file nBodyPhaseSpaceGen.cpp

References _mSum, _n, calcEventKinematics(), calcWeight(), eventAccepted(), lorentzVector::M(), pickAngles(), pickMasses(), and printWarn.

+ Here is the call graph for this function:

double nBodyPhaseSpaceGen::intermediateMass ( const int  index) const
inline

returns intermediate mass of (index + 1)-body system

Definition at line 154 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 154 of file nBodyPhaseSpaceGen.h

References _M.

double nBodyPhaseSpaceGen::maxWeight ( ) const
inline

returns maximum weight used for hit-miss MC

Definition at line 133 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 133 of file nBodyPhaseSpaceGen.h

References _maxWeight.

Referenced by estimateMaxWeight(), and setMaxWeight().

+ Here is the caller graph for this function:

double nBodyPhaseSpaceGen::maxWeightObserved ( ) const
inline

returns maximum observed weight since instantiation

Definition at line 136 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 136 of file nBodyPhaseSpaceGen.h

References _maxWeightObserved.

unsigned int nBodyPhaseSpaceGen::nmbOfDaughters ( ) const
inline

returns number of daughters

Definition at line 152 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 152 of file nBodyPhaseSpaceGen.h

References _n.

Referenced by setDecay().

+ Here is the caller graph for this function:

double nBodyPhaseSpaceGen::normalization ( ) const
inline

returns normalization used in weight calculation

Definition at line 134 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 134 of file nBodyPhaseSpaceGen.h

References _norm.

double nBodyPhaseSpaceGen::phi ( const int  index) const
inline

returns azimuth in (index + 1)-body RF

Definition at line 157 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 157 of file nBodyPhaseSpaceGen.h

References _phi.

void nBodyPhaseSpaceGen::pickAngles ( )
inlineprivate

randomly choses the (n - 1) polar and (n - 1) azimuthal angles in the respective (i + 1)-body RFs

Definition at line 205 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 205 of file nBodyPhaseSpaceGen.h

References _cosTheta, _n, _phi, random(), and starlightConstants::twoPi.

Referenced by generateDecay(), and generateDecayAccepted().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nBodyPhaseSpaceGen::pickMasses ( const double  nBodyMass)
private

randomly choses the (n - 2) effective masses of the respective (i + 1)-body systems

Definition at line 162 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 162 of file nBodyPhaseSpaceGen.cpp

References _M, _mSum, _n, and random().

Referenced by estimateMaxWeight(), generateDecay(), and generateDecayAccepted().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ostream & nBodyPhaseSpaceGen::print ( std::ostream &  out = std::cout) const

prints generator status

Definition at line 241 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 241 of file nBodyPhaseSpaceGen.cpp

References _breakupMom, _cosTheta, _daughters, _m, _M, _maxWeight, _maxWeightObserved, _mSum, _n, _norm, _phi, and _weight.

double nBodyPhaseSpaceGen::random ( )
inline

returns number from internal random generator

Definition at line 122 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 122 of file nBodyPhaseSpaceGen.h

References _randy, and randomGenerator::Rndom().

Referenced by eventAccepted(), pepsimainerhic(), pickAngles(), pickMasses(), and riwibd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nBodyPhaseSpaceGen::resetMaxWeightObserved ( )
inline

sets maximum observed weight back to zero

Definition at line 137 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 137 of file nBodyPhaseSpaceGen.h

References _maxWeightObserved.

Referenced by setDecay().

+ Here is the caller graph for this function:

bool nBodyPhaseSpaceGen::setDecay ( const std::vector< double > &  daughterMasses)

sets decay constants and prepares internal variables

Definition at line 59 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 59 of file nBodyPhaseSpaceGen.cpp

References _breakupMom, _cosTheta, _daughters, _m, _M, _mSum, _n, _norm, _phi, factorial(), printWarn, resetMaxWeightObserved(), and starlightConstants::twoPi.

Referenced by setDecay().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool nBodyPhaseSpaceGen::setDecay ( const unsigned int  nmbOfDaughters,
const double *  daughterMasses 
)

Definition at line 99 of file nBodyPhaseSpaceGen.cpp.

View newest version in sPHENIX GitHub at line 99 of file nBodyPhaseSpaceGen.cpp

References Acts::UnitConstants::m, nmbOfDaughters(), and setDecay().

+ Here is the call graph for this function:

void nBodyPhaseSpaceGen::setMaxWeight ( const double  maxWeight)
inline

sets maximum weight used for hit-miss MC

Definition at line 132 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 132 of file nBodyPhaseSpaceGen.h

References _maxWeight, and maxWeight().

+ Here is the call graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const nBodyPhaseSpaceGen gen 
)
friend

Definition at line 161 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 161 of file nBodyPhaseSpaceGen.h

Member Data Documentation

std::vector<double> nBodyPhaseSpaceGen::_breakupMom
private

breakup momenta for the two-body decays: (i + 1)-body –> daughter_(i + 1) + i-body

Definition at line 192 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 192 of file nBodyPhaseSpaceGen.h

Referenced by breakupMom(), calcEventKinematics(), calcWeight(), print(), and setDecay().

std::vector<double> nBodyPhaseSpaceGen::_cosTheta
private

cosine of polar angle of the 2-body decay of the (i + 1)-body system

Definition at line 189 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 189 of file nBodyPhaseSpaceGen.h

Referenced by calcEventKinematics(), cosTheta(), pickAngles(), print(), and setDecay().

std::vector<lorentzVector> nBodyPhaseSpaceGen::_daughters
private

Lorentz vectors of the daughter particles.

Definition at line 193 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 193 of file nBodyPhaseSpaceGen.h

Referenced by calcEventKinematics(), daughter(), daughters(), print(), and setDecay().

std::vector<double> nBodyPhaseSpaceGen::_m
private

masses of daughter particles

Definition at line 184 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 184 of file nBodyPhaseSpaceGen.h

Referenced by calcEventKinematics(), calcWeight(), daughterMass(), print(), and setDecay().

std::vector<double> nBodyPhaseSpaceGen::_M
private

effective masses of (i + 1)-body systems

Definition at line 188 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 188 of file nBodyPhaseSpaceGen.h

Referenced by calcWeight(), intermediateMass(), pickMasses(), print(), and setDecay().

double nBodyPhaseSpaceGen::_maxWeight
private

maximum weight used to weight events in hit-miss MC

Definition at line 197 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 197 of file nBodyPhaseSpaceGen.h

Referenced by eventAccepted(), maxWeight(), print(), and setMaxWeight().

double nBodyPhaseSpaceGen::_maxWeightObserved
private

maximum event weight calculated processing the input data

Definition at line 196 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 196 of file nBodyPhaseSpaceGen.h

Referenced by calcWeight(), maxWeightObserved(), print(), and resetMaxWeightObserved().

std::vector<double> nBodyPhaseSpaceGen::_mSum
private

sums of daughter particle masses

Definition at line 191 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 191 of file nBodyPhaseSpaceGen.h

Referenced by calcWeight(), generateDecay(), generateDecayAccepted(), pickMasses(), print(), and setDecay().

unsigned int nBodyPhaseSpaceGen::_n
private

number of daughter particles

Definition at line 187 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 187 of file nBodyPhaseSpaceGen.h

Referenced by calcEventKinematics(), calcWeight(), generateDecay(), generateDecayAccepted(), nmbOfDaughters(), pickAngles(), pickMasses(), print(), and setDecay().

double nBodyPhaseSpaceGen::_norm
private

normalization value

Definition at line 194 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 194 of file nBodyPhaseSpaceGen.h

Referenced by calcWeight(), normalization(), print(), and setDecay().

std::vector<double> nBodyPhaseSpaceGen::_phi
private

azimuthal angle of the 2-body decay of the (i + 1)-body system

Definition at line 190 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 190 of file nBodyPhaseSpaceGen.h

Referenced by calcEventKinematics(), phi(), pickAngles(), print(), and setDecay().

randomGenerator nBodyPhaseSpaceGen::_randy
private

Definition at line 198 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 198 of file nBodyPhaseSpaceGen.h

Referenced by random().

double nBodyPhaseSpaceGen::_weight
private

phase space weight of generated event

Definition at line 195 of file nBodyPhaseSpaceGen.h.

View newest version in sPHENIX GitHub at line 195 of file nBodyPhaseSpaceGen.h

Referenced by calcWeight(), estimateMaxWeight(), eventAccepted(), eventWeight(), generateDecay(), and print().


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