BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtSecondary.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: 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//
23#include <iostream>
25#include "EvtGenBase/EvtPDL.hh"
28using std::endl;
29using std::ostream;
30
31
33 _npart=0;
34}
35
37 return _npart;
38}
39
40void EvtSecondary::createSecondary(int stdhepindex,EvtParticle* prnt){
41
42 _stdhepindex[_npart]=stdhepindex;
43 if (prnt->getNDaug()==0){
44 _id1[_npart]=0;
45 _id2[_npart]=0;
46 _id3[_npart]=0;
47 _npart++;
48 return;
49 }
50 if (prnt->getNDaug()==1){
51 _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
52 _id2[_npart]=0;
53 _id3[_npart]=0;
54 _npart++;
55 return;
56 }
57 if (prnt->getNDaug()==2){
58 _id1[_npart]=EvtPDL::getStdHep(prnt->getDaug(0)->getId());
59 _id2[_npart]=EvtPDL::getStdHep(prnt->getDaug(1)->getId());
60 _id3[_npart]=0;
61 _npart++;
62 return;
63 }
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());
68 _npart++;
69 return;
70 }
71
72 report(ERROR,"EvtGen") <<
73 "More than 3 decay products in a secondary particle!"<<endl;
74
75
76}
77
78
79ostream& operator<<(ostream& s, const EvtSecondary& secondary){
80
81 s <<endl;
82 s << "Secondary decays:"<<endl;
83
84 int i;
85 for(i=0;i<secondary._npart;i++){
86
87 report(INFO,"EvtGen") <<i<<" "
88 <<secondary._stdhepindex[i]<<" "
89 <<secondary._id1[i]<<" "
90 <<secondary._id2[i]<<" "
91 <<secondary._id3[i]<<endl;
92
93 }
94
95 s<<endl;
96
97 return s;
98
99}
100
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
@ INFO
Definition: EvtReport.hh:52
ostream & operator<<(ostream &s, const EvtSecondary &secondary)
Definition: EvtSecondary.cc:79
XmlRpcServer s
Definition: HelloServer.cpp:11
static int getStdHep(EvtId id)
Definition: EvtPDL.hh:56
EvtId getId() const
Definition: EvtParticle.cc:113
int getNDaug() const
Definition: EvtParticle.cc:125
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
void createSecondary(int stdhepindex, EvtParticle *prnt)
Definition: EvtSecondary.cc:40