EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
|
#include <estarlight/blob/master/include/nBodyPhaseSpaceGen.h>
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 lorentzVector & | daughter (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) |
Definition at line 108 of file nBodyPhaseSpaceGen.h.
View newest version in sPHENIX GitHub at line 108 of file nBodyPhaseSpaceGen.h
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
|
virtual |
Definition at line 53 of file nBodyPhaseSpaceGen.cpp.
View newest version in sPHENIX GitHub at line 53 of file nBodyPhaseSpaceGen.cpp
|
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.
|
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().
|
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().
|
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.
|
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().
|
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.
|
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().
|
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().
|
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.
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.
|
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.
|
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().
|
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.
|
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().
|
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.
|
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.
|
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().
|
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().
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.
|
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().
|
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().
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().
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().
|
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().
|
friend |
Definition at line 161 of file nBodyPhaseSpaceGen.h.
View newest version in sPHENIX GitHub at line 161 of file nBodyPhaseSpaceGen.h
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().