herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
FxFxFileReader.h
1// -*- C++ -*-
2//
3// FxFxFileReader.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5//
6// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef THEPEG_FxFxFileReader_H
10#define THEPEG_FxFxFileReader_H
11// This is the declaration of the FxFxFileReader class.
12
13#include "FxFxReader.h"
14#include "FxFxFileReader.fh"
15#include "ThePEG/PDT/Decayer.h"
16#include "ThePEG/Utilities/CFileLineReader.h"
17#include <stdio.h>
18
19namespace ThePEG {
20
21
39
40public:
41
46 theIncludeCentral(false) {}
47
53
54public:
55
62 virtual void initialize(FxFxEventHandler & eh);
63
69 virtual void open();
70
74 virtual void close();
75
76
82 virtual bool doReadEvent();
84
88 string filename() const { return theFileName; }
89
90 /* vector<string> optionalWeightsNames;
91
92 virtual vector<string> optWeightNamesFunc();*/
93
94
95 virtual vector<string> optWeightsNamesFunc();
96
97
102 void erase_substr(std::string& subject, const std::string& search);
103
104
105public:
106
114
120 void persistentInput(PersistentIStream & is, int version);
122
126 static void Init();
127
128protected:
129
136 virtual IBPtr clone() const;
137
142 virtual IBPtr fullclone() const;
144
152 virtual void doinit();
153
158 virtual bool preInitialize() const;
159 //@
160
161protected:
162
167
168protected:
169
173 long neve;
174
178 long ieve;
179
186
192
197
202
207 map<string,string> initAttributes;
208
213
218 map<string,string> eventAttributes;
219
220private:
221
226
231
236
241
246
250 map<string,string> scalemap;
251
256 map<string,double> optionalWeightsTemp;
257
258
259private:
260
265
270
271public:
272
276 class FxFxFileError: public Exception {};
279};
280
281}
282
283
284#include "ThePEG/Utilities/ClassTraits.h"
285
286namespace ThePEG {
287
294template <>
295struct BaseClassTrait<FxFxFileReader,1>: public ClassTraitsType {
297 typedef FxFxReader NthBase;
298};
299
305template <>
306struct ClassTraits<FxFxFileReader>
307 : public ClassTraitsBase<FxFxFileReader> {
311 static string className() { return "Herwig::FxFxFileReader"; }
317 static string library() { return "HwFxFx.so"; }
318
319};
320
323}
324
325#endif /* THEPEG_FxFxFileReader_H */
The FxFxEventHandler inherits from the general EventHandler class and administers the reading of even...
FxFxFileReader is an base class to be used for objects which reads event files from matrix element ge...
virtual vector< string > optWeightsNamesFunc()
return the weight names
FxFxFileReader()
Default constructor.
long ieve
The current event number.
DecayerPtr theDecayer
Decayer for any decay modes read from the file.
CFileLineReader cfile
The wrapper around the C FILE stream from which to read.
string outsideBlock
If LHF.
FxFxFileReader(const FxFxFileReader &)
Copy-constructor.
string headerBlock
If LHF.
virtual IBPtr clone() const
Make a simple clone of this object.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
string eventComments
If LHF.
virtual void close()
Close the file from which events have been read.
static void Init()
Standard Init function used to initialize the interfaces.
long neve
The number of events in this file.
string filename() const
Return the name of the file from where to read events.
bool theIncludeFxFxTags
Include/Read FxFx tags.
map< string, string > eventAttributes
If LHF.
string theFileName
The name of the file from where to read events.
FxFxFileReader & operator=(const FxFxFileReader &)=delete
Private and non-existent assignment operator.
map< string, double > optionalWeightsTemp
Temporary holder for optional weights.
virtual void open()
Open a file with events.
map< string, string > scalemap
Further information on the weights.
void erase_substr(std::string &subject, const std::string &search)
Erases all occurences of a substring from a string.
virtual bool doReadEvent()
Read the next event from the file or stream into the corresponding protected variables.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
bool theQNumbers
Whether or not to search for QNUMBERS stuff.
virtual void initialize(FxFxEventHandler &eh)
Initialize.
map< string, string > initAttributes
If LHF.
string initComments
If LHF.
string LHFVersion
If the file is a standard Les Houches formatted file (LHF) this is its version number.
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects because it needs to extra...
static ClassDescription< FxFxFileReader > initFxFxFileReader
Describe an abstract base class with persistent data.
bool theIncludeCentral
Include central weight (for backup use)
FxFxReader is an abstract base class to be used for objects which reads event files or streams from m...
Definition: FxFxReader.h:77
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::Ptr< Decayer >::pointer DecayerPtr
static string className()
static string library()