23#include "EvtGenBase/EvtPatches.hh"
24#include "EvtGenBase/EvtPatches.hh"
25#include "EvtGenBase/EvtParticle.hh"
26#include "EvtGenBase/EvtStringParticle.hh"
27#include "EvtGenBase/EvtDecayTable.hh"
28#include "EvtGenBase/EvtPDL.hh"
29#include "EvtGenModels/EvtOpenCharm.hh"
30#include "EvtGenModels/EvtPsi3Sdecay.hh"
31#include "EvtGenBase/EvtReport.hh"
33#include "EvtGenBase/EvtId.hh"
45using std::resetiosflags;
46using std::setiosflags;
50int EvtOpenCharm::nOpencharmdecays=0;
52int EvtOpenCharm::ntable=0;
54int EvtOpenCharm::ncommand=0;
55int EvtOpenCharm::lcommand=0;
56std::string* EvtOpenCharm::commands=0;
57int EvtOpenCharm::nevt=0;
60std::vector<EvtId> EvtOpenCharm::mypar;
61std::vector<int> EvtOpenCharm::vmode;
62std::vector<double> EvtOpenCharm::Vcms;
75 if (nOpencharmdecays==0) {
81 for(i=0;i<nOpencharmdecays;i++){
82 if (Opencharmdecays[i]==
this){
83 Opencharmdecays[i]=Opencharmdecays[nOpencharmdecays-1];
85 if (nOpencharmdecays==0) {
93 report(
ERROR,
"EvtGen") <<
"Error in destroying OpenCharm model!"<<endl;
100 model_name=
"OPENCHARM";
125 report(
ERROR,
"EvtGen") <<
"EvtOpenCharm finds that you are decaying the"<<endl
126 <<
" aliased particle "
128 <<
" with the OpenCharm model"<<endl
129 <<
" this does not work, please modify decay table."
131 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
143 return std::string(
"OpenCharmPar");
149 if (ncommand==lcommand){
151 lcommand=10+2*lcommand;
153 std::string* newcommands=
new std::string[lcommand];
157 for(i=0;i<ncommand;i++){
158 newcommands[i]=commands[i];
163 commands=newcommands;
167 commands[ncommand]=cmd;
180 if(istdheppar != 9000443 && istdheppar != 9010443 && istdheppar != 9030443 &&istdheppar != 9020443 ){
181 std::cout<<
"EvtGen: EvtOpenCharm cann't not decay the particle pid= "<<istdheppar<<endl;
209 std::vector<EvtVector4R> v_p4=theIni.
getDaugP4();
210 std::vector<EvtId> Vid=theIni.
getDaugId();
211 ndaugjs = Vid.size();
215 for(
int i=0;i<ndaugjs;i++){myId[i]=Vid[i];}
221 for(
int i=0;i<ndaugjs;i++){
232 for(i=0;i<ndaugjs;i++){
236 report(
ERROR,
"EvtGen") <<
"This can not be translated to evt number"<<endl;
237 report(
ERROR,
"EvtGen") <<
"and the decay will be rejected!"<<endl;
238 report(
ERROR,
"EvtGen") <<
"The decay was of particle:"<<ip<<endl;
251 }
while( more && (
count<10000) );
253 if(fabs(xmp-totEn)>0.01){
254 std::cout<<
"Warning:OPENCHARM generate incomplet final state, "<<
mp<<
" "<<totEn<<endl;
259 report(
INFO,
"EvtGen") <<
"Too many loops in EvtOpenCharm!!!"<<endl;
270void EvtOpenCharm::fixPolarizations(
EvtParticle *p){
285 for(i=0;i<ndaug;i++){
287 bool bflag=(idp==Jpsi || idp==psip || idp==psipp || idp==psi_a || idp==psi_b || idp ==psi_c);
308 double beta=acos(p4Psi.
get(3)/p4Psi.
d3mag());
321 if (nOpencharmdecays==ntable){
325 for(i=0;i<ntable;i++){
326 newOpencharmdecays[i]=Opencharmdecays[i];
329 delete [] Opencharmdecays;
330 Opencharmdecays=newOpencharmdecays;
333 Opencharmdecays[nOpencharmdecays++]=jsdecay;
344 for (
int i=0;i<mypar.size();i++){
345 if(myid == mypar[i]) {_index = i;
return true;}
351 for (
int i=0;i<mypar.size();i++){
352 if(myid == mypar[i]){
357 std::cout<<
"EvtOpenCharm::which_mode() fails to find element"<<std::endl; abort();
ostream & report(Severity severity, const char *facility)
DOUBLE_PRECISION count[3]
void setDaughterSpinDensity(int daughter)
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
int which_mode(EvtId myid)
std::string commandName()
void command(std::string cmd)
static void OpencrmInit(int f)
void getName(std::string &name)
bool isbelong(EvtId myid)
void decay(EvtParticle *p)
static int getStdHep(EvtId id)
static std::string name(EvtId i)
static EvtId getId(const std::string &name)
void setSpinDensityForwardHelicityBasis(const EvtSpinDensity &rho)
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void setGeneratorFlag(int flag)
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
void PHSPDecay(EvtParticle *par)
std::vector< EvtVector4R > getDaugP4()
std::vector< EvtId > getDaugId()
void Set(int i, int j, const EvtComplex &rhoij)