BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDecayAmp Class Reference

#include <EvtDecayAmp.hh>

Inheritance diagram for EvtDecayAmp:

Public Member Functions

void makeDecay (EvtParticle *p)
void setWeight (double weight)
void vertex (const EvtComplex &amp)
void vertex (int i1, const EvtComplex &amp)
void vertex (int i1, int i2, const EvtComplex &amp)
void vertex (int i1, int i2, int i3, const EvtComplex &amp)
void vertex (int *i1, const EvtComplex &amp)
virtual ~EvtDecayAmp ()
Public Member Functions inherited from EvtDecayBase
virtual void getName (std::string &name)=0
virtual void decay (EvtParticle *p)=0
virtual EvtDecayBaseclone ()=0
virtual void init ()
virtual void initProbMax ()
virtual std::string commandName ()
virtual void command (std::string cmd)
double getProbMax (double prob)
double resetProbMax (double prob)
 EvtDecayBase ()
virtual ~EvtDecayBase ()
virtual bool matchingDecay (const EvtDecayBase &other) const
EvtId getParentId ()
double getBranchingFraction ()
void disableCheckQ ()
void checkQ ()
int getNDaug ()
EvtIdgetDaugs ()
EvtId getDaug (int i)
int getNArg ()
int getPHOTOS ()
void setPHOTOS ()
void setVerbose ()
void setSummary ()
double * getArgs ()
std::string * getArgsStr ()
double getArg (int j)
std::string getArgStr (int j)
std::string getModelName ()
int getDSum ()
int summary ()
int verbose ()
void saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
void printSummary ()
void setProbMax (double prbmx)
void noProbMax ()
void checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1)
void checkNDaug (int d1, int d2=-1)
void checkSpinParent (EvtSpinType::spintype sp)
void checkSpinDaughter (int d1, EvtSpinType::spintype sp)
virtual int nRealDaughters ()

Protected Attributes

EvtAmp _amp2
Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel

Additional Inherited Members

Static Public Member Functions inherited from EvtDecayBase
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
static void findMass (EvtParticle *p)
static double findMaxMass (EvtParticle *p)
Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()

Detailed Description

Definition at line 27 of file EvtDecayAmp.hh.

Constructor & Destructor Documentation

◆ ~EvtDecayAmp()

virtual EvtDecayAmp::~EvtDecayAmp ( )
inlinevirtual

Definition at line 60 of file EvtDecayAmp.hh.

60{}

Member Function Documentation

◆ makeDecay()

void EvtDecayAmp::makeDecay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 34 of file EvtDecayAmp.cc.

