CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
lhef::Hadronisation Class Referenceabstract

#include <Hadronisation.h>

Inheritance diagram for lhef::Hadronisation:
lhef::Pythia8Hadronisation lhef::ThePEGHadronisation

Public Types

typedef
edmplugin::PluginFactory
< Hadronisation *(const
edm::ParameterSet &)> 
Factory
 

Public Member Functions

virtual std::set< std::string > capabilities () const
 
void clear ()
 
 Hadronisation (const edm::ParameterSet &params)
 
std::auto_ptr< HepMC::GenEvent > hadronize ()
 
void init ()
 
virtual void matchingCapabilities (const std::set< std::string > &capabilities)
 
sigc::signal< void > & onBeforeHadronisation ()
 
sigc::signal< void > & onInit ()
 
sigc::signal< bool, const
boost::shared_ptr
< HepMC::GenEvent > & > & 
onShoweredEvent ()
 
bool setEvent (const boost::shared_ptr< LHEEvent > &event)
 
virtual void statistics ()
 
virtual double totalBranchingRatio (int pdgId) const
 
virtual ~Hadronisation ()
 

Static Public Member Functions

static std::auto_ptr
< Hadronisation
create (const edm::ParameterSet &params)
 

Protected Member Functions

virtual std::auto_ptr
< HepMC::GenEvent > 
doHadronisation ()=0
 
virtual void doInit ()=0
 
const boost::shared_ptr
< LHEEvent > & 
getRawEvent () const
 
virtual void newRunInfo (const boost::shared_ptr< LHERunInfo > &runInfo)
 
bool showeredEvent (const boost::shared_ptr< HepMC::GenEvent > &event)
 
bool wantsShoweredEvent () const
 
bool wantsShoweredEventAsHepMC () const
 

Private Attributes

bool psAsHepMC
 
bool psRequested
 
boost::shared_ptr< LHEEventrawEvent
 
sigc::signal< void > sigBeforeHadronisation
 
sigc::signal< void > sigInit
 
sigc::signal< bool, const
boost::shared_ptr
< HepMC::GenEvent > & > 
sigShower
 

Detailed Description

Definition at line 21 of file Hadronisation.h.

Member Typedef Documentation

Definition at line 49 of file Hadronisation.h.

Constructor & Destructor Documentation

lhef::Hadronisation::Hadronisation ( const edm::ParameterSet params)

Definition at line 37 of file Hadronisation.cc.

37  :
38  psRequested(false),
39  psAsHepMC(true)
40 {
41 }
lhef::Hadronisation::~Hadronisation ( )
virtual

Definition at line 43 of file Hadronisation.cc.

44 {
45 }

Member Function Documentation

std::set< std::string > lhef::Hadronisation::capabilities ( ) const
virtual

Definition at line 69 of file Hadronisation.cc.

Referenced by matchingCapabilities().

70 {
71  return std::set<std::string>();
72 }
void lhef::Hadronisation::clear ( void  )
std::auto_ptr< Hadronisation > lhef::Hadronisation::create ( const edm::ParameterSet params)
static

Definition at line 95 of file Hadronisation.cc.

References reco::get(), edm::ParameterSet::getParameter(), AlCaRecoCosmics_cfg::name, and python.pfTaus_cff::plugin.

97 {
98  std::string name = params.getParameter<std::string>("generator");
99 
100  if (name == "None")
101  return std::auto_ptr<Hadronisation>(
102  new NoHadronisation(params));
103 
104  std::auto_ptr<Hadronisation> plugin(
105  Factory::get()->create(name + "Hadronisation", params));
106 
107  if (!plugin.get())
108  throw cms::Exception("InvalidGenerator")
109  << "Unknown MC generator \"" << name << "\""
110  " specified for hadronisation in LHEProducer."
111  << std::endl;
112 
113  edm::LogInfo("Generator|LHEInterface")
114  << "Using " << name << " to hadronize LHE input." << std::endl;
115 
116  return plugin;
117 }
T getParameter(std::string const &) const
static std::auto_ptr< Hadronisation > create(const edm::ParameterSet &params)
T get(const Candidate &c)
Definition: component.h:56
virtual std::auto_ptr<HepMC::GenEvent> lhef::Hadronisation::doHadronisation ( )
protectedpure virtual
virtual void lhef::Hadronisation::doInit ( )
protectedpure virtual

