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

#include <EvtPhokhara_K0K0.hh>

Inheritance diagram for EvtPhokhara_K0K0:

Public Member Functions

 EvtPhokhara_K0K0 ()
virtual ~EvtPhokhara_K0K0 ()
void getName (std::string &name)
EvtDecayBaseclone ()
void decay (EvtParticle *p)
std::string commandName ()
void command (std::string cmd)
void init ()
void init_mode (EvtParticle *p)
void init_evt (EvtParticle *p)
void initProbMax ()
int getTotalEvt ()
void PhokharaInit (int dummy)
void ExclusiveDecay (EvtParticle *p)
Public Member Functions inherited from EvtDecayIncoherent
void makeDecay (EvtParticle *p)
virtual ~EvtDecayIncoherent ()
void setDaughterSpinDensity (int daughter)
int isDaughterSpinDensitySet (int daughter)
Public Member Functions inherited from EvtDecayBase
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 ()

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 ()
Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel

Detailed Description

Definition at line 33 of file EvtPhokhara_K0K0.hh.

Constructor & Destructor Documentation

◆ EvtPhokhara_K0K0()

EvtPhokhara_K0K0::EvtPhokhara_K0K0 ( )

Definition at line 66 of file EvtPhokhara_K0K0.cc.

66{}

Referenced by clone().

◆ ~EvtPhokhara_K0K0()

EvtPhokhara_K0K0::~EvtPhokhara_K0K0 ( )
virtual

Definition at line 67 of file EvtPhokhara_K0K0.cc.

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

Member Function Documentation

◆ clone()

EvtDecayBase * EvtPhokhara_K0K0::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 98 of file EvtPhokhara_K0K0.cc.

98{ return new EvtPhokhara_K0K0; }

◆ command()

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

Reimplemented from EvtDecayBase.

Definition at line 136 of file EvtPhokhara_K0K0.cc.

136 {
137
138 if ( ncommand == lcommand )
139 {
140
141 lcommand = 10 + 2 * lcommand;
142
143 std::string* newcommands = new std::string[lcommand];
144
145 int i;
146
147 for ( i = 0; i < ncommand; i++ ) { newcommands[i] = commands[i]; }
148
149 delete[] commands;
150
151 commands = newcommands;
152 }
153
154 commands[ncommand] = cmd;
155
156 ncommand++;
157}

◆ commandName()

std::string EvtPhokhara_K0K0::commandName ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 134 of file EvtPhokhara_K0K0.cc.

134{ return std::string( "PhokharaPar" ); }

◆ decay()

void EvtPhokhara_K0K0::decay ( EvtParticle * p)
virtual

Implements EvtDecayBase.

Definition at line 159 of file EvtPhokhara_K0K0.cc.

