CMS 3D CMS Logo

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

#include <ExternalDecayDriver.h>

Public Member Functions

HepMC::GenEvent * decay (HepMC::GenEvent *)
 
 ExternalDecayDriver (const edm::ParameterSet &)
 
void init (const edm::EventSetup &)
 
const std::vector< int > & operatesOnParticles ()
 
const std::vector< std::string > & specialSettings ()
 
void statistics () const
 
 ~ExternalDecayDriver ()
 

Private Attributes

EvtGenInterfacefEvtGenInterface
 
bool fIsInitialized
 
std::vector< int > fPDGs
 
PhotosInterfacefPhotosInterface
 
std::vector< std::string > fSpecialSettings
 
TauolaInterfacefTauolaInterface
 

Detailed Description

Definition at line 18 of file ExternalDecayDriver.h.

Constructor & Destructor Documentation

ExternalDecayDriver::ExternalDecayDriver ( const edm::ParameterSet pset)

Definition at line 21 of file ExternalDecayDriver.cc.

References gen::PhotosInterface::avoidTauLeptonicDecays(), gen::PhotosInterface::configureOnlyFor(), decayRandomEngine, edm::hlt::Exception, fEvtGenInterface, fPhotosInterface, fTauolaInterface, gen::TauolaInterface::getInstance(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gen::TauolaInterface::setPSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

22  : fIsInitialized(false),
26 {
27 
28  std::vector<std::string> extGenNames =
29  pset.getParameter< std::vector<std::string> >("parameterSets");
30 
32  if(!rng.isAvailable()) {
33  throw cms::Exception("Configuration")
34  << "The RandomNumberProducer module requires the RandomNumberGeneratorService\n"
35  "which appears to be absent. Please add that service to your configuration\n"
36  "or remove the modules that require it." << std::endl;
37  }
38  decayRandomEngine = &rng->getEngine();
39 
40  for (unsigned int ip=0; ip<extGenNames.size(); ++ip )
41  {
42  std::string curSet = extGenNames[ip];
43  if ( curSet == "EvtGen" )
44  {
46  }
47  else if ( curSet == "Tauola" )
48  {
49  // this is for old tauola27 (+pretauola)
50  //
51  // --> fTauolaInterface = new gen::TauolaInterface(pset.getUntrackedParameter< ParameterSet >(curSet));
52  //
53  // for tauola++, here it should be something like:
54  //
60  }
61  else if ( curSet == "Photos" )
62  {
64  }
65 
66  }
67 
68 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PhotosInterface * fPhotosInterface
void setPSet(const edm::ParameterSet &)
TauolaInterface * fTauolaInterface
EvtGenInterface * fEvtGenInterface
static TauolaInterface * getInstance()
CLHEP::HepRandomEngine * decayRandomEngine
ExternalDecayDriver::~ExternalDecayDriver ( )

Definition at line 70 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.

71 {
72  if ( fEvtGenInterface ) delete fEvtGenInterface;
73  if ( fTauolaInterface ) delete fTauolaInterface;
74  if ( fPhotosInterface ) delete fPhotosInterface;
75 }
PhotosInterface * fPhotosInterface
TauolaInterface * fTauolaInterface
EvtGenInterface * fEvtGenInterface

Member Function Documentation

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

Definition at line 77 of file ExternalDecayDriver.cc.

References gen::PhotosInterface::apply(), gen::EvtGenInterface::decay(), gen::TauolaInterface::decay(), fEvtGenInterface, fIsInitialized, fPhotosInterface, and fTauolaInterface.

78 {
79 
80  if ( !fIsInitialized ) return evt;
81 
82  if ( fEvtGenInterface )
83  {
84  evt = fEvtGenInterface->decay( evt );
85  if ( !evt ) return 0;
86  }
87 
88  if ( fTauolaInterface )
89  {
90  evt = fTauolaInterface->decay( evt );
91  if ( !evt ) return 0;
92  }
93 
94  if ( fPhotosInterface )
95  {
96  evt = fPhotosInterface->apply( evt );
97  if ( !evt ) return 0;
98  }
99 
100  return evt;
101 }
PhotosInterface * fPhotosInterface
HepMC::GenEvent * decay(HepMC::GenEvent *)
HepMC::GenEvent * decay(HepMC::GenEvent *)
TauolaInterface * fTauolaInterface
EvtGenInterface * fEvtGenInterface
HepMC::GenEvent * apply(HepMC::GenEvent *)
void ExternalDecayDriver::init ( const edm::EventSetup es)

Definition at line 103 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fIsInitialized, fPDGs, fPhotosInterface, fSpecialSettings, fTauolaInterface, i, gen::PhotosInterface::init(), gen::EvtGenInterface::init(), gen::TauolaInterface::init(), gen::EvtGenInterface::operatesOnParticles(), gen::TauolaInterface::operatesOnParticles(), and gen::PhotosInterface::specialSettings().

104 {
105 
106  if ( fIsInitialized ) return;
107 
108  if ( fTauolaInterface )
109  {
110  fTauolaInterface->init( es );
111  for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin();
112  i!=fTauolaInterface->operatesOnParticles().end(); i++ )
113  fPDGs.push_back( *i );
114  }
115 
116  if ( fEvtGenInterface )
117  {
119  for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin();
120  i!=fEvtGenInterface->operatesOnParticles().end(); i++ )
121  fPDGs.push_back( *i );
122  }
123 
124 
125  if ( fPhotosInterface )
126  {
128 // for tauola++
129  if ( fPhotosInterface )
130  {
131  for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ )
132  {
134  }
135  }
136  }
137 
138 // this is specific to old tauola27 only, because it calls up photos automatically
139 //
140 //
141 // if ( fTauolaInterface )
142 // {
143 // // override !
144 // fSpecialSettings.clear();
145 // fSpecialSettings.push_back( "QED-brem-off:15" );
146 // }
147 
148  fIsInitialized = true;
149 
150  return;
151 }
int i
Definition: DBlmapReader.cc:9
PhotosInterface * fPhotosInterface
const std::vector< int > & operatesOnParticles()
TauolaInterface * fTauolaInterface
const std::vector< std::string > & specialSettings()
EvtGenInterface * fEvtGenInterface
std::vector< std::string > fSpecialSettings
const std::vector< int > & operatesOnParticles()
void init(const edm::EventSetup &)
const std::vector<int>& gen::ExternalDecayDriver::operatesOnParticles ( )
inline

