File indexing completed on 2026-08-06 09:20:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef EVTDECAYBASE_HH
0022 #define EVTDECAYBASE_HH
0023
0024 #include "EvtGenBase/EvtId.hh"
0025 #include "EvtGenBase/EvtPatches.hh"
0026 #include "EvtGenBase/EvtSpinType.hh"
0027
0028 #include <stdlib.h>
0029 #include <string>
0030 #include <vector>
0031 class EvtParticle;
0032 class EvtSpinType;
0033
0034 class EvtDecayBase {
0035 public:
0036
0037
0038 virtual std::string getName() = 0;
0039 virtual void decay( EvtParticle* p ) = 0;
0040 virtual void makeDecay( EvtParticle* p, bool recursive = true ) = 0;
0041 virtual EvtDecayBase* clone() = 0;
0042
0043
0044
0045 virtual void init();
0046 virtual void initProbMax();
0047 virtual std::string commandName();
0048 virtual void command( std::string cmd );
0049
0050 virtual std::string getParamName( int i );
0051 virtual std::string getParamDefault( int i );
0052
0053 double getProbMax( double prob );
0054 double resetProbMax( double prob );
0055
0056 EvtDecayBase();
0057 virtual ~EvtDecayBase() = default;
0058
0059 virtual bool matchingDecay( const EvtDecayBase& other ) const;
0060
0061 EvtId getParentId() const { return _parent; }
0062 double getBranchingFraction() const { return _brfr; }
0063 void disableCheckQ() { _chkCharge = 0; };
0064 void checkQ();
0065 int getNDaug() const { return _ndaug; }
0066 EvtId* getDaugs() { return _daug.data(); }
0067 EvtId getDaug( int i ) const { return _daug[i]; }
0068 int getNArg() const { return _narg; }
0069 int getPHOTOS() const { return _photos; }
0070 void setPHOTOS() { _photos = 1; }
0071 void setVerbose() { _verbose = 1; }
0072 void setSummary() { _summary = 1; }
0073 double* getArgs();
0074 std::string* getArgsStr() { return _args.data(); }
0075 double getArg( unsigned int j );
0076 double getStoredArg( int j ) const { return _storedArgs.at( j ); }
0077 double getNStoredArg() const { return _storedArgs.size(); }
0078 std::string getArgStr( int j ) const { return _args[j]; }
0079 std::string getModelName() const { return _modelname; }
0080 int getDSum() const { return _dsum; }
0081 int summary() const { return _summary; }
0082 int verbose() const { return _verbose; }
0083
0084 void saveDecayInfo( EvtId ipar, int ndaug, EvtId* daug, int narg,
0085 std::vector<std::string>& args, std::string name,
0086 double brfr );
0087 void printSummary() const;
0088 void printInfo() const;
0089
0090
0091 static void findMasses( EvtParticle* p, int ndaugs, EvtId daugs[10],
0092 double masses[10] );
0093 static void findMass( EvtParticle* p );
0094 static double findMaxMass( EvtParticle* p );
0095
0096
0097 void setProbMax( double prbmx );
0098 void noProbMax();
0099
0100 void checkNArg( int a1, int a2 = -1, int a3 = -1, int a4 = -1 );
0101 void checkNDaug( int d1, int d2 = -1 );
0102
0103 void checkSpinParent( EvtSpinType::spintype sp );
0104 void checkSpinDaughter( int d1, EvtSpinType::spintype sp );
0105
0106
0107
0108 virtual int nRealDaughters() { return _ndaug; }
0109
0110 protected:
0111 bool _daugsDecayedByParentModel;
0112 bool daugsDecayedByParentModel() { return _daugsDecayedByParentModel; }
0113
0114 private:
0115 int _photos;
0116 int _ndaug;
0117 EvtId _parent;
0118 int _narg;
0119 std::vector<double> _storedArgs;
0120 std::vector<EvtId> _daug;
0121 std::vector<double> _argsD;
0122 std::vector<std::string> _args;
0123 std::string _modelname;
0124 double _brfr;
0125 int _dsum;
0126 int _summary;
0127 int _verbose;
0128
0129 int defaultprobmax;
0130 double probmax;
0131 int ntimes_prob;
0132
0133
0134
0135 int _chkCharge;
0136
0137
0138 double sum_prob;
0139 double max_prob;
0140 };
0141
0142 #endif