CDF II
CDF KITS
source navigation ]
diff markup ]
identifier search ]
freetext search ]
file search ]
 
Architecture: i386 ]
Version: 4.10.4 ] [ 4.10.5 ] [ 4.8.4 ] [ 4.8.4l3s ] [ 4.8.5 ] [ 4.9.0 ] [ 4.9.1 ] [ 4.9.1.hpt3 ] [ 4.9.1hpt3 ] [ 4.9.1top1 ] [ 5.0.0 ] [ 5.1.0 ] [ 5.1.0beamonly ] [ 5.1.1 ] [ 5.2.0 ] [ 5.3.0 ] [ 5.3.1 ] [ 5.3.1dsp ] [ 5.3.3 ] [ 5.3.3_nt ] [ 5.3.4 ] [ 6.1.1 ] [ 6.1.1b ] [ 6.1.2 ] [ 6.1.3 ] [ 6.1.4 ] [ 6.1.4int3 ] [ 6.1.4mc ] [ 6.1.4mc_a ] [ 6.1.6 ] [ development ]

001 //------------------------------------------------------------------------------
002 // Description:
003 // ------------
004 //      Class HeavyQuarkGenModule
005 //
006 //      CDF interface for HeavyQuarkGen generator.
007 //
008 // Author List: S.Gromoll, Ch.Paus
009 //
010 //  revision history:
011 //  -----------------
012 // *0001 Apr 25 2002 S.Gromoll+Ch.Paus: created
013 // *0002 Apr 14 2003 G. Giurgiu, M. Paulini add D*0, D*+ and conjugates
014 //------------------------------------------------------------------------------
015 
016 // C Headers
017 #include <stdlib.h>
018 #include <stdio.h>
019 #include <assert.h>
020 
021 // C++ Headers
022 #include <iostream>
023 
024 // Collaborating Class Headers
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 // Local headers
035 #include "HeavyQuarkGen/HeavyQuarkGen.hh"
036 #include "generatorMods/HeavyQuarkGenModule.hh"
037 
038 // Local constants, macros & typedefs ...
039 static const char rcsid[]  = "$Id: HeavyQuarkGenModule.cc,v 1.2 2003/04/15 18:26:09 paulini Exp $";
040 const long HeavyQuarkGenModule::_defaultRandomSeed1 = 9223591;
041 const long HeavyQuarkGenModule::_defaultRandomSeed2 =  109736;
042 
043 //------------------------------------------------------------------------------
044 HeavyQuarkGenModule::HeavyQuarkGenModule(const char* name, const char* desc):
045   AbsGenModule (name, desc),
046   _Debug       ("Debug",       this,     1,       0,         4),
047   _Verbose     ("Verbose",     this,     0,       0,         4),
048   _doFrag      ("Fragment",    this,  true),
049   _doMix       ("Mixing",      this, false),
050   _Generate    ("Generate",    this),
051   _SetFraction ("SetFraction", this),
052   _SetBMixture ("SetBMixture", this),
053   _SetBEps     ("SetBEps",     this),
054   _SetDMixture ("SetDMixture", this),
055   _SetDEps     ("SetDEps",     this),
056   _Mixes       ("Mixes",       this),
057   _Define      ("Define",      this),
058   _rndmSeed1   ("RandomSeed1", this, _defaultRandomSeed1),
059   _rndmSeed2   ("RandomSeed2", this, _defaultRandomSeed2)
060 {
061 
062   if (_Debug.value() > -1)
063     cout << endl
064          << "HeavyQuarkGen Version: " << rcsId()
065          << endl;
066   if (_Debug.value() > 0)
067     cout << endl << "HeavyQuarkGenModule: Constructor" << endl << endl;
068 
069   // Initialize all the menus
070   // ------------------------
071   _HQgMenu.initialize ("HeavyQuarkGen",this);
072   _HQgMenu.initTitle  ("HeavyQuarkGen Menu:  parameters from HeavyQuarkGen");
073 
074   // Descriptions of HeavyQuarkGen Parameter
075   // -----------------------------------
076   _Debug      .addDescription("\t\t\tModule's verbosity level about actions.");
077   _Verbose    .addDescription("\t\t\tHeavyQuarkGen's verbosity level.");
078   _doFrag     .addDescription("\t\t\tFragment - 1  Take input as is - 0");
079   _doMix      .addDescription("\t\t\tApply mixing to neutral mesons?");
080 
081   commands()->append(&_HQgMenu);
082   _HQgMenu.commands()->append(&_Debug       );
083   _HQgMenu.commands()->append(&_Verbose     );
084   _HQgMenu.commands()->append(&_doFrag      );
085   _HQgMenu.commands()->append(&_doMix       );
086   _HQgMenu.commands()->append(&_Generate    );
087   _HQgMenu.commands()->append(&_Define      );
088   _HQgMenu.commands()->append(&_SetFraction );
089   _HQgMenu.commands()->append(&_SetDMixture );
090   _HQgMenu.commands()->append(&_SetBMixture );
091   _HQgMenu.commands()->append(&_SetDEps     );
092   _HQgMenu.commands()->append(&_SetBEps     );
093   _HQgMenu.commands()->append(&_Mixes       );
094 
095  // Initialize submenu for random numbers
096   _randomNumberMenu.initialize("RandomNumberMenu",this);
097   _randomNumberMenu.initTitle ("Random number menu");
098   commands()->append(&_randomNumberMenu);
099   _randomNumberMenu.commands()->append(&_rndmSeed1);
100   _randomNumberMenu.commands()->append(&_rndmSeed2);
101 
102   std::ostringstream tmpSt1;
103   std::ostringstream tmpSt2;
104 
105   // Describe them
106   tmpSt1 << "\tSeed #1 for the random number generator"
107         << "\n\t(default " << _rndmSeed1.value() << ").";
108   _rndmSeed1.addDescription(tmpSt1.str());
109   tmpSt2 << "\tSeed #2 for the random number generator"
110         << "\n\t(default " << _rndmSeed2.value() << ").";
111   _rndmSeed2.addDescription(tmpSt2.str());
112 
113   // Initialise and copy talk-to parameter
114   HeavyQuarkGen::Instance()->Init();
115 }
116 
117 //------------------------------------------------------------------------------
118 HeavyQuarkGenModule::~HeavyQuarkGenModule()
119 {
120 }
121 
122 //------------------------------------------------------------------------------
123 // Operations
124 //------------------------------------------------------------------------------
125 AppResult HeavyQuarkGenModule::genBeginJob()
126 {
127   CdfRn* rn = CdfRn::Instance();
128   if ( !rn->isReadingFromFile() ) {
129     rn->SetEngineSeeds(_rndmSeed1.value(), _rndmSeed2.value(),"HEAVYQUARKGEN");
130   }
131 
132   if (_Debug.value() > 0)
133     cout << endl
134          << "HeavyQuarkGenModule: genBeginJob" << endl << endl;
135 
136   HeavyQuarkGen::Instance()->EnableFragmentation (_doFrag.value());
137   HeavyQuarkGen::Instance()->EnableMixing        (_doMix.value());
138   HeavyQuarkGen::Instance()->SetVerbose          (_Verbose.value());
139 
140   HeavyQuarkGen::Instance()->BeginJob();
141 
142   return AppResult::OK;
143 }
144 
145 //------------------------------------------------------------------------------
146 AppResult HeavyQuarkGenModule::genBeginRun( AbsEvent* event )
147 {
148   if (_Debug.value() > 0)
149     cout << endl << "HeavyQuarkGenModule: genBeginRun" << endl << endl;
150 
151   if (event != NULL)
152     HeavyQuarkGen::Instance()->BeginRun();
153   else {
154     if (_Debug.value() > 0) {
155       cout << " -- AbsEvent is NULL" << endl;
156       cout << " -- Nothing done." << endl;
157     }
158   }
159 
160   return AppResult::OK;
161 }
162 
163 
164 //------------------------------------------------------------------------------
165 int HeavyQuarkGenModule::callGenerator(AbsEvent* event)
166 {
167   if (_Debug.value() > 0)
168     cout << endl << "HeavyQuarkGenModule: callGenerator" << endl << endl;
169   HeavyQuarkGen* hqgen = HeavyQuarkGen::Instance();
170   hqgen->Event();
171   return 0;
172 }
173 
174 
175 //------------------------------------------------------------------------------
176 AppResult HeavyQuarkGenModule::genEndRun(AbsEvent*)
177 {
178   if (_Debug.value() > 0)
179     cout << endl << "HeavyQuarkGenModule: genEndRun" << endl << endl;
180 
181   HeavyQuarkGen::Instance()->EndRun();
182 
183   return AppResult::OK;
184 }
185 
186 
187 AppResult HeavyQuarkGenModule::genEndJob()
188 {
189   if (_Debug.value() > 0)
190     cout << endl << endl<< "HeavyQuarkGenModule: genEndJob" << endl;
191 
192   HeavyQuarkGen::Instance()->EndJob();
193 
194   return AppResult::OK;
195 }
196 
197 //------------------------------------------------------------------------------
198 void HeavyQuarkGenModule::fillHepevt()
199 {
200   // this is done somewhere inside HeavyQuarkGen
201 }
202 
203 //------------------------------------------------------------------------------
204 const char* HeavyQuarkGenModule::rcsId() const { return rcsid; }
205 
206 //------------------------------------------------------------------------------
207 //------------------------------------------------------------------------------
208 //
209 // HQDefineCommand
210 //
211 //------------------------------------------------------------------------------
212 //------------------------------------------------------------------------------
213 HQDefineCommand::HQDefineCommand(const char* const comd,
214                                  HeavyQuarkGenModule* targ) :
215   APPCommand(comd,targ),
216   _cmd ( "-idhep=0 -name= -mass=-1 -life=-1 -eps=-1 -spec_file= -spec_name=" ),
217   _idhep     (   0  ),
218   _name      (  ""  ),
219   _mass      ( -1.0 ),
220   _lifetime  ( -1.0 ),
221   _epsilon   ( -1.0 ),
222   _spec_file (  ""  ),
223   _spec_name (  ""  )
224 {
225 }
226 
227 //------------------------------------------------------------------------------
228 // Handler Method for HQDefineCommand
229 //------------------------------------------------------------------------------
230 int HQDefineCommand::handle(int argc, char* argv[])
231 { 
232   int      i;
233   double  df;
234   string   s;
235 
236   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
237   AbsInterp *Interpreter = AbsInterp::theInterpreter();
238 
239   int result = Interpreter->parseArgs(_cmd,argc,argv);
240 
241   _idhep     = 0;
242   _name      = "";
243   _mass      = -1;
244   _lifetime  = -1;
245   _epsilon   = -1;
246   _spec_file = "";
247   _spec_name = "";
248 
249   if (result == AbsInterp::ERROR) {
250     cerr << "Parser failed in HQDefineCommand." << endl;
251   }
252   else {
253     if (Interpreter->getInt   ("idhep",     i) == AbsInterp::OK)  _idhep=i;
254     if (Interpreter->getString("name",     &s) == AbsInterp::OK)  _name=s;
255     if (Interpreter->getDouble("mass",     df) == AbsInterp::OK)  _mass=df;
256     if (Interpreter->getDouble("life",     df) == AbsInterp::OK)  _lifetime=df;
257     if (Interpreter->getDouble("eps",      df) == AbsInterp::OK)  _epsilon=df;
258     if (Interpreter->getString("spec_file",&s) == AbsInterp::OK)  _spec_file=s;
259     if (Interpreter->getString("spec_name",&s) == AbsInterp::OK)  _spec_name=s;
260   }
261 
262   HeavyQuarkGen::Instance()->DefineParticle(_idhep, _name.c_str(), _mass,
263                                             _lifetime);
264 
265   if(_spec_file != "" && _spec_name != "")
266     HeavyQuarkGen::Instance()->SetSpectrum(_idhep, _spec_file.c_str(),
267                                            _spec_name.c_str());
268 
269   if(_epsilon != -1)
270     HeavyQuarkGen::Instance()->SetPetersonEps(_idhep, _epsilon, false);
271 
272   return(result);
273 }
274 
275 //------------------------------------------------------------------------------
276 // Show Method for HQDefineCommand
277 //------------------------------------------------------------------------------
278 void HQDefineCommand::show() const
279 {
280   cout << "-------------------------------------------------------" << endl;
281   cout << "Define " << description();
282   cout << endl << endl;
283   cout <<"\t The actual parameter values are:" << endl;
284   cout <<"\t " << endl;
285   cout <<"\t    HEP id                        [-idhep]: "<<_idhep<< endl;
286   cout <<"\t    Particle name                  [-name]: "<<_name<< endl;
287   cout <<"\t    Particle mass                  [-mass]: "<<_mass<< endl;
288   cout <<"\t    Particle lifetime              [-life]: "<<_lifetime<<endl;
289   cout <<"\t    pt vs y spectrum file     [-spec_file]: "<<_spec_file<<endl;
290   cout <<"\t    Name of pt vs y spectrum  [-spec_name]: "<<_spec_name<<endl;
291   cout << endl;
292   cout <<"\t The last two  are optional.  If a spectrum file is" << endl;
293   cout <<"\t specified though a spectrum name must be specified as" << endl;
294   cout <<"\t well. " << endl;
295   cout << endl << endl;
296 }
297 
298 //------------------------------------------------------------------------------
299 // Showable Method for HQDefineCommand
300 //------------------------------------------------------------------------------
301 bool HQDefineCommand::isShowable() const
302 {
303   return true;
304 }
305 
306 //------------------------------------------------------------------------------
307 // Description Method for HQDefineCommand
308 //------------------------------------------------------------------------------
309 string HQDefineCommand::description() const
310 {
311   string retval("");
312   retval += _cmd;
313   retval += "\n\t\n";
314   retval += "\t The Define command is used to define particles.         \n";
315   retval += "\t A list of standard particles is provided, and can be    \n";
316   retval += "\t adjusted with this command.                             \n";
317   retval += "\t                                                         \n";
318   retval += "\t Fully user defined particles can also be added using    \n";
319   retval += "\t this command.                                           \n";
320   retval += "\n";
321   retval += "\t -idhep:     HEP particle ID                             \n";
322   retval += "\t -name:      Particle name                               \n";
323   retval += "\t -mass:      Particle mass                               \n";
324   retval += "\t -spec_file: Particle spectrum file used for generation  \n";
325   retval += "\t -spec_name: Name of spectrum within file                \n";
326   retval += "\t -life:      Particle liftime                            \n";
327   return retval;
328 }
329 
330 //------------------------------------------------------------------------------
331 //------------------------------------------------------------------------------
332 //
333 // HQSetFractionCommand
334 //
335 //------------------------------------------------------------------------------
336 //------------------------------------------------------------------------------
337 HQSetFractionCommand::HQSetFractionCommand(const char* const cmd,
338                                           HeavyQuarkGenModule* targ) :
339   APPCommand(cmd, targ),
340   _cmd      ( "-hepfrom=0 -hepto=0 -frac=1.0 -anti=1" ),
341   _hepfrom  (  0   ),
342   _hepto    (  0   ),
343   _fraction (  1.0 ),
344   _anti     (  1   )
345 {
346 }
347 
348 //------------------------------------------------------------------------------
349 // Handler Method for HQSetFractionCommand
350 //------------------------------------------------------------------------------
351 int HQSetFractionCommand::handle(int argc, char* argv[])
352 { 
353   string    s;
354   int       i;
355   double    d;
356 
357   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
358   AbsInterp *Interpreter = AbsInterp::theInterpreter();
359 
360   int result = Interpreter->parseArgs(_cmd,argc,argv);
361 
362   _hepfrom  = 0;
363   _hepto    = 0;
364   _fraction = 0;
365   _anti     = 1;
366 
367   if (result == AbsInterp::ERROR) {
368     cerr << "Parser failed in HQSetFractionCommand." << endl;
369   }
370   else {
371     if (Interpreter->getInt(   "hepfrom",  i) == AbsInterp::OK)  _hepfrom=i;
372     if (Interpreter->getInt(   "hepto",    i) == AbsInterp::OK)  _hepto=i;
373     if (Interpreter->getDouble("frac",     d) == AbsInterp::OK)  _fraction=d;
374     if (Interpreter->getInt(   "anti",     i) == AbsInterp::OK)  _anti=i;
375   }
376 
377   bool a = true;
378   if(_anti == 0)
379     a = false;
380   HeavyQuarkGen::Instance()->SetFraction(_hepfrom, _hepto, _fraction, a);
381   return(result);
382 }
383 
384 //------------------------------------------------------------------------------
385 // Show Method for HQSetFractionCommand
386 //------------------------------------------------------------------------------
387 void HQSetFractionCommand::show() const
388 {
389   cout << "-------------------------------------------------------" << endl;
390   cout << "SetFraction " << description();
391   cout << endl << endl;
392   cout <<"\t The actual parameter values are:" << endl;
393   cout <<"\t " << endl;
394   cout <<"\t    HEP id of fragmenting particle [-from]: "<< _hepfrom<< endl;
395   cout <<"\t    HEP id of fragmented particle    [-to]: "<< _hepto  << endl;
396   cout <<"\t    Fraction                       [-frac]: "<<_fraction<< endl;
397   cout <<"\t    Also set anti particle         [-anti]: "<<_anti    << endl;
398   cout << endl;
399   cout <<"\t Set the fraction used to fragment -from to -to.   " << endl;
400   cout <<"\t -from and -to are HEP ids. -anti specifies whether" << endl;
401   cout <<"\t the anti particle fractions should be set as well," << endl;
402   cout <<"\t and defaults to true if not otherwise specified.  " << endl;
403   cout << endl << endl;
404 }
405 
406 //------------------------------------------------------------------------------
407 // Showable Method for HQSetFractionCommand
408 //------------------------------------------------------------------------------
409 bool HQSetFractionCommand::isShowable() const
410 {
411   return true;
412 }
413 
414 //------------------------------------------------------------------------------
415 // Description Method for HQSetFractionCommand
416 //------------------------------------------------------------------------------
417 string HQSetFractionCommand::description() const
418 {
419   string retval("");
420   retval += _cmd;
421   retval += "\n\t\n";
422   retval += "\t The SetFraction command is used to set the        \n";
423   retval += "\t production fraction for a particle, used for      \n";
424   retval += "\t fragmentation.                                    \n";
425   retval += "\t -from and -to are the HEP ids.  -anti specifies   \n";
426   retval += "\t whether the anti particle fractions should be set \n";
427   retval += "\t as well, and defaults to true if not otherwise    \n";
428   retval += "\t specified.                                        \n";
429   retval += "\t E.g., to set the fractions of B_s and anti-B_s    \n";
430   retval += "\t produced in the fragmentation of b and bbar quarks\n";
431   retval += "\t use -from=-5 -to=531 -frac=0.11                   \n";
432   retval += "\n";
433   retval += "\t -from:     HEP id of fragmenting particle        \n";
434   retval += "\t -to  :     HEP id of fragmented particle         \n";
435   retval += "\t -frac:     Relative production fraction of the   \n";
436   retval += "\t              particle for fragmentation.         \n";
437   retval += "\t -anti:     Non-zero if the anti particle         \n";
438   retval += "\t              fractions should also be set        \n";
439   retval += "\t              (default), or zero if they should   \n";
440   retval += "\t              not be set.                         \n";
441   return retval;
442 }
443 
444 //------------------------------------------------------------------------------
445 //------------------------------------------------------------------------------
446 //
447 // HQMixesCommand
448 //
449 //------------------------------------------------------------------------------
450 //------------------------------------------------------------------------------
451 HQMixesCommand::HQMixesCommand(const char* const cmd,
452                                HeavyQuarkGenModule* targ) :
453   APPCommand(cmd, targ),
454   _cmd      ( "-idhep=0 -deltam=0 -idhep_to=0 "),
455   _idhep    (  0   ),
456   _delta_m  (  0   ),
457   _mixes_to (  0   )
458 {
459 }
460 
461 //------------------------------------------------------------------------------
462 // Handler Method for HQMixesCommand
463 //------------------------------------------------------------------------------
464 int HQMixesCommand::handle(int argc, char* argv[])
465 { 
466   int       i;
467   double    d;
468 
469   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
470   AbsInterp *Interpreter = AbsInterp::theInterpreter();
471 
472   int result = Interpreter->parseArgs(_cmd,argc,argv);
473 
474   _idhep    = 0;
475   _delta_m  = 0;
476   _mixes_to = 0;
477 
478   if (result == AbsInterp::ERROR) {
479     cerr << "Parser failed in HQMixesCommand." << endl;
480   }
481   else {
482     if (Interpreter->getInt("idhep",    i) == AbsInterp::OK)  _idhep=i;
483     if (Interpreter->getDouble("deltam",d) == AbsInterp::OK)  _delta_m=d;
484     if (Interpreter->getInt("idhep_to", i) == AbsInterp::OK)  _mixes_to=i;
485   }
486 
487   HeavyQuarkGen::Instance()->Mixes(_idhep, _delta_m, _mixes_to);
488   return(result);
489 }
490 
491 //------------------------------------------------------------------------------
492 // Show Method for HQMixesCommand
493 //------------------------------------------------------------------------------
494 void HQMixesCommand::show() const
495 {
496   cout << "-------------------------------------------------------" << endl;
497   cout << "Mixes " << description();
498   cout << endl << endl;
499   cout <<"\t The actual parameter values are:" << endl;
500   cout <<"\t " << endl;
501   cout <<"\t    HEP id of particle            [-idhep]: "<< _idhep  <<endl;
502   cout <<"\t    Mixing parameter             [-deltam]: "<< _delta_m<<endl;
503   cout <<"\t    HEP id of mixed particle   [-idhep_to]: "<<_mixes_to<<endl;
504   cout << endl;
505   cout <<"\t Specify mixing for a particle.  The option        " << endl;
506   cout <<"\t idhep_to is optional.  If omitted, assumes that   " << endl;
507   cout <<"\t the HEP id of the mixed particle is negative the  " << endl;
508   cout <<"\t HEP id of the unmixed particle.                   " << endl;
509   cout << endl << endl;
510 }
511 
512 //------------------------------------------------------------------------------
513 // Showable Method for HQMixesCommand
514 //------------------------------------------------------------------------------
515 bool HQMixesCommand::isShowable() const
516 {
517   return true;
518 }
519 
520 //------------------------------------------------------------------------------
521 // Description Method for HQMixesCommand
522 //------------------------------------------------------------------------------
523 string HQMixesCommand::description() const
524 {
525   string retval("");
526   retval += _cmd;
527   retval += "\n\t\n";
528   retval += "\t The Mixes command is used to specify that a particle \n";
529   retval += "\t can mix.                                             \n";
530   retval += "\n";
531   retval += "\t -idhep:     HEP id of particle                       \n";
532   retval += "\t -deltam:    Mixing parameter                         \n";
533   retval += "\t -idhtp_to:  HEP id of anti-particle.  Defaults to    \n";
534   retval += "\t               negative of idhep.                     \n";
535   return retval;
536 }
537 
538 //------------------------------------------------------------------------------
539 //------------------------------------------------------------------------------
540 //
541 // HQGenerateCommand
542 //
543 //------------------------------------------------------------------------------
544 //------------------------------------------------------------------------------
545 
546 //------------------------------------------------------------------------------
547 // Constructor for HQGenerateCommand
548 //------------------------------------------------------------------------------
549 HQGenerateCommand::HQGenerateCommand(const char* const comd,
550                                      HeavyQuarkGenModule* targ) :
551   APPCommand(comd,targ),
552   _cmd    ( "-idhep=0 -frac=1.0 -ptmin=0 -ptmax=10000 -rapmin=-1000 -rapmax=1000"),
553   _idhep  (    0  ),
554   _fraction(  1.0 ),
555   _pt_min (   0.0 ),
556   _pt_max (  100000 ),
557   _rap_min( -1000 ),
558   _rap_max(  1000 )
559 {
560 }
561 
562 //------------------------------------------------------------------------------
563 // Handler Method for HQGenerateCommand
564 //------------------------------------------------------------------------------
565 int HQGenerateCommand::handle(int argc, char* argv[])
566 {
567   int     i;
568   double  d;
569 
570   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
571   AbsInterp *Interpreter = AbsInterp::theInterpreter();
572 
573   int result = Interpreter->parseArgs(_cmd,argc,argv);
574 
575   _idhep    = 0;
576   _fraction = 1.0;
577   _pt_min   = 0;
578   _pt_max   =  100000;
579   _rap_min  = -100000;
580   _rap_max  =  100000;
581 
582   if (result == AbsInterp::ERROR) {
583     cerr << "Parser failed in HQGenerateCommand." << endl;
584   }
585   else {
586     if (Interpreter->getInt   ("idhep",i)  == AbsInterp::OK) { _idhep=i; }
587     if (Interpreter->getDouble("frac",d)   == AbsInterp::OK) { _fraction=d; }
588     if (Interpreter->getDouble("ptmin",d)  == AbsInterp::OK) { _pt_min=d; }
589     if (Interpreter->getDouble("ptmax",d)  == AbsInterp::OK) { _pt_max=d; }
590     if (Interpreter->getDouble("rapmin", d)== AbsInterp::OK) { _rap_min=d; }
591     if (Interpreter->getDouble("rapmax", d)== AbsInterp::OK) { _rap_max=d; }
592   }
593 
594   HeavyQuarkGen::Instance()->Generate(_idhep,   _fraction,
595                                       _pt_min,  _pt_max,
596                                       _rap_min, _rap_max);
597   return(result);
598 }
599 
600 //------------------------------------------------------------------------------
601 // Show Method for HQGenerateCommand
602 //------------------------------------------------------------------------------
603 void HQGenerateCommand::show() const
604 {
605   cout << "-------------------------------------------------------" << endl;
606   cout << "Generate " << description();
607   cout << endl << endl;
608   cout <<"\t The actual parameter values are:" << endl;
609   cout <<"\t " << endl;
610   cout <<"\t    HEP id to generate        [-idhep]: " << _idhep   << endl;
611   cout <<"\t    Fraction to generate       [-frac]: " << _fraction<< endl;
612   cout <<"\t    Min pt for particle       [-ptmin]: " << _pt_min  << endl;
613   cout <<"\t    Max pt for particle       [-ptmax]: " << _pt_max  << endl;
614   cout <<"\t    Min rapidity for particle  [-ymin]: " << _rap_min << endl;
615   cout <<"\t    Max rapidity for particle  [-ymax]: " << _rap_max << endl;
616   cout <<"\t " << endl << endl;
617 }
618 
619 //------------------------------------------------------------------------------
620 // Showable Method for HQGenerateCommand
621 //------------------------------------------------------------------------------
622 bool HQGenerateCommand::isShowable() const
623 {
624   return true;
625 }
626 
627 //------------------------------------------------------------------------------
628 // Description Method for HQGenerateCommand
629 //------------------------------------------------------------------------------
630 string HQGenerateCommand::description() const
631 {
632   string retval("");
633   retval += _cmd;
634   retval += "\n\t\n";
635   retval += "\t Add a particle to be generated.  The particle must be \n";
636   retval += "\t defined and will be generated using the spectrum      \n";
637   retval += "\t defined for the particle.                             \n";
638   return retval;
639 }
640 
641 
642 //------------------------------------------------------------------------------
643 //------------------------------------------------------------------------------
644 //
645 // HQSetDMixture   (shortcut for SetFraction command)
646 //
647 //------------------------------------------------------------------------------
648 //------------------------------------------------------------------------------
649 HQSetDMixtureCommand::HQSetDMixtureCommand(const char* const cmd,
650                                            HeavyQuarkGenModule* targ) :
651   APPCommand(cmd, targ),
652   _cmd ( "-mixu=0 -mixd=0 -mixs=0 -mixl=0 -mixustar=0, -mixdstar=0" ),
653   _mixu( 0.00 ),
654   _mixd( 0.00 ),
655   _mixs( 0.00 ),
656   _mixl( 0.00 ),
657   _mixustar( 0.00 ),
658   _mixdstar( 0.00 )
659 {
660 }
661 
662 //------------------------------------------------------------------------------
663 // Handler Method for HQSetDMixtureCommand
664 //------------------------------------------------------------------------------
665 int HQSetDMixtureCommand::handle(int argc, char* argv[])
666 { 
667   double    d;
668 
669   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
670   AbsInterp *Interpreter = AbsInterp::theInterpreter();
671 
672   int result = Interpreter->parseArgs(_cmd,argc,argv);
673 
674   _mixu = 0;
675   _mixd = 0;
676   _mixs = 0;
677   _mixl = 0;
678   _mixustar = 0;
679   _mixdstar = 0;
680 
681   if (result == AbsInterp::ERROR) {
682     cerr << "Parser failed in HQSetDMixtureCommand." << endl;
683   }
684   else {
685     if (Interpreter->getDouble("mixu",  d) == AbsInterp::OK)  _mixu = d;
686     if (Interpreter->getDouble("mixd",  d) == AbsInterp::OK)  _mixd = d;
687     if (Interpreter->getDouble("mixs",  d) == AbsInterp::OK)  _mixs = d;
688     if (Interpreter->getDouble("mixl",  d) == AbsInterp::OK)  _mixl = d;
689     if (Interpreter->getDouble("mixustar",  d) == AbsInterp::OK)  _mixustar = d;
690     if (Interpreter->getDouble("mixdstar",  d) == AbsInterp::OK)  _mixdstar = d;
691   }
692 
693   HeavyQuarkGen::Instance()->SetDMixture(_mixu, _mixd, _mixs, _mixl, _mixustar, _mixdstar);
694   return(result);
695 }
696 
697 //------------------------------------------------------------------------------
698 // Show Method for HQSetDMixtureCommand
699 //------------------------------------------------------------------------------
700 void HQSetDMixtureCommand::show() const
701 {
702   cout << "-------------------------------------------------------" << endl;
703   cout << "SetDMixture " << description();
704   cout << endl << endl;
705   cout <<"\t The actual parameter values are:" << endl;
706   cout <<"\t " << endl;
707   cout <<"\t D0     admixture             [-mixu]: " << _mixu << endl;
708   cout <<"\t D+     admixture             [-mixd]: " << _mixd << endl;
709   cout <<"\t Ds     admixture             [-mixs]: " << _mixs << endl;
710   cout <<"\t Lambda admixture             [-mixl]: " << _mixl << endl;
711   cout <<"\t D*0    admixture             [-mixustar]: " << _mixustar << endl;
712   cout <<"\t D*+    admixture             [-mixdstar]: " << _mixdstar << endl;
713   cout << endl << endl;
714 }
715 
716 //------------------------------------------------------------------------------
717 // Showable Method for HQSetDMixtureCommand
718 //------------------------------------------------------------------------------
719 bool HQSetDMixtureCommand::isShowable() const
720 {
721   return true;
722 }
723 
724 //------------------------------------------------------------------------------
725 // Description Method for HQSetDMixtureCommand
726 //------------------------------------------------------------------------------
727 string HQSetDMixtureCommand::description() const
728 {
729   string retval("");
730   retval += _cmd;
731   retval += "\n\t\n";
732   retval += "\t The SetDMixture command is a shortcut for the     \n";
733   retval += "\t SetFraction command, and is used to set all the   \n";
734   retval += "\t fractions for c fragmentation.                    \n";
735   retval += "\n";
736   retval += "\t\t\t -mixu:           admixture of D0              \n";
737   retval += "\t\t\t -mixd:           admixture of D+              \n";
738   retval += "\t\t\t -mixs:           admixture of Ds              \n";
739   retval += "\t\t\t -mixl:           admixture of Lambda D        \n";
740   retval += "\t\t\t -mixustar:       admixture of D*0             \n";
741   retval += "\t\t\t -mixdstar:       admixture of D*+             \n";
742 
743   return retval;
744 }
745 
746 
747 //------------------------------------------------------------------------------
748 //------------------------------------------------------------------------------
749 //
750 // HQSetBMixture   (shortcut for SetFraction command)
751 //
752 //------------------------------------------------------------------------------
753 //------------------------------------------------------------------------------
754 HQSetBMixtureCommand::HQSetBMixtureCommand(const char* const cmd,
755                                            HeavyQuarkGenModule* targ) :
756   APPCommand(cmd, targ),
757   _cmd ( "-mixu=0 -mixd=0 -mixs=0 -mixc=0 -mixl=0" ),
758   _mixu( 0.00 ),
759   _mixd( 0.00 ),
760   _mixs( 0.00 ),
761   _mixc( 0.00 ),
762   _mixl( 0.00 )
763 {
764 }
765 
766 //------------------------------------------------------------------------------
767 // Handler Method for HQSetBMixtureCommand
768 //------------------------------------------------------------------------------
769 int HQSetBMixtureCommand::handle(int argc, char* argv[])
770 { 
771   double    d;
772 
773   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
774   AbsInterp *Interpreter = AbsInterp::theInterpreter();
775 
776   int result = Interpreter->parseArgs(_cmd,argc,argv);
777 
778   _mixu = 0;
779   _mixd = 0;
780   _mixs = 0;
781   _mixc = 0;
782   _mixl = 0;
783 
784   if (result == AbsInterp::ERROR) {
785     cerr << "Parser failed in HQSetBMixtureCommand." << endl;
786   }
787   else {
788     if (Interpreter->getDouble("mixu",  d) == AbsInterp::OK)  _mixu = d;
789     if (Interpreter->getDouble("mixd",  d) == AbsInterp::OK)  _mixd = d;
790     if (Interpreter->getDouble("mixs",  d) == AbsInterp::OK)  _mixs = d;
791     if (Interpreter->getDouble("mixc",  d) == AbsInterp::OK)  _mixc = d;
792     if (Interpreter->getDouble("mixl",  d) == AbsInterp::OK)  _mixl = d;
793   }
794 
795   HeavyQuarkGen::Instance()->SetBMixture(_mixu, _mixd, _mixs, _mixc, _mixl);
796   return(result);
797 }
798 
799 //------------------------------------------------------------------------------
800 // Show Method for HQSetBMixtureCommand
801 //------------------------------------------------------------------------------
802 void HQSetBMixtureCommand::show() const
803 {
804   cout << "-------------------------------------------------------" << endl;
805   cout << "SetBMixture " << description();
806   cout << endl << endl;
807   cout <<"\t The actual parameter values are:" << endl;
808   cout <<"\t " << endl;
809   cout <<"\t Bu     admixture             [-mixu]: " << _mixu << endl;
810   cout <<"\t Bd     admixture             [-mixd]: " << _mixd << endl;
811   cout <<"\t Bs     admixture             [-mixs]: " << _mixs << endl;
812   cout <<"\t Bc     admixture             [-mixc]: " << _mixc << endl;
813   cout <<"\t Lambda admixture             [-mixl]: " << _mixl << endl;
814   cout << endl << endl;
815 }
816 
817 //------------------------------------------------------------------------------
818 // Showable Method for HQSetBMixtureCommand
819 //------------------------------------------------------------------------------
820 bool HQSetBMixtureCommand::isShowable() const
821 {
822   return true;
823 }
824 
825 //------------------------------------------------------------------------------
826 // Description Method for HQSetBMixtureCommand
827 //------------------------------------------------------------------------------
828 string HQSetBMixtureCommand::description() const
829 {
830   string retval("");
831   retval += _cmd;
832   retval += "\n\t\n";
833   retval += "\t The SetBMixture command is a shortcut for the     \n";
834   retval += "\t SetFraction command, and is used to set all the   \n";
835   retval += "\t fractions for b fragmentation.                    \n";
836   retval += "\n";
837   retval += "\t\t\t -mixu:      admixture of Bu                   \n";
838   retval += "\t\t\t -mixd:      admixture of Bd                   \n";
839   retval += "\t\t\t -mixs:      admixture of Bs                   \n";
840   retval += "\t\t\t -mixc:      admixture of Bc                   \n";
841   retval += "\t\t\t -mixl:      admixture of Lambda B             \n";
842 
843   return retval;
844 }
845 
846 
847 
848 
849 //------------------------------------------------------------------------------
850 //------------------------------------------------------------------------------
851 //
852 // HQSetDEps   (shortcut for SetFraction command)
853 //
854 //------------------------------------------------------------------------------
855 //------------------------------------------------------------------------------
856 HQSetDEpsCommand::HQSetDEpsCommand(const char* const cmd,
857                                            HeavyQuarkGenModule* targ) :
858   APPCommand(cmd, targ),
859   _cmd ( "-epsu=0 -epsd=0 -epss=0 -epsl=0, -epsustar=0, -epsdstar=0" ),
860   _epsu( 0.00 ),
861   _epsd( 0.00 ),
862   _epss( 0.00 ),
863   _epsl( 0.00 ),
864   _epsustar( 0.00 ),
865   _epsdstar( 0.00 )
866 {
867 }
868 
869 //------------------------------------------------------------------------------
870 // Handler Method for HQSetDEpsCommand
871 //------------------------------------------------------------------------------
872 int HQSetDEpsCommand::handle(int argc, char* argv[])
873 { 
874   double    d;
875 
876   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
877   AbsInterp *Interpreter = AbsInterp::theInterpreter();
878 
879   int result = Interpreter->parseArgs(_cmd,argc,argv);
880 
881   _epsu = 0;
882   _epsd = 0;
883   _epss = 0;
884   _epsl = 0;
885   _epsustar = 0;
886   _epsdstar = 0;
887 
888   if (result == AbsInterp::ERROR) {
889     cerr << "Parser failed in HQSetDEpsCommand." << endl;
890   }
891   else {
892     if (Interpreter->getDouble("epsu",  d) == AbsInterp::OK)  _epsu = d;
893     if (Interpreter->getDouble("epsd",  d) == AbsInterp::OK)  _epsd = d;
894     if (Interpreter->getDouble("epss",  d) == AbsInterp::OK)  _epss = d;
895     if (Interpreter->getDouble("epsl",  d) == AbsInterp::OK)  _epsl = d;
896     if (Interpreter->getDouble("epsustar",  d) == AbsInterp::OK)  _epsustar = d;
897     if (Interpreter->getDouble("epsdstar",  d) == AbsInterp::OK)  _epsdstar = d;
898   }
899 
900   HeavyQuarkGen::Instance()->SetDEps(_epsu, _epsd, _epss, _epsl, _epsustar, _epsdstar);
901   return(result);
902 }
903 
904 //------------------------------------------------------------------------------
905 // Show Method for HQSetDEpsCommand
906 //------------------------------------------------------------------------------
907 void HQSetDEpsCommand::show() const
908 {
909   cout << "-------------------------------------------------------" << endl;
910   cout << "SetDEps " << description();
911   cout << endl << endl;
912   cout <<"\t The actual parameter values are:" << endl;
913   cout <<"\t " << endl;
914   cout <<"\t Peterson eps for D0              [-epsu]: "      << _epsu << endl;
915   cout <<"\t Peterson eps for D+              [-epsd]: "      << _epsd << endl;
916   cout <<"\t Peterson eps for Ds              [-epss]: "      << _epss << endl;
917   cout <<"\t Peterson eps for Lambda          [-epsl]: "      << _epsl << endl;
918   cout <<"\t Peterson eps for D*0             [-epsustar]: "  << _epsustar << endl;
919   cout <<"\t Peterson eps for D*+             [-epsdstar]: "  << _epsdstar << endl;
920   cout << endl << endl;
921 }
922 
923 //------------------------------------------------------------------------------
924 // Showable Method for HQSetDEpsCommand
925 //------------------------------------------------------------------------------
926 bool HQSetDEpsCommand::isShowable() const
927 {
928   return true;
929 }
930 
931 //------------------------------------------------------------------------------
932 // Description Method for HQSetDEpsCommand
933 //------------------------------------------------------------------------------
934 string HQSetDEpsCommand::description() const
935 {
936   string retval("");
937   retval += _cmd;
938   retval += "\n\t\n";
939   retval += "\t The SetDEps command is a shortcut for the         \n";
940   retval += "\t Define -eps= command, and is used to set all the  \n";
941   retval += "\t peterson epsilons for D meson fragmentation.      \n";
942   retval += "\n";
943   retval += "\t\t\t -epsu:           peterson eps for D0               \n";
944   retval += "\t\t\t -epsd:           peterson eps for D+               \n";
945   retval += "\t\t\t -epss:           peterson eps for Ds               \n";
946   retval += "\t\t\t -epsl:           peterson eps for Lambda D         \n";
947   retval += "\t\t\t -epsustar:       peterson eps for D*0              \n";
948   retval += "\t\t\t -epsdstar:       peterson eps for D*+              \n";
949 
950   return retval;
951 }
952 
953 
954 
955 //------------------------------------------------------------------------------
956 //------------------------------------------------------------------------------
957 //
958 // HQSetBEps   (shortcut for SetFraction command)
959 //
960 //------------------------------------------------------------------------------
961 //------------------------------------------------------------------------------
962 HQSetBEpsCommand::HQSetBEpsCommand(const char* const cmd,
963                                            HeavyQuarkGenModule* targ) :
964   APPCommand(cmd, targ),
965   _cmd ( "-epsu=0 -epsd=0 -epsc=0 -epss=0 -epsl=0" ),
966   _epsu( 0.00 ),
967   _epsd( 0.00 ),
968   _epsc( 0.00 ),
969   _epss( 0.00 ),
970   _epsl( 0.00 )
971 {
972 }
973 
974 //------------------------------------------------------------------------------
975 // Handler Method for HQSetBEpsCommand
976 //------------------------------------------------------------------------------
977 int HQSetBEpsCommand::handle(int argc, char* argv[])
978 { 
979   double    d;
980 
981   HeavyQuarkGenModule *targetModule = (HeavyQuarkGenModule*) target();
982   AbsInterp *Interpreter = AbsInterp::theInterpreter();
983 
984   int result = Interpreter->parseArgs(_cmd,argc,argv);
985 
986   _epsu = 0;
987   _epsd = 0;
988   _epsc = 0;
989   _epss = 0;
990   _epsl = 0;
991 
992   if (result == AbsInterp::ERROR) {
993     cerr << "Parser failed in HQSetBEpsCommand." << endl;
994   }
995   else {
996     if (Interpreter->getDouble("epsu",  d) == AbsInterp::OK)  _epsu = d;
997     if (Interpreter->getDouble("epsd",  d) == AbsInterp::OK)  _epsd = d;
998     if (Interpreter->getDouble("epsc",  d) == AbsInterp::OK)  _epsc = d;
999     if (Interpreter->getDouble("epss",  d) == AbsInterp::OK)  _epss = d;
1000     if (Interpreter->getDouble("epsl",  d) == AbsInterp::OK)  _epsl = d;
1001   }
1002 
1003   HeavyQuarkGen::Instance()->SetBEps(_epsu, _epsd, _epsc, _epss, _epsl);
1004   return(result);
1005 }
1006 
1007 //------------------------------------------------------------------------------
1008 // Show Method for HQSetBEpsCommand
1009 //------------------------------------------------------------------------------
1010 void HQSetBEpsCommand::show() const
1011 {
1012   cout << "-------------------------------------------------------" << endl;
1013   cout << "SetBEps " << description();
1014   cout << endl << endl;
1015   cout <<"\t The actual parameter values are:" << endl;
1016   cout <<"\t " << endl;
1017   cout <<"\t Peterson eps for B+              [-epsu]: " << _epsu << endl;
1018   cout <<"\t Peterson eps for B0              [-epsd]: " << _epsd << endl;
1019   cout <<"\t Peterson eps for Bc              [-epsc]: " << _epsc << endl;
1020   cout <<"\t Peterson eps for Bs              [-epss]: " << _epss << endl;
1021   cout <<"\t Peterson eps for Lambda          [-epsl]: " << _epsl << endl;
1022   cout << endl << endl;
1023 }
1024 
1025 //------------------------------------------------------------------------------
1026 // Showable Method for HQSetBEpsCommand
1027 //------------------------------------------------------------------------------
1028 bool HQSetBEpsCommand::isShowable() const
1029 {
1030   return true;
1031 }
1032 
1033 //------------------------------------------------------------------------------
1034 // Description Method for HQSetBEpsCommand
1035 //------------------------------------------------------------------------------
1036 string HQSetBEpsCommand::description() const
1037 {
1038   string retval("");
1039   retval += _cmd;
1040   retval += "\n\t\n";
1041   retval += "\t The SetBEps command is a shortcut for the         \n";
1042   retval += "\t Define -eps= command, and is used to set all the  \n";
1043   retval += "\t peterson epsilons for B meson fragmentation.      \n";
1044   retval += "\n";
1045   retval += "\t\t\t -epsu:      peterson eps for B+            \n";
1046   retval += "\t\t\t -epsd:      peterson eps for B0            \n";
1047   retval += "\t\t\t -epsc:      peterson eps for Bc            \n";
1048   retval += "\t\t\t -epss:      peterson eps for Bs            \n";
1049   retval += "\t\t\t -epsl:      peterson eps for Lambda B      \n";
1050 
1051   return retval;
1052 }
1053 

source navigation ] diff markup ] identifier search ] freetext search ] file search ]

This page was automatically generated by the LXR engine.
The LXR team
Valid HTML 4.01!

Send problems or questions to cdfcode@fnal.gov