159 {
160 EvtId myvpho = EvtPDL::getId( "vpho" );
161 if ( p->getId() != myvpho )
162 {
163 std::cout << "Parent particle is required to be vpho for Phokhara model" << std::endl;
164 abort();
165 }
166 if ( nevtgen == 0 ) { init_mode( p ); }
167 else { init_evt( p ); }
168 std::cout << "PHOKHARA : K0K0bar mode " << std::endl;
169
170 int istdheppar = EvtPDL::getStdHep( p->getId() );
171 int ntrials = 0;
172 int tr_old[3];
173 tr_old[0] = (int)maxima_.tr[0];
174 tr_old[1] = (int)maxima_.tr[1];
175 tr_old[2] = (int)maxima_.tr[2];
176
177 while ( ntrials < 1000000 )
178 {
179 ievent++;
180 RANLXDF( Ar_r, 1 );
181 Ar[1] = Ar_r[0];
182
183 if ( Ar[1] <=
184 ( maxima_.Mmax[0] / ( maxima_.Mmax[0] + maxima_.Mmax[1] + maxima_.Mmax[2] ) ) )
185 {
186 maxima_.count[0] = maxima_.count[0] + 1.0;
187 GEN_0PH( 2, qqmin, ctes_.Sp, cos3min, cos3max );
188 }
189 else if ( Ar[1] <= ( ( maxima_.Mmax[0] + maxima_.Mmax[1] ) /
190 ( maxima_.Mmax[0] + maxima_.Mmax[1] + maxima_.Mmax[2] ) ) )
191 {
192 maxima_.count[1] = maxima_.count[1] + 1.0;
193 GEN_1PH( 2, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
194 }
195 else
196 {
197 maxima_.count[2] = maxima_.count[2] + 1.0;
198 GEN_2PH( 2, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
199 }
200
201 if ( ( (int)maxima_.tr[0] + (int)maxima_.tr[1] + (int)maxima_.tr[2] ) >
202 ( tr_old[0] + tr_old[1] + tr_old[2] ) ) // event accepted after cuts
203 { goto storedEvents; }
204 ntrials++;
205 }
206 std::cout << "FATAL: Could not satisfy cuts after " << ntrials << "trials. Terminate."
207 << std::endl;
208 //----
209storedEvents:
210 int more = 0;
211 int numstable = 0;
212 int numparton = 0;
213 EvtId evtnumstable[100]; //
214 EvtVector4R p4[20];
215
216 // except ISR photos, products depending on channel
217 if ( flags_.pion == 0 )
218 { // mu+ mu-
219 // mu+
220 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -13 );
221 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
222 ctes_.momenta[3][5] );
223 numstable++;
224 // mu -
225 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 13 );
226 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
227 ctes_.momenta[3][6] );
228 numstable++;
229 }
230 if ( flags_.pion == 1 )
231 { // pi+ pi-
232 // pi+
233 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
234 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
235 ctes_.momenta[3][5] );
236 numstable++;
237 // pi -
238 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
239 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
240 ctes_.momenta[3][6] );
241 numstable++;
242 }
243 if ( flags_.pion == 2 )
244 { // pi+ pi-2pi0
245 // pi0
246 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 111 );
247 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
248 ctes_.momenta[3][5] );
249 numstable++;
250 // pi0
251 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 111 );
252 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
253 ctes_.momenta[3][6] );
254 numstable++;
255 // pi-
256 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
257 p4[numstable].set( ctes_.momenta[0][7], ctes_.momenta[1][7], ctes_.momenta[2][7],
258 ctes_.momenta[3][7] );
259 numstable++;
260 // pi +
261 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
262 p4[numstable].set( ctes_.momenta[0][8], ctes_.momenta[1][8], ctes_.momenta[2][8],
263 ctes_.momenta[3][8] );
264 numstable++;
265 }
266 if ( flags_.pion == 3 )
267 { // 2(pi+ pi-)
268 // pi+
269 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
270 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
271 ctes_.momenta[3][5] );
272 numstable++;
273 // pi-
274 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
275 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
276 ctes_.momenta[3][6] );
277 numstable++;
278 // pi+
279 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
280 p4[numstable].set( ctes_.momenta[0][7], ctes_.momenta[1][7], ctes_.momenta[2][7],
281 ctes_.momenta[3][7] );
282 numstable++;
283 // pi -
284 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
285 p4[numstable].set( ctes_.momenta[0][8], ctes_.momenta[1][8], ctes_.momenta[2][8],
286 ctes_.momenta[3][8] );
287 numstable++;
288 }
289 if ( flags_.pion == 4 )
290 { // ppbar
291 // pbar
292 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -2212 );
293 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
294 ctes_.momenta[3][5] );
295 numstable++;
296 // p
297 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 2212 );
298 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
299 ctes_.momenta[3][6] );
300 numstable++;
301 }
302 if ( flags_.pion == 5 )
303 { // nnbar
304 // pbar
305 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -2112 );
306 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
307 ctes_.momenta[3][5] );
308 numstable++;
309 // p
310 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 2112 );
311 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
312 ctes_.momenta[3][6] );
313 numstable++;
314 }
315 if ( flags_.pion == 6 )
316 { // K+ K-
317 // K+
318 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 321 );
319 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
320 ctes_.momenta[3][5] );
321 numstable++;
322 // K -
323 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -321 );
324 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
325 ctes_.momenta[3][6] );
326 numstable++;
327 }
328 if ( flags_.pion == 7 )
329 { // K0K0bar
330 // Kbar
331 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 310 );
332 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
333 ctes_.momenta[3][5] );
334 numstable++;
335 // K0
336 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 130 );
337 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
338 ctes_.momenta[3][6] );
339 numstable++;
340 }
341 if ( flags_.pion == 8 )
342 { // pi+ pi-pi0
343 // pi+
344 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
345 p4[numstable].set( ctes_.momenta[0][5], ctes_.momenta[1][5], ctes_.momenta[2][5],
346 ctes_.momenta[3][5] );
347 numstable++;
348 // pi-
349 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
350 p4[numstable].set( ctes_.momenta[0][6], ctes_.momenta[1][6], ctes_.momenta[2][6],
351 ctes_.momenta[3][6] );
352 numstable++;
353 // pi0
354 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 111 );
355 p4[numstable].set( ctes_.momenta[0][7], ctes_.momenta[1][7], ctes_.momenta[2][7],
356 ctes_.momenta[3][7] );
357 numstable++;
358 }
359 if ( flags_.pion == 9 )
360 { // Lambda Lambdabar-> pi+ pi- ppbar
361 // pi+
362 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 211 );
363 p4[numstable].set( ctes_.momenta[0][7], ctes_.momenta[1][7], ctes_.momenta[2][7],
364 ctes_.momenta[3][7] );
365 numstable++;
366 // pbar
367 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -2212 );
368 p4[numstable].set( ctes_.momenta[0][8], ctes_.momenta[1][8], ctes_.momenta[2][8],
369 ctes_.momenta[3][8] );
370 numstable++;
371 // pi-
372 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( -211 );
373 p4[numstable].set( ctes_.momenta[0][9], ctes_.momenta[1][9], ctes_.momenta[2][9],
374 ctes_.momenta[3][9] );
375 numstable++;
376 // p
377 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 2212 );
378 p4[numstable].set( ctes_.momenta[0][10], ctes_.momenta[1][10], ctes_.momenta[2][10],
379 ctes_.momenta[3][10] );
380 numstable++;
381 }
382
383 // ISR gamma
384 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 22 );
385 p4[numstable].set( ctes_.momenta[0][2], ctes_.momenta[1][2], ctes_.momenta[2][2],
386 ctes_.momenta[3][2] );
387 numstable++;
388 if ( ctes_.momenta[0][3] != 0 ) // second photon exists
389 {
390 evtnumstable[numstable] = EvtPDL::evtIdFromStdHep( 22 );
391 p4[numstable].set( ctes_.momenta[0][3], ctes_.momenta[1][3], ctes_.momenta[2][3],
392 ctes_.momenta[3][3] );
393 numstable++;
394 }
395
396 int channel = EvtDecayTable::inChannelList( p->getId(), numstable, evtnumstable );
397 more = ( channel != -1 );
398 if ( more )
399 {
400 std::cout << "Existence of mode " << channel
401 << " in exclusive decay list has the same final state as this one" << std::endl;
402 abort();
403 }
404
405 p->makeDaughters( numstable, evtnumstable );
406 // double weight = p->initializePhaseSpace(getNDaug(),getDaugs());
407
408 int ndaugFound = 0;
409 EvtVector4R SUMP4( 0, 0, 0, 0 );
410 for ( int i = 0; i < numstable; i++ )
411 {
412 p->getDaug( i )->init( evtnumstable[i], p4[i] );
413 ndaugFound++;
414 }
415 if ( ndaugFound == 0 )
416 {
417 report( ERROR, "EvtGen" ) << "Phokhara has failed to do a decay ";
418 report( ERROR, "EvtGen" ) << EvtPDL::name( p->getId() ).c_str() << " " << p->mass()
419 << endl;
420 assert( 0 );
421 }
422
423 nevtgen++;
424 return;
425}
struct @053254170326070136226344307237142165176240334330 ctes_
struct @027003056066344010031101102046265032310161340072 maxima_
#define GEN_1PH(I, QQMIN, QQMAX, COS1MIN, COS1MAX, COS3MIN, COS3MAX)
#define RANLXDF(AR, VAL)
#define GEN_0PH(I, QQMIN, SP, COS3MIN, COS3MAX)
#define GEN_2PH(I, QQMIN, COS1MIN, COS1MAX, COS2MIN, COS2MAX, COS3MIN, COS3MAX)
struct @366025114004024134344043225357106161032107165361 flags_
static int inChannelList(EvtId parent, int ndaug, EvtId *daugs)
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
static EvtId evtIdFromStdHep(int stdhep)
Definition EvtPDL.cc:232
static std::string name(EvtId i)
Definition EvtPDL.hh:70
static EvtId getId(const std::string &name)
Definition EvtPDL.cc:272
void makeDaughters(int ndaug, EvtId *id)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtId getId() const
EvtParticle * getDaug(int i)
double mass() const
void init_mode(EvtParticle *p)
void init_evt(EvtParticle *p)
void set(int i, double d)

