CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
gen::TauolaInterface Class Reference

#include <TauolaInterface.h>

Public Member Functions

HepMC::GenEvent * decay (HepMC::GenEvent *)
 
void disablePolarization ()
 
void enablePolarization ()
 
void init (const edm::EventSetup &)
 
const std::vector< int > & operatesOnParticles ()
 
void setPSet (const edm::ParameterSet &)
 
void statistics ()
 
 ~TauolaInterface ()
 

Static Public Member Functions

static TauolaInterfacegetInstance ()
 

Private Member Functions

void decodeMDTAU (int)
 
float flat ()
 
void selectDecayByMDTAU ()
 
int selectHadronic ()
 
int selectLeptonic ()
 
 TauolaInterface ()
 

Private Attributes

std::vector< int > fHadronModes
 
bool fIsInitialized
 
std::vector< int > fLeptonModes
 
int fMDTAU
 
std::vector< int > fPDGs
 
edm::ESHandle
< HepPDT::ParticleDataTable
fPDGTable
 
bool fPolarization
 
edm::ParameterSetfPSet
 
CLHEP::HepRandomEngine * fRandomEngine
 
std::vector< double > fScaledHadronBrRatios
 
std::vector< double > fScaledLeptonBrRatios
 
bool fSelectDecayByEvent
 

Static Private Attributes

static TauolaInterfacefInstance = 0
 

Friends

void gen::ranmar_ (float *rvec, int *lenv)
 
double gen::TauolappInterface_RandGetter ()
 

Detailed Description

Definition at line 64 of file TauolaInterface.h.

Constructor & Destructor Documentation

TauolaInterface::~TauolaInterface ( )

Definition at line 379 of file TauolaInterface.cc.

References fInstance, and fPSet.

380 {
381 
382  if ( fPSet != 0 ) delete fPSet;
383  if ( fInstance == this ) fInstance = 0;
384 
385 }
static TauolaInterface * fInstance
edm::ParameterSet * fPSet
TauolaInterface::TauolaInterface ( )
private

Definition at line 323 of file TauolaInterface.cc.

References edm::hlt::Exception, fRandomEngine, edm::RandomNumberGenerator::getEngine(), and edm::Service< T >::isAvailable().

Referenced by getInstance().

324  : fPolarization(false), fPSet(0), fIsInitialized(false), fMDTAU(-1), fSelectDecayByEvent(false)
325 {
326 
328  if(!rng.isAvailable()) {
329  throw cms::Exception("Configuration")
330  << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n"
331  "which appears to be absent. Please add that service to your configuration\n"
332  "or remove the modules that require it." << std::endl;
333  }
334 
335  fRandomEngine = &rng->getEngine();
336 
337 }
bool isAvailable() const
Definition: Service.h:47
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
CLHEP::HepRandomEngine * fRandomEngine
edm::ParameterSet * fPSet

Member Function Documentation

HepMC::GenEvent * TauolaInterface::decay ( HepMC::GenEvent *  evt)

Definition at line 499 of file TauolaInterface.cc.

References abs, fIsInitialized, fPDGTable, fSelectDecayByEvent, configurableAnalysis::GenParticle, create_public_lumi_plots::log, p1, RecoTau_DiTaus_pt_20-420_cfg::ParticleID, mix_2012_Summer_inTimeOnly_cff::prob, gen::ranmar_(), and selectDecayByMDTAU().

Referenced by gen::ExternalDecayDriver::decay(), and ParticleReplacerClass::produce().

