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 lhef {
17 
18 class LHEEvent;
19 class LHERunInfo;
20 
22  public:
23  Hadronisation(const edm::ParameterSet &params);
24  virtual ~Hadronisation();
25 
26  void init();
27  bool setEvent(const boost::shared_ptr<LHEEvent> &event);
28  void clear();
29 
30  virtual void statistics() {}
31  virtual double totalBranchingRatio(int pdgId) const { return 1.0; }
32 
33  std::auto_ptr<HepMC::GenEvent> hadronize();
34 
35  virtual std::set<std::string> capabilities() const;
36  virtual void matchingCapabilities(
37  const std::set<std::string> &capabilities);
38 
39  inline sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&>&
40  onShoweredEvent() { return sigShower; }
41  inline sigc::signal<void>& onInit() { return sigInit; }
42  inline sigc::signal<void>& onBeforeHadronisation()
43  { return sigBeforeHadronisation; }
44 
45  static std::auto_ptr<Hadronisation> create(
46  const edm::ParameterSet &params);
47 
50 
51  protected:
52  inline bool wantsShoweredEvent() const
53  { return psRequested && !sigShower.empty(); }
54  inline bool wantsShoweredEventAsHepMC() const
55  { return psAsHepMC; }
56 
57  bool showeredEvent(const boost::shared_ptr<HepMC::GenEvent> &event);
58 
59  inline const boost::shared_ptr<LHEEvent> &getRawEvent() const
60  { return rawEvent; }
61 
62  virtual void doInit() = 0;
63  virtual std::auto_ptr<HepMC::GenEvent> doHadronisation() = 0;
64  virtual void newRunInfo(const boost::shared_ptr<LHERunInfo> &runInfo);
65 
66  private:
67  sigc::signal<bool, const boost::shared_ptr<HepMC::GenEvent>&> sigShower;
68  sigc::signal<void> sigInit;
69  sigc::signal<void> sigBeforeHadronisation;
71  bool psAsHepMC;
72  boost::shared_ptr<LHEEvent> rawEvent;
73 };
74 
75 } // namespace lhef
76 
77 #define DEFINE_LHE_HADRONISATION_PLUGIN(T) \
78  DEFINE_EDM_PLUGIN(lhef::Hadronisation::Factory, T, #T)
79 
80 #endif // GeneratorRunInfo_LHEInterface_Hadronisation_h
sigc::signal< bool, const boost::shared_ptr< HepMC::GenEvent > & > & onShoweredEvent()
Definition: Hadronisation.h:40
bool wantsShoweredEventAsHepMC() const
Definition: Hadronisation.h:54
virtual std::set< std::string > capabilities() const
bool showeredEvent(const boost::shared_ptr< HepMC::GenEvent > &event)
virtual void statistics()
Definition: Hadronisation.h:30
bool wantsShoweredEvent() const
Definition: Hadronisation.h:52
virtual void newRunInfo(const boost::shared_ptr< LHERunInfo > &runInfo)
virtual std::auto_ptr< HepMC::GenEvent > doHadronisation()=0
Hadronisation(const edm::ParameterSet &params)
virtual double totalBranchingRatio(int pdgId) const
Definition: Hadronisation.h:31
const boost::shared_ptr< LHEEvent > & getRawEvent() const
Definition: Hadronisation.h:59
virtual void matchingCapabilities(const std::set< std::string > &capabilities)
sigc::signal< void > sigBeforeHadronisation
Definition: Hadronisation.h:69
std::auto_ptr< HepMC::GenEvent > hadronize()
sigc::signal< void > & onBeforeHadronisation()
Definition: Hadronisation.h:42
sigc::signal< void > sigInit
Definition: Hadronisation.h:68
virtual ~Hadronisation()
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
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:67
bool setEvent(const boost::shared_ptr< LHEEvent > &event)
sigc::signal< void > & onInit()
Definition: Hadronisation.h:41