CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Hadronisation.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_LHEInterface_Hadronisation_h
2 #define GeneratorInterface_LHEInterface_Hadronisation_h
3 
4 #include <memory>
5 #include <string>
6 #include <set>
7 
8 #include <boost/shared_ptr.hpp>
9 #include <sigc++/signal.h>
10 
11 #include "HepMC/GenEvent.h"
12 
15 
16 namespace CLHEP {
17  class HepRandomEngine;
18 }
19 
20 namespace lhef {
21 
22 class LHEEvent;
23 class LHERunInfo;
24 
26  public:
27  Hadronisation(const edm::ParameterSet &params);
28  virtual ~Hadronisation();
29 
30  void init();
31  bool setEvent(const boost::shared_ptr<LHEEvent> &event);
32  void clear();
33 
34  void setRandomEngine(CLHEP::HepRandomEngine* v) { doSetRandomEngine(v); }
35 
36  virtual void statistics() {}
37  virtual double totalBranchingRatio(int pdgId) const { return 1.0; }
38 
39  std::auto_ptr<HepMC::GenEvent> hadronize();
40 
41  virtual std::set<std::string> capabilities() const;
42  virtual void matchingCapabilities(
43  const std::set<std::string> &capabilities);
44 
45  inline sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&>&
46  onShoweredEvent() { return sigShower; }
47  inline sigc::signal<void>& onInit() { return sigInit; }
48  inline sigc::signal<void>& onBeforeHadronisation()
49  { return sigBeforeHadronisation; }
50 
51  static std::auto_ptr<Hadronisation> create(
52  const edm::ParameterSet &params);
53 
56 
57  protected:
58  inline bool wantsShoweredEvent() const
59  { return psRequested && !sigShower.empty(); }
60  inline bool wantsShoweredEventAsHepMC() const
61  { return psAsHepMC; }
62 
63  bool showeredEvent(const boost::shared_ptr<HepMC::GenEvent> &event);
64 
65  inline const boost::shared_ptr<LHEEvent> &getRawEvent() const
66  { return rawEvent; }
67 
68  virtual void doInit() = 0;
69  virtual std::auto_ptr<HepMC::GenEvent> doHadronisation() = 0;
70  virtual void newRunInfo(const boost::shared_ptr<LHERunInfo> &runInfo);
71 
72  private:
73 
74  virtual void doSetRandomEngine(CLHEP::HepRandomEngine* v) { }
75 
76  sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&> sigShower;
77  sigc::signal<void> sigInit;
78  sigc::signal<void> sigBeforeHadronisation;
80  bool psAsHepMC;
81  boost::shared_ptr<LHEEvent> rawEvent;
82 };
83 
84 } // namespace lhef
85 
86 #define DEFINE_LHE_HADRONISATION_PLUGIN(T) \
87  DEFINE_EDM_PLUGIN(lhef::Hadronisation::Factory, T, #T)
88 
89 #endif // GeneratorRunInfo_LHEInterface_Hadronisation_h
sigc::signal< bool, const boost::shared_ptr< HepMC::GenEvent > & > & onShoweredEvent()
Definition: Hadronisation.h:46
bool wantsShoweredEventAsHepMC() const
Definition: Hadronisation.h:60
virtual std::set< std::string > capabilities() const
bool showeredEvent(const boost::shared_ptr< HepMC::GenEvent > &event)
virtual void statistics()
Definition: Hadronisation.h:36
bool wantsShoweredEvent() const
Definition: Hadronisation.h:58
virtual void newRunInfo(const boost::shared_ptr< LHERunInfo > &runInfo)
virtual std::auto_ptr< HepMC::GenEvent > doHadronisation()=0
void setRandomEngine(CLHEP::HepRandomEngine *v)
Definition: Hadronisation.h:34
Hadronisation(const edm::ParameterSet &params)
virtual double totalBranchingRatio(int pdgId) const
Definition: Hadronisation.h:37
const boost::shared_ptr< LHEEvent > & getRawEvent() const
Definition: Hadronisation.h:65
virtual void matchingCapabilities(const std::set< std::string > &capabilities)
sigc::signal< void > sigBeforeHadronisation
Definition: Hadronisation.h:78
std::auto_ptr< HepMC::GenEvent > hadronize()
sigc::signal< void > & onBeforeHadronisation()
Definition: Hadronisation.h:48
sigc::signal< void > sigInit
Definition: Hadronisation.h:77
virtual ~Hadronisation()
boost::shared_ptr< LHEEvent > rawEvent
Definition: Hadronisation.h:81
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 std::auto_ptr< Hadronisation > create(const edm::ParameterSet &params)
virtual void doInit()=0
sigc::signal< bool, const boost::shared_ptr< HepMC::GenEvent > & > sigShower
Definition: Hadronisation.h:76
bool setEvent(const boost::shared_ptr< LHEEvent > &event)
virtual void doSetRandomEngine(CLHEP::HepRandomEngine *v)
Definition: Hadronisation.h:74
sigc::signal< void > & onInit()
Definition: Hadronisation.h:47