Implemented in lhef::ThePEGHadronisation, and lhef::Pythia8Hadronisation.

Referenced by init().

const boost::shared_ptr<LHEEvent>& lhef::Hadronisation::getRawEvent ( ) const
inlineprotected

Definition at line 59 of file Hadronisation.h.

References rawEvent.

Referenced by lhef::Pythia8Hadronisation::doHadronisation(), and lhef::ThePEGHadronisation::doHadronisation().

60  { return rawEvent; }
boost::shared_ptr< LHEEvent > rawEvent
Definition: Hadronisation.h:72
std::auto_ptr< HepMC::GenEvent > lhef::Hadronisation::hadronize ( )

Definition at line 119 of file Hadronisation.cc.

References doHadronisation(), event(), and lhef::LHEEvent::findSignalVertex().

120 {
121  std::auto_ptr<HepMC::GenEvent> event = this->doHadronisation();
122  if (!event.get())
123  return event;
124 
125  const HepMC::GenVertex *signalVertex = event->signal_process_vertex();
126  if (!signalVertex) {
127  signalVertex = LHEEvent::findSignalVertex(event.get());
128  event->set_signal_process_vertex(
129  const_cast<HepMC::GenVertex*>(signalVertex));
130  }
131 
132  return event;
133 }
virtual std::auto_ptr< HepMC::GenEvent > doHadronisation()=0
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
static const HepMC::GenVertex * findSignalVertex(const HepMC::GenEvent *event, bool status3=true)
Definition: LHEEvent.cc:439
void lhef::Hadronisation::init ( void  )

Definition at line 47 of file Hadronisation.cc.

References doInit().

48 {
49  doInit();
50 }
virtual void doInit()=0
void lhef::Hadronisation::matchingCapabilities ( const std::set< std::string > &  capabilities)
virtual

Definition at line 74 of file Hadronisation.cc.

References capabilities(), psAsHepMC, and psRequested.

76 {
77  psRequested = false;
78  psAsHepMC = false;
79  for(std::set<std::string>::const_iterator iter = capabilities.begin();
80  iter != capabilities.end(); ++iter) {
81  if (*iter == "hepmc")
82  psAsHepMC = true;
83  else if (*iter == "psFinalState")
84  psRequested = true;
85  else if (*iter == "matchSummary")
86  /* nothing */;
87  else if (!this->capabilities().count(*iter))
88  throw cms::Exception("Generator|LHEInterface")
89  << "JetMatching expected capability \""
90  << *iter << "\", but hadronizer does not "
91  "support it." << std::endl;
92  }
93 }
virtual std::set< std::string > capabilities() const
void lhef::Hadronisation::newRunInfo ( const boost::shared_ptr< LHERunInfo > &  runInfo)
protectedvirtual

Reimplemented in lhef::ThePEGHadronisation, and lhef::Pythia8Hadronisation.

Definition at line 135 of file Hadronisation.cc.

Referenced by setEvent().

136 {
137 }
sigc::signal<void>& lhef::Hadronisation::onBeforeHadronisation ( )
inline

Definition at line 42 of file Hadronisation.h.

References sigBeforeHadronisation.

43  { return sigBeforeHadronisation; }
sigc::signal< void > sigBeforeHadronisation
Definition: Hadronisation.h:69
sigc::signal<void>& lhef::Hadronisation::onInit ( )
inline

Definition at line 41 of file Hadronisation.h.

References sigInit.

41 { return sigInit; }
sigc::signal< void > sigInit
Definition: Hadronisation.h:68
sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&>& lhef::Hadronisation::onShoweredEvent ( )
inline

