Loading [MathJax]/extensions/tex2jax.js
hej is hosted by Hepforge, IPPP Durham
HEJ  2.3.0
High energy resummation for hadron colliders
LesHouchesWriter.hh
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <fstream>
11 #include <memory>
12 #include <string>
13 #include <string_view>
14 
15 #include "LHEF/LHEF.h"
16 
17 #include "HEJ/EventWriter.hh"
18 
19 namespace HEJ {
20  class Event;
21 
23  class LesHouchesWriter : public EventWriter{
24  public:
26 
30  LesHouchesWriter(std::string const & file, LHEF::HEPRUP heprup);
32 
47  std::string const & file,
48  LHEF::HEPRUP heprup,
49  std::string_view config
50  );
51  LesHouchesWriter(LesHouchesWriter const & other) = delete;
52  LesHouchesWriter & operator=(LesHouchesWriter const & other) = delete;
56  LesHouchesWriter(LesHouchesWriter && other) = delete;
58  ~LesHouchesWriter() override;
59 
61  void write(Event const & ev) override;
62 
64  void set_xs_scale(double scale) override;
65 
67  void finish() override;
68 
69  private:
70  void write_init(){
71  writer_->init();
72  }
73 
74  void rewrite_init_and_close();
75 
76  LHEF::HEPRUP & heprup(){
77  return writer_->heprup;
78  }
79 
80  LHEF::HEPEUP & hepeup(){
81  return writer_->hepeup;
82  }
83 
84  std::fstream out_;
85  std::unique_ptr<LHEF::Writer> writer_;
86  double xs_scale_ = 1.;
87  };
88 } // namespace HEJ
Header file for the EventWriter interface.
Pure abstract base class for event writers.
Definition: EventWriter.hh:16
An event with clustered jets.
Definition: Event.hh:51
Class for writing events to a file in the Les Houches Event File format.
Definition: LesHouchesWriter.hh:23
void write(Event const &ev) override
Write an event to the file specified in the constructor.
LesHouchesWriter(LesHouchesWriter &&other)=delete
LesHouchesWriter(LesHouchesWriter const &other)=delete
void finish() override
Dump general information & finish writing.
LesHouchesWriter & operator=(LesHouchesWriter const &other)=delete
LesHouchesWriter & operator=(LesHouchesWriter &&other)=delete
LesHouchesWriter(std::string const &file, LHEF::HEPRUP heprup)
Constructor.
void set_xs_scale(double scale) override
Set the ratio (cross section) / (sum of event weights)
LesHouchesWriter(std::string const &file, LHEF::HEPRUP heprup, std::string_view config)
Constructor.
~LesHouchesWriter() override
Main HEJ 2 Namespace.
Definition: mainpage.dox:1