BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDecayBase.hh
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: EvtGen/EvtDecayBase.hh
12//
13// Description:
14//
15// Modification history:
16//
17// DJL/RYD August 11, 1998 Module created
18//
19//------------------------------------------------------------------------
20
21#ifndef EVTDECAYBASE_HH
22#define EVTDECAYBASE_HH
23
24#include "EvtComplex.hh"
25#include "EvtId.hh"
26#include "EvtPatches.hh"
27#include "EvtSpinType.hh"
28#include "EvtVector4R.hh"
29#include <map>
30#include <stdlib.h>
31#include <string>
32#include <vector>
33
34using std::string;
35
36class EvtParticle;
37class EvtSpinType;
38
40public:
41 // These pure virtual methods has to be implemented
42 // by any derived class
43 virtual void getName( std::string& name ) = 0;
44 virtual void decay( EvtParticle* p ) = 0;
45 virtual void makeDecay( EvtParticle* p ) = 0;
46 virtual EvtDecayBase* clone() = 0;
47
48 // These virtual methods can be implemented by the
49 // derived class to implement nontrivial functionality.
50 virtual void init();
51 virtual void initProbMax();
52 virtual std::string commandName();
53 virtual void command( std::string cmd );
54
55 double getProbMax( double prob );
56 double resetProbMax( double prob );
57
59 virtual ~EvtDecayBase();
60
61 virtual bool matchingDecay( const EvtDecayBase& other ) const;
62
63 EvtId getParentId() { return _parent; }
64 double getBranchingFraction() { return _brfr; }
65 void disableCheckQ() { _chkCharge = 0; };
66 void checkQ();
67 int getNDaug() { return _ndaug; }
68 EvtId* getDaugs() { return _daug; }
69 EvtId getDaug( int i ) { return _daug[i]; }
70 int getNArg() { return _narg; }
71 int getPHOTOS() { return _photos; }
72 void setPHOTOS() { _photos = 1; }
73 void setVerbose() { _verbose = 1; }
74 void setSummary() { _summary = 1; }
75 double* getArgs();
76 std::string* getArgsStr() { return _args; }
77 double getArg( int j );
78 std::string getArgStr( int j ) { return _args[j]; }
79 std::string getModelName() { return _modelname; }
80 int getDSum() { return _dsum; }
81 int summary() { return _summary; }
82 int verbose() { return _verbose; }
83
84 void saveDecayInfo( EvtId ipar, int ndaug, EvtId* daug, int narg,
85 std::vector<std::string>& args, std::string name, double brfr );
86 void printSummary();
87
88 // Does not really belong here but I don't have a better place.
89 static void findMasses( EvtParticle* p, int ndaugs, EvtId daugs[10], double masses[10] );
90 static void findMass( EvtParticle* p );
91 static double findMaxMass( EvtParticle* p );
92
93 // Methods to set the maximum probability.
94 void setProbMax( double prbmx );
95 void noProbMax();
96
97 void checkNArg( int a1, int a2 = -1, int a3 = -1, int a4 = -1 );
98 void checkNDaug( int d1, int d2 = -1 );
99
101 void checkSpinDaughter( int d1, EvtSpinType::spintype sp );
102
103 // lange - some models can take more daughters
104 // than they really have to fool aliases (VSSBMIX for example)
105 virtual int nRealDaughters() { return _ndaug; }
106
107protected:
110
111private:
112 int _photos;
113 int _ndaug;
114 EvtId _parent;
115 int _narg;
116 EvtId* _daug;
117 double* _argsD;
118 std::string* _args;
119 std::string _modelname;
120 double _brfr;
121 int _dsum;
122 int _summary;
123 int _verbose;
124
125 int defaultprobmax;
126 double probmax;
127 int ntimes_prob;
128
129 // Should charge conservation be checked when model is
130 // created? 1=yes 0 no.
131 int _chkCharge;
132
133 // These are used for gathering statistics.
134 double sum_prob;
135 double max_prob;
136};
137
138#endif
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
virtual void decay(EvtParticle *p)=0
double getArg(int j)
virtual EvtDecayBase * clone()=0
std::string * getArgsStr()
virtual ~EvtDecayBase()
double resetProbMax(double prob)
void setProbMax(double prbmx)
virtual void init()
static void findMass(EvtParticle *p)
virtual bool matchingDecay(const EvtDecayBase &other) const
virtual void getName(std::string &name)=0
void disableCheckQ()
static double findMaxMass(EvtParticle *p)
std::string getModelName()
EvtId getParentId()
void printSummary()
void saveDecayInfo(EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
virtual int nRealDaughters()
virtual void command(std::string cmd)
double * getArgs()
double getProbMax(double prob)
virtual void makeDecay(EvtParticle *p)=0
double getBranchingFraction()
static void findMasses(EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
virtual void initProbMax()
bool daugsDecayedByParentModel()
virtual std::string commandName()
void setSummary()
bool _daugsDecayedByParentModel
EvtId getDaug(int i)
void setVerbose()
std::string getArgStr(int j)
Definition EvtId.hh:27