BOSS 8.0.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//
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_antiLambda::getName( std::string& model_name ) {
43
44 model_name = "FromParent_antiLambda";
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 // pi-
82 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
83 p4[numstable] = EvtParticle::_NextLevelP4[2];
84 std::cout << "FromParent_antiLambda: pi- p4[numstable] = " << p4[numstable] << std::endl;
85 numstable++;
86 // p
87 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 2212 );
88 p4[numstable] = EvtParticle::_NextLevelP4[3];
89 std::cout << "FromParent_antiLambda: p+ p4[numstable] = " << p4[numstable] << std::endl;
90 numstable++;
91 }
92 if ( p->getId() == antiLambdaId )
93 {
94 std::cout << "anti-Lambda0's parent id:" << p->getParent()->getId()
95 << " p4 =" << p->getParent()->getP4Lab() << std::endl;
96 std::cout << "anti-Lambda0 id:" << p->getId() << " p4 =" << p->getP4Lab() << std::endl;
97 // pi+
98 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
99 p4[numstable] = EvtParticle::_NextLevelP4[0];
100 std::cout << "FromParent_antiLambda: pi+ p4[numstable] = " << p4[numstable] << std::endl;
101 numstable++;
102 // pbar
103 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -2212 );
104 p4[numstable] = EvtParticle::_NextLevelP4[1];
105 std::cout << "FromParent_antiLambda: anti-p- p4[numstable] = " << p4[numstable]
106 << std::endl;
107 numstable++;
108 }
109 p->makeDaughters( numstable, evtnumstable );
110 int ndaugFound = 0;
111 for ( int i = 0; i < numstable; i++ )
112 {
113 p->getDaug( i )->init( evtnumstable[i], p4[i] );
114 ndaugFound++;
115 }
116 if ( ndaugFound == 0 )
117 {
118 report( ERROR, "EvtGen" ) << "Phokhara has failed to do a decay ";
119 report( ERROR, "EvtGen" ) << EvtPDL::name( p->getId() ).c_str() << " " << p->mass()
120 << endl;
121 assert( 0 );
122 }
123 if ( p->getId() == LambdaId )
124 {
125 // int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable);
126 // more=(channel!=-1);
127 // if(more) { std::cout<<"EvtFromParent_antiLambda:Existence of mode "<<channel<<" in
128 // exclusive decay list has the same final state as this one"<<std::endl;abort(); }
129
130 std::cout << "EvtFromParent_antiLambda Lambda0's parent id:" << p->getParent()->getId()
131 << " p4 =" << p->getParent()->getP4Lab() << std::endl;
132 std::cout << "EvtFromParent_antiLambda SUMMARY: part p4" << p->getP4Lab() << std::endl;
133 std::cout << "EvtFromParent_antiLambda SUMMARY: Daug0 p4" << p->getDaug( 0 )->getP4Lab()
134 << std::endl;
135 std::cout << "EvtFromParent_antiLambda SUMMARY: Daug1 p4" << p->getDaug( 1 )->getP4Lab()
136 << std::endl;
137 }
138 if ( p->getId() == antiLambdaId )
139 {
140 // int channel=EvtDecayTable::inChannelList(p->getId(),numstable,evtnumstable);
141 // more=(channel!=0);
142 // if(more) { std::cout<<"EvtFromParent_antiLambda:Existence of mode "<<channel<<" in
143 // exclusive decay list has the same final state as this one"<<std::endl;abort(); }
144
145 std::cout << "EvtFromParent_antiLambda antiLambda0's parent id:"
146 << p->getParent()->getId() << " p4 =" << p->getParent()->getP4Lab()
147 << std::endl;
148 std::cout << "EvtFromParent_antiLambda SUMMARY: part p4" << p->getP4Lab() << std::endl;
149 std::cout << "EvtFromParent_antiLambda SUMMARY: Daug0 p4" << p->getDaug( 0 )->getP4Lab()
150 << std::endl;
151 std::cout << "EvtFromParent_antiLambda SUMMARY: Daug1 p4" << p->getDaug( 1 )->getP4Lab()
152 << std::endl;
153 }
154 }
155 return;
156}
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 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