BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtFromParent_antiLambda.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtFromParent_antiLambda.cc
12//
13// Description: Routine to decay a particle according th phase space
14//
15// Modification history:
16//
17// RYD January 8, 1997 Module created
18//
19//------------------------------------------------------------------------
20//
22#include <stdlib.h>
26#include "EvtGenBase/EvtPDL.hh"
27#include "EvtGenBase/EvtId.hh"
31#include <iostream>
32#include <iomanip>
33#include <fstream>
34#include <stdlib.h>
35#include <unistd.h>
36#include <stdio.h>
37
39#include <string>
40
42
43void EvtFromParent_antiLambda::getName(std::string& model_name){
44
45 model_name="FromParent_antiLambda";
46
47}
48
50
51 return new EvtFromParent_antiLambda;
52
53}
54
55
57
58 // check that there are 0 arguments
59 checkNArg(0);
60
61}
62
64
65 noProbMax();
66
67}
68
70 //p->printTree();
71 //std::cout<<"FromParent:p->getId() = "<<p->getId()<<std::endl;
72 EvtId LambdaId = EvtPDL::getId("Lambda0");
73 //std::cout<<"LambdaId = "<<LambdaId<<std::endl;
74 EvtId antiLambdaId = EvtPDL::getId("anti-Lambda0");
75 //std::cout<<"antiLambdaId = "<<antiLambdaId<<std::endl;
76 if(p->getId()!=LambdaId&&p->getId()!=antiLambdaId){std::cout<<"Parent particle is required to be Lambda0 or antiLambda0"<<std::endl;abort();}
77 int more=0;
78 int numstable=0;
79 EvtId evtnumstable[100];
80 EvtVector4R p4[20];
81 /*if(EvtParticle::_NextLevelDauNum == 0) {
82 report(ERROR,"EvtGen") << "EvtParticle failed to store the info of NextLevel";
83 ::abort();
84 }*/
86 if(p->getId()==LambdaId) {
87 //pi-
88 evtnumstable[numstable]=EvtPDL::evtIdFromStdHep(-211);
89 p4[numstable] = EvtParticle::_NextLevelP4[2];
90 std::cout<<"FromParent_antiLambda: pi- p4[numstable] = "<<p4[numstable]<<std::endl;
91 numstable++;
92 //p
93 evtnumstable[numstable]=EvtPDL::evtIdFromStdHep(2212);
94 p4[numstable] = EvtParticle::_NextLevelP4[3];
95 std::cout<<"FromParent_antiLambda: p+ p4[numstable] = "<<p4[numstable]<<std::endl;
96 numstable++;
97 }
98 if(p->getId()==antiLambdaId) {
99 std::cout<<"anti-Lambda0's parent id:"<<p->getParent()->getId()<<" p4 ="<<p->getParent()->getP4Lab()<<std::endl;
100 std::cout<<"anti-Lambda0 id:"<<p->getId()<<" p4 ="<<p->getP4Lab()<<std::endl;
101 //pi+
102 evtnumstable[numstable]=EvtPDL::evtIdFromStdHep(211);
103 p4[numstable] = EvtParticle::_NextLevelP4[0];
104 std::cout<<"FromParent_antiLambda: pi+ p4[numstable] = "<<p4[numstable]<<std::endl;
105 numstable++;
106 //pbar
107 evtnumstable[numstable]=EvtPDL::evtIdFromStdHep(-2212);
108 p4[numstable] = EvtParticle::_NextLevelP4[1];
109 std::cout<<"FromParent_antiLambda: anti-p- p4[numstable] = "<<p4[numstable]<<std::endl;
110 numstable++;
111 }
112 p->makeDaughters(numstable,evtnumstable);
113 int ndaugFound=0;
114 for(int i=0;i<numstable;i++){
115 p->getDaug(i)->init(evtnumstable[i],p4[i]);
116 ndaugFound++;
117 }
118 if ( ndaugFound == 0 ) {
119 report(ERROR,"EvtGen") << "Phokhara has failed to do a decay ";
120 report(ERROR,"EvtGen") << EvtPDL::name(p->getId()).c_str() << " " << p->mass()<<endl;
121 assert(0);
122 }
123 if(p->getId()==LambdaId) {
124 //int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable);
125 //more=(channel!=-1);
126 //if(more) { std::cout<<"EvtFromParent_antiLambda:Existence of mode "<<channel<<" in exclusive decay list has the same final state as this one"<<std::endl;abort(); }
127
128 std::cout<<"EvtFromParent_antiLambda Lambda0's parent id:"<<p->getParent()->getId()<<" p4 ="<<p->getParent()->getP4Lab()<<std::endl;
129 std::cout<<"EvtFromParent_antiLambda SUMMARY: part p4"<<p->getP4Lab()<<std::endl;
130 std::cout<<"EvtFromParent_antiLambda SUMMARY: Daug0 p4"<<p->getDaug(0)->getP4Lab()<<std::endl;
131 std::cout<<"EvtFromParent_antiLambda SUMMARY: Daug1 p4"<<p->getDaug(1)->getP4Lab()<<std::endl;
132 }
133 if(p->getId()==antiLambdaId) {
134 //int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable);
135 //more=(channel!=0);
136 //if(more) { std::cout<<"EvtFromParent_antiLambda:Existence of mode "<<channel<<" in exclusive decay list has the same final state as this one"<<std::endl;abort(); }
137
138 std::cout<<"EvtFromParent_antiLambda antiLambda0's parent id:"<<p->getParent()->getId()<<" p4 ="<<p->getParent()->getP4Lab()<<std::endl;
139 std::cout<<"EvtFromParent_antiLambda SUMMARY: part p4"<<p->getP4Lab()<<std::endl;
140 std::cout<<"EvtFromParent_antiLambda SUMMARY: Daug0 p4"<<p->getDaug(0)->getP4Lab()<<std::endl;
141 std::cout<<"EvtFromParent_antiLambda SUMMARY: Daug1 p4"<<p->getDaug(1)->getP4Lab()<<std::endl;
142 }
143 }
144 return ;
145
146
147
148}
149
150
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
void noProbMax()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void getName(std::string &name)
Definition: EvtId.hh:27
static EvtId evtIdFromStdHep(int stdhep)
Definition: EvtPDL.cc:244
static std::string name(EvtId i)
Definition: EvtPDL.hh:64
static EvtId getId(const std::string &name)
Definition: EvtPDL.cc:287
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtVector4R getP4Lab()
Definition: EvtParticle.cc:684
EvtId getId() const
Definition: EvtParticle.cc:112
EvtParticle * getParent()
Definition: EvtParticle.cc:86
static int _NextLevelDauNum
Definition: EvtParticle.hh:149
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:84
static EvtVector4R _NextLevelP4[20]
Definition: EvtParticle.hh:151
double mass() const
Definition: EvtParticle.cc:126
double double double * p4
Definition: qcdloop1.h:77