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 decayRandomEngine, edm::hlt::Exception, fEvtGenInterface, fPhotosInterface, fTauolaInterface, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

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  {
50  // in the future, here it should be something like:
51  // fPhotosInterface = new gen::PhotosInterface();
52  // fPhotosInterface->avoidTauLeptonicDecays();
53  }
54  else if ( curSet == "Photos" )
55  {
57  }
58 
59  }
60 
61 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PhotosInterface * fPhotosInterface
TauolaInterface * fTauolaInterface
EvtGenInterface * fEvtGenInterface
CLHEP::HepRandomEngine * decayRandomEngine
ExternalDecayDriver::~ExternalDecayDriver ( )

Definition at line 63 of file ExternalDecayDriver.cc.

References fEvtGenInterface, fPhotosInterface, and fTauolaInterface.

64 {
65  if ( fEvtGenInterface ) delete fEvtGenInterface;
66  if ( fTauolaInterface ) delete fTauolaInterface;
67  if ( fPhotosInterface ) delete fPhotosInterface;
68 }
PhotosInterface * fPhotosInterface
TauolaInterface * fTauolaInterface
EvtGenInterface * fEvtGenInterface

Member Function Documentation

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

Definition at line 70 of file ExternalDecayDriver.cc.

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

71 {
72 
73  if ( !fIsInitialized ) return evt;
74 
75  if ( fEvtGenInterface )
76  {
77  evt = fEvtGenInterface->decay( evt );
78  if ( !evt ) return 0;
79  }
80 
81  if ( fTauolaInterface )
82  {
83  evt = fTauolaInterface->decay( evt );
84  if ( !evt ) return 0;
85  }
86 
87 
88  if ( fPhotosInterface )
89  {
90  evt = fPhotosInterface->apply( evt );
91  if ( !evt ) return 0;
92  }
93 
94 
95  return evt;
96 }
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 98 of file ExternalDecayDriver.cc.

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

99 {
100 
101  if ( fIsInitialized ) return;
102 
103  if ( fTauolaInterface )
104  {
105  fTauolaInterface->init( es );
106  for ( std::vector<int>::const_iterator i=fTauolaInterface->operatesOnParticles().begin();
107  i!=fTauolaInterface->operatesOnParticles().end(); i++ )
108  fPDGs.push_back( *i );
109  }
110 
111  if ( fEvtGenInterface )
112  {
114  for ( std::vector<int>::const_iterator i=fEvtGenInterface->operatesOnParticles().begin();
115  i!=fEvtGenInterface->operatesOnParticles().end(); i++ )
116  fPDGs.push_back( *i );
117  }
118 
119 
120  if ( fPhotosInterface )
121  {
123 /* will fix shortly, for future tauola++
124  if ( fPhotosInterface )
125  {
126  for ( unsigned int iss=0; iss<fPhotosInterface->specialSettings().size(); iss++ )
127  {
128  fSpecialSettings.push_back( fPhotosInterface->specialSettings()[iss]; )
129  }
130  }
131 */
132  }
133 
134  // now do special settings
135 
136  // This is TEMPORARY THING, until we switch to tauola++ !!!
137 
138  if ( fPhotosInterface )
139  {
140  fSpecialSettings.push_back( "QED-brem-off:all" );
141  }
142  if ( fTauolaInterface )
143  {
144  // override !
145  fSpecialSettings.clear();
146  fSpecialSettings.push_back( "QED-brem-off:15" );
147  }
148 
149  fIsInitialized = true;
150 
151  return;
152 }
int i
Definition: DBlmapReader.cc:9
PhotosInterface * fPhotosInterface
const std::vector< int > & operatesOnParticles()
TauolaInterface * fTauolaInterface
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 154 of file ExternalDecayDriver.cc.

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

155 {
157  // similar for EvtGen and/or Photos, if needs be
158  return;
159 }
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