BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtOpenCharm Class Reference

#include <EvtOpenCharm.hh>

+ Inheritance diagram for EvtOpenCharm:

Public Member Functions

 EvtOpenCharm ()
 
virtual ~EvtOpenCharm ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void decay (EvtParticle *p)
 
std::string commandName ()
 
void command (std::string cmd)
 
void init ()
 
void initProbMax ()
 
int getTotalEvt ()
 
bool isbelong (EvtId myid)
 
int which_mode (EvtId myid)
 
 EvtOpenCharm ()
 
virtual ~EvtOpenCharm ()
 
void getName (std::string &name)
 
EvtDecayBaseclone ()
 
void decay (EvtParticle *p)
 
std::string commandName ()
 
void command (std::string cmd)
 
void init ()
 
void initProbMax ()
 
int getTotalEvt ()
 
bool isbelong (EvtId myid)
 
int which_mode (EvtId myid)
 
- Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
void makeDecay (EvtParticle *p)
 
virtual ~EvtDecayIncoherent ()
 
void setDaughterSpinDensity (int daughter)
 
int isDaughterSpinDensitySet (int daughter)
 
- Public Member Functions inherited from EvtDecayBase
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (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 ()
 
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (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 ()
 

Static Public Member Functions

static void OpencrmInit (int f)
 
static void OpencrmInit (int f)
 
- 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)
 
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
 
static void findMass (EvtParticle *p)
 
static double findMaxMass (EvtParticle *p)
 

Static Public Attributes

static int myiter = 1
 

Additional Inherited Members

- Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()
 
bool daugsDecayedByParentModel ()
 
- Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel
 

Detailed Description

Constructor & Destructor Documentation

◆ EvtOpenCharm() [1/2]

EvtOpenCharm::EvtOpenCharm ( )

Definition at line 65 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

65{}

Referenced by clone().

◆ ~EvtOpenCharm() [1/2]

EvtOpenCharm::~EvtOpenCharm ( )
virtual

Definition at line 67 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

67 {
68
69
70 int i;
71
72
73 //the deletion of commands is really uggly!
74
75 if (nOpencharmdecays==0) {
76 delete [] commands;
77 commands=0;
78 return;
79 }
80
81 for(i=0;i<nOpencharmdecays;i++){
82 if (Opencharmdecays[i]==this){
83 Opencharmdecays[i]=Opencharmdecays[nOpencharmdecays-1];
84 nOpencharmdecays--;
85 if (nOpencharmdecays==0) {
86 delete [] commands;
87 commands=0;
88 }
89 return;
90 }
91 }
92
93 report(ERROR,"EvtGen") << "Error in destroying OpenCharm model!"<<endl;
94
95}
ostream & report(Severity severity, const char *facility)

◆ EvtOpenCharm() [2/2]

EvtOpenCharm::EvtOpenCharm ( )

◆ ~EvtOpenCharm() [2/2]

virtual EvtOpenCharm::~EvtOpenCharm ( )
virtual

Member Function Documentation

◆ clone() [1/2]

EvtDecayBase * EvtOpenCharm::clone ( )
virtual

◆ clone() [2/2]

EvtDecayBase * EvtOpenCharm::clone ( )
virtual

Implements EvtDecayBase.

◆ command() [1/2]

void EvtOpenCharm::command ( std::string  cmd)
virtual

Reimplemented from EvtDecayBase.

Definition at line 147 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

147 {
148
149 if (ncommand==lcommand){
150
151 lcommand=10+2*lcommand;
152
153 std::string* newcommands=new std::string[lcommand];
154
155 int i;
156
157 for(i=0;i<ncommand;i++){
158 newcommands[i]=commands[i];
159 }
160
161 delete [] commands;
162
163 commands=newcommands;
164
165 }
166
167 commands[ncommand]=cmd;
168
169 ncommand++;
170
171
172}

◆ command() [2/2]

void EvtOpenCharm::command ( std::string  cmd)
virtual

Reimplemented from EvtDecayBase.

◆ commandName() [1/2]

std::string EvtOpenCharm::commandName ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 141 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

141 {
142
143 return std::string("OpenCharmPar");
144
145}

◆ commandName() [2/2]

std::string EvtOpenCharm::commandName ( )
virtual

Reimplemented from EvtDecayBase.

◆ decay() [1/2]

void EvtOpenCharm::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 176 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

176 {
177
178 int istdheppar=EvtPDL::getStdHep(p->getId());
179
180 if(istdheppar != 9000443 && istdheppar != 9010443 && istdheppar != 9030443 &&istdheppar != 9020443 ){
181 std::cout<<"EvtGen: EvtOpenCharm cann't not decay the particle pid= "<<istdheppar<<endl;
182 ::abort();
183 }
184
185 double mp=p->mass();
186 float xmp=mp;
187 double totEn=0;
188
189 //debugging
190 // std::cout<<"parent "<<EvtPDL::name(p->getId())<<"float xmp="<<xmp<<" "<<p->getP4Lab()<<std::endl;
191
192 EvtVector4R p4[20];
193
194 int i,more;
195 int ip=EvtPDL::getStdHep(p->getId());
196 int ndaugjs;
197
198 static int myflag;
199 EvtPsi3Sdecay theIni;
200 EvtId pid = p->getId();
201
202 static int themode;
203 if(getNArg()==1){ themode = getArg(0); theIni.setMode(themode);}
204
205 int count=0;
206 do{
207
208 theIni.PHSPDecay(p);
209 std::vector<EvtVector4R> v_p4=theIni.getDaugP4();
210 std::vector<EvtId> Vid=theIni.getDaugId();
211 ndaugjs = Vid.size();
212
213 EvtId myId[3];
214
215 for(int i=0;i<ndaugjs;i++){myId[i]=Vid[i];}
216
217
218 if(p->getNDaug()!=0) p->resetNDaug();
219 p->makeDaughters(ndaugjs,myId);
220
221 for(int i=0;i<ndaugjs;i++){
222 // std::cout<<"Vid "<<EvtPDL::name(Vid[i])<<" p4: "<<v_p4[i]<<std::endl;
223 p->getDaug(i)->init(Vid[i],v_p4[i]);
224 }
225
226
227 theMode = theIni.getMode();
228 p->setGeneratorFlag(theMode);
229
230
231 totEn=0;
232 for(i=0;i<ndaugjs;i++){
233 totEn +=p->getDaug(i)->getP4().get(0);
234 if ( p->getDaug(i)->getId() ==EvtId(-1,-1)) {
235 report(ERROR,"EvtGen") << "OpenCharm returned particle:"<<EvtPDL::name( p->getDaug(i)->getId() )<<endl;
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;
239
240 }
241
242 }
243 int channel=EvtDecayTable::inChannelList(p->getId(),ndaugjs,myId);
244
245 // std::cout<<"channel= "<<channel<<std::endl;
246 more=(channel!=-1);
247 //if(more){std::cout<<"count= "<<count<<" inchannel= "<<channel<<std::endl;}
248
249 count++;
250
251 }while( more && (count<10000) );
252
253 if(fabs(xmp-totEn)>0.01){
254 std::cout<<"Warning:OPENCHARM generate incomplet final state, "<<mp<<" "<<totEn<<endl;
255 ::abort();
256 }
257
258 if (count>9999) {
259 report(INFO,"EvtGen") << "Too many loops in EvtOpenCharm!!!"<<endl;
260 report(INFO,"EvtGen") << "Parent:"<<EvtPDL::name(getParentId()).c_str()<<endl;
261 }
262
263 fixPolarizations(p);
264
265 return ;
266
267
268}
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
const double mp
Definition: incllambda.cxx:45

◆ decay() [2/2]

void EvtOpenCharm::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

◆ getName() [1/2]

void EvtOpenCharm::getName ( std::string &  name)
virtual

Implements EvtDecayBase.

Definition at line 98 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

98 {
99
100 model_name="OPENCHARM";
101
102}

◆ getName() [2/2]

void EvtOpenCharm::getName ( std::string &  name)
virtual

Implements EvtDecayBase.

◆ getTotalEvt() [1/2]

int EvtOpenCharm::getTotalEvt ( )
inline

Definition at line 53 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.hh.

53{return nevt;}

◆ getTotalEvt() [2/2]

int EvtOpenCharm::getTotalEvt ( )
inline

Definition at line 53 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.hh.

53{return nevt;}

◆ init() [1/2]

void EvtOpenCharm::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 118 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

118 {
119
120// checkNArg(1);
121
122
123 if (getParentId().isAlias()){
124
125 report(ERROR,"EvtGen") << "EvtOpenCharm finds that you are decaying the"<<endl
126 << " aliased particle "
127 << EvtPDL::name(getParentId()).c_str()
128 << " with the OpenCharm model"<<endl
129 << " this does not work, please modify decay table."
130 << endl;
131 report(ERROR,"EvtGen") << "Will terminate execution!"<<endl;
132 ::abort();
133
134 }
135
136 store(this);
137
138}

◆ init() [2/2]

void EvtOpenCharm::init ( )
virtual

Reimplemented from EvtDecayBase.

◆ initProbMax() [1/2]

void EvtOpenCharm::initProbMax ( )
virtual

◆ initProbMax() [2/2]

void EvtOpenCharm::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

◆ isbelong() [1/2]

bool EvtOpenCharm::isbelong ( EvtId  myid)

Definition at line 343 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

343 {
344 for (int i=0;i<mypar.size();i++){
345 if(myid == mypar[i]) {_index = i; return true;}
346 }
347 return false;
348}

◆ isbelong() [2/2]

bool EvtOpenCharm::isbelong ( EvtId  myid)

◆ OpencrmInit() [1/2]

void EvtOpenCharm::OpencrmInit ( int  f)
static

◆ OpencrmInit() [2/2]

static void EvtOpenCharm::OpencrmInit ( int  f)
static

◆ which_mode() [1/2]

int EvtOpenCharm::which_mode ( EvtId  myid)

Definition at line 350 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtOpenCharm.cc.

350 {
351 for (int i=0;i<mypar.size();i++){
352 if(myid == mypar[i]){
353 _index = i;
354 return i;
355 }
356 }
357 std::cout<<"EvtOpenCharm::which_mode() fails to find element"<<std::endl; abort();
358}

◆ which_mode() [2/2]

int EvtOpenCharm::which_mode ( EvtId  myid)

Member Data Documentation

◆ myiter

static int EvtOpenCharm::myiter = 1
static

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