◆ ExclusiveDecay()

void EvtPhokhara_K0K0::ExclusiveDecay ( EvtParticle * p)

◆ getName()

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

Implements EvtDecayBase.

Definition at line 96 of file EvtPhokhara_K0K0.cc.

96{ model_name = "PHOKHARA_K0K0"; }

◆ getTotalEvt()

int EvtPhokhara_K0K0::getTotalEvt ( )
inline

Definition at line 51 of file EvtPhokhara_K0K0.hh.

51{ return nevt; }

◆ init()

void EvtPhokhara_K0K0::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 112 of file EvtPhokhara_K0K0.cc.

112 {
113 checkNArg( 0 );
114
115 std::string locvp = getenv( "BESEVTGENROOT" );
116 system( "cat $BESEVTGENROOT/share/phokhara_10.0.param>phokhara_10.0.param" );
117 system( "cat $BESEVTGENROOT/share/phokhara_10.0.fferr>phokhara_10.0.fferr" );
118 system( "cat $BESEVTGENROOT/share/phokhara_10.0.ffwarn>phokhara_10.0.ffwarn" );
119
120 if ( getParentId().isAlias() )
121 {
122
123 report( ERROR, "EvtGen" ) << "EvtPhokhara finds that you are decaying the" << endl
124 << " aliased particle " << EvtPDL::name( getParentId() ).c_str()
125 << " with the Phokhara model" << endl
126 << " this does not work, please modify decay table." << endl;
127 report( ERROR, "EvtGen" ) << "Will terminate execution!" << endl;
128 ::abort();
129 }
130
131 store( this );
132}
EvtId getParentId()
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)