500 {
501 
502  if ( !fIsInitialized ) return evt;
503 
504  int NPartBefore = evt->particles_size();
505  int NVtxBefore = evt->vertices_size();
506 
507  // what do we do if Hep::GenEvent size is larger than 10K ???
508  // Tauola (& Photos, BTW) can only handle up to 10K via HEPEVT,
509  // and in case of CMS, it's only up to 4K !!!
510  //
511  // if ( NPartBefore > 10000 ) return evt;
512  //
513 
514  // override decay mode if needs be
515  if ( fSelectDecayByEvent )
516  {
518  }
519 
520  //construct tmp TAUOLA event
521  //
522  TauolaHepMCEvent * t_event = new TauolaHepMCEvent(evt);
523 
524  // another option: if one lets Pythia or another master gen to decay taus,
525  // we have to undecay them first
526  // t_event->undecayTaus();
527 
528  // run Tauola on the tmp event - HepMC::GenEvernt will be MODIFIED !!!
529  //
530  t_event->decayTaus();
531 
532  // delet tmp Tauola event
533  //
534  delete t_event;
535 
536  // do we also need to apply the lifetime and vtx position shift ???
537  // (see TauolaInterface, for example)
538  //
539  // NOTE: the procedure ASSYMES that vertex barcoding is COUNTIUOUS/SEQUENTIAL,
540  // and that the abs(barcode) corresponds to vertex "plain indexing"
541  //
542  for ( int iv=NVtxBefore+1; iv<=evt->vertices_size(); iv++ )
543  {
544  HepMC::GenVertex* GenVtx = evt->barcode_to_vertex(-iv);
545  HepMC::GenParticle* GenPart = *(GenVtx->particles_in_const_begin());
546  HepMC::GenVertex* ProdVtx = GenPart->production_vertex();
547  HepMC::FourVector PMom = GenPart->momentum();
548  double mass = GenPart->generated_mass();
549  const HepPDT::ParticleData*
550  PData = fPDGTable->particle(HepPDT::ParticleID(abs(GenPart->pdg_id()))) ;
551  double lifetime = PData->lifetime().value();
552  float prob = 0.;
553  int length=1;
554  ranmar_(&prob,&length);
555  double ct = -lifetime * std::log(prob);
556  double VxDec = GenVtx->position().x();
557  VxDec += ct * (PMom.px()/mass);
558  VxDec += ProdVtx->position().x();
559  double VyDec = GenVtx->position().y();
560  VyDec += ct * (PMom.py()/mass);
561  VyDec += ProdVtx->position().y();
562  double VzDec = GenVtx->position().z();
563  VzDec += ct * (PMom.pz()/mass);
564  VzDec += ProdVtx->position().z();
565  double VtDec = GenVtx->position().t();
566  VtDec += ct * (PMom.e()/mass);
567  VtDec += ProdVtx->position().t();
568  GenVtx->set_position( HepMC::FourVector(VxDec,VyDec,VzDec,VtDec) );
569  //
570  // now find decay products with funky barcode, weed out and replace with clones of sensible barcode
571  // we can NOT change the barcode while iterating, because iterators do depend on the barcoding
572  // thus we have to take a 2-step procedure
573  //
574  std::vector<int> BCodes;
575  BCodes.clear();
576  for (HepMC::GenVertex::particle_iterator pitr= GenVtx->particles_begin(HepMC::children);
577  pitr != GenVtx->particles_end(HepMC::children); ++pitr)
578  {
579  if ( (*pitr)->barcode() > 10000 )
580  {
581  BCodes.push_back( (*pitr)->barcode() );
582  }
583  }
584  if ( BCodes.size() > 0 )
585  {
586  for ( size_t ibc=0; ibc<BCodes.size(); ibc++ )
587  {
588  HepMC::GenParticle* p1 = evt->barcode_to_particle( BCodes[ibc] );
589  int nbc = p1->barcode() - 10000 + NPartBefore;
590  p1->suggest_barcode( nbc );
591  }
592  }
593  }
594 
595  return evt;
596 
597 }
#define abs(x)
Definition: mlp_lapack.h:159
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
void ranmar_(float *rvec, int *lenv)
HepPDT::ParticleData ParticleData
double p1[4]
Definition: TauolaWrapper.h:89
void TauolaInterface::decodeMDTAU ( int  mdtau)
private

Definition at line 604 of file TauolaInterface.cc.

References fHadronModes, fLeptonModes, fScaledHadronBrRatios, fScaledLeptonBrRatios, fSelectDecayByEvent, i, hitfit::return, and taubra_.

Referenced by init().

