ATLAS Offline Software
Loading...
Searching...
No Matches
BB4LPowhegLesHouchesFileReader.h
Go to the documentation of this file.
1// -*- C++ -*-
2//
3// myLesHouchesReader.h is - (c) Silvia Ferrario Ravasio and Tomas Jezo
4// inspired by LesHouchesFileReader.h which is a part of ThePEG
5//
6#ifndef THEPEG_BB4LPowhegLesHouchesFileReader_H
7#define THEPEG_BB4LPowhegLesHouchesFileReader_H
8// This is the declaration of the BB4LPowhegLesHouchesFileReader class.
9
10#include "ThePEG/LesHouches/LesHouchesReader.h"
11#include "ThePEG/PDT/Decayer.h"
12#include "ThePEG/Utilities/CFileLineReader.h"
13
14#include "herwig7_interface.h"
16#include <string>
17#include <map>
18#include <vector>
19
21
22namespace ThePEG {
23
24
42
43public:
44
47
53
59
65
66public:
67
70
74 virtual void initialize(LesHouchesEventHandler & eh);
75
81 virtual void open ();
82
86 virtual void close();
87
88
94 virtual bool doReadEvent ();
96
100 const std::string & filename() const { return m_theFileName; }
101
105
106 virtual std::vector<std::string> optWeightsNamesFunc();
107
108 double eventWeight() {return powheg_weight;}
109
110public:
111
114
118 void persistentOutput(PersistentOStream & os) const;
119
125 void persistentInput(PersistentIStream & is, int version);
127
131 static void Init ();
132
133
137
138 void erase_substr(std::string& subject, const std::string& search);
139
140
141protected:
142
145
149 virtual IBPtr clone() const;
150
155 virtual IBPtr fullclone() const;
157
160
165 virtual void doinit ();
166
171 virtual bool preInitialize() const;
172 //@
173
174protected:
175
179 CFileLineReader m_cfile;
180
181protected:
182
186 long m_neve;
187
191 long m_ieve;
192
198 std::string m_LHFVersion;
199
204 std::string m_outsideBlock;
205
209 std::string m_headerBlock;
210
214 std::string m_initComments;
215
220 std::map<std::string,std::string> m_initAttributes;
221
225 std::string m_eventComments;
226
231 std::map<std::string,std::string> m_eventAttributes;
232
233private:
234
238 std::string m_theFileName;
239
244
249
254
258 DecayerPtr m_theDecayer;
259
263 std::map<std::string,std::string> m_scalemap;
264
268
269 std::map<std::string,double> m_optionalWeightsTemp;
270 std::map<std::string,std::string> m_optionalWeightsLabel;
271
272
273private:
274
278 static ClassDescription<BB4LPowhegLesHouchesFileReader> m_initBB4LPowhegLesHouchesFileReader;
279
284
285public:
286
290 class powhegLesHouchesFileError: public Exception {};
292
293};
294
295}
296
297
298#include "ThePEG/Utilities/ClassTraits.h"
299
300namespace ThePEG {
301
303
308template <>
309struct BaseClassTrait<BB4LPowhegLesHouchesFileReader,1>: public ClassTraitsType {
311 typedef LesHouchesReader NthBase;
312};
313
319template <>
320struct ClassTraits<BB4LPowhegLesHouchesFileReader>
321 : public ClassTraitsBase<BB4LPowhegLesHouchesFileReader> {
325 static std::string className() { return "ThePEG::BB4LPowhegLesHouchesFileReader"; }
331 static std::string library() { return "libpowhegHerwigBB4L.so"; }
332
333};
334
336
337}
338
339#endif /* THEPEG_BB4LPowhegLesHouchesFileReader_H */
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
BB4LPowhegLesHouchesFileReader is an base class to be used for objects which reads event files from m...
BB4LPowhegLesHouchesFileReader & operator=(const BB4LPowhegLesHouchesFileReader &)=delete
Private and non-existent assignment operator.
bool m_theIncludeCentral
Include central weight (for backup use)
void erase_substr(std::string &subject, const std::string &search)
Erases all occurences of a substring from a string.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual void open()
Open a file with events.
std::map< std::string, std::string > m_initAttributes
If LHF.
virtual ~BB4LPowhegLesHouchesFileReader()
Destructor.
virtual IBPtr clone() const
Make a simple clone of this object.
std::map< std::string, double > m_optionalWeightsTemp
Temporary holder for optional weights.
DecayerPtr m_theDecayer
Decayer for any decay modes read from the file.
bool m_theQNumbers
Whether or not to search for QNUMBERS stuff.
virtual std::vector< std::string > optWeightsNamesFunc()
Return the optional weights information string ("Names")
std::string m_LHFVersion
If the file is a standard Les Houches formatted file (LHF) this is its version number.
std::map< std::string, std::string > m_scalemap
Further information on the weights.
static ClassDescription< BB4LPowhegLesHouchesFileReader > m_initBB4LPowhegLesHouchesFileReader
Describe an abstract base class with persistent data.
std::map< std::string, std::string > m_optionalWeightsLabel
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
const std::string & filename() const
Return the name of the file from where to read events.
std::string m_theFileName
The name of the file from where to read events.
virtual void initialize(LesHouchesEventHandler &eh)
Initialize.
long m_neve
The number of events in this file.
static void Init()
Standard Init function used to initialize the interfaces.
BB4LPowhegLesHouchesFileReader(const BB4LPowhegLesHouchesFileReader &)
Copy-constructor.
virtual bool doReadEvent()
Read the next event from the file or stream into the corresponding protected variables.
std::map< std::string, std::string > m_eventAttributes
If LHF.
virtual bool preInitialize() const
Return true if this object needs to be initialized before all other objects because it needs to extra...
virtual void close()
Close the file from which events have been read.
CFileLineReader m_cfile
The wrapper around the C FILE stream from which to read.
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition hcg.cxx:739