173 <<
"Error in EvtParticle::setVectorSpinDensity" << endl;
202 for ( i = 0; i < n; i++ ) {
203 for ( j = 0; j < n; j++ ) {
205 for ( k = 0; k < n; k++ ) {
206 for ( l = 0; l < n; l++ ) {
207 tmp += R.
get( l, i ) * rho.
get( l, k ) *
217 double alpha,
double beta,
230 for ( i = 0; i < n; i++ ) {
231 for ( j = 0; j < n; j++ ) {
233 for ( k = 0; k < n; k++ ) {
234 for ( l = 0; l < n; l++ ) {
235 tmp += R.
get( l, i ) * rho.
get( l, k ) *
249 double parMass = -1.;
252 parMass = par->
mass();
253 for (
size_t i = 0; i < par->
getNDaug(); i++ ) {
263 for (
size_t ii = 0; ii <
m_ndaug; ii++ ) {
273 EvtId* dauId =
nullptr;
274 double* dauMasses =
nullptr;
277 dauMasses =
new double[
m_ndaug];
278 for (
size_t j = 0; j <
m_ndaug; j++ ) {
283 EvtId* parId =
nullptr;
284 EvtId* othDauId =
nullptr;
289 if ( tempPar->
getDaug( 0 ) ==
this )
298 dauId, othDauId, parMass,
323 static const EvtIdSet borUps{ BS0, BSB, BD0, BDB, U4S };
326 bool hasBorUps =
false;
333 if ( (
getNDaug() == 0 && !hasBorUps ) &&
334 ( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
344 if (
getId() == BS0 ) {
347 }
else if (
getId() == BSB ) {
350 }
else if (
getId() == BD0 ) {
353 }
else if (
getId() == BDB ) {
356 }
else if (
getId() == D0 ) {
359 }
else if (
getId() == D0B ) {
383 for (
size_t i = 0; i < p->
getNDaug(); i++ ) {
394 EvtId* dauId =
nullptr;
395 double* dauMasses =
nullptr;
398 dauId =
new EvtId[nDaugT];
399 dauMasses =
new double[nDaugT];
400 for ( j = 0; j < nDaugT; j++ ) {
406 EvtId* parId =
nullptr;
407 EvtId* othDauId =
nullptr;
412 if ( tempPar->
getDaug( 0 ) ==
this )
421 dauId, othDauId, parMass,
470 bool massTreeOK(
true );
475 if ( massTreeOK ==
false ) {
478 << p->
mass() <<
" to decay channel number " <<
m_channel << endl;
494 ( thisId == BS0 || thisId == BSB || thisId == BD0 || thisId == BDB ) ) {
499 if ( decayer !=
nullptr ) {
513 double massProb = 1.;
517 while ( massProb < ranNum ) {
524 if ( counter > 10000 ) {
525 if ( counter == 10001 ) {
527 <<
"Too many iterations to determine the mass tree. Parent mass= "
528 << p->
mass() <<
" " << massProb << endl;
531 <<
"will take next combo with non-zero likelihood\n";
535 if ( counter > 20000 ) {
540 if ( massProb > 0. ) {
543 <<
"Taking the minimum mass of all particles in the chain\n";
546 <<
"Sorry, no luck finding a valid set of masses. This may be a pathological combo\n";
567 double* dMasses =
nullptr;
571 dMasses =
new double[nDaug];
572 for ( i = 0; i < nDaug; i++ )
585 for ( i = 0; i < nDaug; i++ ) {
593 for (
size_t i = 0; i <
m_ndaug; i++ ) {
616 <<
"and you have asked for the:" << i <<
"th polarization vector."
617 <<
" I.e. you thought it was a"
618 <<
" vector particle!" << endl;
628 <<
"and you have asked for the:" << i <<
"th polarization vector."
629 <<
" I.e. you thought it was a"
630 <<
" vector particle!" << endl;
640 <<
"th polarization vector of photon."
641 <<
" I.e. you thought it was a"
642 <<
" photon particle!" << endl;
652 <<
"and you have asked for the:" << i
653 <<
"th polarization vector of a photon."
654 <<
" I.e. you thought it was a"
655 <<
" photon particle!" << endl;
665 <<
"and you have asked for the:" << i <<
"th dirac spinor."
666 <<
" I.e. you thought it was a"
667 <<
" Dirac particle!" << endl;
677 <<
"and you have asked for the:" << i <<
"th dirac spinor."
678 <<
" I.e. you thought it was a"
679 <<
" Dirac particle!" << endl;
690 <<
" I.e. you thought it was a"
691 <<
" neutrino particle!" << endl;
702 <<
" I.e. you thought it was a"
703 <<
" neutrino particle!" << endl;
713 <<
"and you have asked for the:" << i <<
"th tensor."
714 <<
" I.e. you thought it was a"
715 <<
" Tensor particle!" << endl;
725 <<
"and you have asked for the:" << i <<
"th tensor."
726 <<
" I.e. you thought it was a"
727 <<
" Tensor particle!" << endl;
737 <<
"and you have asked for the:" << i <<
"th Rarita-Schwinger spinor."
738 <<
" I.e. you thought it was a"
739 <<
" RaritaSchwinger particle!" << std::endl;
749 <<
"and you have asked for the:" << i <<
"th Rarita-Schwinger spinor."
750 <<
" I.e. you thought it was a"
751 <<
" RaritaSchwinger particle!" << std::endl;
761 temp = this->
getP4();
766 mom = ptemp->
getP4();
782 mom = ptemp->
getP4();
798 temp.
set( 0.0, 0.0, 0.0, 0.0 );
805 temp = ( ptemp->
m_t / ptemp->
mass() ) * ( ptemp->
getP4() );
809 mom = ptemp->
getP4();
811 temp = temp + ( ptemp->
m_t / ptemp->
mass() ) * ( ptemp->
getP4() );
834 while ( bpart->
m_daug[i] != current ) {
838 if ( bpart == rootOfTree ) {
839 if ( i + 1 == bpart->
m_ndaug ) {
846 }
while ( i >= bpart->
m_ndaug );
852 EvtId* list_of_stable )
863 while ( list_of_stable[ii] !=
EvtId( -1, -1 ) ) {
864 if (
getId() == list_of_stable[ii] ) {
871 for (
size_t i = 0; i <
m_ndaug; i++ ) {
876 for (
size_t i = 0; i <
m_ndaug; i++ ) {
877 m_daug[i]->makeStdHepRec( 1 + i, 1 + i, stdhep, secondary,
889 for (
size_t i = 0; i <
m_ndaug; i++ ) {
894 for (
size_t i = 0; i <
m_ndaug; i++ ) {
895 m_daug[i]->makeStdHepRec( 1 + i, 1 + i, stdhep );
902 EvtId* list_of_stable )
909 while ( list_of_stable[ii] !=
EvtId( -1, -1 ) ) {
910 if (
getId() == list_of_stable[ii] ) {
918 for (
size_t i = 0; i <
m_ndaug; i++ ) {
920 firstparent, lastparent,
924 for (
size_t i = 0; i <
m_ndaug; i++ ) {
925 m_daug[i]->makeStdHepRec( parent_num + i, parent_num + i, stdhep,
926 secondary, list_of_stable );
935 for (
size_t i = 0; i <
m_ndaug; i++ ) {
937 firstparent, lastparent,
941 for (
size_t i = 0; i <
m_ndaug; i++ ) {
942 m_daug[i]->makeStdHepRec( parent_num + i, parent_num + i, stdhep );
950 newlevel = level + 1;
954 for ( i = 0; i < ( 5 * level ); i++ ) {
960 for ( i = 0; i <
m_ndaug; i++ ) {
964 for ( i = 0; i <
m_ndaug; i++ ) {
966 <<
m_daug[i]->mass() <<
" " <<
m_daug[i]->getP4() <<
" "
967 <<
m_daug[i]->getSpinStates() <<
"; ";
970 for ( i = 0; i <
m_ndaug; i++ ) {
971 m_daug[i]->printTreeRec( newlevel );
979 <<
"This is the current decay chain" << endl;
982 << this->
mass() <<
" " << this->
getP4() << endl;
991 newlevel = level + 1;
993 std::string retval =
"";
995 for ( i = 0; i <
m_ndaug; i++ ) {
999 retval +=
m_daug[i]->treeStrRec( newlevel );
1057 <<
"Unknown particle type in EvtParticle::printParticle()"
1062 <<
"Number of daughters:" <<
m_ndaug <<
"\n";
1101 const EvtId* daughters,
1102 bool forceDaugMassReset,
1103 double poleSize,
int whichTwo1,
1112 static thread_local double mass[100];
1125 bool resetDaughters =
false;
1128 resetDaughters =
true;
1129 if ( numdaughter == this->
getNDaug() )
1130 for ( i = 0; i < numdaughter; i++ ) {
1132 resetDaughters =
true;
1137 if ( resetDaughters || forceDaugMassReset ) {
1143 if ( massTreeOK ==
false ) {
1149 for ( i = 0; i < numdaughter; i++ ) {
1153 if ( poleSize < -0.1 ) {
1155 if ( numdaughter == 1 ) {
1160 for ( i = 0; i < numdaughter; i++ ) {
1165 if ( numdaughter != 3 ) {
1167 <<
"Only can generate pole phase space "
1168 <<
"distributions for 3 body final states" << endl
1169 <<
"Will terminate." << endl;
1173 if ( ( whichTwo1 == 1 && whichTwo2 == 0 ) ||
1174 ( whichTwo1 == 0 && whichTwo2 == 1 ) ) {
1182 if ( ( whichTwo1 == 1 && whichTwo2 == 2 ) ||
1183 ( whichTwo1 == 2 && whichTwo2 == 1 ) ) {
1191 if ( ( whichTwo1 == 0 && whichTwo2 == 2 ) ||
1192 ( whichTwo1 == 2 && whichTwo2 == 0 ) ) {
1202 <<
"Invalid pair of particle to generate a pole dist "
1203 << whichTwo1 <<
" " << whichTwo2 << endl
1204 <<
"Will terminate." << endl;
1217 size_t nVector = idVector.size();
1218 if ( nVector < ndaugstore ) {
1220 <<
"Asking to make " << ndaugstore <<
" daughters when there "
1221 <<
"are only " << nVector <<
" EvtId values available" << endl;
1226 for (
size_t i = 0; i < ndaugstore; i++ ) {
1227 idArray[i] = idVector[i];
1242 if (
m_ndaug != ndaugstore ) {
1244 <<
"Asking to make a different number of "
1245 <<
"daughters than what was previously created." << endl;
1248 for (
size_t i = 0; i <
m_ndaug; i++ ) {
1250 <<
"Original daugther:"
1253 for (
size_t i = 0; i < ndaugstore; i++ ) {
1261 for (
size_t i = 0; i < ndaugstore; i++ ) {
1264 pdaug->
setId(
id[i] );
1280 std::string theName =
m_id.getName();
1291 EvtAttIntMap::const_iterator mapIter;
1294 attValue = mapIter->second;
1305 double attValue = 0.0;
1307 EvtAttDblMap::const_iterator mapIter;
1310 attValue = mapIter->second;
EvtComplex conj(const EvtComplex &c)
void init_photon(EvtParticle **part)
void init_dirac(EvtParticle **part)
void init_neutrino(EvtParticle **part)
void init_vector(EvtParticle **part)
void init_tensor(EvtParticle **part)
void init_scalar(EvtParticle **part)
void init_string(EvtParticle **part)
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
static EvtCPUtil * getInstance()
void incoherentMix(const EvtId id, double &t, int &mix)
virtual void makeDecay(EvtParticle *p, bool recursive=true)=0
virtual int nRealDaughters() const
const EvtId * getDaugs() const
static EvtDecayTable & getInstance()
EvtDecayBase * getDecayFunc(EvtParticle *p)
static double PhaseSpacePole(double M, double m1, double m2, double m3, double a, EvtVector4R p4[10])
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
bool contains(const EvtId &id) const
static double getWidth(EvtId i)
static EvtSpinType::spintype getSpinType(EvtId i)
static int getStdHep(EvtId id)
static double getMass(EvtId i)
static double getRandMass(EvtId i, EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
static std::string name(EvtId i)
static double getMeanMass(EvtId i)
static EvtId chargeConj(EvtId id)
static double getMassProb(EvtId i, double mass, double massPar, int nDaug, double *massDau)
static double getctau(EvtId i)
static double getMinMass(EvtId i)
static EvtId getId(const std::string &name)
static EvtParticle * particleFactory(EvtSpinType::spintype spinType)
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
void setDecayProb(double p)
virtual EvtVector4C epsParent(int i) const
EvtAttIntMap m_intAttributes
double getAttributeDouble(std::string attName) const
void initDecay(bool useMinMass=false)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void insertDaugPtr(int idaug, EvtParticle *partptr)
virtual EvtTensor4C epsTensorParent(int i) const
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
std::string treeStrRec(unsigned int level) const
virtual EvtRaritaSchwinger spRSParent(int) const
EvtVector4R getP4Restframe() const
void printTreeRec(unsigned int level) const
virtual EvtDiracSpinor spParentNeutrino() const
virtual EvtDiracSpinor spParent(int) const
void setVectorSpinDensity()
EvtVector4R getP4LabBeforeFSR() const
void printParticle() const
virtual EvtDiracSpinor spNeutrino() const
virtual EvtRaritaSchwinger spRS(int) const
int getSpinStates() const
void setDiagonalSpinDensity()
EvtSpinType::spintype getSpinType() const
const EvtVector4R & getP4() const
EvtParticle * nextIter(EvtParticle *rootOfTree=nullptr)
void setLifetime(double tau)
virtual EvtSpinDensity rotateToHelicityBasis() const =0
EvtAttDblMap m_dblAttributes
std::string getName() const
EvtParticle * getDaug(const int i)
void deleteDaughters(bool keepChannel=false)
double getLifetime() const
virtual EvtDiracSpinor sp(int) const
virtual EvtVector4C epsPhoton(int i) const
virtual EvtVector4C epsParentPhoton(int i) const
EvtParticle * m_daug[MAX_DAUG]
void makeStdHep(EvtStdHep &stdhep, EvtSecondary &secondary, EvtId *stable_parent_ihep)
EvtSpinDensity m_rhoForward
EvtSpinDensity m_rhoBackward
EvtVector4R getP4Lab() const
virtual EvtVector4C eps(int i) const
void addDaug(EvtParticle *node)
std::string treeStr() const
virtual EvtTensor4C epsTensor(int i) const
EvtVector4R get4Pos() const
void makeStdHepRec(int firstparent, int lastparent, EvtStdHep &stdhep, EvtSecondary &secondary, EvtId *stable_parent_ihep)
EvtParticle * getParent() const
void makeDaughters(size_t ndaug, const EvtId *id)
int getAttribute(std::string attName) const
void init(EvtId part_n, double e, double px, double py, double pz)
void createSecondary(int stdhepindex, EvtParticle *prnt)
const EvtComplex & get(int i, int j) const
void set(int i, int j, const EvtComplex &rhoij)
static int getSpinStates(spintype stype)
void createParticle(EvtVector4R p4, EvtVector4R x, int prntfirst, int prntlast, int id)
void set(int i, double d)