104 node->_daug[node->_ndaug++]=
this;
140 report(
ERROR,
"EvtGen")<<
"Error in EvtParticle::setVectorSpinDensity"<<endl;
159 report(
ERROR,
"EvtGen")<<
"Error in EvtParticle::setVectorSpinDensity"<<endl;
181 assert(R.GetDim()==rho.
GetDim());
194 tmp+=R.Get(l,i)*rho.
Get(l,k)*
conj(R.Get(k,j));
197 _rhoForward.
Set(i,j,tmp);
212 assert(R.GetDim()==rho.
GetDim());
225 tmp+=R.Get(l,i)*rho.
Get(l,k)*
conj(R.Get(k,j));
228 _rhoForward.
Set(i,j,tmp);
256 for(ii=0;ii<_ndaug;ii++){
267 dauId=
new EvtId[_ndaug];
268 dauMasses=
new double[_ndaug];
269 for (j=0;j<_ndaug;j++) {
288 if ( parId)
delete parId;
289 if ( othDauId)
delete othDauId;
290 if ( dauId)
delete [] dauId;
291 if ( dauMasses)
delete [] dauMasses;
317 scalar_part->
init(BSB,p_init);
319 else if (
getId()==BSB) {
321 scalar_part->
init(BS0,p_init);
323 else if (
getId()==BD0) {
325 scalar_part->
init(BDB,p_init);
327 else if (
getId()==BDB) {
329 scalar_part->
init(BD0,p_init);
373 dauId=
new EvtId[nDaugT];
374 dauMasses=
new double[nDaugT];
375 for (j=0;j<nDaugT;j++) {
395 if ( parId)
delete parId;
396 if ( othDauId)
delete othDauId;
397 if ( dauId)
delete [] dauId;
398 if ( dauMasses)
delete [] dauMasses;
442 std::cout<<
"if ( _ndaug==1 && (getId()==BS0||getId()==BSB||getId()==BD0||getId()==BDB) )"<<endl;
465 while (massProb<ranNum) {
474 if ( counter > 10000 ) {
475 if ( counter == 10001 ) {
476 report(
INFO,
"EvtGen") <<
"Too many iterations to determine the mass tree. Parent mass= "<< p->
mass() << _p<<
" " << massProb <<endl;
478 report(
INFO,
"EvtGen") <<
"will take next combo with non-zero likelihood\n";
480 if ( massProb>0. ) massProb=2.0;
481 if ( counter > 20000 ) {
488 report(
INFO,
"EvtGen") <<
"Taking the minimum mass of all particles in the chain\n";
491 report(
INFO,
"EvtGen") <<
"Sorry, no luck finding a valid set of masses. This may be a pathological combo\n";
519 dMasses=
new double[nDaug];
520 for (i=0; i<nDaug; i++) dMasses[i]=p->
getDaug(i)->
mass();
533 for (i=0; i<nDaug; i++) {
542 for(i=0;i<_ndaug;i++){
548 if ( !keepChannel) _channel=-10;
567 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
568 <<
"th polarization vector."
569 <<
" I.e. you thought it was a"
570 <<
" vector particle!" << endl;
578 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
579 <<
"th polarization vector."
580 <<
" I.e. you thought it was a"
581 <<
" vector particle!" << endl;
589 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
590 <<
"th polarization vector of photon."
591 <<
" I.e. you thought it was a"
592 <<
" photon particle!" << endl;
600 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
601 <<
"th polarization vector of a photon."
602 <<
" I.e. you thought it was a"
603 <<
" photon particle!" << endl;
613 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
615 <<
" I.e. you thought it was a"
616 <<
" Dirac particle!" << endl;
626 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
628 <<
" I.e. you thought it was a"
629 <<
" Dirac particle!" << endl;
637 report(
ERROR,
"EvtGen") <<
"and you have asked for the "
639 <<
" I.e. you thought it was a"
640 <<
" neutrino particle!" << endl;
648 report(
ERROR,
"EvtGen") <<
"and you have asked for the "
650 <<
" I.e. you thought it was a"
651 <<
" neutrino particle!" << endl;
661 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
663 <<
" I.e. you thought it was a"
664 <<
" Tensor particle!" << endl;
674 report(
ERROR,
"EvtGen") <<
"and you have asked for the:"<<i
676 <<
" I.e. you thought it was a"
677 <<
" Tensor particle!" << endl;
710 temp.
set(0.0,0.0,0.0,0.0);
713 if (ptemp==0)
return temp;
715 temp=(ptemp->_t/ptemp->
mass())*(ptemp->
getP4());
721 temp=temp+(ptemp->_t/ptemp->
mass())*(ptemp->
getP4());
736 if (_ndaug!=0)
return _daug[0];
739 bpart=current->_parent;
740 if (bpart==0)
return 0;
742 while (bpart->_daug[i]!=current) {i++;}
744 if ( bpart==rootOfTree ) {
745 if ( i== bpart->_ndaug-1 )
return 0;
751 }
while(i>=bpart->_ndaug);
753 return bpart->_daug[i];
759 EvtId *list_of_stable){
770 while (list_of_stable[ii]!=
EvtId(-1,-1)) {
771 if (
getId()==list_of_stable[ii]){
782 for(i=0;i<_ndaug;i++){
787 for(i=0;i<_ndaug;i++){
788 _daug[i]->makeStdHepRec(1+i,1+i,stdhep,secondary,list_of_stable);
801 for(i=0;i<_ndaug;i++){
806 for(i=0;i<_ndaug;i++){
807 _daug[i]->makeStdHepRec(1+i,1+i,stdhep);
814void EvtParticle::makeStdHepRec(
int firstparent,
int lastparent,
817 EvtId *list_of_stable){
825 while (list_of_stable[ii]!=
EvtId(-1,-1)) {
826 if (
getId()==list_of_stable[ii]){
837 for(i=0;i<_ndaug;i++){
839 firstparent,lastparent,
843 for(i=0;i<_ndaug;i++){
844 _daug[i]->makeStdHepRec(parent_num+i,parent_num+i,stdhep,
845 secondary,list_of_stable);
851void EvtParticle::makeStdHepRec(
int firstparent,
int lastparent,
856 for(i=0;i<_ndaug;i++){
858 firstparent,lastparent,
862 for(i=0;i<_ndaug;i++){
863 _daug[i]->makeStdHepRec(parent_num+i,parent_num+i,stdhep);
877 for (i=0;i<(5*level);i++) {
883 for(i=0;i<_ndaug;i++){
886 for(i=0;i<_ndaug;i++){
890 for(i=0;i<_ndaug;i++){
898 report(
INFO,
"EvtGen") <<
"This is the current decay chain"<<endl;
903 report(
INFO,
"EvtGen") <<
"End of decay chain."<<endl;
912 std::string retval=
"";
914 for(i=0;i<_ndaug;i++){
922 if ( i!=_ndaug-1) retval+=
" ";
930 std::string retval=
"";
932 if (resonance ==
EvtPDL::name(_id).c_str() && _ndaug!=0) {
933 retval=resonance+
": "+
IntToStr(_ndaug)+
" ";
934 for(
int i=0;i<_ndaug;i++){
940 for(
int i=0;i<_ndaug;i++){
964 report(
INFO,
"") <<newlevel<<
" "<< cid<<
" "<<dj;
970 for(i=0;i<_ndaug;i++){
979 report(
INFO,
"EvtGen") <<
"This is the current decay chain to dump"<<endl;
984 report(
INFO,
"EvtGen") <<
"End of decay chain."<<endl;
1027 report(
INFO,
"EvtGen") <<
"Unknown particle type in EvtParticle::printParticle()"<<endl;
1030 report(
INFO,
"EvtGen") <<
"Number of daughters:"<<_ndaug<<
"\n";
1071 int numdaughter,
EvtId *daughters,
double poleSize,
1072 int whichTwo1,
int whichTwo2) {
1080 static double mass[100];
1093 bool resetDaughters=
false;
1094 if ( numdaughter != this->
getNDaug() && this->
getNDaug() > 0 ) resetDaughters=
true;
1095 if ( numdaughter == this->
getNDaug() )
1096 for (i=0; i<numdaughter;i++) {
1097 if ( this->
getDaug(i)->
getId() != daughters[i] ) resetDaughters=
true;
1101 if ( resetDaughters ) {
1117 for (i=0; i<numdaughter;i++) {
1122 if ( poleSize<-0.1) {
1124 for(i=0;i<numdaughter;i++){
1130 if ( numdaughter != 3 ) {
1131 report(
ERROR,
"EvtGen") <<
"Only can generate pole phase space "
1132 <<
"distributions for 3 body final states"
1133 << endl<<
"Will terminate."<<endl;
1137 if ( (whichTwo1 == 1 && whichTwo2 == 0 ) ||
1138 (whichTwo1 == 0 && whichTwo2 == 1 ) ) {
1147 if ( (whichTwo1 == 1 && whichTwo2 == 2 ) ||
1148 (whichTwo1 == 2 && whichTwo2 == 1 ) ) {
1156 if ( (whichTwo1 == 0 && whichTwo2 == 2 ) ||
1157 (whichTwo1 == 2 && whichTwo2 == 0 ) ) {
1166 report(
ERROR,
"EvtGen") <<
"Invalid pair of particle to generate a pole dist"
1167 << whichTwo1 <<
" " << whichTwo2
1168 << endl<<
"Will terminate."<<endl;
1179 if ( _channel < 0 ) {
1185 if (_ndaug!=ndaugstore){
1186 report(
ERROR,
"EvtGen") <<
"Asking to make a different number of "
1187 <<
"daughters than what was previously created."
1188 << endl<<
"Will terminate."<<endl;
1193 for(i=0;i<ndaugstore;i++){
1195 pdaug->
setId(
id[i]);
1205 if ( _decayProb == 0 ) _decayProb=
new double;
1217 ans += char (a % 10 + 48 );
1220 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)
double double double * p4