Definition at line 40 of file Hadronisation.h.

References sigShower.

40 { return sigShower; }
sigc::signal< bool, const boost::shared_ptr< HepMC::GenEvent > & > sigShower
Definition: Hadronisation.h:67
bool lhef::Hadronisation::setEvent ( const boost::shared_ptr< LHEEvent > &  event)

Definition at line 52 of file Hadronisation.cc.

References event(), newRunInfo(), and rawEvent.

53 {
54  bool newRunInfo = !rawEvent ||
55  (rawEvent->getRunInfo() != event->getRunInfo() &&
56  *rawEvent->getRunInfo() != *event->getRunInfo());
57  rawEvent = event;
58  if (newRunInfo) {
59  this->newRunInfo(event->getRunInfo());
60  return true;
61  } else
62  return false;
63 }
virtual void newRunInfo(const boost::shared_ptr< LHERunInfo > &runInfo)
boost::shared_ptr< LHEEvent > rawEvent
Definition: Hadronisation.h:72
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool lhef::Hadronisation::showeredEvent ( const boost::shared_ptr< HepMC::GenEvent > &  event)
protected

Definition at line 139 of file Hadronisation.cc.

References lhef::LHEEvent::findSignalVertex(), and sigShower.

141 {
142  if (event.get()) {
143  const HepMC::GenVertex *signalVertex =
144  event->signal_process_vertex();
145  if (!signalVertex) {
146  signalVertex = LHEEvent::findSignalVertex(event.get(), false);
147  event->set_signal_process_vertex(
148  const_cast<HepMC::GenVertex*>(signalVertex));
149  }
150  }
151 
152  return sigShower.emit(event);
153 }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
sigc::signal< bool, const boost::shared_ptr< HepMC::GenEvent > & > sigShower
Definition: Hadronisation.h:67
static const HepMC::GenVertex * findSignalVertex(const HepMC::GenEvent *event, bool status3=true)
Definition: LHEEvent.cc:439
virtual void lhef::Hadronisation::statistics ( )
inlinevirtual

Definition at line 30 of file Hadronisation.h.

30 {}
virtual double lhef::Hadronisation::totalBranchingRatio ( int  pdgId) const
inlinevirtual

Definition at line 31 of file Hadronisation.h.

Referenced by lhef::BranchingRatios::get().

31 { return 1.0; }
bool lhef::Hadronisation::wantsShoweredEvent ( ) const
inlineprotected

Definition at line 52 of file Hadronisation.h.

References psRequested, and sigShower.

53  { return psRequested && !sigShower.empty(); }
sigc::signal< bool, const boost::shared_ptr< HepMC::GenEvent > & > sigShower
Definition: Hadronisation.h:67
bool lhef::Hadronisation::wantsShoweredEventAsHepMC ( ) const
inlineprotected

Definition at line 54 of file Hadronisation.h.

References psAsHepMC.

55  { return psAsHepMC; }

Member Data Documentation

bool lhef::Hadronisation::psAsHepMC
private

Definition at line 71 of file Hadronisation.h.

Referenced by matchingCapabilities(), and wantsShoweredEventAsHepMC().

bool lhef::Hadronisation::psRequested
private

Definition at line 70 of file Hadronisation.h.

Referenced by matchingCapabilities(), and wantsShoweredEvent().

boost::shared_ptr<LHEEvent> lhef::Hadronisation::rawEvent
private

Definition at line 72 of file Hadronisation.h.

Referenced by getRawEvent(), and setEvent().

sigc::signal<void> lhef::Hadronisation::sigBeforeHadronisation
private

Definition at line 69 of file Hadronisation.h.

Referenced by onBeforeHadronisation().

sigc::signal<void> lhef::Hadronisation::sigInit
private

Definition at line 68 of file Hadronisation.h.

Referenced by onInit().

sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&> lhef::Hadronisation::sigShower
private

Definition at line 67 of file Hadronisation.h.

Referenced by onShoweredEvent(), showeredEvent(), and wantsShoweredEvent().