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::TauolappInterface Class Reference

#include <TauolappInterface.h>

Inheritance diagram for gen::TauolappInterface:
gen::TauolaInterfaceBase

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 Setup ()
 
void statistics ()
 
 TauolappInterface ()
 
 TauolappInterface (const edm::ParameterSet &)
 
 ~TauolappInterface ()
 
- Public Member Functions inherited from gen::TauolaInterfaceBase
virtual void SetDecayRandomEngine (CLHEP::HepRandomEngine *decayRandomEngine)
 
 TauolaInterfaceBase ()
 
 TauolaInterfaceBase (const edm::ParameterSet &)
 
virtual ~TauolaInterfaceBase ()
 

Static Public Member Functions

static TauolappInterfacegetInstance ()
 

Private Member Functions

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

Private Attributes

std::vector< int > fHadronModes
 
bool fIsInitialized
 
std::vector< int > fLeptonModes
 
int fMDTAU
 
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 TauolappInterfacefInstance = 0
 

Friends

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

Additional Inherited Members

- Protected Attributes inherited from gen::TauolaInterfaceBase
std::vector< int > fPDGs
 

Detailed Description

Definition at line 31 of file TauolappInterface.h.

Constructor & Destructor Documentation

TauolappInterface::TauolappInterface ( )

Definition at line 47 of file TauolappInterface.cc.

47  {
48  Setup();
49 }
TauolappInterface::TauolappInterface ( const edm::ParameterSet pset)

Definition at line 51 of file TauolappInterface.cc.

51  {
52  Setup();
53  setPSet(pset);
54 }
void setPSet(const edm::ParameterSet &)
TauolappInterface::~TauolappInterface ( )

Definition at line 115 of file TauolappInterface.cc.

116 {
117 
118  if ( fPSet != 0 ) delete fPSet;
119  if ( fInstance == this ) fInstance = 0;
120 
121 }
edm::ParameterSet * fPSet
static TauolappInterface * fInstance

Member Function Documentation

HepMC::GenEvent * TauolappInterface::decay ( HepMC::GenEvent *  evt)
virtual

Reimplemented from gen::TauolaInterfaceBase.

Definition at line 235 of file TauolappInterface.cc.

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

236 {
237 
238  if ( !fIsInitialized ) return evt;
239 
240  int NPartBefore = evt->particles_size();
241  int NVtxBefore = evt->vertices_size();
242 
243  // what do we do if Hep::GenEvent size is larger than 10K ???
244  // Tauola (& Photos, BTW) can only handle up to 10K via HEPEVT,
245  // and in case of CMS, it's only up to 4K !!!
246  //
247  // if ( NPartBefore > 10000 ) return evt;
248  //
249 
250  // override decay mode if needs be
251  if ( fSelectDecayByEvent )
252  {
254  }
255 
256  //construct tmp TAUOLA event
257  //
258  auto * t_event = new TauolaHepMCEvent(evt);
259 
260  // another option: if one lets Pythia or another master gen to decay taus,
261  // we have to undecay them first
262  // t_event->undecayTaus();
263 
264  // run Tauola on the tmp event - HepMC::GenEvernt will be MODIFIED !!!
265  //
266  t_event->decayTaus();
267 
268  // delet tmp Tauola event
269  //
270  delete t_event;
271 
272  // do we also need to apply the lifetime and vtx position shift ???
273  // (see TauolappInterface, for example)
274  //
275  // NOTE: the procedure ASSYMES that vertex barcoding is COUNTIUOUS/SEQUENTIAL,
276  // and that the abs(barcode) corresponds to vertex "plain indexing"
277  //
278  for ( int iv=NVtxBefore+1; iv<=evt->vertices_size(); iv++ )
279  {
280  HepMC::GenVertex* GenVtx = evt->barcode_to_vertex(-iv);
281  HepMC::GenParticle* GenPart = *(GenVtx->particles_in_const_begin());
282  HepMC::GenVertex* ProdVtx = GenPart->production_vertex();
283  HepMC::FourVector PMom = GenPart->momentum();
284  double mass = GenPart->generated_mass();
285  const HepPDT::ParticleData*
286  PData = fPDGTable->particle(HepPDT::ParticleID(abs(GenPart->pdg_id()))) ;
287  double lifetime = PData->lifetime().value();
288  float prob = 0.;
289  int length=1;
290  ranmar_(&prob,&length);
291  double ct = -lifetime * std::log(prob);
292  double VxDec = GenVtx->position().x();
293  VxDec += ct * (PMom.px()/mass);
294  VxDec += ProdVtx->position().x();
295  double VyDec = GenVtx->position().y();
296  VyDec += ct * (PMom.py()/mass);
297  VyDec += ProdVtx->position().y();
298  double VzDec = GenVtx->position().z();
299  VzDec += ct * (PMom.pz()/mass);
300  VzDec += ProdVtx->position().z();
301  double VtDec = GenVtx->position().t();
302  VtDec += ct * (PMom.e()/mass);
303  VtDec += ProdVtx->position().t();
304  GenVtx->set_position( HepMC::FourVector(VxDec,VyDec,VzDec,VtDec) );
305  //
306  // now find decay products with funky barcode, weed out and replace with clones of sensible barcode
307  // we can NOT change the barcode while iterating, because iterators do depend on the barcoding
308  // thus we have to take a 2-step procedure
309  //
310  std::vector<int> BCodes;
311  BCodes.clear();
312  for (HepMC::GenVertex::particle_iterator pitr= GenVtx->particles_begin(HepMC::children);
313  pitr != GenVtx->particles_end(HepMC::children); ++pitr)
314  {
315  if ( (*pitr)->barcode() > 10000 )
316  {
317  BCodes.push_back( (*pitr)->barcode() );
318  }
319  }
320  if ( BCodes.size() > 0 )
321  {
322  for ( size_t ibc=0; ibc<BCodes.size(); ibc++ )
323  {
324  HepMC::GenParticle* p1 = evt->barcode_to_particle( BCodes[ibc] );
325  int nbc = p1->barcode() - 10000 + NPartBefore;
326  p1->suggest_barcode( nbc );
327  }
328  }
329  }
330 
331  return evt;
332 
333 }
#define abs(x)
Definition: mlp_lapack.h:159
void ranmar_(float *rvec, int *lenv)
HepPDT::ParticleData ParticleData
double p1[4]
Definition: TauolaWrapper.h:89
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
void TauolappInterface::decodeMDTAU ( int  mdtau)
private