605 {
606 
607  // Note-1:
608  // I have to hack the common block directly because set<...>DecayMode(...)
609  // only changes it in the Tauola++ instance but does NOT passes it over
610  // to the Fortran core - this it does only one, via initialize() stuff...
611  //
612  // So I'll do both ways of settings, just for consistency...
613  // but I probably need to communicate it to the Tauola(++) team...
614  //
615 
616  // Note-2:
617  // originally, the 1xx settings are meant for tau's from hard event,
618  // and the 2xx settings are for any tau in the event record;
619  //
620  // later one, we'll have to take this into account...
621  // but first I'll have to sort out what happens in the 1xx case
622  // to tau's coming outside of hard event (if any in the record)
623  //
624 
625  if ( mdtau == 101 || mdtau == 201 )
626  {
627  // override with electron mode for both tau's
628  //
629  jaki_.jak1 = 1;
630  jaki_.jak2 = 1;
631  Tauola::setSameParticleDecayMode( 1 ) ;
632  Tauola::setOppositeParticleDecayMode( 1 ) ;
633  return;
634  }
635 
636  if ( mdtau == 102 || mdtau == 202 )
637  {
638  // override with muon mode for both tau's
639  //
640  jaki_.jak1 = 2;
641  jaki_.jak2 = 2;
642  Tauola::setSameParticleDecayMode( 2 ) ;
643  Tauola::setOppositeParticleDecayMode( 2 ) ;
644  return;
645  }
646 
647  if ( mdtau == 111 || mdtau == 211 )
648  {
649  // override with electron mode for 1st tau
650  // and any mode for 2nd tau
651  //
652  jaki_.jak1 = 1;
653  jaki_.jak2 = 0;
654  Tauola::setSameParticleDecayMode( 1 ) ;
655  Tauola::setOppositeParticleDecayMode( 0 ) ;
656  return;
657  }
658 
659  if ( mdtau == 112 || mdtau == 212 )
660  {
661  // override with muon mode for the 1st tau
662  // and any mode for the 2nd tau
663  //
664  jaki_.jak1 = 2;
665  jaki_.jak2 = 0;
666  Tauola::setSameParticleDecayMode( 2 ) ;
667  Tauola::setOppositeParticleDecayMode( 0 ) ;
668  return;
669  }
670 
671  if ( mdtau == 121 || mdtau == 221 )
672  {
673  // override with any mode for the 1st tau
674  // and electron mode for the 2nd tau
675  //
676  jaki_.jak1 = 0;
677  jaki_.jak2 = 1;
678  Tauola::setSameParticleDecayMode( 0 ) ;
679  Tauola::setOppositeParticleDecayMode( 1 ) ;
680  return;
681  }
682 
683  if ( mdtau == 122 || mdtau == 222 )
684  {
685  // override with any mode for the 1st tau
686  // and muon mode for the 2nd tau
687  //
688  jaki_.jak1 = 0;
689  jaki_.jak2 = 2;
690  Tauola::setSameParticleDecayMode( 0 ) ;
691  Tauola::setOppositeParticleDecayMode( 2 ) ;
692  return;
693  }
694 
695  if ( mdtau == 140 || mdtau == 240 )
696  {
697  // override with pi+/- nutau mode for both tau's
698  //
699  jaki_.jak1 = 3;
700  jaki_.jak2 = 3;
701  Tauola::setSameParticleDecayMode( 3 ) ;
702  Tauola::setOppositeParticleDecayMode( 3 ) ;
703  return;
704  }
705 
706  if ( mdtau == 141 || mdtau == 241 )
707  {
708  // override with pi+/- nutau mode for the 1st tau
709  // and any mode for the 2nd tau
710  //
711  jaki_.jak1 = 3;
712  jaki_.jak2 = 0;
713  Tauola::setSameParticleDecayMode( 3 ) ;
714  Tauola::setOppositeParticleDecayMode( 0 ) ;
715  return;
716  }
717 
718  if ( mdtau == 142 || mdtau == 242 )
719  {
720  // override with any mode for the 1st tau
721  // and pi+/- nutau mode for 2nd tau
722  //
723  jaki_.jak1 = 0;
724  jaki_.jak2 = 3;
725  Tauola::setSameParticleDecayMode( 0 ) ;
726  Tauola::setOppositeParticleDecayMode( 3 ) ;
727  return;
728  }
729 
730  // OK, we come here for semi-inclusive modes
731  //
732 
733  // First of all, leptons and hadron modes sums
734  //
735  // re-scale branching ratios, just in case...
736  //
737  double sumBra = 0;
738 
739  // the number of decay modes is hardcoded at 22 because that's what it is right now in Tauola
740  // in the future, perhaps an asscess method would be useful - communicate to Tauola team...
741  //
742 
743  for ( int i=0; i<22; i++ )
744  {
745  sumBra += taubra_.gamprt[i];
746  }
747  if ( sumBra == 0. ) return ; // perhaps need to throw ?
748  for ( int i=0; i<22; i++ )
749  {
750  double newBra = taubra_.gamprt[i] / sumBra;
751  Tauola::setTauBr( i+1, newBra );
752  }
753  sumBra = 1.0;
754 
755  double sumLeptonBra = taubra_.gamprt[0] + taubra_.gamprt[1];
756  double sumHadronBra = sumBra - sumLeptonBra;
757 
758  for ( int i=0; i<2; i++ )
759  {
760  fLeptonModes.push_back( i+1 );
761  fScaledLeptonBrRatios.push_back( (taubra_.gamprt[i]/sumLeptonBra) );
762  }
763  for ( int i=2; i<22; i++ )
764  {
765  fHadronModes.push_back( i+1 );
766  fScaledHadronBrRatios.push_back( (taubra_.gamprt[i]/sumHadronBra) );
767  }
768 
769  fSelectDecayByEvent = true;
770  return;
771 
772 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > fScaledLeptonBrRatios
std::vector< int > fLeptonModes
std::vector< double > fScaledHadronBrRatios
std::vector< int > fHadronModes
struct @351 taubra_
int mdtau
Definition: TauolaWrapper.h:59
void gen::TauolaInterface::disablePolarization ( )
inline

Definition at line 75 of file TauolaInterface.h.

References fPolarization.

75 { fPolarization = false; return; }
void gen::TauolaInterface::enablePolarization ( )
inline

Definition at line 74 of file TauolaInterface.h.

References fPolarization.

74 { fPolarization = true; return; }
float TauolaInterface::flat ( void  )
private

Definition at line 476 of file TauolaInterface.cc.

References edm::hlt::Exception, fIsInitialized, fPSet, and fRandomEngine.

Referenced by gen::ranmar_(), selectLeptonic(), and gen::TauolappInterface_RandGetter().

477 {
478 
479  if ( !fPSet )
480  {
481  // throw
482  throw cms::Exception("TauolaInterfaceError")
483  << "Attempt to run random number generator of un-initialized Tauola\n"
484  << std::endl;
485  }
486 
487  if ( !fIsInitialized )
488  {
489  // throw
490  throw cms::Exception("TauolaInterfaceError")
491  << "Attempt to run random number generator of un-initialized Tauola\n"
492  << std::endl;
493  }
494 
495  return fRandomEngine->flat();
496 
497 }
CLHEP::HepRandomEngine * fRandomEngine
edm::ParameterSet * fPSet
TauolaInterface * TauolaInterface::getInstance ( )
static

Definition at line 370 of file TauolaInterface.cc.

References fInstance, and TauolaInterface().

Referenced by gen::ExternalDecayDriver::ExternalDecayDriver(), and gen::TauolappInterface_RandGetter().

371 {
372 
373  if ( fInstance == 0 ) fInstance = new TauolaInterface() ;
374  return fInstance;
375 
376 }
static TauolaInterface * fInstance
void TauolaInterface::init ( const edm::EventSetup es)

Definition at line 403 of file TauolaInterface.cc.

References decodeMDTAU(), edm::hlt::Exception, fIsInitialized, fMDTAU, fPDGs, fPDGTable, fPolarization, fPSet, edm::EventSetup::getData(), edm::ParameterSet::getParameter(), and gen::TauolappInterface_RandGetter().

Referenced by ParticleReplacerClass::beginRun(), and gen::ExternalDecayDriver::init().

404 {
405 
406  if ( fIsInitialized ) return; // do init only once
407 
408  if ( fPSet == 0 )
409  {
410 
411  throw cms::Exception("TauolaInterfaceError")
412  << "Attempt to initialize Tauola with an empty ParameterSet\n"
413  << std::endl;
414  }
415 
416  fIsInitialized = true;
417 
418  es.getData( fPDGTable ) ;
419 
420  Tauola::setDecayingParticle(15);
421  // --> ??? Tauola::setRadiation(false);
422 
423  // polarization switch
424  //
425  // fPolarization = fPSet->getParameter<bool>("UseTauolaPolarization") ? 1 : 0 ;
426  fPolarization = fPSet->getParameter<bool>("UseTauolaPolarization");
427 
428  // read tau decay mode switches
429  //
430  ParameterSet cards = fPSet->getParameter< ParameterSet >("InputCards");
431 
432  fMDTAU = cards.getParameter< int >( "mdtau" );
433 
434  if ( fMDTAU == 0 || fMDTAU == 1 )
435  {
436  Tauola::setSameParticleDecayMode( cards.getParameter< int >( "pjak1" ) ) ;
437  Tauola::setOppositeParticleDecayMode( cards.getParameter< int >( "pjak2" ) ) ;
438  }
439 
440  Tauola::setTauLifetime(0.0);
441  Tauola::spin_correlation.setAll(fPolarization);
442 
443  // some more options, copied over from an example
444  // - maybe will use later...
445  //
446  //Tauola::setEtaK0sPi(0,0,0); // switches to decay eta K0_S and pi0 1/0 on/off.
447  //
448 
449 //
450 // const HepPDT::ParticleData*
451 // PData = fPDGTable->particle(HepPDT::ParticleID( abs(Tauola::getDecayingParticle()) )) ;
452 // double lifetime = PData->lifetime().value();
453 // Tauola::setTauLifetime( lifetime );
454 
455  fPDGs.push_back( Tauola::getDecayingParticle() );
456 
457  Tauola::setRandomGenerator(&gen::TauolappInterface_RandGetter);
458  Tauola::initialize();
459 
460  Tauola::spin_correlation.setAll(fPolarization);// Tauola switches this on during Tauola::initialise(); so we add this here to keep it on/off
461 
462  // override decay modes if needs be
463  //
464  // we have to do it AFTER init because otherwises branching ratios are NOT filled in
465  //
466  if ( fMDTAU != 0 && fMDTAU != 1 )
467  {
468  decodeMDTAU( fMDTAU );
469  }
470 
471  Log::LogWarning(false);
472 
473  return;
474 }
T getParameter(std::string const &) const
void getData(T &iHolder) const
Definition: EventSetup.h:67
double TauolappInterface_RandGetter()
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
edm::ParameterSet * fPSet
std::vector< int > fPDGs
const std::vector<int>& gen::TauolaInterface::operatesOnParticles ( )
inline

Definition at line 77 of file TauolaInterface.h.

References fPDGs.

Referenced by gen::ExternalDecayDriver::init().

77 { return fPDGs; }
std::vector< int > fPDGs
void TauolaInterface::selectDecayByMDTAU ( )
private

Definition at line 774 of file TauolaInterface.cc.

References fMDTAU, alignBH_cfg::mode, hitfit::return, selectHadronic(), and selectLeptonic().

Referenced by decay().

775 {
776 
777 
778  if ( fMDTAU == 100 || fMDTAU == 200 )
779  {
780  int mode = selectLeptonic();
781  jaki_.jak1 = mode;
782  Tauola::setSameParticleDecayMode( mode );
783  mode = selectLeptonic();
784  jaki_.jak2 = mode;
785  Tauola::setOppositeParticleDecayMode( mode );
786  return ;
787  }
788 
789  int modeL = selectLeptonic();
790  int modeH = selectHadronic();
791 
792  if ( fMDTAU == 110 || fMDTAU == 210 )
793  {
794  jaki_.jak1 = modeL;
795  jaki_.jak2 = 0;
796  Tauola::setSameParticleDecayMode( modeL );
797  Tauola::setOppositeParticleDecayMode( 0 );
798  return ;
799  }
800 
801  if ( fMDTAU == 120 || fMDTAU == 22 )
802  {
803  jaki_.jak1 = 0;
804  jaki_.jak2 = modeL;
805  Tauola::setSameParticleDecayMode( 0 );
806  Tauola::setOppositeParticleDecayMode( modeL );
807  return;
808  }
809 
810  if ( fMDTAU == 114 || fMDTAU == 214 )
811  {
812  jaki_.jak1 = modeL;
813  jaki_.jak2 = modeH;
814  Tauola::setSameParticleDecayMode( modeL );
815  Tauola::setOppositeParticleDecayMode( modeH );
816  return;
817  }
818 
819  if ( fMDTAU == 124 || fMDTAU == 224 )
820  {
821  jaki_.jak1 = modeH;
822  jaki_.jak2 = modeL;
823  Tauola::setSameParticleDecayMode( modeH );
824  Tauola::setOppositeParticleDecayMode( modeL );
825  return;
826  }
827 
828  if ( fMDTAU == 115 || fMDTAU == 215 )
829  {
830  jaki_.jak1 = 1;
831  jaki_.jak2 = modeH;
832  Tauola::setSameParticleDecayMode( 1 );
833  Tauola::setOppositeParticleDecayMode( modeH );
834  return;
835  }
836 
837  if ( fMDTAU == 125 || fMDTAU == 225 )
838  {
839  jaki_.jak1 = modeH;
840  jaki_.jak2 = 1;
841  Tauola::setSameParticleDecayMode( modeH );
842  Tauola::setOppositeParticleDecayMode( 1 );
843  return;
844  }
845 
846  if ( fMDTAU == 116 || fMDTAU == 216 )
847  {
848  jaki_.jak1 = 2;
849  jaki_.jak2 = modeH;
850  Tauola::setSameParticleDecayMode( 2 );
851  Tauola::setOppositeParticleDecayMode( modeH );
852  return;
853  }
854 
855  if ( fMDTAU == 126 || fMDTAU == 226 )
856  {
857  jaki_.jak1 = modeH;
858  jaki_.jak2 = 2;
859  Tauola::setSameParticleDecayMode( modeH );
860  Tauola::setOppositeParticleDecayMode( 2 );
861  return;
862  }
863 
864  if ( fMDTAU == 130 || fMDTAU == 230 )
865  {
866  jaki_.jak1 = modeH;
867  jaki_.jak2 = selectHadronic();
868  Tauola::setSameParticleDecayMode( modeH );
869  Tauola::setOppositeParticleDecayMode( jaki_.jak2 );
870  return;
871  }
872 
873  if ( fMDTAU == 131 || fMDTAU == 231 )
874  {
875  jaki_.jak1 = modeH;
876  jaki_.jak2 = 0;
877  Tauola::setSameParticleDecayMode( modeH );
878  Tauola::setOppositeParticleDecayMode( 0 );
879  return;
880  }
881 
882  if ( fMDTAU == 132 || fMDTAU == 232 )
883  {
884  jaki_.jak1 = 0;
885  jaki_.jak2 = modeH;
886  Tauola::setSameParticleDecayMode( 0 );
887  Tauola::setOppositeParticleDecayMode( modeH );
888  return;
889  }
890 
891  // unlikely that we get here on unknown mdtau
892  // - there's a protection earlier
893  // but if we do, just set defaults
894  // probably need to spit a warning...
895  //
896  Tauola::setSameParticleDecayMode( 0 );
897  Tauola::setOppositeParticleDecayMode( 0 );
898 
899  return;
900 
901 
902 }
int TauolaInterface::selectHadronic ( )
private

Definition at line 921 of file TauolaInterface.cc.

References fHadronModes, fScaledHadronBrRatios, i, mix_2012_Summer_inTimeOnly_cff::prob, and gen::ranmar_().

Referenced by selectDecayByMDTAU().

922 {
923 
924  float prob = 0.;
925  int len = 1;
926  ranmar_(&prob,&len);
927 
928  double sumBra = fScaledHadronBrRatios[0];
929  if ( prob > 0. && prob <= sumBra )
930  {
931  return fHadronModes[0];
932  }
933  else
934  {
935  int NN = fScaledHadronBrRatios.size();
936  for ( int i=1; i<NN; i++ )
937  {
938  if ( prob > sumBra && prob <= (sumBra+fScaledHadronBrRatios[i]) )
939  {
940  return fHadronModes[i];
941  }
942  sumBra += fScaledHadronBrRatios[i];
943  }
944  }
945 
946  return 0;
947 
948 }
int i
Definition: DBlmapReader.cc:9
void ranmar_(float *rvec, int *lenv)
std::vector< double > fScaledHadronBrRatios
std::vector< int > fHadronModes
int TauolaInterface::selectLeptonic ( )
private

Definition at line 904 of file TauolaInterface.cc.

References flat(), fScaledLeptonBrRatios, and mix_2012_Summer_inTimeOnly_cff::prob.

Referenced by selectDecayByMDTAU().

905 {
906 
907  float prob = flat();
908 
909  if ( prob > 0. && prob <= fScaledLeptonBrRatios[0] )
910  {
911  return 1;
912  }
913  else if ( prob > fScaledLeptonBrRatios[1] && prob <=1. )
914  {
915  return 2;
916  }
917 
918  return 0;
919 }
std::vector< double > fScaledLeptonBrRatios
void TauolaInterface::setPSet ( const edm::ParameterSet pset)

Definition at line 387 of file TauolaInterface.cc.

References edm::hlt::Exception, and fPSet.

Referenced by gen::ExternalDecayDriver::ExternalDecayDriver(), ParticleReplacerClass::ParticleReplacerClass(), and ParticleReplacerParticleGun::ParticleReplacerParticleGun().

388 {
389 
390  if ( fPSet != 0 )
391  {
392  throw cms::Exception("TauolaInterfaceError")
393  << "Attempt to override Tauola an existing ParameterSet\n"
394  << std::endl;
395  }
396 
397  fPSet = new ParameterSet(pset);
398 
399  return;
400 
401 }
edm::ParameterSet * fPSet
void TauolaInterface::statistics ( )

Definition at line 599 of file TauolaInterface.cc.

Referenced by ParticleReplacerClass::endJob(), and gen::ExternalDecayDriver::statistics().

600 {
601  return;
602 }

Friends And Related Function Documentation

void gen::ranmar_ ( float *  rvec,
int *  lenv 
)
friend

Member Data Documentation

std::vector<int> gen::TauolaInterface::fHadronModes
private

Definition at line 107 of file TauolaInterface.h.

Referenced by decodeMDTAU(), and selectHadronic().

TauolaInterface * TauolaInterface::fInstance = 0
staticprivate

Definition at line 111 of file TauolaInterface.h.

Referenced by getInstance(), and ~TauolaInterface().

bool gen::TauolaInterface::fIsInitialized
private

Definition at line 102 of file TauolaInterface.h.

Referenced by decay(), flat(), and init().

std::vector<int> gen::TauolaInterface::fLeptonModes
private

Definition at line 106 of file TauolaInterface.h.

Referenced by decodeMDTAU().

int gen::TauolaInterface::fMDTAU
private

Definition at line 104 of file TauolaInterface.h.

Referenced by init(), and selectDecayByMDTAU().

std::vector<int> gen::TauolaInterface::fPDGs
private

Definition at line 98 of file TauolaInterface.h.

Referenced by init(), and operatesOnParticles().

edm::ESHandle<HepPDT::ParticleDataTable> gen::TauolaInterface::fPDGTable
private

Definition at line 100 of file TauolaInterface.h.

Referenced by decay(), and init().

bool gen::TauolaInterface::fPolarization
private

Definition at line 99 of file TauolaInterface.h.

Referenced by disablePolarization(), enablePolarization(), and init().

edm::ParameterSet* gen::TauolaInterface::fPSet
private

Definition at line 101 of file TauolaInterface.h.

Referenced by flat(), init(), setPSet(), and ~TauolaInterface().

CLHEP::HepRandomEngine* gen::TauolaInterface::fRandomEngine
private

Definition at line 97 of file TauolaInterface.h.

Referenced by flat(), and TauolaInterface().

std::vector<double> gen::TauolaInterface::fScaledHadronBrRatios
private

Definition at line 109 of file TauolaInterface.h.

Referenced by decodeMDTAU(), and selectHadronic().

std::vector<double> gen::TauolaInterface::fScaledLeptonBrRatios
private

Definition at line 108 of file TauolaInterface.h.

Referenced by decodeMDTAU(), and selectLeptonic().

bool gen::TauolaInterface::fSelectDecayByEvent
private

Definition at line 105 of file TauolaInterface.h.

Referenced by decay(), and decodeMDTAU().