◆ init_evt()

void EvtPhokhara_K0K0::init_evt ( EvtParticle * p)

======== list parameters to be initialized

Definition at line 454 of file EvtPhokhara_K0K0.cc.

454 {
455 m_pion = 7;
456 // mu+mu-(0),pi+pi-(1),2pi0pi+pi-(2),
457 // 2pi+2pi-(3),ppbar(4),nnbar(5),
458 // K+K-(6),K0K0bar(7),pi+pi-pi0(8),
459 // Lamb Lambbar->pi-pi+ppbar(9)
460#include "Phokhara_init_evt.txt"
461}

Referenced by decay().

◆ init_mode()

void EvtPhokhara_K0K0::init_mode ( EvtParticle * p)

======== list parameters to be initialized

Definition at line 102 of file EvtPhokhara_K0K0.cc.

102 {
103 m_pion = 7;
104 // mu+mu-(0),pi+pi-(1),2pi0pi+pi-(2),
105 // 2pi+2pi-(3),ppbar(4),nnbar(5),
106 // K+K-(6),K0K0bar(7),pi+pi-pi0(8),
107 // Lamb Lambbar->pi-pi+ppbar(9)
108 // pi+pi-eta
109#include "Phokhara_init_mode.txt"
110}

Referenced by decay().

◆ initProbMax()

void EvtPhokhara_K0K0::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 100 of file EvtPhokhara_K0K0.cc.

100{ noProbMax(); }

◆ PhokharaInit()

void EvtPhokhara_K0K0::PhokharaInit ( int dummy)

Definition at line 443 of file EvtPhokhara_K0K0.cc.

443 {
444 static int first = 1;
445 if ( first )
446 {
447
448 first = 0;
449 // for(int i=0;i<ncommand;i++)
450 // lugive0_(commands[i].c_str(),strlen(commands[i].c_str()));
451 }
452}
Index first(Pair i)

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