Definition at line 28 of file ExternalDecayDriver.h.

References fPDGs.

28 { return fPDGs; }
const std::vector<std::string>& gen::ExternalDecayDriver::specialSettings ( )
inline

Definition at line 29 of file ExternalDecayDriver.h.

References fSpecialSettings.

29 { return fSpecialSettings; }
std::vector< std::string > fSpecialSettings
void ExternalDecayDriver::statistics ( ) const

Definition at line 153 of file ExternalDecayDriver.cc.

References fTauolaInterface, and gen::TauolaInterface::statistics().

154 {
156  // similar for EvtGen and/or Photos, if needs be
157  return;
158 }
TauolaInterface * fTauolaInterface

Member Data Documentation

EvtGenInterface* gen::ExternalDecayDriver::fEvtGenInterface
private

Definition at line 39 of file ExternalDecayDriver.h.

Referenced by decay(), ExternalDecayDriver(), init(), and ~ExternalDecayDriver().

bool gen::ExternalDecayDriver::fIsInitialized
private

Definition at line 37 of file ExternalDecayDriver.h.

Referenced by decay(), and init().

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

Definition at line 41 of file ExternalDecayDriver.h.

Referenced by init(), and operatesOnParticles().

PhotosInterface* gen::ExternalDecayDriver::fPhotosInterface
private

Definition at line 40 of file ExternalDecayDriver.h.

Referenced by decay(), ExternalDecayDriver(), init(), and ~ExternalDecayDriver().

std::vector<std::string> gen::ExternalDecayDriver::fSpecialSettings
private

Definition at line 42 of file ExternalDecayDriver.h.

Referenced by init(), and specialSettings().

TauolaInterface* gen::ExternalDecayDriver::fTauolaInterface
private