34 {
35
36 int ntimes = 10000;
37
38 int i, more;
39
40 EvtSpinDensity rho;
41 double prob, prob_max;
42
43 _amp2.init( p->getId(), getNDaug(), getDaugs() );
44 // report(INFO,"EvtGen") << "Decaying " << EvtPDL::name(p->getId()) << endl;
45 do {
46
48 _weight = 1.0;
49 decay( p );
50
51 rho = _amp2.getSpinDensity();
52 prob = p->getSpinDensityForward().NormalizedProb( rho );
53 if ( prob < 0.0 )
54 {
55
56 report( ERROR, "EvtGen" ) << "Negative prob:" << p->getId().getId() << " "
57 << p->getChannel() << endl;
58
59 report( ERROR, "EvtGen" ) << "rho_forward:" << endl;
60 report( ERROR, "EvtGen" ) << p->getSpinDensityForward();
61 report( ERROR, "EvtGen" ) << "rho decay:" << endl;
62 report( ERROR, "EvtGen" ) << rho << endl;
63 }
64
65 if ( prob != prob )
66 {
67
68 report( DEBUG, "EvtGen" ) << "Forward density matrix:" << endl;
69 report( ERROR, "EvtGen" ) << p->getSpinDensityForward();
70
71 report( DEBUG, "EvtGen" ) << "Decay density matrix:" << endl;
72 report( ERROR, "EvtGen" ) << rho;
73
74 report( DEBUG, "EvtGen" ) << "prob:" << prob << endl;
75
76 report( DEBUG, "EvtGen" ) << "Particle:" << EvtPDL::name( p->getId() ).c_str() << endl;
77 report( DEBUG, "EvtGen" ) << "channel :" << p->getChannel() << endl;
78 report( DEBUG, "EvtGen" ) << "Momentum:" << p->getP4() << " " << p->mass() << endl;
79 if ( p->getParent() != 0 )
80 {
81 report( DEBUG, "EvtGen" )
82 << "parent:" << EvtPDL::name( p->getParent()->getId() ).c_str() << endl;
83 report( DEBUG, "EvtGen" )
84 << "parent channel :" << p->getParent()->getChannel() << endl;
85
86 int i;
87 report( DEBUG, "EvtGen" ) << "parent daughters :";
88 for ( i = 0; i < p->getParent()->getNDaug(); i++ )
89 {
90 report( DEBUG, "" ) << EvtPDL::name( p->getParent()->getDaug( i )->getId() ).c_str()
91 << " ";
92 }
93 report( DEBUG, "" ) << endl;
94
95 report( DEBUG, "EvtGen" ) << "daughters :";
96 for ( i = 0; i < p->getNDaug(); i++ )
97 { report( DEBUG, "" ) << EvtPDL::name( p->getDaug( i )->getId() ).c_str() << " "; }
98 report( DEBUG, "" ) << endl;
99
100 report( DEBUG, "EvtGen" ) << "daughter momenta :" << endl;
101 ;
102 for ( i = 0; i < p->getNDaug(); i++ )
103 {
104 report( DEBUG, "" ) << p->getDaug( i )->getP4() << " " << p->getDaug( i )->mass();
105 report( DEBUG, "" ) << endl;
106 }
107 }
108 }
109
110 prob /= _weight;
111
112 prob_max = getProbMax( prob );
113 p->setDecayProb( prob / prob_max );
114
115 // report(INFO,"EvtGen") << "Prob,prob_max,weight:"<<prob<<" "<<prob_max<<"
116 // "<<_weight<<endl;
117
118 more = prob < EvtRandom::Flat( prob_max );
119
120 ntimes--;
121
122 } while ( ntimes && more );
123 // report(INFO,"EvtGen") << "Done\n";
124
125 if ( ntimes == 0 )
126 {
127 report( DEBUG, "EvtGen" ) << "Tried accept/reject:10000"
128 << " times, and rejected all the times!" << endl;
129 report( DEBUG, "" ) << p->getSpinDensityForward() << endl;
130 report( DEBUG, "EvtGen" ) << "Is therefore accepting the last event!" << endl;
131 report( DEBUG, "EvtGen" ) << "Decay of particle:" << EvtPDL::name( p->getId() ).c_str()
132 << "(channel:" << p->getChannel() << ") with mass " << p->mass()
133 << endl;
134
135 int ii;
136 for ( ii = 0; ii < p->getNDaug(); ii++ )
137 {
138 report( DEBUG, "EvtGen" ) << "Daughter " << ii << ":"
139 << EvtPDL::name( p->getDaug( ii )->getId() ).c_str()
140 << " with mass " << p->getDaug( ii )->mass() << endl;
141 }
142 }
143
144 EvtSpinDensity rho_list[10];
145
146 rho_list[0] = p->getSpinDensityForward();
147
148 EvtAmp ampcont;
149
150 if ( _amp2._pstates != 1 )
151 {
152 ampcont = _amp2.contract( 0, p->getSpinDensityForward() ); // J2BB2 bugging here
153 }
154 else { ampcont = _amp2; }
155
156 // it may be that the parent decay model has already
157 // done the decay - this should be rare and the
158 // model better know what it is doing..
159
161 {
162
163 // report(INFO,"EvtGen") << "Found " << p->getNDaug() << " daughters\n";
164 for ( i = 0; i < p->getNDaug(); i++ )
165 {
166
167 rho.SetDim( _amp2.dstates[i] );
168
169 if ( _amp2.dstates[i] == 1 ) { rho.Set( 0, 0, EvtComplex( 1.0, 0.0 ) ); }
170 else { rho = ampcont.contract( _amp2._dnontrivial[i], _amp2 ); }
171
172 if ( !rho.Check() )
173 {
174
175 report( ERROR, "EvtGen" ) << "-------start error-------" << endl;
176 report( ERROR, "EvtGen" )
177 << "forward rho failed Check:" << EvtPDL::name( p->getId() ).c_str() << " "
178 << p->getChannel() << " " << i << endl;
179
180 report( ERROR, "EvtGen" )
181 << "Parent:" << EvtPDL::name( p->getParent()->getId() ).c_str() << endl;
182 report( ERROR, "EvtGen" )
183 << "GrandParent:" << EvtPDL::name( p->getParent()->getParent()->getId() ).c_str()
184 << endl;
185 report( ERROR, "EvtGen" )
186 << "GrandGrandParent:"
187 << EvtPDL::name( p->getParent()->getParent()->getParent()->getId() ).c_str()
188 << endl;
189
190 report( ERROR, "EvtGen" ) << rho;
191 int ii;
192 _amp2.dump();
193
194 for ( ii = 0; ii < i + 1; ii++ ) { report( ERROR, "EvtGen" ) << rho_list[ii]; }
195 report( ERROR, "EvtGen" ) << "-------Done with error-------" << endl;
196 }
197
198 p->getDaug( i )->setSpinDensityForward( rho );
199
200 // debugging
201 // p->printTree();
202 p->getDaug( i )->decay();
203
204 rho_list[i + 1] = p->getDaug( i )->getSpinDensityBackward();
205
206 if ( _amp2.dstates[i] != 1 )
207 { ampcont = ampcont.contract( _amp2._dnontrivial[i], rho_list[i + 1] ); }
208 }
209
210 p->setSpinDensityBackward( _amp2.getBackwardSpinDensity( rho_list ) );
211
212 if ( !p->getSpinDensityBackward().Check() )
213 {
214
215 report( ERROR, "EvtGen" ) << "rho_backward failed Check" << p->getId().getId() << " "
216 << p->getChannel() << endl;
217
218 report( ERROR, "EvtGen" ) << p->getSpinDensityBackward();
219 }
220 }
221
223}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ DEBUG
Definition EvtReport.hh:53
@ ERROR
Definition EvtReport.hh:49
EvtSpinDensity contract(int i, const EvtAmp &a)
Definition EvtAmp.cc:317
virtual void decay(EvtParticle *p)=0
double getProbMax(double prob)
EvtId * getDaugs()
bool daugsDecayedByParentModel()
bool _daugsDecayedByParentModel
int getId() const
Definition EvtId.hh:40
static std::string name(EvtId i)
Definition EvtPDL.hh:70
void setSpinDensityBackward(const EvtSpinDensity &rho)
void setSpinDensityForward(const EvtSpinDensity &rho)
void setDecayProb(double p)
EvtId getId() const
EvtParticle * getParent()
const EvtVector4R & getP4() const
int getNDaug() const
EvtParticle * getDaug(int i)
double mass() const
EvtSpinDensity getSpinDensityBackward()
int getChannel() const
EvtSpinDensity getSpinDensityForward()
static bool alwaysRadCorr()
Definition EvtRadCorr.cc:61
static void doRadCorr(EvtParticle *p)
Definition EvtRadCorr.cc:48
static double Flat()
Definition EvtRandom.cc:69
double NormalizedProb(const EvtSpinDensity &d)
void Set(int i, int j, const EvtComplex &rhoij)
void SetDim(int n)

