105 node->_daug[node->_ndaug++]=
this;
141 report(
ERROR,
"EvtGen")<<
"Error in EvtParticle::setVectorSpinDensity"<<endl;
160 report(
ERROR,
"EvtGen")<<
"Error in EvtParticle::setVectorSpinDensity"<<endl;
182 assert(R.GetDim()==rho.
GetDim());
195 tmp+=R.Get(l,i)*rho.
Get(l,k)*
conj(R.Get(k,j));
198 _rhoForward.
Set(i,j,tmp);
213 assert(R.GetDim()==rho.
GetDim());
226 tmp+=R.Get(l,i)*rho.
Get(l,k)*
conj(R.Get(k,j));
229 _rhoForward.
Set(i,j,tmp);
257 for(ii=0;ii<_ndaug;ii++){
268 dauId=
new EvtId[_ndaug];
269 dauMasses=
new double[_ndaug];
270 for (j=0;j<_ndaug;j++) {
289 if ( parId)
delete parId;
290 if ( othDauId)
delete othDauId;
291 if ( dauId)
delete [] dauId;
292 if ( dauMasses)
delete [] dauMasses;
318 scalar_part->
init(BSB,p_init);
320 else if (
getId()==BSB) {
322 scalar_part->
init(BS0,p_init);
324 else if (
getId()==BD0) {
326 scalar_part->
init(BDB,p_init);
328 else if (
getId()==BDB) {
330 scalar_part->
init(BD0,p_init);
374 dauId=
new EvtId[nDaugT];
375 dauMasses=
new double[nDaugT];
376 for (j=0;j<nDaugT;j++) {
396 if ( parId)
delete parId;
397 if ( othDauId)
delete othDauId;
398 if ( dauId)
delete [] dauId;
399 if ( dauMasses)
delete [] dauMasses;
443 std::cout<<
"if ( _ndaug==1 && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB) )"<<endl;
466 while (massProb<ranNum) {
475 if ( counter > 10000 ) {
476 if ( counter == 10001 ) {
477 report(
INFO,
"EvtGen") <<
"Too many iterations to determine the mass tree. Parent mass= "<< p->
mass() <<
" " << massProb <<endl;
479 report(
INFO,
"EvtGen") <<
"will take next combo with non-zero likelihood\n";
481 if ( massProb>0. ) massProb=2.0;
482 if ( counter > 20000 ) {
489 report(
INFO,
"EvtGen") <<
"Taking the minimum mass of all particles in the chain\n";
492 report(
INFO,
"EvtGen") <<
"Sorry, no luck finding a valid set of masses. This may be a pathological combo\n";
518 dMasses=
new double[nDaug];
519 for (i=0; i<nDaug; i++) dMasses[i]=p->
getDaug(i)->
mass();
532 for (i=0; i<nDaug; i++) {
541 for(i=0;i<_ndaug;i++){
547 if ( !keepChannel) _channel=-10;
566 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
567 <<
"th polarization vector."
568 <<
" I.e. you thought it was a"
569 <<
" vector particle!" << endl;
577 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
578 <<
"th polarization vector."
579 <<
" I.e. you thought it was a"
580 <<
" vector particle!" << endl;
588 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
589 <<
"th polarization vector of photon."
590 <<
" I.e. you thought it was a"
591 <<
" photon particle!" << endl;
599 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
600 <<
"th polarization vector of a photon."
601 <<
" I.e. you thought it was a"
602 <<
" photon particle!" << endl;
612 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
614 <<
" I.e. you thought it was a"
615 <<
" Dirac particle!" << endl;
625 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
627 <<
" I.e. you thought it was a"
628 <<
" Dirac particle!" << endl;
636 report(
ERROR,
"EvtGen") <<
"and you have asked for the "
638 <<
" I.e. you thought it was a"
639 <<
" neutrino particle!" << endl;
647 report(
ERROR,
"EvtGen") <<
"and you have asked for the "
649 <<
" I.e. you thought it was a"
650 <<
" neutrino particle!" << endl;
660 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
662 <<
" I.e. you thought it was a"
663 <<
" Tensor particle!" << endl;
673 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
675 <<
" I.e. you thought it was a"
676 <<
" Tensor particle!" << endl;
709 temp.
set(0.0,0.0,0.0,0.0);
712 if (ptemp==0)
return temp;
714 temp=(ptemp->_t/ptemp->
mass())*(ptemp->
getP4());
720 temp=temp+(ptemp->_t/ptemp->
mass())*(ptemp->
getP4());
735 if (_ndaug!=0)
return _daug[0];
738 bpart=current->_parent;
739 if (bpart==0)
return 0;
741 while (bpart->_daug[i]!=current) {i++;}
743 if ( bpart==rootOfTree ) {
744 if ( i== bpart->_ndaug-1 )
return 0;
750 }
while(i>=bpart->_ndaug);
752 return bpart->_daug[i];
758 EvtId *list_of_stable){
769 while (list_of_stable[ii]!=
EvtId(-1,-1)) {
770 if (
getId()==list_of_stable[ii]){
781 for(i=0;i<_ndaug;i++){
786 for(i=0;i<_ndaug;i++){
787 _daug[i]->makeStdHepRec(1+i,1+i,stdhep,secondary,list_of_stable);
800 for(i=0;i<_ndaug;i++){
805 for(i=0;i<_ndaug;i++){
806 _daug[i]->makeStdHepRec(1+i,1+i,stdhep);
813void EvtParticle::makeStdHepRec(
int firstparent,
int lastparent,
816 EvtId *list_of_stable){
824 while (list_of_stable[ii]!=
EvtId(-1,-1)) {
825 if (
getId()==list_of_stable[ii]){
836 for(i=0;i<_ndaug;i++){
838 firstparent,lastparent,
842 for(i=0;i<_ndaug;i++){
843 _daug[i]->makeStdHepRec(parent_num+i,parent_num+i,stdhep,
844 secondary,list_of_stable);
850void EvtParticle::makeStdHepRec(
int firstparent,
int lastparent,
855 for(i=0;i<_ndaug;i++){
857 firstparent,lastparent,
861 for(i=0;i<_ndaug;i++){
862 _daug[i]->makeStdHepRec(parent_num+i,parent_num+i,stdhep);
876 for (i=0;i<(5*level);i++) {
882 for(i=0;i<_ndaug;i++){
885 for(i=0;i<_ndaug;i++){
889 for(i=0;i<_ndaug;i++){
897 report(
INFO,
"EvtGen") <<
"This is the current decay chain"<<endl;
902 report(
INFO,
"EvtGen") <<
"End of decay chain."<<endl;
911 std::string retval=
"";
913 for(i=0;i<_ndaug;i++){
921 if ( i!=_ndaug-1) retval+=
" ";
929 std::string retval=
"";
931 if (resonance ==
EvtPDL::name(_id).c_str() && _ndaug!=0) {
932 retval=resonance+
": "+
IntToStr(_ndaug)+
" ";
933 for(
int i=0;i<_ndaug;i++){
939 for(
int i=0;i<_ndaug;i++){
963 report(
INFO,
"") <<newlevel<<
" "<< cid<<
" "<<dj;
969 for(i=0;i<_ndaug;i++){
978 report(
INFO,
"EvtGen") <<
"This is the current decay chain to dump"<<endl;
983 report(
INFO,
"EvtGen") <<
"End of decay chain."<<endl;
1026 report(
INFO,
"EvtGen") <<
"Unknown particle type in EvtParticle::printParticle()"<<endl;
1029 report(
INFO,
"EvtGen") <<
"Number of daughters:"<<_ndaug<<
"\n";
1070 int numdaughter,
EvtId *daughters,
double poleSize,
1071 int whichTwo1,
int whichTwo2) {
1079 static double mass[100];
1092 bool resetDaughters=
false;
1093 if ( numdaughter != this->
getNDaug() && this->
getNDaug() > 0 ) resetDaughters=
true;
1094 if ( numdaughter == this->
getNDaug() )
1095 for (i=0; i<numdaughter;i++) {
1096 if ( this->
getDaug(i)->
getId() != daughters[i] ) resetDaughters=
true;
1100 if ( resetDaughters ) {
1116 for (i=0; i<numdaughter;i++) {
1121 if ( poleSize<-0.1) {
1123 for(i=0;i<numdaughter;i++){
1129 if ( numdaughter != 3 ) {
1130 report(
ERROR,
"EvtGen") <<
"Only can generate pole phase space "
1131 <<
"distributions for 3 body final states"
1132 << endl<<
"Will terminate."<<endl;
1136 if ( (whichTwo1 == 1 && whichTwo2 == 0 ) ||
1137 (whichTwo1 == 0 && whichTwo2 == 1 ) ) {
1146 if ( (whichTwo1 == 1 && whichTwo2 == 2 ) ||
1147 (whichTwo1 == 2 && whichTwo2 == 1 ) ) {
1155 if ( (whichTwo1 == 0 && whichTwo2 == 2 ) ||
1156 (whichTwo1 == 2 && whichTwo2 == 0 ) ) {
1165 report(
ERROR,
"EvtGen") <<
"Invalid pair of particle to generate a pole dist"
1166 << whichTwo1 <<
" " << whichTwo2
1167 << endl<<
"Will terminate."<<endl;
1178 if ( _channel < 0 ) {
1184 if (_ndaug!=ndaugstore){
1185 report(
ERROR,
"EvtGen") <<
"Asking to make a different number of "
1186 <<
"daughters than what was previously created."
1187 << endl<<
"Will terminate."<<endl;
1192 for(i=0;i<ndaugstore;i++){
1194 pdaug->
setId(
id[i]);
1204 if ( _decayProb == 0 ) _decayProb=
new double;
1216 ans += char (a % 10 + 48 );
1219 for (
int i = ans.size() - 1 ; i >= 0 ; i -- )
Evt3Rank3C conj(const Evt3Rank3C &t2)
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
void init_photon(EvtParticle **part)
void init_dirac(EvtParticle **part)
void init_neutrino(EvtParticle **part)
std::string IntToStr(int a)
void init_vector(EvtParticle **part)
void init_raritaschinger(EvtParticle **part)
void init_tensor(EvtParticle **part)
void init_scalar(EvtParticle **part)
void init_string(EvtParticle **part)
std::string IntToStr(int a)
ostream & report(Severity severity, const char *facility)
*********DOUBLE PRECISION m_pi INTEGER m_lenwt !max no of aux weights INTEGER m_phmax !maximum photon multiplicity ISR FSR *DOUBLE COMPLEX m_Pauli4 DOUBLE COMPLEX m_AmpBorn DOUBLE COMPLEX m_AmpBoxy DOUBLE COMPLEX m_AmpBorn1 DOUBLE COMPLEX m_AmpBorn2 DOUBLE COMPLEX m_AmpExpo2p DOUBLE COMPLEX m_Rmat DOUBLE COMPLEX m_BoxGZut !DOUBLE COMPLEX m_F1finPair2 !DOUBLE PRECISION m_Vcut DOUBLE PRECISION m_Alfinv DOUBLE PRECISION m_Lorin1 DOUBLE PRECISION m_Lorin2 DOUBLE PRECISION m_b
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
static void incoherentMix(const EvtId id, double &t, int &mix)
virtual int nRealDaughters()
virtual void makeDecay(EvtParticle *p)=0
static EvtDecayBase * getDecayFunc(EvtParticle *)
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)
static double getWidth(EvtId i)
static int getStdHep(EvtId id)
static double getRandMass(EvtId i, EvtId *parId, int nDaug, EvtId *dauId, EvtId *othDaugId, double maxMass, double *dauMasses)
static double getMeanMass(EvtId i)
static std::string name(EvtId i)
static double getMassProb(EvtId i, double mass, double massPar, int nDaug, double *massDau)
static double getMinMass(EvtId i)
static EvtSpinType::spintype getSpinType(EvtId i)
static double getMass(EvtId i)
static EvtId getId(const std::string &name)
static double getctau(EvtId i)
static EvtParticle * particleFactory(EvtSpinType::spintype spinType)
virtual EvtVector4C epsPhoton(int i)
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
void setDecayProb(double p)
void makeDaughters(int ndaug, EvtId *id)
virtual EvtVector4C epsParent(int i) 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
virtual EvtVector4C epsParentPhoton(int i)
void printTreeRec(int level) const
EvtParticle * getParent()
virtual EvtDiracSpinor spParentNeutrino() const
virtual EvtDiracSpinor spParent(int) const
void setVectorSpinDensity()
void printParticle() const
virtual EvtDiracSpinor spNeutrino() const
int getSpinStates() const
EvtVector4R getP4Restframe()
void setPolarizedSpinDensity(double r00, double r11, double r22)
void setDiagonalSpinDensity()
EvtSpinType::spintype getSpinType() const
const EvtVector4R & getP4() const
void setLifetime(double tau)
virtual EvtSpinDensity rotateToHelicityBasis() const =0
EvtParticle * getDaug(int i)
void dumpTreeRec(int level, int dj) const
void deleteDaughters(bool keepChannel=false)
virtual EvtDiracSpinor sp(int) const
void makeStdHep(EvtStdHep &stdhep, EvtSecondary &secondary, EvtId *stable_parent_ihep)
virtual EvtVector4C eps(int i) const
void addDaug(EvtParticle *node)
std::string treeStr() const
std::string treeStrRec(int level) const
virtual EvtTensor4C epsTensor(int i) const
std::string writeTreeRec(std::string) const
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
EvtParticle * nextIter(EvtParticle *rootOfTree=0)
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)