Definition at line 340 of file TauolappInterface.cc.

References i, hitfit::return, and taubra_.

341 {
342 
343  // Note-1:
344  // I have to hack the common block directly because set<...>DecayMode(...)
345  // only changes it in the Tauola++ instance but does NOT passes it over
346  // to the Fortran core - this it does only one, via initialize() stuff...
347  //
348  // So I'll do both ways of settings, just for consistency...
349  // but I probably need to communicate it to the Tauola(++) team...
350  //
351 
352  // Note-2:
353  // originally, the 1xx settings are meant for tau's from hard event,
354  // and the 2xx settings are for any tau in the event record;
355  //
356  // later one, we'll have to take this into account...
357  // but first I'll have to sort out what happens in the 1xx case
358  // to tau's coming outside of hard event (if any in the record)
359  //
360 
361  if ( mdtau == 101 || mdtau == 201 )
362  {
363  // override with electron mode for both tau's
364  //
365  jaki_.jak1 = 1;
366  jaki_.jak2 = 1;
367  Tauola::setSameParticleDecayMode( 1 ) ;
368  Tauola::setOppositeParticleDecayMode( 1 ) ;
369  return;
370  }
371 
372  if ( mdtau == 102 || mdtau == 202 )
373  {
374  // override with muon mode for both tau's
375  //
376  jaki_.jak1 = 2;
377  jaki_.jak2 = 2;
378  Tauola::setSameParticleDecayMode( 2 ) ;
379  Tauola::setOppositeParticleDecayMode( 2 ) ;
380  return;
381  }
382 
383  if ( mdtau == 111 || mdtau == 211 )
384  {
385  // override with electron mode for 1st tau
386  // and any mode for 2nd tau
387  //
388  jaki_.jak1 = 1;
389  jaki_.jak2 = 0;
390  Tauola::setSameParticleDecayMode( 1 ) ;
391  Tauola::setOppositeParticleDecayMode( 0 ) ;
392  return;
393  }
394 
395  if ( mdtau == 112 || mdtau == 212 )
396  {
397  // override with muon mode for the 1st tau
398  // and any mode for the 2nd tau
399  //
400  jaki_.jak1 = 2;
401  jaki_.jak2 = 0;
402  Tauola::setSameParticleDecayMode( 2 ) ;
403  Tauola::setOppositeParticleDecayMode( 0 ) ;
404  return;
405  }
406 
407  if ( mdtau == 121 || mdtau == 221 )
408  {
409  // override with any mode for the 1st tau
410  // and electron mode for the 2nd tau
411  //
412  jaki_.jak1 = 0;
413  jaki_.jak2 = 1;
414  Tauola::setSameParticleDecayMode( 0 ) ;
415  Tauola::setOppositeParticleDecayMode( 1 ) ;
416  return;
417  }
418 
419  if ( mdtau == 122 || mdtau == 222 )
420  {
421  // override with any mode for the 1st tau
422  // and muon mode for the 2nd tau
423  //
424  jaki_.jak1 = 0;
425  jaki_.jak2 = 2;
426  Tauola::setSameParticleDecayMode( 0 ) ;
427  Tauola::setOppositeParticleDecayMode( 2 ) ;
428  return;
429  }
430 
431  if ( mdtau == 140 || mdtau == 240 )
432  {
433  // override with pi+/- nutau mode for both tau's
434  //
435  jaki_.jak1 = 3;
436  jaki_.jak2 = 3;
437  Tauola::setSameParticleDecayMode( 3 ) ;
438  Tauola::setOppositeParticleDecayMode( 3 ) ;
439  return;
440  }
441 
442  if ( mdtau == 141 || mdtau == 241 )
443  {
444  // override with pi+/- nutau mode for the 1st tau
445  // and any mode for the 2nd tau
446  //
447  jaki_.jak1 = 3;
448  jaki_.jak2 = 0;
449  Tauola::setSameParticleDecayMode( 3 ) ;
450  Tauola::setOppositeParticleDecayMode( 0 ) ;
451  return;
452  }
453 
454  if ( mdtau == 142 || mdtau == 242 )
455  {
456  // override with any mode for the 1st tau
457  // and pi+/- nutau mode for 2nd tau
458  //
459  jaki_.jak1 = 0;
460  jaki_.jak2 = 3;
461  Tauola::setSameParticleDecayMode( 0 ) ;
462  Tauola::setOppositeParticleDecayMode( 3 ) ;
463  return;
464  }
465 
466  // OK, we come here for semi-inclusive modes
467  //
468 
469  // First of all, leptons and hadron modes sums
470  //
471  // re-scale branching ratios, just in case...
472  //
473  double sumBra = 0;
474 
475  // the number of decay modes is hardcoded at 22 because that's what it is right now in Tauola
476  // in the future, perhaps an asscess method would be useful - communicate to Tauola team...
477  //
478 
479  for ( int i=0; i<22; i++ )
480  {
481  sumBra += taubra_.gamprt[i];
482  }
483  if ( sumBra == 0. ) return ; // perhaps need to throw ?
484  for ( int i=0; i<22; i++ )
485  {
486  double newBra = taubra_.gamprt[i] / sumBra;
487  Tauola::setTauBr( i+1, newBra );
488  }
489  sumBra = 1.0;
490 
491  double sumLeptonBra = taubra_.gamprt[0] + taubra_.gamprt[1];
492  double sumHadronBra = sumBra - sumLeptonBra;
493 
494  for ( int i=0; i<2; i++ )
495  {
496  fLeptonModes.push_back( i+1 );
497  fScaledLeptonBrRatios.push_back( (taubra_.gamprt[i]/sumLeptonBra) );
498  }
499  for ( int i=2; i<22; i++ )
500  {
501  fHadronModes.push_back( i+1 );
502  fScaledHadronBrRatios.push_back( (taubra_.gamprt[i]/sumHadronBra) );
503  }
504 
505  fSelectDecayByEvent = true;
506  return;
507 
508 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > fScaledHadronBrRatios
struct @401 taubra_
std::vector< int > fLeptonModes
std::vector< double > fScaledLeptonBrRatios
std::vector< int > fHadronModes
int mdtau
Definition: TauolaWrapper.h:59
void gen::TauolappInterface::disablePolarization ( )
inlinevirtual

Reimplemented from gen::TauolaInterfaceBase.

Definition at line 43 of file TauolappInterface.h.

References fPolarization.

43 { fPolarization = false; return; }
void gen::TauolappInterface::enablePolarization ( )
inlinevirtual

Reimplemented from gen::TauolaInterfaceBase.

Definition at line 42 of file TauolappInterface.h.

References fPolarization.

42 { fPolarization = true; return; }
float TauolappInterface::flat ( void  )
private

Definition at line 212 of file TauolappInterface.cc.

References edm::hlt::Exception.

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

213 {
214 
215  if ( !fPSet )
216  {
217  // throw
218  throw cms::Exception("TauolappInterfaceError")
219  << "Attempt to run random number generator of un-initialized Tauola\n"
220  << std::endl;
221  }
222 
223  if ( !fIsInitialized )
224  {
225  // throw
226  throw cms::Exception("TauolappInterfaceError")
227  << "Attempt to run random number generator of un-initialized Tauola\n"
228  << std::endl;
229  }
230 
231  return fRandomEngine->flat();
232 
233 }
edm::ParameterSet * fPSet
CLHEP::HepRandomEngine * fRandomEngine
TauolappInterface * TauolappInterface::getInstance ( )
static

Definition at line 106 of file TauolappInterface.cc.

Referenced by gen::TauolappInterface_RandGetter().

107 {
108 
109  if ( fInstance == 0 ) fInstance = new TauolappInterface() ;
110  return fInstance;
111 
112 }
static TauolappInterface * fInstance
void TauolappInterface::init ( const edm::EventSetup es)
virtual

Reimplemented from gen::TauolaInterfaceBase.

Definition at line 139 of file TauolappInterface.cc.

References edm::hlt::Exception, edm::EventSetup::getData(), edm::ParameterSet::getParameter(), and gen::TauolappInterface_RandGetter().

140 {
141 
142  if ( fIsInitialized ) return; // do init only once
143 
144  if ( fPSet == 0 )
145  {
146 
147  throw cms::Exception("TauolappInterfaceError")
148  << "Attempt to initialize Tauola with an empty ParameterSet\n"
149  << std::endl;
150  }
151 
152  fIsInitialized = true;
153 
154  es.getData( fPDGTable ) ;
155 
156  Tauola::setDecayingParticle(15);
157  // --> ??? Tauola::setRadiation(false);
158 
159  // polarization switch
160  //
161  // fPolarization = fPSet->getParameter<bool>("UseTauolaPolarization") ? 1 : 0 ;
162  fPolarization = fPSet->getParameter<bool>("UseTauolaPolarization");
163 
164  // read tau decay mode switches
165  //
166  ParameterSet cards = fPSet->getParameter< ParameterSet >("InputCards");
167 
168  fMDTAU = cards.getParameter< int >( "mdtau" );
169 
170  if ( fMDTAU == 0 || fMDTAU == 1 )
171  {
172  Tauola::setSameParticleDecayMode( cards.getParameter< int >( "pjak1" ) ) ;
173  Tauola::setOppositeParticleDecayMode( cards.getParameter< int >( "pjak2" ) ) ;
174  }
175 
176  Tauola::setTauLifetime(0.0);
177  Tauola::spin_correlation.setAll(fPolarization);
178 
179  // some more options, copied over from an example
180  // - maybe will use later...
181  //
182  //Tauola::setEtaK0sPi(0,0,0); // switches to decay eta K0_S and pi0 1/0 on/off.
183  //
184 
185 //
186 // const HepPDT::ParticleData*
187 // PData = fPDGTable->particle(HepPDT::ParticleID( abs(Tauola::getDecayingParticle()) )) ;
188 // double lifetime = PData->lifetime().value();
189 // Tauola::setTauLifetime( lifetime );
190 
191  fPDGs.push_back( Tauola::getDecayingParticle() );
192 
193  Tauola::setRandomGenerator(&gen::TauolappInterface_RandGetter);
194  Tauola::initialize();
195 
196  Tauola::spin_correlation.setAll(fPolarization);// Tauola switches this on during Tauola::initialise(); so we add this here to keep it on/off
197 
198  // override decay modes if needs be
199  //
200  // we have to do it AFTER init because otherwises branching ratios are NOT filled in
201  //
202  if ( fMDTAU != 0 && fMDTAU != 1 )
203  {
204  decodeMDTAU( fMDTAU );
205  }
206 
207  Log::LogWarning(false);
208 
209  return;
210 }
T getParameter(std::string const &) const
edm::ParameterSet * fPSet
void getData(T &iHolder) const
Definition: EventSetup.h:67
double TauolappInterface_RandGetter()
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
const std::vector<int>& gen::TauolappInterface::operatesOnParticles ( )
inlinevirtual

Reimplemented from gen::TauolaInterfaceBase.

Definition at line 45 of file TauolappInterface.h.

References gen::TauolaInterfaceBase::fPDGs.

45 { return fPDGs; }
void TauolappInterface::selectDecayByMDTAU ( )
private

Definition at line 510 of file TauolappInterface.cc.

References alignBH_cfg::mode, and hitfit::return.

511 {
512 
513 
514  if ( fMDTAU == 100 || fMDTAU == 200 )
515  {
516  int mode = selectLeptonic();
517  jaki_.jak1 = mode;
518  Tauola::setSameParticleDecayMode( mode );
519  mode = selectLeptonic();
520  jaki_.jak2 = mode;
521  Tauola::setOppositeParticleDecayMode( mode );
522  return ;
523  }
524 
525  int modeL = selectLeptonic();
526  int modeH = selectHadronic();
527 
528  if ( fMDTAU == 110 || fMDTAU == 210 )
529  {
530  jaki_.jak1 = modeL;
531  jaki_.jak2 = 0;
532  Tauola::setSameParticleDecayMode( modeL );
533  Tauola::setOppositeParticleDecayMode( 0 );
534  return ;
535  }
536 
537  if ( fMDTAU == 120 || fMDTAU == 22 )
538  {
539  jaki_.jak1 = 0;
540  jaki_.jak2 = modeL;
541  Tauola::setSameParticleDecayMode( 0 );
542  Tauola::setOppositeParticleDecayMode( modeL );
543  return;
544  }
545 
546  if ( fMDTAU == 114 || fMDTAU == 214 )
547  {
548  jaki_.jak1 = modeL;
549  jaki_.jak2 = modeH;
550  Tauola::setSameParticleDecayMode( modeL );
551  Tauola::setOppositeParticleDecayMode( modeH );
552  return;
553  }
554 
555  if ( fMDTAU == 124 || fMDTAU == 224 )
556  {
557  jaki_.jak1 = modeH;
558  jaki_.jak2 = modeL;
559  Tauola::setSameParticleDecayMode( modeH );
560  Tauola::setOppositeParticleDecayMode( modeL );
561  return;
562  }
563 
564  if ( fMDTAU == 115 || fMDTAU == 215 )
565  {
566  jaki_.jak1 = 1;
567  jaki_.jak2 = modeH;
568  Tauola::setSameParticleDecayMode( 1 );
569  Tauola::setOppositeParticleDecayMode( modeH );
570  return;
571  }
572 
573  if ( fMDTAU == 125 || fMDTAU == 225 )
574  {
575  jaki_.jak1 = modeH;
576  jaki_.jak2 = 1;
577  Tauola::setSameParticleDecayMode( modeH );
578  Tauola::setOppositeParticleDecayMode( 1 );
579  return;
580  }
581 
582  if ( fMDTAU == 116 || fMDTAU == 216 )
583  {
584  jaki_.jak1 = 2;
585  jaki_.jak2 = modeH;
586  Tauola::setSameParticleDecayMode( 2 );
587  Tauola::setOppositeParticleDecayMode( modeH );
588  return;
589  }
590 
591  if ( fMDTAU == 126 || fMDTAU == 226 )
592  {
593  jaki_.jak1 = modeH;
594  jaki_.jak2 = 2;
595  Tauola::setSameParticleDecayMode( modeH );
596  Tauola::setOppositeParticleDecayMode( 2 );
597  return;
598  }
599 
600  if ( fMDTAU == 130 || fMDTAU == 230 )
601  {
602  jaki_.jak1 = modeH;
603  jaki_.jak2 = selectHadronic();
604  Tauola::setSameParticleDecayMode( modeH );
605  Tauola::setOppositeParticleDecayMode( jaki_.jak2 );
606  return;
607  }
608 
609  if ( fMDTAU == 131 || fMDTAU == 231 )
610  {
611  jaki_.jak1 = modeH;
612  jaki_.jak2 = 0;
613  Tauola::setSameParticleDecayMode( modeH );
614  Tauola::setOppositeParticleDecayMode( 0 );
615  return;
616  }
617 
618  if ( fMDTAU == 132 || fMDTAU == 232 )
619  {
620  jaki_.jak1 = 0;
621  jaki_.jak2 = modeH;
622  Tauola::setSameParticleDecayMode( 0 );
623  Tauola::setOppositeParticleDecayMode( modeH );
624  return;
625  }
626 
627  // unlikely that we get here on unknown mdtau
628  // - there's a protection earlier
629  // but if we do, just set defaults
630  // probably need to spit a warning...
631  //
632  Tauola::setSameParticleDecayMode( 0 );
633  Tauola::setOppositeParticleDecayMode( 0 );
634 
635  return;
636 
637 
638 }
int TauolappInterface::selectHadronic ( )
private

Definition at line 657 of file TauolappInterface.cc.

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

658 {
659 
660  float prob = 0.;
661  int len = 1;
662  ranmar_(&prob,&len);
663 
664  double sumBra = fScaledHadronBrRatios[0];
665  if ( prob > 0. && prob <= sumBra )
666  {
667  return fHadronModes[0];
668  }
669  else
670  {
671  int NN = fScaledHadronBrRatios.size();
672  for ( int i=1; i<NN; i++ )
673  {
674  if ( prob > sumBra && prob <= (sumBra+fScaledHadronBrRatios[i]) )
675  {
676  return fHadronModes[i];
677  }
678  sumBra += fScaledHadronBrRatios[i];
679  }
680  }
681 
682  return 0;
683 
684 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > fScaledHadronBrRatios
void ranmar_(float *rvec, int *lenv)
std::vector< int > fHadronModes
int TauolappInterface::selectLeptonic ( )
private

Definition at line 640 of file TauolappInterface.cc.

References mix_2012_Summer_inTimeOnly_cff::prob.

641 {
642 
643  float prob = flat();
644 
645  if ( prob > 0. && prob <= fScaledLeptonBrRatios[0] )
646  {
647  return 1;
648  }
649  else if ( prob > fScaledLeptonBrRatios[1] && prob <=1. )
650  {
651  return 2;
652  }
653 
654  return 0;
655 }
std::vector< double > fScaledLeptonBrRatios
void TauolappInterface::setPSet ( const edm::ParameterSet pset)

Definition at line 123 of file TauolappInterface.cc.

References edm::hlt::Exception.

124 {
125 
126  if ( fPSet != 0 )
127  {
128  throw cms::Exception("TauolappInterfaceError")
129  << "Attempt to override Tauola an existing ParameterSet\n"
130  << std::endl;
131  }
132 
133  fPSet = new ParameterSet(pset);
134 
135  return;
136 
137 }
edm::ParameterSet * fPSet
void TauolappInterface::Setup ( )

Definition at line 56 of file TauolappInterface.cc.

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

56  {
57  fInstance=this;
58  fPolarization=false;
59  fPSet=0;
60  fIsInitialized=false; fMDTAU=-1;
61  fSelectDecayByEvent=false;
62 
64  if(!rng.isAvailable()) {
65  throw cms::Exception("Configuration")
66  << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n"
67  "which appears to be absent. Please add that service to your configuration\n"
68  "or remove the modules that require it." << std::endl;
69  }
70 
71  fRandomEngine = &rng->getEngine();
72 
73 }
edm::ParameterSet * fPSet
bool isAvailable() const
Definition: Service.h:47
static TauolappInterface * fInstance
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
void TauolappInterface::statistics ( )
virtual

Reimplemented from gen::TauolaInterfaceBase.

Definition at line 335 of file TauolappInterface.cc.

336 {
337  return;
338 }

Friends And Related Function Documentation

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

Member Data Documentation

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

Definition at line 74 of file TauolappInterface.h.

TauolappInterface * TauolappInterface::fInstance = 0
staticprivate

Definition at line 78 of file TauolappInterface.h.

bool gen::TauolappInterface::fIsInitialized
private

Definition at line 69 of file TauolappInterface.h.

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

Definition at line 73 of file TauolappInterface.h.

int gen::TauolappInterface::fMDTAU
private

Definition at line 71 of file TauolappInterface.h.

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

Definition at line 67 of file TauolappInterface.h.

bool gen::TauolappInterface::fPolarization
private

Definition at line 66 of file TauolappInterface.h.

Referenced by disablePolarization(), and enablePolarization().

edm::ParameterSet* gen::TauolappInterface::fPSet
private

Definition at line 68 of file TauolappInterface.h.

CLHEP::HepRandomEngine* gen::TauolappInterface::fRandomEngine
private

Definition at line 65 of file TauolappInterface.h.

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

Definition at line 76 of file TauolappInterface.h.

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

Definition at line 75 of file TauolappInterface.h.

bool gen::TauolappInterface::fSelectDecayByEvent
private

Definition at line 72 of file TauolappInterface.h.