◆ setWeight()

void EvtDecayAmp::setWeight ( double weight)
inline

Definition at line 31 of file EvtDecayAmp.hh.

31{ _weight = weight; }
*********Class see also m_nmax DOUBLE PRECISION m_MasPhot DOUBLE PRECISION m_phsu DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_r2 DOUBLE PRECISION m_WtMass INTEGER m_nmax INTEGER m_Nevgen INTEGER m_IsFSR INTEGER m_MarTot *COMMON c_KarFin $ !Output file $ !Event serial number $ !alpha QED at Thomson limit $ !minimum energy at CMS for remooval $ !infrared dimensionless $ !dummy photon IR regulator $ !crude photon multiplicity enhancement factor *EVENT $ !MC crude volume of PhhSpace *Sfactors $ !YFS formfactor IR part only $ !YFS formfactor non IR finite part $ !mass weight
Definition KarFin.h:34

Referenced by EvtbTosllAli::decay(), and EvtbTosllBall::decay().

◆ vertex() [1/5]

void EvtDecayAmp::vertex ( const EvtComplex & amp)
inline

sets the amplitudes calculated in the decay objects

Definition at line 36 of file EvtDecayAmp.hh.

36{ _amp2.vertex( amp ); }

Referenced by EvtAV2GV::decay(), EvtBHadronic::decay(), EvtBto2piCPiso::decay(), EvtBTo3piCP::decay(), EvtBTo4piCP::decay(), EvtBtoKD3P::decay(), EvtBtoKpiCPiso::decay(), EvtBToKpipiCP::decay(), EvtCBTo3piMPP::decay(), EvtCBTo3piP00::decay(), EvtChi0BB1::decay(), EvtChi0BB2::decay(), EvtChi1BB1::decay(), EvtChi1BB2::decay(), EvtChi2BB1::decay(), EvtChi2BB2::decay(), EvtD0mixDalitz::decay(), EvtDDalitz::decay(), EvtDeBD::decay(), EvtEDM::decay(), EvtEtaDalitz::decay(), EvtHelPPJ::decay(), EvtHypWK::decay(), EvtIntervalDecayAmp< T >::decay(), EvtJ2BB1::decay(), EvtJ2BB2::decay(), EvtJ2BB3::decay(), EvtJPE::decay(), EvtJpipi::decay(), EvtJTO3P::decay(), EvtKstarnunu::decay(), EvtKstarstargamma::decay(), EvtLambdaP_BarGamma::decay(), EvtLNuGamma::decay(), EvtMultibody::decay(), EvtOmegaDalitz::decay(), EvtP2GC0::decay(), EvtP2GC1::decay(), EvtP2GC2::decay(), EvtPBB1::decay(), EvtPBB2::decay(), EvtPhiDalitz::decay(), EvtS2GV::decay(), EvtSll::decay(), EvtSLN::decay(), EvtSPL::decay(), EvtSSDCP::decay(), EvtSSSCP::decay(), EvtSSSCPpng::decay(), EvtSSSCPT::decay(), EvtSTS::decay(), EvtSTSCP::decay(), EvtSVPCP::decay(), EvtSVPHelAmp::decay(), EvtSVS::decay(), EvtSVSCP::decay(), EvtSVSCPiso::decay(), EvtSVSCPLH::decay(), EvtSVSNONCPEIGEN::decay(), EvtT2GV::decay(), EvtTauGamMu::decay(), EvtTauHadnu::decay(), EvtTaulnunu::decay(), EvtTauScalarnu::decay(), EvtTauVectornu::decay(), EvtTSS::decay(), EvtTVSPwave::decay(), EvtVll::decay(), EvtVPHOtoVISR::decay(), EvtVPHOtoVISRHi::decay(), EvtVSPPwave::decay(), EvtVSS::decay(), EvtVSSBMixCPT::decay(), EvtVSSMix::decay(), EvtVVP::decay(), EvtVVpipi::decay(), EvtVVPIPI_WEIGHTED::decay(), EvtVVSPwave::decay(), and EvtTauGamMu::init().

◆ vertex() [2/5]

void EvtDecayAmp::vertex ( int * i1,
const EvtComplex & amp )
inline

sets the amplitudes calculated in the decay objects

Definition at line 58 of file EvtDecayAmp.hh.

58{ _amp2.vertex( i1, amp ); }

◆ vertex() [3/5]

void EvtDecayAmp::vertex ( int i1,
const EvtComplex & amp )
inline

sets the amplitudes calculated in the decay objects

Definition at line 41 of file EvtDecayAmp.hh.

41{ _amp2.vertex( i1, amp ); }

◆ vertex() [4/5]

void EvtDecayAmp::vertex ( int i1,
int i2,
const EvtComplex & amp )
inline

sets the amplitudes calculated in the decay objects

Definition at line 46 of file EvtDecayAmp.hh.

46{ _amp2.vertex( i1, i2, amp ); }

◆ vertex() [5/5]

void EvtDecayAmp::vertex ( int i1,
int i2,
int i3,
const EvtComplex & amp )
inline

sets the amplitudes calculated in the decay objects

Definition at line 51 of file EvtDecayAmp.hh.

51 {
52 _amp2.vertex( i1, i2, i3, amp );
53 }

Member Data Documentation

◆ _amp2


The documentation for this class was generated from the following files: