BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtFromParent_Lambda.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_Lambda.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//
30#include <fstream>
31#include <iomanip>
32#include <iostream>
33#include <stdio.h>
34#include <stdlib.h>
35#include <unistd.h>
36
37#include "GeneratorObject/McGenEvent.h"
38#include <string>
39
41
42void EvtFromParent_Lambda::getName( std::string& model_name ) {
43
44 model_name = "FromParent_Lambda";
45}
46
48
50
51 // check that there are 0 arguments
52 checkNArg( 0 );
53}
54
56
58 // p->printTree();
59 // std::cout<<"FromParent:p->getId() = "<<p->getId()<<std::endl;
60 EvtId LambdaId = EvtPDL::getId( "Lambda0" );
61 // std::cout<<"LambdaId = "<<LambdaId<<std::endl;
62 EvtId antiLambdaId = EvtPDL::getId( "anti-Lambda0" );
63 // std::cout<<"antiLambdaId = "<<antiLambdaId<<std::endl;
64 if ( p->getId() != LambdaId && p->getId() != antiLambdaId )
65 {
66 std::cout << "Parent particle is required to be Lambda0 or antiLambda0" << std::endl;
67 abort();
68 }
69 int more = 0;
70 int numstable = 0;
71 EvtId evtnumstable[100];
72 EvtVector4R p4[20];
73 /*if(EvtParticle::_NextLevelDauNum == 0) {
74 report(ERROR,"EvtGen") << "EvtParticle failed to store the info of NextLevel";
75 ::abort();
76 }*/
78 {
79 if ( p->getId() == LambdaId )
80 {
81 std::cout << "Lambda0's parent id:" << p->getParent()->getId()
82 << " p4 =" << p->getParent()->getP4Lab() << std::endl;
83 std::cout << "Lambda0's id:" << p->getId() << " p4 =" << p->getP4Lab() << std::endl;
84 // pi-
85 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
86 p4[numstable] = EvtParticle::_NextLevelP4[2];
87 std::cout << "FromParent_Lambda: pi- p4[numstable] = " << p4[numstable] << std::endl;
88 numstable++;
89 // p
90 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 2212 );
91 p4[numstable] = EvtParticle::_NextLevelP4[3];
92 std::cout << "FromParent_Lambda: p+ p4[numstable] = " << p4[numstable] << std::endl;
93 numstable++;
94 }
95 if ( p->getId() == antiLambdaId )
96 {
97 std::cout << "anti-Lambda0's parent id:" << p->getParent()->getId()
98 << " p4 =" << p->getParent()->getP4Lab() << std::endl;
99 std::cout << "anti-Lambda0's id:" << p->getId() << " p4 =" << p->getP4Lab() << std::endl;
100 // pi+
101 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
102 p4[numstable] = EvtParticle::_NextLevelP4[0];
103 std::cout << "FromParent_Lambda: pi+ p4[numstable] = " << p4[numstable] << std::endl;
104 numstable++;
105 // pbar
106 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -2212 );
107 p4[numstable] = EvtParticle::_NextLevelP4[1];
108 std::cout << "FromParent_Lambda: anti-p- p4[numstable] = " << p4[numstable] << std::endl;
109 numstable++;
110 }
111 p->makeDaughters( numstable, evtnumstable );
112 int ndaugFound = 0;
113 for ( int i = 0; i < numstable; i++ )
114 {
115 p->getDaug( i )->init( evtnumstable[i], p4[i] );
116 ndaugFound++;
117 }
118 if ( ndaugFound == 0 )
119 {
120 report( ERROR, "EvtGen" ) << "Phokhara has failed to do a decay ";
121 report( ERROR, "EvtGen" ) << EvtPDL::name( p->getId() ).c_str() << " " << p->mass()
122 << endl;
123 assert( 0 );
124 }
125 if ( p->getId() == LambdaId )
126 {
127 // int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable);
128 // more=(channel!=-1);
129 // if(more) { std::cout<<"EvtFromParent_Lambda:Existence of mode "<<channel<<" in
130 // exclusive decay list has the same final state as this one"<<std::endl;abort(); }
131
132 std::cout << "EvtFromParent_Lambda Lambda0's parent id:" << p->getParent()->getId()
133 << " p4 =" << p->getParent()->getP4Lab() << std::endl;
134 std::cout << "EvtFromParent_Lambda SUMMARY: part p4" << p->getP4Lab() << std::endl;
135 std::cout << "EvtFromParent_Lambda SUMMARY: Daug0 p4" << p->getDaug( 0 )->getP4Lab()
136 << std::endl;
137 std::cout << "EvtFromParent_Lambda SUMMARY: Daug1 p4" << p->getDaug( 1 )->getP4Lab()
138 << std::endl;
139 }
140 if ( p->getId() == antiLambdaId )
141 {
142 // int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable);
143 // more=(channel!=-1);
144 // if(more) { std::cout<<"EvtFromParent_Lambda:Existence of mode "<<channel<<" in
145 // exclusive decay list has the same final state as this one"<<std::endl;abort(); }
146
147 std::cout << "EvtFromParent_Lambda antiLambda0's parent id:" << p->getParent()->getId()
148 << " p4 =" << p->getParent()->getP4Lab() << std::endl;
149 std::cout << "EvtFromParent_Lambda SUMMARY: part p4" << p->getP4Lab() << std::endl;
150 std::cout << "EvtFromParent_Lambda SUMMARY: Daug0 p4" << p->getDaug( 0 )->getP4Lab()
151 << std::endl;
152 std::cout << "EvtFromParent_Lambda SUMMARY: Daug1 p4" << p->getDaug( 1 )->getP4Lab()
153 << std::endl;
154 }
155 }
156 return;
157}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void decay(EvtParticle *p)
void getName(std::string &name)
Definition EvtId.hh:27
static EvtId evtIdFromStdHep(int stdhep)
Definition EvtPDL.cc:232
static std::string name(EvtId i)
Definition EvtPDL.hh:70
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtVector4R getP4Lab()
EvtId getId() const
EvtParticle * getParent()
static int _NextLevelDauNum
EvtParticle * getDaug(int i)
static EvtVector4R _NextLevelP4[20]
double mass() const