1 //--------------------------------------------------------------------------
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.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtSecondary.cc
13 // Description: Class to store the decays of the secondary particles.
15 // Modification history:
17 // RYD March 12, 1998 Module created
19 //------------------------------------------------------------------------
21 #include "EvtGenBase/EvtPatches.hh"
22 #include "EvtGenBase/EvtPatches.hh"
24 #include "EvtGenBase/EvtParticle.hh"
25 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtSecondary.hh"
27 #include "EvtGenBase/EvtReport.hh"
32 void EvtSecondary::init(){
36 int EvtSecondary::getNPart(){
40 void EvtSecondary::createSecondary(int stdhepindex,EvtParticle* prnt){
42 _stdhepindex[_npart]=stdhepindex;
43 if (prnt->getNDaug()==0){
50 if (prnt->getNDaug()==1){
51 _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
57 if (prnt->getNDaug()==2){
58 _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
59 _id2[_npart]=EvtPDL::getStdHep(prnt->getDaug(1)->getId());
64 if (prnt->getNDaug()==3){
65 _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
66 _id2[_npart]=EvtPDL::getStdHep(prnt->getDaug(1)->getId());
67 _id3[_npart]=EvtPDL::getStdHep(prnt->getDaug(2)->getId());
72 report(ERROR,"EvtGen") <<
73 "More than 3 decay products in a secondary particle!"<<endl;
79 ostream& operator<<(ostream& s, const EvtSecondary& secondary){
82 s << "Secondary decays:"<<endl;
85 for(i=0;i<secondary._npart;i++){
87 report(INFO,"EvtGen") <<i<<" "
88 <<secondary._stdhepindex[i]<<" "
89 <<secondary._id1[i]<<" "
90 <<secondary._id2[i]<<" "
91 <<secondary._id3[i]<<endl;