Line data Source code
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: EvtSecondary.cc
12 : //
13 : // Description: Class to store the decays of the secondary particles.
14 : //
15 : // Modification history:
16 : //
17 : // RYD March 12, 1998 Module created
18 : //
19 : //------------------------------------------------------------------------
20 : //
21 : #include "EvtGenBase/EvtPatches.hh"
22 : #include "EvtGenBase/EvtPatches.hh"
23 : #include <iostream>
24 : #include "EvtGenBase/EvtParticle.hh"
25 : #include "EvtGenBase/EvtPDL.hh"
26 : #include "EvtGenBase/EvtSecondary.hh"
27 : #include "EvtGenBase/EvtReport.hh"
28 : using std::endl;
29 : using std::ostream;
30 :
31 :
32 : void EvtSecondary::init(){
33 0 : _npart=0;
34 0 : }
35 :
36 : int EvtSecondary::getNPart(){
37 0 : return _npart;
38 : }
39 :
40 : void EvtSecondary::createSecondary(int stdhepindex,EvtParticle* prnt){
41 :
42 0 : _stdhepindex[_npart]=stdhepindex;
43 0 : if (prnt->getNDaug()==0){
44 0 : _id1[_npart]=0;
45 0 : _id2[_npart]=0;
46 0 : _id3[_npart]=0;
47 0 : _npart++;
48 0 : return;
49 : }
50 0 : if (prnt->getNDaug()==1){
51 0 : _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
52 0 : _id2[_npart]=0;
53 0 : _id3[_npart]=0;
54 0 : _npart++;
55 0 : return;
56 : }
57 0 : if (prnt->getNDaug()==2){
58 0 : _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
59 0 : _id2[_npart]=EvtPDL::getStdHep(prnt->getDaug(1)->getId());
60 0 : _id3[_npart]=0;
61 0 : _npart++;
62 0 : return;
63 : }
64 0 : if (prnt->getNDaug()==3){
65 0 : _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
66 0 : _id2[_npart]=EvtPDL::getStdHep(prnt->getDaug(1)->getId());
67 0 : _id3[_npart]=EvtPDL::getStdHep(prnt->getDaug(2)->getId());
68 0 : _npart++;
69 0 : return;
70 : }
71 :
72 0 : report(Severity::Error,"EvtGen") <<
73 0 : "More than 3 decay products in a secondary particle!"<<endl;
74 :
75 :
76 0 : }
77 :
78 :
79 : ostream& operator<<(ostream& s, const EvtSecondary& secondary){
80 :
81 0 : s <<endl;
82 0 : s << "Secondary decays:"<<endl;
83 :
84 : int i;
85 0 : for(i=0;i<secondary._npart;i++){
86 :
87 0 : report(Severity::Info,"EvtGen") <<i<<" "
88 0 : <<secondary._stdhepindex[i]<<" "
89 0 : <<secondary._id1[i]<<" "
90 0 : <<secondary._id2[i]<<" "
91 0 : <<secondary._id3[i]<<endl;
92 :
93 : }
94 :
95 0 : s<<endl;
96 :
97 0 : return s;
98 :
99 : }
100 :
|