001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017 #include <stdlib.h>
018 #include <stdio.h>
019 #include <assert.h>
020
021
022 #include <iostream>
023
024
025 #include "BaBar/Cdf.hh"
026 #include "evt/Event.hh"
027 #include "cern_i/packlib.h"
028 #include "ParticleDB/hepevt.hh"
029 #include "evt/Event.hh"
030 #include "inc/bcs.h"
031 #include "r_n/CdfRn.hh"
032 #include <sstream>
033
034
035 #include "Bgenerator/Bgenerator.hh"
036 #include "generatorMods/BgeneratorModule.hh"
037
038
039 static const char rcsid[] = "$Id: BgeneratorModule.cc,v 1.13 2007/07/03 00:37:28 paus Exp $";
040 const long BgeneratorModule::_defaultRandomSeed1 = 9223591;
041 const long BgeneratorModule::_defaultRandomSeed2 = 109736;
042
043
044 extern "C" {
045 void obsppt_ (int *lun);
046 void obsvpt_ (int *lun);
047 void genppt_ (int *lun);
048 void obsbtc_ (int *ierr);
049 void gnpbtc_ (int *ierr);
050 void stdhepctb_();
051 void stdhepgnp_(int* ierr);
052 }
053
054
055 BgeneratorModule::BgeneratorModule(const BgeneratorModule&):
056 AbsGenModule("Bgenerator::copy","ROOT Bgenerator module::copy"),
057 _VERBOSE ("VERBOSE", this, 0, 0, 4),
058 _PT_MIN_B1("PT-MIN-b1", this, 5.0, 0.0, 100.0),
059 _PT_MIN_B2("PT-MIN-b2", this, 5.0, 0.0, 100.0),
060 _RAPMIN ("RAPMIN-b1", this, -2.0, -10.0, 10.0),
061 _RAPMAX ("RAPMAX-b1", this, 2.0, -10.0, 10.0),
062 _FRAGMENT ("FRAGMENT", this, 1, 0, 1),
063 _EPS ("EPS-b", this,0.006,0.0001, 1.0),
064 _MASS_BQ ("BMASS", this, 4.75, 0.0, 10.0),
065 _MASS_CQ ("CMASS", this, 1.50, 0.0, 10.0),
066 _DOMIX ("MIXING", this, false),
067 _X_D ("X_D", this, 0.72, 0.0, 999.9),
068 _X_S ("X_S", this, 15.0, 0.0, 999.9),
069 _DEFINE ("DEFINE", this),
070 _NDE ("NDE", this),
071 _MNR ("MNR", this),
072 _BMESON ("BMESON", this),
073 _CMESON ("CMESON", this),
074 _rndmSeed1("RandomSeed1",this,BgeneratorModule::_defaultRandomSeed1),
075 _rndmSeed2("RandomSeed2",this,BgeneratorModule::_defaultRandomSeed2) {
076 if (_VERBOSE.value() > 0)
077 cout << endl << "BgeneratorModule: Constructor" << endl << endl;
078 }
079
080
081 BgeneratorModule::BgeneratorModule(const char* name, const char* desc):
082 AbsGenModule(name, desc),
083 _VERBOSE ("VERBOSE", this, 0, 0, 4),
084 _PT_MIN_B1("PT-MIN-b1", this, 5.0, 0.0, 100.0),
085 _PT_MIN_B2("PT-MIN-b2", this, 5.0, 0.0, 100.0),
086 _RAPMIN ("RAPMIN-b1", this, -2.0, -10.0, 10.0),
087 _RAPMAX ("RAPMAX-b1", this, 2.0, -10.0, 10.0),
088 _FRAGMENT ("FRAGMENT", this, 1, 0, 1),
089 _EPS ("EPS-b", this,0.006,0.0001, 1.0),
090 _MASS_BQ ("BMASS", this, 4.75, 0.0, 10.0),
091 _MASS_CQ ("CMASS", this, 1.50, 0.0, 10.0),
092 _DOMIX ("MIXING", this, false),
093 _X_D ("X_D", this, 0.72, 0.0, 999.9),
094 _X_S ("X_S", this, 15.0, 0.0, 999.9),
095 _DEFINE ("DEFINE", this),
096 _NDE ("NDE", this),
097 _MNR ("MNR", this),
098 _BMESON ("BMESON", this),
099 _CMESON ("CMESON", this),
100 _rndmSeed1("RandomSeed1",this,_defaultRandomSeed1),
101 _rndmSeed2("RandomSeed2",this,_defaultRandomSeed2) {
102
103 if (_VERBOSE.value() > -1)
104 cout << endl
105 << "Bgenerator Version: " << rcsId()
106 << endl;
107 if (_VERBOSE.value() > 0)
108 cout << endl << "BgeneratorModule: Constructor" << endl << endl;
109
110
111
112 _BgMenu.initialize ("Bgenerator",this);
113 _BgMenu.initTitle ("Bgenerator Menu: parameters from Bgenerator");
114
115
116
117 _VERBOSE .addDescription("\t\t\tModule's verbosity level about actions.");
118 _PT_MIN_B1.addDescription("\t\t\tMinimum b quark pt (first b) [GeV]");
119 _PT_MIN_B2.addDescription("\t\t\tMinimum b quark pt (second b) [GeV]");
120 _RAPMIN .addDescription("\t\t\tMimimum b quark rapidity (first b)");
121 _RAPMAX .addDescription("\t\t\tMaximum b quark rapidity (first b)");
122 _FRAGMENT .addDescription("\t\t\tFragment - 1 Take input as is - 0");
123 _EPS .addDescription("\t\t\tPeterson epsilon (b quark fragmentation)");
124 _MASS_BQ .addDescription("\t\t\tBottom quark mass [GeV]");
125 _MASS_CQ .addDescription("\t\t\tCharm quark mass (needed for Bc) [GeV]");
126 _DOMIX .addDescription("\t\t\tApply mixing to neutral mesons?");
127 _X_D .addDescription("\t\t\tEnter Xd");
128 _X_S .addDescription("\t\t\tEnter Xs");
129
130 commands()->append(&_BgMenu);
131 _BgMenu.commands()->append(&_VERBOSE );
132 _BgMenu.commands()->append(&_PT_MIN_B1);
133 _BgMenu.commands()->append(&_PT_MIN_B2);
134 _BgMenu.commands()->append(&_RAPMIN );
135 _BgMenu.commands()->append(&_RAPMAX );
136 _BgMenu.commands()->append(&_EPS );
137 _BgMenu.commands()->append(&_MASS_BQ );
138 _BgMenu.commands()->append(&_MASS_CQ );
139 _BgMenu.commands()->append(&_FRAGMENT );
140 _BgMenu.commands()->append(&_DOMIX );
141 _BgMenu.commands()->append(&_X_D );
142 _BgMenu.commands()->append(&_X_S );
143 _BgMenu.commands()->append(&_DEFINE );
144 _BgMenu.commands()->append(&_NDE );
145 _BgMenu.commands()->append(&_MNR );
146 _BgMenu.commands()->append(&_BMESON );
147 _BgMenu.commands()->append(&_CMESON );
148
149
150 _randomNumberMenu.initialize("RandomNumberMenu",this);
151 _randomNumberMenu.initTitle ("Random number menu");
152 commands()->append(&_randomNumberMenu);
153 _randomNumberMenu.commands()->append(&_rndmSeed1);
154 _randomNumberMenu.commands()->append(&_rndmSeed2);
155
156 std::ostringstream tmpSt1;
157 std::ostringstream tmpSt2;
158
159
160 tmpSt1 << "\t\t\t\tSeed #1 for the random number generator"
161 << "\n\t\t\t(default " << _rndmSeed1.value() << ").";
162 _rndmSeed1.addDescription(tmpSt1.str());
163 tmpSt2 << "\t\t\t\tSeed #2 for the random number generator"
164 << "\n\t\t\t(default " << _rndmSeed2.value() << ").";
165 _rndmSeed2.addDescription(tmpSt2.str());
166
167
168 Bgenerator::Instance()->Init();
169 AbsParm2Bgen();
170 }
171
172
173 BgeneratorModule::~BgeneratorModule( ) {
174 }
175
176
177
178
179 AppResult BgeneratorModule::genBeginJob( ) {
180
181 CdfRn* rn = CdfRn::Instance();
182 if ( !rn->isReadingFromFile() ) {
183 rn->SetEngineSeeds(_rndmSeed1.value(), _rndmSeed2.value(),"BGENERATOR");
184 }
185
186 if (_VERBOSE.value() > 0)
187 cout << endl
188 << "BgeneratorModule: genBeginJob" << endl << endl;
189
190 AbsParm2Bgen();
191
192 Bgenerator::Instance()->BeginJob();
193
194 if (_VERBOSE.value() > 0)
195 Bgenerator::Instance()->Show();
196
197 return AppResult::OK;
198 }
199
200
201 AppResult BgeneratorModule::genBeginRun( AbsEvent* event ) {
202
203 if (_VERBOSE.value() > 0)
204 cout << endl << "BgeneratorModule: genBeginRun" << endl << endl;
205
206 if (event != NULL)
207 Bgenerator::Instance()->BeginRun();
208 else {
209 if (_VERBOSE.value() > 0) {
210 cout << " -- AbsEvent is NULL" << endl;
211 cout << " -- Nothing done." << endl;
212 }
213 }
214
215 return AppResult::OK;
216 }
217
218
219
220 int BgeneratorModule::callGenerator( AbsEvent* event ) {
221
222 if (_VERBOSE.value() > 0)
223 cout << endl << "BgeneratorModule: callGenerator" << endl << endl;
224
225 Bgenerator* bgen = Bgenerator::Instance();
226
227 bgen->Event();
228 return 0;
229 }
230
231
232
233 AppResult BgeneratorModule::genEndRun( AbsEvent* ) {
234
235 if (_VERBOSE.value() > 0)
236 cout << endl << "BgeneratorModule: genEndRun" << endl << endl;
237
238 return AppResult::OK;
239 }
240
241
242 AppResult BgeneratorModule::genEndJob() {
243
244 if (_VERBOSE.value() > 0)
245 cout << endl << endl<< "BgeneratorModule: genEndJob" << endl;
246
247 Bgenerator::Instance()->EndRun();
248
249 return AppResult::OK;
250 }
251
252
253 void BgeneratorModule::fillHepevt() {
254
255 }
256
257
258 void BgeneratorModule::Bgen2AbsParm() {
259
260
261 if (_VERBOSE.value() > 0)
262 cout << endl << endl<< "BgeneratorModule: Bgen2AbsParm" << endl;
263
264 Bgncom_t* bgc = Bgenerator::Instance()->GetBgncom();
265
266 _PT_MIN_B1.set(bgc->PTMN[0]);
267 _PT_MIN_B1.set(bgc->PTMN[1]);
268 _RAPMIN .set(bgc->RAPMIN);
269 _RAPMAX .set(bgc->RAPMAX);
270 _EPS .set(bgc->EPS);
271 _MASS_BQ .set(bgc->MASS_BQ);
272 _MASS_CQ .set(bgc->MASS_CQ);
273 _FRAGMENT .set(bgc->FRAGMENT);
274 _DOMIX .set(bgc->DOMIX);
275 _X_D .set(bgc->X_D);
276 _X_S .set(bgc->X_S);
277 }
278
279
280 void BgeneratorModule::AbsParm2Bgen() {
281
282
283 if (_VERBOSE.value() > 0)
284 cout << endl << endl<< "BgeneratorModule: AbsParm2Bgen" << endl;
285
286 Bgncom_t* bgc = Bgenerator::Instance()->GetBgncom();
287
288 bgc->PTMN[0] = _PT_MIN_B1.value();
289 bgc->PTMN[1] = _PT_MIN_B2.value();
290 bgc->RAPMIN = _RAPMIN .value();
291 bgc->RAPMAX = _RAPMAX .value();
292 bgc->EPS = _EPS .value();
293 bgc->MASS_BQ = _MASS_BQ .value();
294 bgc->MASS_CQ = _MASS_CQ .value();
295 bgc->FRAGMENT = _FRAGMENT .value();
296 bgc->DOMIX = _DOMIX .value();
297 bgc->X_D = _X_D .value();
298 bgc->X_S = _X_S .value();
299 }
300
301
302 const char* BgeneratorModule::rcsId() const { return rcsid; }
303
304
305
306
307 DefineCommand::DefineCommand(const char* const comd,
308 BgeneratorModule* targ) :
309 APPCommand(comd,targ),
310 _cmd ( "-ipart=0 -bmass=-1. -blife=-1. -bidhep=-999 -name= -aname=" ),
311 _ipart ( 0 ),
312 _bm ( -1. ),
313 _bl ( -1. ),
314 _bidhep ( 9999 ),
315 _name ( "ND" ),
316 _aname ( "ND" )
317 {
318 }
319
320
321
322
323 int DefineCommand::handle(int argc, char* argv[])
324 {
325 int i;
326 double df;
327 string s;
328
329 BgeneratorModule *targetModule = (BgeneratorModule*) target();
330 AbsInterp *Interpreter = AbsInterp::theInterpreter();
331
332 int result = Interpreter->parseArgs(_cmd,argc,argv);
333
334 if (result == AbsInterp::ERROR) {
335 cerr << "Parser failed in DefineCommand." << endl;
336 }
337 else {
338 if (Interpreter->getInt ("ipart" ,i) == AbsInterp::OK) { _ipart=i; }
339 if (Interpreter->getDouble("bmass" ,df) == AbsInterp::OK) { _bm=df; }
340 if (Interpreter->getDouble("blife" ,df) == AbsInterp::OK) { _bl=df; }
341 if (Interpreter->getInt ("bidhep",i) == AbsInterp::OK) { _bidhep=i; }
342 if (Interpreter->getString("name" ,&s) == AbsInterp::OK) { _name=s; }
343 if (Interpreter->getString("aname" ,&s) == AbsInterp::OK) { _aname=s; }
344 }
345
346 Bgenerator::Instance()->DefineParticle(_ipart,_bidhep,
347 _name.c_str(),_aname.c_str(),_bm,_bl);
348 return(result);
349 }
350
351
352
353
354 void DefineCommand::show() const
355 {
356 cout << "DEFINE " << description();
357 cout << endl << endl;
358 cout <<"\t\t\t The actual parameter values are:" << endl;
359 cout <<"\t\t\t " << endl;
360 cout <<"\t\t\t Particle to define [-ipart]: " << _ipart << endl;
361 cout <<"\t\t\t B particle mass [-bmass]: " << _bm << endl;
362 cout <<"\t\t\t B particle lifetime [-blife]: " << _bl << endl;
363 cout <<"\t\t\t HEP id [-bidhep]: " << _bidhep << endl;
364 cout <<"\t\t\t Particle name [-name]: " << _name << endl;
365 cout <<"\t\t\t Anti-particle name [-aname]: " << _aname << endl;
366 cout <<"\t\t\t " << endl;
367 cout <<"\t\t\t The three last parameters are only necessary when a" << endl;
368 cout <<"\t\t\t user defines a new particle (-ipart=6)." << endl;
369 cout <<"\t\t\t " << endl;
370 }
371
372
373
374
375 bool DefineCommand::isShowable() const
376 {
377 return true;
378 }
379
380
381
382
383 string DefineCommand::description() const
384 {
385 string retval("");
386 retval += _cmd;
387 retval += "\n\t\t\t\n";
388 retval += "\t\t\t The DEFINE command is used to define the B particles. \n";
389 retval += "\t\t\t A list of standard particles can be produced and there \n";
390 retval += "\t\t\t mass and liftime can be adjusted. \n";
391 retval += "\t\t\t \n";
392 retval += "\t\t\t Also a fully user defined particle can be created which \n";
393 retval += "\t\t\t needs somewhat more input. \n";
394 retval += "\t\t\t \n";
395 retval += "\t\t\t \n";
396 retval += "\t\t\t -ipart: bgen particle ID (1-5: 6 user defined) \n";
397 retval += "\t\t\t -bidhep: hep particle ID \n";
398 retval += "\t\t\t -name: particle name \n";
399 retval += "\t\t\t -aname: anti-particle name \n";
400 retval += "\t\t\t -bmass: b particle mass \n";
401 retval += "\t\t\t -blife: b particle liftime \n";
402 return retval;
403 }
404
405
406
407
408 NdeCommand::NdeCommand(const char* const comd, BgeneratorModule* targ) :
409 APPCommand(comd,targ),
410 _cmd ( "-gentype=0 -file=no-file -ihist=-1 -bxsec=-1." ),
411 _gentype ( 1 ),
412 _file ( "NOT-DEFINED" ),
413 _ihist ( 20 ),
414 _bxsec ( 0.0 )
415 {
416 }
417
418
419
420
421 int NdeCommand::handle(int argc, char* argv[])
422 {
423 int i;
424 double df;
425 string s;
426
427 BgeneratorModule *targetModule = (BgeneratorModule*) target();
428 AbsInterp *Interpreter = AbsInterp::theInterpreter();
429
430 int result = Interpreter->parseArgs(_cmd,argc,argv);
431
432 if (result == AbsInterp::ERROR) {
433 cerr << "Parser failed in NdeCommand." << endl;
434 }
435 else {
436 if (Interpreter->getInt ("gentype",i) == AbsInterp::OK) { _gentype=i; }
437 if (Interpreter->getString("file" ,&s) == AbsInterp::OK) { _file=s; }
438 if (Interpreter->getInt ("ihist" ,i) == AbsInterp::OK) { _ihist=i; }
439 if (Interpreter->getDouble("bxsec" ,df) == AbsInterp::OK) { _bxsec=df; }
440 }
441
442 Bgenerator::Instance()->DefineNde(_gentype,_file.c_str(),_ihist,_bxsec);
443
444 return(result);
445 }
446
447
448
449
450 void NdeCommand::show() const
451 {
452 cout << "NDE " << description();
453 cout << endl << endl;
454 cout <<"\t\t\t The actual parameter values are:" << endl;
455 cout <<"\t\t\t " << endl;
456 cout <<"\t\t\t Generation type [-gentype]: " << _gentype << endl;
457 cout <<"\t\t\t Spectrum file name [-file]: " << _file << endl;
458 cout <<"\t\t\t Histogram ID [-ihist]: " << _ihist << endl;
459 cout <<"\t\t\t Total B cross section [-bxsec]: " << _bxsec << endl;
460 cout <<"\t\t\t " << endl;
461 cout <<"\t\t\t The three last parameters are only necessary when a" << endl;
462 cout <<"\t\t\t user defined spectrum is used." << endl;
463 cout <<"\t\t\t " << endl;
464 }
465
466
467
468
469 bool NdeCommand::isShowable() const
470 {
471 return true;
472 }
473
474
475
476
477 string NdeCommand::description() const
478 {
479 string retval("");
480 retval += _cmd;
481 retval += "\n\t\t\t\n";
482 retval += "\t\t\t The NDE command is used to specify the b-quark spectrum.\n";
483 retval += "\t\t\t Using this command automatically means that only one \n";
484 retval += "\t\t\t b-quark per event is generated. The spectrum follow \n";
485 retval += "\t\t\t calculations of Nason, Dawson and Ellis. \n";
486 retval += "\t\t\t \n";
487 retval += "\t\t\t -gentype: spectrum type (1-9) see bgenerator print out \n";
488 retval += "\t\t\t -file: file where to read spectrum histogram \n";
489 retval += "\t\t\t -ihist: histogram ID for spectrum \n";
490 retval += "\t\t\t -bxsec: total b cross section \n";
491 return retval;
492 }
493
494
495
496
497 MnrCommand::MnrCommand(const char* const comd, BgeneratorModule* targ) :
498 APPCommand(comd,targ),
499 _cmd ( "-gentype=0 -file=no-file -ihistpp=-1 -ihistdp=-1 -ihistyy=-1" ),
500 _gentype ( 1 ),
501 _file ( "NOT-DEFINED" ),
502 _ihistpp ( 200000 ),
503 _ihistdp ( 320000 ),
504 _ihistyy ( 210000 )
505 {
506 }
507
508
509
510
511 int MnrCommand::handle(int argc, char* argv[])
512 {
513 int i;
514 string s;
515
516 BgeneratorModule *targetModule = (BgeneratorModule*) target();
517 AbsInterp *Interpreter = AbsInterp::theInterpreter();
518
519 int result = Interpreter->parseArgs(_cmd,argc,argv);
520
521 if (result == AbsInterp::ERROR) {
522 cerr << "Parser failed in MnrCommand." << endl;
523 }
524 else {
525 if (Interpreter->getInt ("gentype",i) == AbsInterp::OK) { _gentype=i; }
526 if (Interpreter->getString("file" ,&s) == AbsInterp::OK) { _file=s; }
527 if (Interpreter->getInt ("ihistpp",i) == AbsInterp::OK) { _ihistpp=i; }
528 if (Interpreter->getInt ("ihistdp",i) == AbsInterp::OK) { _ihistdp=i; }
529 if (Interpreter->getInt ("ihistyy",i) == AbsInterp::OK) { _ihistyy=i; }
530 }
531
532 Bgenerator::Instance()->DefineMnr(_gentype,_file.c_str(),
533 _ihistpp,_ihistdp,_ihistyy);
534 return(result);
535 }
536
537
538
539
540 void MnrCommand::show() const
541 {
542 cout << "MNR " << description();
543 cout << endl << endl;
544 cout <<"\t\t\t The actual parameter values are:" << endl;
545 cout <<"\t\t\t " << endl;
546 cout <<"\t\t\t Generation type [-gentype]: " << _gentype << endl;
547 cout <<"\t\t\t Spectrum file name [-file]: " << _file << endl;
548 cout <<"\t\t\t Hist ID Ptmn vs Ptmx [-ihistpp]: " << _ihistpp << endl;
549 cout <<"\t\t\t Hist ID delta-phi [-ihistdp]: " << _ihistdp << endl;
550 cout <<"\t\t\t Hist ID Y* vs Yboost [-ihistyy]: " << _ihistyy << endl;
551 cout <<"\t\t\t " << endl;
552 cout <<"\t\t\t The four last parameters are only necessary when a" << endl;
553 cout <<"\t\t\t user defined spectrum is used." << endl;
554 cout <<"\t\t\t " << endl;
555 }
556
557
558
559
560 bool MnrCommand::isShowable() const
561 {
562 return true;
563 }
564
565
566
567
568 string MnrCommand::description() const
569 {
570 string retval("");
571 retval += _cmd;
572 retval += "\n\t\t\t\n";
573 retval += "\t\t\t The MNR command is used to specify the b-quark spectrum.\n";
574 retval += "\t\t\t Using this command automatically means that two \n";
575 retval += "\t\t\t b-quarks per event are generated. The spectra follow \n";
576 retval += "\t\t\t calculations of Mangano, Nason and Ridolfi. \n";
577 retval += "\t\t\t \n";
578 retval += "\t\t\t -gentype: spectrum type (1-9) see bgenerator print out \n";
579 retval += "\t\t\t -file: file where to read spectrum histogram \n";
580 retval += "\t\t\t -ihistpp: histogram ID - Ptmin vs Ptmax \n";
581 retval += "\t\t\t -ihistdp: histogram ID - delta-phi \n";
582 retval += "\t\t\t -ihistyy: histogram ID - Y* vs Yboost \n";
583 return retval;
584 }
585
586
587
588
589
590 BMesonCommand::BMesonCommand(const char* const comd,
591 BgeneratorModule* targ) :
592 APPCommand(comd,targ),
593 _cmd ( "-gencode=1 -bmeson=1 -mixu=0. -mixd=0. -mixs=0. -mixc=0. -mixl=0. -mixx=0." ),
594 _gencode( 1 ),
595 _bmeson ( 1 ),
596 _mixu ( 0.0 ),
597 _mixd ( 0.0 ),
598 _mixs ( 0.0 ),
599 _mixc ( 0.0 ),
600 _mixl ( 0.0 ),
601 _mixx ( 0.0 )
602 {
603 }
604
605
606
607
608 int BMesonCommand::handle(int argc, char* argv[])
609 {
610 int i;
611 double df;
612
613 BgeneratorModule *targetModule = (BgeneratorModule*) target();
614 AbsInterp *Interpreter = AbsInterp::theInterpreter();
615
616 int result = Interpreter->parseArgs(_cmd,argc,argv);
617
618 if (result == AbsInterp::ERROR) {
619 cerr << "Parser failed in DefineCommand." << endl;
620 }
621 else {
622 if (Interpreter->getInt ("gencode",i) == AbsInterp::OK) { _gencode=i; }
623 if (Interpreter->getInt ("bmeson" ,i) == AbsInterp::OK) { _bmeson=i; }
624 if (Interpreter->getDouble("mixu" ,df) == AbsInterp::OK) { _mixu=df; }
625 if (Interpreter->getDouble("mixd" ,df) == AbsInterp::OK) { _mixd=df; }
626 if (Interpreter->getDouble("mixs" ,df) == AbsInterp::OK) { _mixs=df; }
627 if (Interpreter->getDouble("mixc" ,df) == AbsInterp::OK) { _mixc=df; }
628 if (Interpreter->getDouble("mixl" ,df) == AbsInterp::OK) { _mixl=df; }
629 if (Interpreter->getDouble("mixx" ,df) == AbsInterp::OK) { _mixx=df; }
630 }
631
632 Bgenerator::Instance()->DefineMix(_gencode,_bmeson,
633 _mixu,_mixd,_mixs,_mixc,_mixl,_mixx);
634 return(result);
635 }
636
637
638
639
640 void BMesonCommand::show() const
641 {
642 cout << "BMESON " << description();
643 cout << endl << endl;
644 cout <<"\t\t\t The actual parameter values are:" << endl;
645 cout <<"\t\t\t " << endl;
646 cout <<"\t\t\t Generation code [-gencode]: " << _gencode << endl;
647 cout <<"\t\t\t B meson ID [-bmeson]: " << _bmeson << endl;
648 cout <<"\t\t\t Admixtures of Bu [-mixu]: " << _mixu << endl;
649 cout <<"\t\t\t Admixtures of Bd [-mixd]: " << _mixd << endl;
650 cout <<"\t\t\t Admixtures of Bs [-mixs]: " << _mixs << endl;
651 cout <<"\t\t\t Admixtures of Bc [-mixc]: " << _mixc << endl;
652 cout <<"\t\t\t Admixtures of LambdaB [-mixl]: " << _mixl << endl;
653 cout <<"\t\t\t Admixtures of User B [-mixx]: " << _mixx << endl;
654 cout <<"\t\t\t " << endl;
655 cout <<"\t\t\t The last parameter is only necessary when a user" << endl;
656 cout <<"\t\t\t defined particle exists." << endl;
657 cout <<"\t\t\t " << endl;
658 cout <<"\t\t\t The B meson ID is only used in case the generation" << endl;
659 cout <<"\t\t\t code is lower 3. For generation code 3 the complete" << endl;
660 cout <<"\t\t\t admixtures have to be specified." << endl << endl;
661 }
662
663
664
665
666 bool BMesonCommand::isShowable() const
667 {
668 return true;
669 }
670
671
672
673
674 string BMesonCommand::description() const
675 {
676 string retval("");
677 retval += _cmd;
678 retval += "\n\t\t\t\n";
679 retval += "\t\t\t The BMESON command is used to determine the B \n";
680 retval += "\t\t\t particle(s) to be generated. \n";
681 retval += "\t\t\t For -gencode=1 only the with bmeson given particle will \n";
682 retval += "\t\t\t be generated; for -gencode=2 also its anti-particle. \n";
683 retval += "\t\t\t For -gencode=3 the admixtures will be used to generate \n";
684 retval += "\t\t\t all particles and anti-particles with the given \n";
685 retval += "\t\t\t probabilities. \n";
686 retval += "\t\t\t \n";
687 retval += "\t\t\t \n";
688 retval += "\t\t\t -gencode: generation code (1-3) \n";
689 retval += "\t\t\t -bmeson: B meson to be generated (gencodes 1+2) \n";
690 retval += "\t\t\t -mixu: admixture of Bu \n";
691 retval += "\t\t\t -mixd: admixture of Bd \n";
692 retval += "\t\t\t -mixs: admixture of Bs \n";
693 retval += "\t\t\t -mixc: admixture of Bc \n";
694 retval += "\t\t\t -mixl: admixture of Lambda B \n";
695 retval += "\t\t\t -mixx: admixture of user defined particle \n";
696 return retval;
697 }
698
699
700
701
702 CMesonCommand::CMesonCommand(const char* const comd,
703 BgeneratorModule* targ) :
704 APPCommand(comd,targ)
705 {
706 _active = false;
707 }
708
709
710
711
712 int CMesonCommand::handle(int argc, char* argv[])
713 {
714 int i;
715 double df;
716
717 _active = true;
718 Bgenerator::Instance()->InitAsCgenerator();
719
720 return AbsInterp::OK;
721 }
722
723
724
725
726 void CMesonCommand::show() const
727 {
728 cout << "CMESON " << description();
729 cout << endl << endl;
730 cout <<"\t\t\t The CMESON option is ";
731 if (_active) cout << "ACTIVE." << endl << endl;
732 else cout << "NOT active." << endl << endl;
733 }
734
735
736
737
738 bool CMesonCommand::isShowable() const
739 {
740 return true;
741 }
742
743
744
745
746 string CMesonCommand::description() const
747 {
748 string retval("");
749 retval += _cmd;
750 retval += "\n\t\t\t\n";
751 retval += "\t\t\t Issue CMESON command in order to configure Bgenerator\n";
752 retval += "\t\t\t to generate c quarks/mesons. This is needed in order\n";
753 retval += "\t\t\t to generate and admixture of c-mesons, while a single\n";
754 retval += "\t\t\t c-meson can be generated as a user defined particle.\n";
755 return retval;
756 }
757
Send problems or questions to cdfcode@fnal.gov