BOSS 8.0.0
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//
21#include "EvtSecondary.hh"
22#include "EvtPDL.hh"
23#include "EvtParticle.hh"
24#include "EvtPatches.hh"
25#include "EvtReport.hh"
26#include <iostream>
27using std::endl;
28using std::ostream;
29
30void EvtSecondary::init() { _npart = 0; }
31
32int EvtSecondary::getNPart() { return _npart; }
33
34void EvtSecondary::createSecondary( int stdhepindex, EvtParticle* prnt ) {
35
36 _stdhepindex[_npart] = stdhepindex;
37 if ( prnt->getNDaug() == 0 )
38 {
39 _id1[_npart] = 0;
40 _id2[_npart] = 0;
41 _id3[_npart] = 0;
42 _npart++;
43 return;
44 }
45 if ( prnt->getNDaug() == 1 )
46 {
47 _id1[_npart] = EvtPDL::getStdHep( prnt->getDaug( 0 )->getId() );
48 _id2[_npart] = 0;
49 _id3[_npart] = 0;
50 _npart++;
51 return;
52 }
53 if ( prnt->getNDaug() == 2 )
54 {
55 _id1[_npart] = EvtPDL::getStdHep( prnt->getDaug( 0 )->getId() );
56 _id2[_npart] = EvtPDL::getStdHep( prnt->getDaug( 1 )->getId() );
57 _id3[_npart] = 0;
58 _npart++;
59 return;
60 }
61 if ( prnt->getNDaug() == 3 )
62 {
63 _id1[_npart] = EvtPDL::getStdHep( prnt->getDaug( 0 )->getId() );
64 _id2[_npart] = EvtPDL::getStdHep( prnt->getDaug( 1 )->getId() );
65 _id3[_npart] = EvtPDL::getStdHep( prnt->getDaug( 2 )->getId() );
66 _npart++;
67 return;
68 }
69
70 report( ERROR, "EvtGen" ) << "More than 3 decay products in a secondary particle!" << endl;
71}
72
73ostream& operator<<( ostream& s, const EvtSecondary& secondary ) {
74
75 s << endl;
76 s << "Secondary decays:" << endl;
77
78 int i;
79 for ( i = 0; i < secondary._npart; i++ )
80 {
81
82 report( INFO, "EvtGen" ) << i << " " << secondary._stdhepindex[i] << " "
83 << secondary._id1[i] << " " << secondary._id2[i] << " "
84 << secondary._id3[i] << endl;
85 }
86
87 s << endl;
88
89 return s;
90}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
@ INFO
Definition EvtReport.hh:52
ostream & operator<<(ostream &s, const EvtSecondary &secondary)
XmlRpcServer s
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
EvtId getId() const
int getNDaug() const
EvtParticle * getDaug(int i)
void createSecondary(int stdhepindex, EvtParticle *prnt)