BOSS 7.1.2
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 63 of file EvtDecayAmp.hh.

63{}

Member Function Documentation

◆ makeDecay()

void EvtDecayAmp::makeDecay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 35 of file EvtDecayAmp.cc.

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

32{_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 37 of file EvtDecayAmp.hh.

37{_amp2.vertex(amp);}
void vertex(const EvtComplex &amp)
Definition EvtAmp.cc:477

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 60 of file EvtDecayAmp.hh.

61 { _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 42 of file EvtDecayAmp.hh.

42{_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 47 of file EvtDecayAmp.hh.

48 {_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 54 of file EvtDecayAmp.hh.

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

Member Data Documentation

◆ _amp2


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